Changeset 10887 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 25, 2008 12:05:11 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 33710
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/QIStatusBar.h
r9729 r10887 27 27 #include <QStatusBar> 28 28 29 class QPaintEvent; 30 29 /** 30 * The QIStatusBar class is a replacement of QStatusBar with disabling 31 * drawing of sunken borders around every widget on the status bar. 32 */ 31 33 class QIStatusBar : public QStatusBar 32 34 { … … 35 37 public: 36 38 37 QIStatusBar (QWidget *parent = 0); 39 QIStatusBar (QWidget *aParent = 0); 40 41 protected slots: 42 43 void rememberLastMessage (const QString &aMsg) { mMessage = aMsg; } 38 44 39 45 protected: 40 46 41 virtual void paintEvent (QPaintEvent *); 42 43 protected slots: 44 45 void rememberLastMessage (const QString &msg) { message = msg; } 46 47 protected: 48 49 QString message; 47 QString mMessage; 50 48 }; 51 49 -
trunk/src/VBox/Frontends/VirtualBox4/src/QIStatusBar.cpp
r10373 r10887 23 23 #include "QIStatusBar.h" 24 24 25 /* Qt includes */ 26 #include <QPainter> 27 //#include <qsizegrip.h> 25 QIStatusBar::QIStatusBar (QWidget *aParent) 26 : QStatusBar (aParent) 27 { 28 connect (this, SIGNAL (messageChanged (const QString&)), 29 this, SLOT (rememberLastMessage (const QString&))); 28 30 29 /** @clas QIStatusLine30 *31 * The QIStatusBar class is a replacement of QStatusBar that reimplements32 * QStatusBar::paintEvent() to disable drawing of those sunken borders33 * around every widget on the status bar.34 */35 36 QIStatusBar::QIStatusBar (QWidget *parent) :37 QStatusBar (parent)38 {39 connect (40 this, SIGNAL( messageChanged (const QString &) ),41 this, SLOT( rememberLastMessage (const QString &) )42 );43 31 /* Remove that ugly border around the statusbar items on every platform */ 44 32 setStyleSheet ("QStatusBar::item { border: 0px none black; }"); 45 33 } 46 34 47 /**48 * Reimplemented to disable drawing of sunken borders around statusbar's49 * widgets.50 */51 void QIStatusBar::paintEvent (QPaintEvent *e)52 {53 QStatusBar::paintEvent (e);54 return;55 //#warning port me: is this needed anymore?56 // QPainter p (this);57 //58 //#ifndef QT_NO_SIZEGRIP59 // this will work provided that QStatusBar::setSizeGripEnabled() names60 // its resizer child as specified (at least Qt 3.3.x does this).61 //#warning port me: check this62 // QSizeGrip *resizer = (QSizeGrip *) child ("QStatusBar::resizer", "QSizeGrip");63 // int psx = (resizer && resizer->isVisible()) ? resizer->x() : width() - 12;64 //#else65 // int psx = width() - 12;66 //#endif67 //68 // if (!message.isEmpty())69 // {70 // p.setPen (colorGroup().foreground());71 // p.drawText (6, 0, psx, height(), Qt::AlignVCenter | Qt::TextSingleLine, message);72 // }73 }74
Note:
See TracChangeset
for help on using the changeset viewer.