Diffstat (limited to 'noncore/settings/sysinfo/load.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/sysinfo/load.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/noncore/settings/sysinfo/load.cpp b/noncore/settings/sysinfo/load.cpp index 0fcfa6b..900b3d3 100644 --- a/noncore/settings/sysinfo/load.cpp +++ b/noncore/settings/sysinfo/load.cpp @@ -10,49 +10,54 @@ ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include <stdio.h> + +#include <qfile.h> #include <qlayout.h> #include <qlabel.h> #include <qpainter.h> #include <qpixmap.h> -#include <qtimer.h> -#include <qfile.h> #include <qtextstream.h> +#include <qtimer.h> +#include <qwhatsthis.h> + #include "load.h" LoadInfo::LoadInfo( QWidget *parent, const char *name, WFlags f ) : QWidget( parent, name, f ) { QVBoxLayout *vb = new QVBoxLayout( this, 6 ); QString cpuInfo = getCpuInfo(); if ( !cpuInfo.isNull() ) vb->addWidget( new QLabel( cpuInfo, this ) ); vb->addWidget( new Load( this ), 100 ); QLabel *l = new QLabel( this ); l->setPixmap( makeLabel( red, tr("Application CPU usage (%)") ) ); vb->addWidget( l, 1 ); l = new QLabel( this ); l->setPixmap( makeLabel( green, tr("System CPU usage (%)") ) ); vb->addWidget( l, 1 ); vb->addStretch(50); + + QWhatsThis::add( this, tr( "This page shows how much this device's processor is being used." ) ); } QPixmap LoadInfo::makeLabel( const QColor &col, const QString &text ) { int h = fontMetrics().height(); QPixmap pm( 20 + fontMetrics().width( text ), h ); QPainter p( &pm ); p.fillRect( pm.rect(), colorGroup().background() ); p.fillRect( 0, h/2-4, 18, h/2+3, black ); p.setPen( col ); p.drawLine( 2, h/2, 15, h/2 ); p.setPen( colorGroup().text() ); |