Vidalia  0.2.15
LogHeaderView.cpp
Go to the documentation of this file.
00001 /*
00002 **  This file is part of Vidalia, and is subject to the license terms in the
00003 **  LICENSE file, found in the top level directory of this distribution. If you
00004 **  did not receive the LICENSE file with this file, you may obtain it from the
00005 **  Vidalia source package distributed by the Vidalia Project at
00006 **  http://www.torproject.org/projects/vidalia.html. No part of Vidalia, 
00007 **  including this file, may be copied, modified, propagated, or distributed 
00008 **  except according to the terms described in the LICENSE file.
00009 */
00010 
00011 /*
00012 ** \file LogHeaderView.cpp
00013 ** \brief Header for the message log QTreeView
00014 */
00015 
00016 #include "LogHeaderView.h"
00017 #include "LogTreeWidget.h"
00018 
00019 /* Column indices */
00020 #define COL_TIME  LogTreeWidget::TimeColumn
00021 #define COL_TYPE  LogTreeWidget::TypeColumn
00022 #define COL_MESG  LogTreeWidget::MessageColumn
00023 
00024 /* Default column widths */
00025 #define COL_TIME_WIDTH    135
00026 #define COL_TYPE_WIDTH    70
00027 
00028 
00029 /** Default constructor. */
00030 LogHeaderView::LogHeaderView(QWidget *parent)
00031   : QHeaderView(Qt::Horizontal, parent)
00032 {
00033 }
00034 
00035 /** Resets all column widths back to their defaults. */
00036 void
00037 LogHeaderView::resetColumnWidths()
00038 {
00039   resizeSection(COL_TIME, COL_TIME_WIDTH);
00040   resizeSection(COL_TYPE, COL_TYPE_WIDTH);
00041   setStretchLastSection(true);
00042 }
00043 
00044