• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kleopatra

Public Slots | Public Member Functions | Protected Member Functions | Properties | List of all members
KDLogTextWidget Class Reference

#include <kdlogtextwidget.h>

Inheritance diagram for KDLogTextWidget:
Inheritance graph
[legend]

Public Slots

void clear ()
 
void message (const QString &msg, const QColor &color)
 
void message (const QString &msg)
 

Public Member Functions

 KDLogTextWidget (QWidget *parent=0)
 
 ~KDLogTextWidget ()
 
bool alternatingRowColors () const
 
unsigned int historySize () const
 
QStringList lines () const
 
QSize minimumSizeHint () const
 
unsigned int minimumVisibleColumns () const
 
unsigned int minimumVisibleLines () const
 
void setAlternatingRowColors (bool on)
 
void setHistorySize (unsigned int size)
 
void setLines (const QStringList &list)
 
void setMinimumVisibleColumns (unsigned int num)
 
void setMinimumVisibleLines (unsigned int num)
 
QSize sizeHint () const
 
QString text () const
 

Protected Member Functions

void changeEvent (QEvent *)
 
void paintEvent (QPaintEvent *)
 
void resizeEvent (QResizeEvent *)
 
void timerEvent (QTimerEvent *)
 

Properties

bool alternatingRowColors
 
uint historySize
 
QStringList lines
 
uint minimumVisibleColumns
 
uint minimumVisibleLines
 
QString text
 

Detailed Description

A high-speed text display widget.

This widget provides very fast display of large amounts of line-oriented text, as commonly found in application log viewers. The feature set and implementation are optimized for frequent appends.

You can set initial text using setLines(), and append lines with calls to message(). You can limit the number of lines kept in the view using setHistorySize().

Text formatting is currently limited to per-line text color, but is expected to be enhanced on client request in upcoming versions. You can pass the color to use to calls to message().

Definition at line 34 of file kdlogtextwidget.h.

Constructor & Destructor Documentation

KDLogTextWidget::KDLogTextWidget ( QWidget *  parent_ = 0)
explicit

Constructor. Creates an empty KDLogTextWidget.

Definition at line 138 of file kdlogtextwidget.cpp.

KDLogTextWidget::~KDLogTextWidget ( )

Destructor.

Definition at line 147 of file kdlogtextwidget.cpp.

Member Function Documentation

bool KDLogTextWidget::alternatingRowColors ( ) const
void KDLogTextWidget::changeEvent ( QEvent *  e)
protected
Reimplemented from superclass.

Definition at line 393 of file kdlogtextwidget.cpp.

void KDLogTextWidget::clear ( )
slot

Clears the text.

Postcondition
lines().empty() == true

Definition at line 291 of file kdlogtextwidget.cpp.

unsigned int KDLogTextWidget::historySize ( ) const
QStringList KDLogTextWidget::lines ( ) const
void KDLogTextWidget::message ( const QString &  str,
const QColor &  color 
)
slot

Appends str to the view, highlighting the line in color.

Postcondition
lines().back() == str (modulo trailing whitespace and contained newlines)

Definition at line 306 of file kdlogtextwidget.cpp.

void KDLogTextWidget::message ( const QString &  str)
slot

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Uses the default text color set in this widget's palette.

Definition at line 318 of file kdlogtextwidget.cpp.

QSize KDLogTextWidget::minimumSizeHint ( ) const
Reimplemented from superclass.

Definition at line 269 of file kdlogtextwidget.cpp.

unsigned int KDLogTextWidget::minimumVisibleColumns ( ) const
unsigned int KDLogTextWidget::minimumVisibleLines ( ) const
void KDLogTextWidget::paintEvent ( QPaintEvent *  e)
protected
Reimplemented from superclass.

Definition at line 324 of file kdlogtextwidget.cpp.

void KDLogTextWidget::resizeEvent ( QResizeEvent *  )
protected
Reimplemented from superclass.

Definition at line 398 of file kdlogtextwidget.cpp.

void KDLogTextWidget::setAlternatingRowColors ( bool  on)

Definition at line 258 of file kdlogtextwidget.cpp.

void KDLogTextWidget::setHistorySize ( unsigned int  size)

Definition at line 159 of file kdlogtextwidget.cpp.

void KDLogTextWidget::setLines ( const QStringList &  list)

Definition at line 192 of file kdlogtextwidget.cpp.

void KDLogTextWidget::setMinimumVisibleColumns ( unsigned int  num)

Definition at line 238 of file kdlogtextwidget.cpp.

void KDLogTextWidget::setMinimumVisibleLines ( unsigned int  num)

Definition at line 216 of file kdlogtextwidget.cpp.

QSize KDLogTextWidget::sizeHint ( ) const
Reimplemented from superclass.

Definition at line 279 of file kdlogtextwidget.cpp.

QString KDLogTextWidget::text ( ) const
void KDLogTextWidget::timerEvent ( QTimerEvent *  e)
protected
Reimplemented from superclass.

Definition at line 384 of file kdlogtextwidget.cpp.

Property Documentation

bool KDLogTextWidget::alternatingRowColors
readwrite

Specifies whether the background should be drawn using row-alternating colors. The default is false.

Get this property's value using alternatingRowColors(), and set it using setAlternatingRowColors().

Definition at line 41 of file kdlogtextwidget.h.

unsigned int KDLogTextWidget::historySize
readwrite

Specifies the maximum number of lines this widget will hold before dropping old lines. The default is INT_MAX (ie. essentially unlimited).

Get this property's value using historySize(), and set it with setHistorySize().

Definition at line 36 of file kdlogtextwidget.h.

QStringList KDLogTextWidget::lines
readwrite

Contains the current text as a string list. The default empty.

Get this property's value using lines(), and set it with setLines().

Definition at line 38 of file kdlogtextwidget.h.

unsigned int KDLogTextWidget::minimumVisibleColumns
readwrite

Specifies the number of columns that should be visible at any one time. The default is 1 (one). The width is calculated using QFontMetrics::averageCharWidth(), if that is available. Otherwise, the width of M is used.

Get this property's value using minimumVisibleColumns(), and set it using setMinimumVisibleColumns().

Definition at line 40 of file kdlogtextwidget.h.

unsigned int KDLogTextWidget::minimumVisibleLines
readwrite

Specifies the number of lines that should be visible at any one time. The default is 1 (one).

Get this property's value using minimumVisibleLines(), and set it using setMinimumVisibleLines().

Definition at line 39 of file kdlogtextwidget.h.

QString KDLogTextWidget::text
read

Contains the current text as a single string. Equivalent to

lines().join( "\n" )

Definition at line 37 of file kdlogtextwidget.h.


The documentation for this class was generated from the following files:
  • kdlogtextwidget.h
  • kdlogtextwidget.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:56:42 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kleopatra

Skip menu "kleopatra"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal