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.vidalia-project.net/. No part of Vidalia, including this file, 00007 ** may be copied, modified, propagated, or distributed except according to the 00008 ** terms described in the LICENSE file. 00009 */ 00010 00011 /* 00012 ** \file logmessagecolumndelegate.cpp 00013 ** \version $Id: logmessagecolumndelegate.cpp 2985 2008-08-18 00:22:21Z edmanm $ 00014 ** \brief Delegate responsible for rendering the log message column 00015 */ 00016 00017 #include "logmessagecolumndelegate.h" 00018 00019 00020 /** Default constructor. */ 00021 LogMessageColumnDelegate::LogMessageColumnDelegate(QObject *parent) 00022 : QItemDelegate(parent) 00023 { 00024 } 00025 00026 /** Overrides the default paint() method so that we can prevent Qt from 00027 * munging Tor's log messages when using a Right-to-Left layout (e.g. when 00028 * viewing Vidalia in Farsi). */ 00029 void 00030 LogMessageColumnDelegate::paint(QPainter *painter, 00031 const QStyleOptionViewItem &option, 00032 const QModelIndex &index) const 00033 { 00034 QStyleOptionViewItem styleOption = option; 00035 styleOption.direction = Qt::LeftToRight; 00036 00037 QItemDelegate::paint(painter, styleOption, index); 00038 }