Qt 4.8
qstatusbar.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "qstatusbar.h"
43 #ifndef QT_NO_STATUSBAR
44 
45 #include "qlist.h"
46 #include "qdebug.h"
47 #include "qevent.h"
48 #include "qlayout.h"
49 #include "qpainter.h"
50 #include "qtimer.h"
51 #include "qstyle.h"
52 #include "qstyleoption.h"
53 #include "qsizegrip.h"
54 #include "qmainwindow.h"
55 
56 #ifndef QT_NO_ACCESSIBILITY
57 #include "qaccessible.h"
58 #endif
59 
60 #include <private/qlayoutengine_p.h>
61 #include <private/qwidget_p.h>
62 
64 
66 {
68 public:
70 
71  struct SBItem {
72  SBItem(QWidget* widget, int stretch, bool permanent)
73  : s(stretch), w(widget), p(permanent) {}
74  int s;
76  bool p;
77  };
78 
81 
84 
85 #ifndef QT_NO_SIZEGRIP
88 #endif
89 
91 
92 #ifdef Q_WS_MAC
94 #endif
95 
97  {
98  int i = items.size() - 1;
99  for (; i >= 0; --i) {
100  SBItem *item = items.at(i);
101  if (!(item && item->p))
102  break;
103  }
104  return i;
105  }
106 
107 #ifndef QT_NO_SIZEGRIP
109  {
110  if (!showSizeGrip)
111  return;
112  showSizeGrip = false;
113  if (!resizer || resizer->isVisible())
114  return;
116  QMetaObject::invokeMethod(resizer, "_q_showIfNotHidden", Qt::DirectConnection);
118  }
119 #endif
120 
121  QRect messageRect() const;
122 };
123 
124 
126 {
127  Q_Q(const QStatusBar);
128  bool rtl = q->layoutDirection() == Qt::RightToLeft;
129 
130  int left = 6;
131  int right = q->width() - 12;
132 
133 #ifndef QT_NO_SIZEGRIP
134  if (resizer && resizer->isVisible()) {
135  if (rtl)
136  left = resizer->x() + resizer->width();
137  else
138  right = resizer->x();
139  }
140 #endif
141 
142  for (int i=0; i<items.size(); ++i) {
143  QStatusBarPrivate::SBItem* item = items.at(i);
144  if (!item)
145  break;
146  if (item->p && item->w->isVisible()) {
147  if (item->p) {
148  if (rtl)
149  left = qMax(left, item->w->x() + item->w->width() + 2);
150  else
151  right = qMin(right, item->w->x() - 2);
152  }
153  break;
154  }
155  }
156  return QRect(left, 0, right-left, q->height());
157 }
158 
159 
228 #ifdef QT3_SUPPORT
229 
244  : QWidget(*new QStatusBarPrivate, parent, 0)
245 {
246  Q_D(QStatusBar);
247  setObjectName(QString::fromAscii(name));
248  d->box = 0;
249  d->timer = 0;
250 
251 #ifndef QT_NO_SIZEGRIP
252  d->resizer = 0;
253  d->showSizeGrip = false;
254  setSizeGripEnabled(true); // causes reformat()
255 #else
256  reformat();
257 #endif
258 }
259 
260 
276 #endif
277 
284  : QWidget(*new QStatusBarPrivate, parent, 0)
285 {
286  Q_D(QStatusBar);
287  d->box = 0;
288  d->timer = 0;
289 
290 #ifndef QT_NO_SIZEGRIP
291  d->resizer = 0;
292  setSizeGripEnabled(true); // causes reformat()
293 #else
294  reformat();
295 #endif
296 }
297 
303 {
304  Q_D(QStatusBar);
305  while (!d->items.isEmpty())
306  delete d->items.takeFirst();
307 }
308 
309 
325 {
326  if (!widget)
327  return;
328  insertWidget(d_func()->indexToLastNonPermanentWidget() + 1, widget, stretch);
329 }
330 
354 {
355  if (!widget)
356  return -1;
357 
358  Q_D(QStatusBar);
359  QStatusBarPrivate::SBItem* item = new QStatusBarPrivate::SBItem(widget, stretch, false);
360 
361  int idx = d->indexToLastNonPermanentWidget();
362  if (index < 0 || index > d->items.size() || (idx >= 0 && index > idx + 1)) {
363  qWarning("QStatusBar::insertWidget: Index out of range (%d), appending widget", index);
364  index = idx + 1;
365  }
366  d->items.insert(index, item);
367 
368  if (!d->tempItem.isEmpty())
369  widget->hide();
370 
371  reformat();
372  if (!widget->isHidden() || !widget->testAttribute(Qt::WA_WState_ExplicitShowHide))
373  widget->show();
374 
375  return index;
376 }
377 
393 {
394  if (!widget)
395  return;
396  insertPermanentWidget(d_func()->items.size(), widget, stretch);
397 }
398 
399 
422 {
423  if (!widget)
424  return -1;
425 
426  Q_D(QStatusBar);
427  QStatusBarPrivate::SBItem* item = new QStatusBarPrivate::SBItem(widget, stretch, true);
428 
429  int idx = d->indexToLastNonPermanentWidget();
430  if (index < 0 || index > d->items.size() || (idx >= 0 && index <= idx)) {
431  qWarning("QStatusBar::insertPermanentWidget: Index out of range (%d), appending widget", index);
432  index = d->items.size();
433  }
434  d->items.insert(index, item);
435 
436  reformat();
437  if (!widget->isHidden() || !widget->testAttribute(Qt::WA_WState_ExplicitShowHide))
438  widget->show();
439 
440  return index;
441 }
442 
454 {
455  if (!widget)
456  return;
457 
458  Q_D(QStatusBar);
459  bool found = false;
461  for (int i=0; i<d->items.size(); ++i) {
462  item = d->items.at(i);
463  if (!item)
464  break;
465  if (item->w == widget) {
466  d->items.removeAt(i);
467  item->w->hide();
468  delete item;
469  found = true;
470  break;
471  }
472  }
473 
474  if (found)
475  reformat();
476 #if defined(QT_DEBUG)
477  else
478  qDebug("QStatusBar::removeWidget(): Widget not found.");
479 #endif
480 }
481 
495 {
496 #ifdef QT_NO_SIZEGRIP
497  return false;
498 #else
499  Q_D(const QStatusBar);
500  return !!d->resizer;
501 #endif
502 }
503 
505 {
506 #ifdef QT_NO_SIZEGRIP
507  Q_UNUSED(enabled);
508 #else
509  Q_D(QStatusBar);
510  if (!enabled != !d->resizer) {
511  if (enabled) {
512  d->resizer = new QSizeGrip(this);
513  d->resizer->hide();
514  d->resizer->installEventFilter(this);
515  d->showSizeGrip = true;
516  } else {
517  delete d->resizer;
518  d->resizer = 0;
519  d->showSizeGrip = false;
520  }
521  reformat();
522  if (d->resizer && isVisible())
523  d->tryToShowSizeGrip();
524  }
525 #endif
526 }
527 
528 
536 {
537  Q_D(QStatusBar);
538  if (d->box)
539  delete d->box;
540 
541  QBoxLayout *vbox;
542 #ifndef QT_NO_SIZEGRIP
543  if (d->resizer) {
544  d->box = new QHBoxLayout(this);
545  d->box->setMargin(0);
546  vbox = new QVBoxLayout;
547  d->box->addLayout(vbox);
548  } else
549 #endif
550  {
551  vbox = d->box = new QVBoxLayout(this);
552  d->box->setMargin(0);
553  }
554  vbox->addSpacing(3);
555  QBoxLayout* l = new QHBoxLayout;
556  vbox->addLayout(l);
557  l->addSpacing(2);
558  l->setSpacing(6);
559 
560  int maxH = fontMetrics().height();
561 
562  int i;
564  for (i=0,item=0; i<d->items.size(); ++i) {
565  item = d->items.at(i);
566  if (!item || item->p)
567  break;
568  l->addWidget(item->w, item->s);
569  int itemH = qMin(qSmartMinSize(item->w).height(), item->w->maximumHeight());
570  maxH = qMax(maxH, itemH);
571  }
572 
573  l->addStretch(0);
574 
575  for (item=0; i<d->items.size(); ++i) {
576  item = d->items.at(i);
577  if (!item)
578  break;
579  l->addWidget(item->w, item->s);
580  int itemH = qMin(qSmartMinSize(item->w).height(), item->w->maximumHeight());
581  maxH = qMax(maxH, itemH);
582  }
583 #ifndef QT_NO_SIZEGRIP
584  if (d->resizer) {
585  maxH = qMax(maxH, d->resizer->sizeHint().height());
586  d->box->addSpacing(1);
587  d->box->addWidget(d->resizer, 0, Qt::AlignBottom);
588  }
589 #endif
590  l->addStrut(maxH);
591  d->savedStrut = maxH;
592  vbox->addSpacing(2);
593  d->box->activate();
594  update();
595 }
596 
611 void QStatusBar::showMessage(const QString &message, int timeout)
612 {
613  Q_D(QStatusBar);
614 
615  d->tempItem = message;
616 
617  if (timeout > 0) {
618  if (!d->timer) {
619  d->timer = new QTimer(this);
620  connect(d->timer, SIGNAL(timeout()), this, SLOT(clearMessage()));
621  }
622  d->timer->start(timeout);
623  } else if (d->timer) {
624  delete d->timer;
625  d->timer = 0;
626  }
627 
628  hideOrShow();
629 }
630 
638 {
639  Q_D(QStatusBar);
640  if (d->tempItem.isEmpty())
641  return;
642  if (d->timer) {
643  qDeleteInEventHandler(d->timer);
644  d->timer = 0;
645  }
646  d->tempItem.clear();
647  hideOrShow();
648 }
649 
657 {
658  Q_D(const QStatusBar);
659  return d->tempItem;
660 }
661 
700 {
701  Q_D(QStatusBar);
702  bool haveMessage = !d->tempItem.isEmpty();
703 
704  QStatusBarPrivate::SBItem* item = 0;
705  for (int i=0; i<d->items.size(); ++i) {
706  item = d->items.at(i);
707  if (!item || item->p)
708  break;
709  if (haveMessage && item->w->isVisible()) {
710  item->w->hide();
712  } else if (!haveMessage && !item->w->testAttribute(Qt::WA_WState_ExplicitShowHide)) {
713  item->w->show();
714  }
715  }
716 
717  emit messageChanged(d->tempItem);
718 
719 #ifndef QT_NO_ACCESSIBILITY
720  if (QAccessible::isActive())
722 #endif
723 
724  repaint(d->messageRect());
725 }
726 
731 {
732 #ifndef QT_NO_SIZEGRIP
733  Q_D(QStatusBar);
734  if (d->resizer && d->showSizeGrip)
735  d->tryToShowSizeGrip();
736 #endif
737 }
738 
747 {
748  Q_D(QStatusBar);
749  bool haveMessage = !d->tempItem.isEmpty();
750 
751  QPainter p(this);
752  QStyleOption opt;
753  opt.initFrom(this);
754  style()->drawPrimitive(QStyle::PE_PanelStatusBar, &opt, &p, this);
755 
756  for (int i=0; i<d->items.size(); ++i) {
757  QStatusBarPrivate::SBItem* item = d->items.at(i);
758  if (item && item->w->isVisible() && (!haveMessage || item->p)) {
759  QRect ir = item->w->geometry().adjusted(-2, -1, 2, 1);
760  if (event->rect().intersects(ir)) {
761  QStyleOption opt(0);
762  opt.rect = ir;
763  opt.palette = palette();
765  style()->drawPrimitive(QStyle::PE_FrameStatusBarItem, &opt, &p, item->w);
766  }
767  }
768  }
769  if (haveMessage) {
770  p.setPen(palette().foreground().color());
771  p.drawText(d->messageRect(), Qt::AlignLeading | Qt::AlignVCenter | Qt::TextSingleLine, d->tempItem);
772  }
773 }
774 
779 {
781 }
782 
788 {
789  Q_D(QStatusBar);
790 
791  if (e->type() == QEvent::LayoutRequest
792 #ifdef QT3_SUPPORT
793  || e->type() == QEvent::LayoutHint
794 #endif
795  ) {
796  // Calculate new strut height and call reformat() if it has changed
797  int maxH = fontMetrics().height();
798 
799  QStatusBarPrivate::SBItem* item = 0;
800  for (int i=0; i<d->items.size(); ++i) {
801  item = d->items.at(i);
802  if (!item)
803  break;
804  int itemH = qMin(qSmartMinSize(item->w).height(), item->w->maximumHeight());
805  maxH = qMax(maxH, itemH);
806  }
807 
808 #ifndef QT_NO_SIZEGRIP
809  if (d->resizer)
810  maxH = qMax(maxH, d->resizer->sizeHint().height());
811 #endif
812 
813  if (maxH != d->savedStrut)
814  reformat();
815  else
816  update();
817  }
818  if (e->type() == QEvent::ChildRemoved) {
819  QStatusBarPrivate::SBItem* item = 0;
820  for (int i=0; i<d->items.size(); ++i) {
821  item = d->items.at(i);
822  if (!item)
823  break;
824  if (item->w == ((QChildEvent*)e)->child()) {
825  d->items.removeAt(i);
826  delete item;
827  }
828  }
829  }
830 
831 // On Mac OS X Leopard it is possible to drag the window by clicking
832 // on the tool bar on most applications.
833 #ifndef Q_WS_MAC
834  return QWidget::event(e);
835 #else
837  return QWidget::event(e);
838 
839  // Enable drag-click only if the status bar is the status bar for a
840  // QMainWindow with a unifed toolbar.
841  if (parent() == 0 || qobject_cast<QMainWindow *>(parent()) == 0 ||
842  qobject_cast<QMainWindow *>(parent())->unifiedTitleAndToolBarOnMac() == false )
843  return QWidget::event(e);
844 
845  // Check for mouse events.
847  if (e->type() == QEvent::MouseButtonPress ||
848  e->type() == QEvent::MouseMove ||
850  mouseEvent = static_cast <QMouseEvent*>(e);
851  } else {
852  return QWidget::event(e);
853  }
854 
855  // The following is a standard mouse drag handler.
856  if (e->type() == QEvent::MouseButtonPress && (mouseEvent->button() == Qt::LeftButton)) {
857  d->dragStart = mouseEvent->pos();
858  } else if (e->type() == QEvent::MouseMove){
859  if (d->dragStart == QPoint())
860  return QWidget::event(e);
861  QPoint pos = mouseEvent->pos();
862  QPoint delta = (pos - d->dragStart);
863  window()->move(window()->pos() + delta);
864  } else if (e->type() == QEvent::MouseButtonRelease && (mouseEvent->button() == Qt::LeftButton)){
865  d->dragStart = QPoint();
866  } else {
867  return QWidget::event(e);
868  }
869 
870  return true;
871 #endif
872 }
873 
875 
876 #endif
QPoint pos() const
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:86
double d
Definition: qnumeric_p.h:62
bool enabled
whether the widget is enabled
Definition: qwidget.h:157
static void updateAccessibility(QObject *, int who, Event reason)
Notifies accessibility clients about a change in object&#39;s accessibility information.
QRect adjusted(int x1, int y1, int x2, int y2) const
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
Definition: qrect.h:431
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
The QBoxLayout class lines up child widgets horizontally or vertically.
Definition: qboxlayout.h:60
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
The QSizeGrip class provides a resize handle for resizing top-level windows.
Definition: qsizegrip.h:55
Q_GUI_EXPORT QSize qSmartMinSize(const QSize &sizeHint, const QSize &minSizeHint, const QSize &minSize, const QSize &maxSize, const QSizePolicy &sizePolicy)
QPointer< QWidget > widget
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
Definition: qstring.cpp:4276
int width
the width of the widget excluding any window frame
Definition: qwidget.h:166
QStyle::State state
the style flags that are used when drawing the control
Definition: qstyleoption.h:88
bool isVisible() const
Definition: qwidget.h:1005
void addLayout(QLayout *layout, int stretch=0)
Adds layout to the end of the box, with serial stretch factor stretch.
void reformat()
Changes the status bar&#39;s appearance to account for item changes.
Definition: qstatusbar.cpp:535
#define SLOT(a)
Definition: qobjectdefs.h:226
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
virtual void resizeEvent(QResizeEvent *)
This event handler can be reimplemented in a subclass to receive widget resize events which are passe...
Definition: qwidget.cpp:9587
void addPermanentWidget(QWidget *widget, int stretch=0)
Adds the given widget permanently to this status bar, reparenting the widget if it isn&#39;t already a ch...
Definition: qstatusbar.cpp:392
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define Q_D(Class)
Definition: qglobal.h:2482
int x
the x coordinate of the widget relative to its parent including any window frame
Definition: qwidget.h:161
void addWidget(QWidget *, int stretch=0, Qt::Alignment alignment=0)
Adds widget to the end of this box layout, with a stretch factor of stretch and alignment alignment...
virtual ~QStatusBar()
Destroys this status bar and frees any allocated resources and child widgets.
Definition: qstatusbar.cpp:302
void clearMessage()
Removes any temporary message being shown.
Definition: qstatusbar.cpp:637
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
const QPoint & pos() const
Returns the position of the mouse cursor, relative to the widget that received the event...
Definition: qevent.h:95
QStyle * style() const
Definition: qwidget.cpp:2742
#define Q_Q(Class)
Definition: qglobal.h:2483
The QStatusBar class provides a horizontal bar suitable for presenting status information.
Definition: qstatusbar.h:57
bool isHidden() const
Returns true if the widget is hidden, otherwise returns false.
Definition: qwidget.h:1008
void update()
Updates the widget unless updates are disabled or the widget is hidden.
Definition: qwidget.cpp:10883
Q_CORE_EXPORT void qDebug(const char *,...)
void addStretch(int stretch=0)
Adds a stretchable space (a QSpacerItem) with zero minimum size and stretch factor stretch to the end...
#define SIGNAL(a)
Definition: qobjectdefs.h:227
void resizeEvent(QResizeEvent *)
Reimplemented Function
Definition: qstatusbar.cpp:778
void drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position...
Definition: qpainter.cpp:6231
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
QBoxLayout * box
Definition: qstatusbar.cpp:82
The QStyleOption class stores the parameters used by QStyle functions.
Definition: qstyleoption.h:67
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
int width() const
void initFrom(const QWidget *w)
Definition: qstyleoption.h:99
const char * name
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
#define emit
Definition: qobjectdefs.h:76
const QPalette & palette() const
QFontMetrics fontMetrics() const
Returns the font metrics for the widget&#39;s current font.
Definition: qwidget.h:984
virtual void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const =0
Draws the given primitive element with the provided painter using the style options specified by opti...
The QResizeEvent class contains event parameters for resize events.
Definition: qevent.h:349
Q_CORE_EXPORT void qWarning(const char *,...)
void addStrut(int)
Limits the perpendicular dimension of the box (e.g.
int maximumHeight
the widget&#39;s maximum height in pixels
Definition: qwidget.h:177
void tryToShowSizeGrip()
Definition: qstatusbar.cpp:108
void show()
Shows the widget and its child widgets.
The QShowEvent class provides an event that is sent when a widget is shown.
Definition: qevent.h:380
SBItem(QWidget *widget, int stretch, bool permanent)
Definition: qstatusbar.cpp:72
Qt::MouseButton button() const
Returns the button that caused the event.
Definition: qevent.h:101
void hide()
Hides the widget.
Definition: qwidget.h:501
QString currentMessage() const
Returns the temporary message currently shown, or an empty string if there is no such message...
Definition: qstatusbar.cpp:656
static bool isActive()
Returns true if an accessibility implementation has been requested during the runtime of the applicat...
int indexToLastNonPermanentWidget() const
Definition: qstatusbar.cpp:96
The QMouseEvent class contains parameters that describe a mouse event.
Definition: qevent.h:85
void repaint()
Repaints the widget directly by calling paintEvent() immediately, unless updates are disabled or the ...
Definition: qwidget.cpp:10761
The QChildEvent class contains event parameters for child object events.
Definition: qcoreevent.h:353
int insertPermanentWidget(int index, QWidget *widget, int stretch=0)
Inserts the given widget at the given index permanently to this status bar, reparenting the widget if...
Definition: qstatusbar.cpp:421
QPalette palette
the palette that should be used when painting the control
Definition: qstyleoption.h:92
#define Q_DECLARE_PUBLIC(Class)
Definition: qglobal.h:2477
void qDeleteInEventHandler(QObject *o)
Definition: qobject.cpp:4348
int x() const
void paintEvent(QPaintEvent *)
Reimplemented FunctionShows the temporary message, if appropriate, in response to the paint event...
Definition: qstatusbar.cpp:746
QStatusBar(QWidget *parent=0)
Constructs a status bar with a size grip and the given parent.
Definition: qstatusbar.cpp:283
QRect messageRect() const
Definition: qstatusbar.cpp:125
void removeWidget(QWidget *widget)
Removes the specified widget from the status bar.
Definition: qstatusbar.cpp:453
void addSpacing(int size)
Adds a non-stretchable space (a QSpacerItem) with size size to the end of this box layout...
bool event(QEvent *)
Reimplemented Function
Definition: qstatusbar.cpp:787
void setSpacing(int spacing)
Reimplements QLayout::setSpacing().
Definition: qboxlayout.cpp:667
QObject * parent() const
Returns a pointer to the parent object.
Definition: qobject.h:273
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
void setPen(const QColor &color)
Sets the painter&#39;s pen to have style Qt::SolidLine, width 0 and the specified color.
Definition: qpainter.cpp:4047
int height() const
Returns the height.
Definition: qsize.h:129
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
QFactoryLoader * l
QSizeGrip * resizer
Definition: qstatusbar.cpp:86
static void mouseEvent(MouseAction action, QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1)
Definition: qtestmouse.h:71
The QHBoxLayout class lines up widgets horizontally.
Definition: qboxlayout.h:129
void setAttribute(Qt::WidgetAttribute, bool on=true)
Sets the attribute attribute on this widget if on is true; otherwise clears the attribute.
Definition: qwidget.cpp:11087
quint16 index
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
QObject * parent
Definition: qobject.h:92
static bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
Invokes the member (a signal or a slot name) on the object obj.
static const MacVersion MacintoshVersion
the version of the Macintosh operating system on which the application is run (Mac only)...
Definition: qglobal.h:1646
void showEvent(QShowEvent *)
Reimplemented Function
Definition: qstatusbar.cpp:730
bool intersects(const QRect &r) const
Returns true if this rectangle intersects with the given rectangle (i.
Definition: qrect.cpp:1429
void showMessage(const QString &text, int timeout=0)
Hides the normal status indications and displays the given message for the specified number of milli-...
Definition: qstatusbar.cpp:611
void setSizeGripEnabled(bool)
Definition: qstatusbar.cpp:504
The QVBoxLayout class lines up widgets vertically.
Definition: qboxlayout.h:149
bool event(QEvent *)
This is the main event handler; it handles event event.
Definition: qwidget.cpp:8636
The QTimer class provides repetitive and single-shot timers.
Definition: qtimer.h:56
const QRect & rect() const
Returns the rectangle that needs to be updated.
Definition: qevent.h:305
int height() const
Returns the height of the font.
The QPaintEvent class contains event parameters for paint events.
Definition: qevent.h:298
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56
Type type() const
Returns the event type.
Definition: qcoreevent.h:303
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
void messageChanged(const QString &text)
This signal is emitted whenever the temporary status message changes.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
QRect geometry
the geometry of the widget relative to its parent and excluding the window frame
Definition: qwidget.h:158
void hideOrShow()
Ensures that the right widgets are visible.
Definition: qstatusbar.cpp:699
QRect rect
the area that should be used for various calculations and painting
Definition: qstyleoption.h:90
bool isSizeGripEnabled() const
Definition: qstatusbar.cpp:494
int insertWidget(int index, QWidget *widget, int stretch=0)
Inserts the given widget at the given index to this status bar, reparenting the widget if it isn&#39;t al...
Definition: qstatusbar.cpp:353
void move(int x, int y)
This corresponds to move(QPoint(x, y)).
Definition: qwidget.h:1011
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
QList< SBItem * > items
Definition: qstatusbar.cpp:79
void addWidget(QWidget *widget, int stretch=0)
Adds the given widget to this status bar, reparenting the widget if it isn&#39;t already a child of this ...
Definition: qstatusbar.cpp:324