1 /****************************************************************************
2 ** Copyright (C) 2001-2010 Klaralvdalens Datakonsult AB. All rights reserved.
4 ** This file is part of the KD Tools library.
6 ** Licensees holding valid commercial KD Tools licenses may use this file in
7 ** accordance with the KD Tools Commercial License Agreement provided with
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU Lesser General Public License version 2 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.LGPL included.
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18 ** Contact info@kdab.com if any conditions of this licensing are not
21 **********************************************************************/
23 #ifndef __KDTOOLSGUI_KDLOGTEXTWIDGET_H__
24 #define __KDTOOLSGUI_KDLOGTEXTWIDGET_H__
26 #include <utils/kdtoolsglobal.h>
27 #include <utils/pimpl_ptr.h>
28 #include <QtGui/QAbstractScrollArea>
34 class KDLogTextWidget
: public QAbstractScrollArea
{
36 Q_PROPERTY( uint historySize READ historySize WRITE setHistorySize
)
37 Q_PROPERTY( QString text READ text
)
38 Q_PROPERTY( QStringList lines READ lines WRITE setLines
)
39 Q_PROPERTY( uint minimumVisibleLines READ minimumVisibleLines WRITE setMinimumVisibleLines
)
40 Q_PROPERTY( uint minimumVisibleColumns READ minimumVisibleColumns WRITE setMinimumVisibleColumns
)
41 Q_PROPERTY( bool alternatingRowColors READ alternatingRowColors WRITE setAlternatingRowColors
)
42 Q_CLASSINFO( "description", "High-speed text display widget" )
44 explicit KDLogTextWidget( QWidget
* parent
=0 );
47 void setHistorySize( unsigned int size
);
48 unsigned int historySize() const;
52 void setLines( const QStringList
& list
);
53 QStringList
lines() const;
55 void setMinimumVisibleLines( unsigned int num
);
56 unsigned int minimumVisibleLines() const;
58 void setMinimumVisibleColumns( unsigned int num
);
59 unsigned int minimumVisibleColumns() const;
61 void setAlternatingRowColors( bool on
);
62 bool alternatingRowColors() const;
64 /*! \reimp */ QSize
minimumSizeHint() const;
65 /*! \reimp */ QSize
sizeHint() const;
69 void message( const QString
& msg
, const QColor
& color
);
70 void message( const QString
& msg
);
73 /*! \reimp */ void paintEvent( QPaintEvent
* );
74 /*! \reimp */ void timerEvent( QTimerEvent
* );
75 /*! \reimp */ void resizeEvent( QResizeEvent
* );
76 /*! \reimp */ void changeEvent( QEvent
* );
80 kdtools::pimpl_ptr
<Private
> d
;
83 #endif /* __KDTOOLSGUI_KDLOGTEXTWIDGET_H__ */