Qt 4.8
qdecorationdefault_qws.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 <qapplication.h>
43 #include <qwidget.h>
44 #include <qpainter.h>
45 #include <qpaintengine.h>
46 #include <qdrawutil.h>
47 #include "qdecorationdefault_qws.h"
48 
50 
51 #if !defined(QT_NO_QWS_DECORATION_DEFAULT) || defined(QT_PLUGIN)
52 
59 
60 #ifndef QT_NO_IMAGEFORMAT_XPM
61 
62 /* XPM */
63 static const char * const default_menu_xpm[] = {
64 /* width height ncolors chars_per_pixel */
65 "16 16 11 1",
66 /* colors */
67 " c #000000",
68 ". c #336600",
69 "X c #666600",
70 "o c #99CC00",
71 "O c #999933",
72 "+ c #333300",
73 "@ c #669900",
74 "# c #999900",
75 "$ c #336633",
76 "% c #666633",
77 "& c #99CC33",
78 /* pixels */
79 "oooooooooooooooo",
80 "oooooooooooooooo",
81 "ooooo#.++X#ooooo",
82 "ooooX Xoooo",
83 "oooX XO#% X&oo",
84 "oo# Ooo&@O Ooo",
85 "oo. Xoo#+ @X Xoo",
86 "oo+ OoO+ +O# +oo",
87 "oo+ #O+ +## +oo",
88 "oo. %@ ++ +. Xoo",
89 "oo# O@OO+ #oo",
90 "oooX X##$ Ooo",
91 "ooooX Xoo",
92 "oooo&OX++X#OXooo",
93 "oooooooooooooooo",
94 "oooooooooooooooo"
95 };
96 
97 static const char * const default_help_xpm[] = {
98 "16 16 3 1",
99 " s None c None",
100 ". c #ffffff",
101 "X c #707070",
102 " ",
103 " ",
104 " ...... ",
105 " ..XXXXXX ",
106 " .XX .XX ",
107 " .XX .XX ",
108 " ..XX ",
109 " ..XX ",
110 " ..XX ",
111 " .XX ",
112 " .XX ",
113 " .. ",
114 " .XX ",
115 " .XX ",
116 " ",
117 " "};
118 
119 static const char * const default_close_xpm[] = {
120 "16 16 3 1",
121 " s None c None",
122 ". c #ffffff",
123 "X c #707070",
124 " ",
125 " ",
126 " .X .X ",
127 " .XX .XX ",
128 " .XX .XX ",
129 " .XX .XX ",
130 " .XX.XX ",
131 " .XXX ",
132 " .XXX ",
133 " .XX.XX ",
134 " .XX .XX ",
135 " .XX .XX ",
136 " .XX .XX ",
137 " .X .X ",
138 " ",
139 " "};
140 
141 static const char * const default_maximize_xpm[] = {
142 "16 16 3 1",
143 " s None c None",
144 ". c #ffffff",
145 "X c #707070",
146 " ",
147 " ",
148 " ........... ",
149 " .XXXXXXXXXX ",
150 " .X .X ",
151 " .X .X ",
152 " .X .X ",
153 " .X .X ",
154 " .X .X ",
155 " .X .X ",
156 " .X .X ",
157 " .X........X ",
158 " .XXXXXXXXXX ",
159 " ",
160 " ",
161 " "};
162 
163 static const char * const default_minimize_xpm[] = {
164 "16 16 3 1",
165 " s None c None",
166 ". c #ffffff",
167 "X c #707070",
168 " ",
169 " ",
170 " ",
171 " ",
172 " ",
173 " ",
174 " ... ",
175 " . X ",
176 " .XX ",
177 " ",
178 " ",
179 " ",
180 " ",
181 " ",
182 " ",
183 " "};
184 
185 static const char * const default_normalize_xpm[] = {
186 "16 16 3 1",
187 " s None c None",
188 ". c #ffffff",
189 "X c #707070",
190 " ",
191 " ",
192 " ........ ",
193 " .XXXXXXXX ",
194 " .X .X ",
195 " .X .X ",
196 " ....X... .X ",
197 " .XXXXXXXX .X ",
198 " .X .XXXX ",
199 " .X .X ",
200 " .X .X ",
201 " .X......X ",
202 " .XXXXXXXX ",
203 " ",
204 " ",
205 " "};
206 
207 #endif // QT_NO_IMAGEFORMAT_XPM
208 
230  : QDecoration()
231 {
232  menu_width = 20;
233  help_width = 20;
234  close_width = 20;
235  minimize_width = 20;
236  maximize_width = 20;
237  normalize_width = 20;
238 }
239 
244 {
245  delete staticMenuPixmap;
246  delete staticClosePixmap;
247  delete staticMinimizePixmap;
248  delete staticMaximizePixmap;
249  delete staticNormalizePixmap;
250 
251  // This makes it safe to delete and then create a QDecorationDefault
252  staticMenuPixmap = 0;
253  staticClosePixmap = 0;
257 }
258 
271 const char **QDecorationDefault::xpmForRegion(int reg)
272 {
273 #ifdef QT_NO_IMAGEFORMAT_XPM
274  Q_UNUSED(reg);
275 #else
276  switch(reg)
277  {
278  case Help:
279  return (const char **)default_help_xpm;
280  case Menu:
281  return (const char **)default_menu_xpm;
282  case Close:
283  return (const char **)default_close_xpm;
284  case Minimize:
285  return (const char **)default_minimize_xpm;
286  case Maximize:
287  return (const char **)default_maximize_xpm;
288  case Normalize:
289  return (const char **)default_normalize_xpm;
290  }
291 #endif
292  return 0;
293 }
294 
313  int decorationRegion,
314  int &xoff,
315  int &/*yoff*/)
316 {
317 #ifdef QT_NO_IMAGEFORMAT_XPM
318  Q_UNUSED(widget);
319  Q_UNUSED(decorationRegion);
320  Q_UNUSED(xoff);
321  return QPixmap();
322 #else
323  static const char **staticHelpPixmapXPM = 0;
324  static const char **staticMenuPixmapXPM = 0;
325  static const char **staticClosePixmapXPM = 0;
326  static const char **staticMinimizePixmapXPM = 0;
327  static const char **staticMaximizePixmapXPM = 0;
328  static const char **staticNormalizePixmapXPM = 0;
329  const char **xpm;
330 
331  // Why don't we just use/extend the enum type...
332 
333  if (staticHelpPixmapXPM != (xpm = xpmForRegion(Help)) || !staticHelpPixmap) {
334  staticHelpPixmapXPM = xpm;
335  staticHelpPixmap = new QPixmap(xpm);
336  }
337  if (staticMenuPixmapXPM != (xpm = xpmForRegion(Menu)) || !staticMenuPixmap) {
338  staticMenuPixmapXPM = xpm;
339  staticMenuPixmap = new QPixmap(xpm);
340  }
341  if (staticClosePixmapXPM != (xpm = xpmForRegion(Close)) || !staticClosePixmap) {
342  staticClosePixmapXPM = xpm;
343  staticClosePixmap = new QPixmap(xpm);
344  }
345  if (staticMinimizePixmapXPM != (xpm = xpmForRegion(Minimize)) || !staticMinimizePixmap) {
346  staticMinimizePixmapXPM = xpm;
347  staticMinimizePixmap = new QPixmap(xpm);
348  }
349  if (staticMaximizePixmapXPM != (xpm = xpmForRegion(Maximize)) || !staticMaximizePixmap) {
350  staticMaximizePixmapXPM = xpm;
351  staticMaximizePixmap = new QPixmap(xpm);
352  }
353  if (staticNormalizePixmapXPM != (xpm = xpmForRegion(Normalize)) || !staticNormalizePixmap) {
354  staticNormalizePixmapXPM = xpm;
355  staticNormalizePixmap = new QPixmap(xpm);
356  }
357 
358  const QPixmap *pm = 0;
359 
360  switch (decorationRegion) {
361  case Help:
362  pm = staticHelpPixmap;
363  break;
364  case Menu:
365  if (!widget->windowIcon().isNull())
366  return widget->windowIcon().pixmap(16,16); //##### QIcon::pixmap() needs a size !!!!!!"
367  if (!pm) {
368  xoff = 1;
369  pm = staticMenuPixmap;
370  }
371  break;
372  case Close:
373  pm = staticClosePixmap;
374  break;
375  case Maximize:
377  break;
378  case Normalize:
380  break;
381  case Minimize:
383  break;
384  default:
385  break;
386  }
387  return *pm;
388 #endif
389 }
390 
399 {
400  return qMax(20, QApplication::fontMetrics().height() + BORDER_WIDTH);
401 }
402 
410  const QRect &rect,
411  int decorationRegion)
412 {
413  Qt::WindowFlags flags = widget->windowFlags();
414  bool hasBorder = !widget->isMaximized();
415  bool hasTitle = flags & Qt::WindowTitleHint;
416  bool hasSysMenu = flags & Qt::WindowSystemMenuHint;
417  bool hasContextHelp = flags & Qt::WindowContextHelpButtonHint;
418  bool hasMinimize = flags & Qt::WindowMinimizeButtonHint;
419  bool hasMaximize = flags & Qt::WindowMaximizeButtonHint;
420  int state = widget->windowState();
421  bool isMinimized = state & Qt::WindowMinimized;
422  bool isMaximized = state & Qt::WindowMaximized;
423 
424  int titleHeight = hasTitle ? titleBarHeight(widget) : 0;
425  int bw = hasBorder ? BORDER_WIDTH : 0;
426  int bbw = hasBorder ? BOTTOM_BORDER_WIDTH : 0;
427 
428  QRegion region;
429  switch (decorationRegion) {
430  case All: {
431  QRect r(rect.left() - bw,
432  rect.top() - titleHeight - bw,
433  rect.width() + 2 * bw,
434  rect.height() + titleHeight + bw + bbw);
435  region = r;
436  region -= rect;
437  }
438  break;
439 
440  case Title: {
441  QRect r(rect.left()
442  + (hasSysMenu ? menu_width : 0),
443  rect.top() - titleHeight,
444  rect.width()
445  - (hasSysMenu ? menu_width : 0)
446  - close_width
447  - (hasMaximize ? maximize_width : 0)
448  - (hasMinimize ? minimize_width : 0)
449  - (hasContextHelp ? help_width : 0),
450 
451  titleHeight);
452  if (r.width() > 0)
453  region = r;
454  }
455  break;
456 
457  case Top: {
458  QRect r(rect.left() + CORNER_GRAB,
459  rect.top() - titleHeight - bw,
460  rect.width() - 2 * CORNER_GRAB,
461  bw);
462  region = r;
463  }
464  break;
465 
466  case Left: {
467  QRect r(rect.left() - bw,
468  rect.top() - titleHeight + CORNER_GRAB,
469  bw,
470  rect.height() + titleHeight - 2 * CORNER_GRAB);
471  region = r;
472  }
473  break;
474 
475  case Right: {
476  QRect r(rect.right() + 1,
477  rect.top() - titleHeight + CORNER_GRAB,
478  bw,
479  rect.height() + titleHeight - 2 * CORNER_GRAB);
480  region = r;
481  }
482  break;
483 
484  case Bottom: {
485  QRect r(rect.left() + CORNER_GRAB,
486  rect.bottom() + 1,
487  rect.width() - 2 * CORNER_GRAB,
488  bw);
489  region = r;
490  }
491  break;
492 
493  case TopLeft: {
494  QRect r1(rect.left() - bw,
495  rect.top() - bw - titleHeight,
496  CORNER_GRAB + bw,
497  bw);
498 
499  QRect r2(rect.left() - bw,
500  rect.top() - bw - titleHeight,
501  bw,
502  CORNER_GRAB + bw);
503 
504  region = QRegion(r1) + r2;
505  }
506  break;
507 
508  case TopRight: {
509  QRect r1(rect.right() - CORNER_GRAB,
510  rect.top() - bw - titleHeight,
511  CORNER_GRAB + bw,
512  bw);
513 
514  QRect r2(rect.right() + 1,
515  rect.top() - bw - titleHeight,
516  bw,
517  CORNER_GRAB + bw);
518 
519  region = QRegion(r1) + r2;
520  }
521  break;
522 
523  case BottomLeft: {
524  QRect r1(rect.left() - bw,
525  rect.bottom() + 1,
526  CORNER_GRAB + bw,
527  bw);
528 
529  QRect r2(rect.left() - bw,
530  rect.bottom() - CORNER_GRAB,
531  bw,
532  CORNER_GRAB + bw);
533  region = QRegion(r1) + r2;
534  }
535  break;
536 
537  case BottomRight: {
538  QRect r1(rect.right() - CORNER_GRAB,
539  rect.bottom() + 1,
540  CORNER_GRAB + bw,
541  bw);
542 
543  QRect r2(rect.right() + 1,
544  rect.bottom() - CORNER_GRAB,
545  bw,
546  CORNER_GRAB + bw);
547  region = QRegion(r1) + r2;
548  }
549  break;
550 
551  case Menu: {
552  if (hasSysMenu) {
553  region = QRect(rect.left(), rect.top() - titleHeight,
554  menu_width, titleHeight);
555  }
556  }
557  break;
558 
559  case Help: {
560  if (hasContextHelp) {
561  QRect r(rect.right()
562  - close_width
563  - (hasMaximize ? maximize_width : 0)
564  - (hasMinimize ? minimize_width : 0)
565  - help_width + 1, rect.top() - titleHeight,
566  help_width, titleHeight);
567  if (r.left() > rect.left() + titleHeight)
568  region = r;
569  }
570  }
571  break;
572 
573 
574  case Minimize: {
575  if (hasMinimize && !isMinimized) {
576  QRect r(rect.right() - close_width
577  - (hasMaximize ? maximize_width : 0)
578  - minimize_width + 1, rect.top() - titleHeight,
579  minimize_width, titleHeight);
580  if (r.left() > rect.left() + titleHeight)
581  region = r;
582  }
583  }
584  break;
585 
586  case Maximize: {
587  if (hasMaximize && !isMaximized) {
588  QRect r(rect.right() - close_width - maximize_width + 1,
589  rect.top() - titleHeight, maximize_width, titleHeight);
590  if (r.left() > rect.left() + titleHeight)
591  region = r;
592  }
593  }
594  break;
595 
596  case Normalize: {
597  if (hasMinimize && isMinimized) {
598  QRect r(rect.right() - close_width
599  - (hasMaximize ? maximize_width : 0)
600  - minimize_width + 1, rect.top() - titleHeight,
601  minimize_width, titleHeight);
602  if (r.left() > rect.left() + titleHeight)
603  region = r;
604  } else if (hasMaximize && isMaximized) {
605  QRect r(rect.right() - close_width - maximize_width + 1,
606  rect.top() - titleHeight, maximize_width, titleHeight);
607  if (r.left() > rect.left() + titleHeight)
608  region = r;
609  }
610  }
611  break;
612 
613  case Close: {
614  QRect r(rect.right() - close_width + 1, rect.top() - titleHeight,
615  close_width, titleHeight);
616  if (r.left() > rect.left() + titleHeight)
617  region = r;
618  }
619  break;
620 
621  default: {
622  int i = 1;
623  while (i) {
624  if (i & decorationRegion)
625  region += this->region(widget, rect, i);
626  i <<= 1;
627  }
628  }
629  break;
630  }
631 
632  return region;
633 }
634 
645  const QWidget *widget,
646  int decorationRegion,
647  DecorationState state)
648 {
649  if (decorationRegion == None)
650  return false;
651 
652  const QRect titleRect = QDecoration::region(widget, Title).boundingRect();
653  const QPalette pal = QApplication::palette();
654  int titleHeight = titleRect.height();
655  int titleWidth = titleRect.width();
656  QRegion oldClipRegion = painter->clipRegion();
657 
658 
659  Qt::WindowFlags flags = widget->windowFlags();
660  bool hasBorder = !widget->isMaximized();
661  bool hasTitle = flags & Qt::WindowTitleHint;
662  bool hasSysMenu = flags & Qt::WindowSystemMenuHint;
663  bool hasContextHelp = flags & Qt::WindowContextHelpButtonHint;
664  bool hasMinimize = flags & Qt::WindowMinimizeButtonHint;
665  bool hasMaximize = flags & Qt::WindowMaximizeButtonHint;
666 
667  bool paintAll = (decorationRegion == int(All));
668  bool handled = false;
669 
670  bool porterDuff = painter->paintEngine()->hasFeature(QPaintEngine::PorterDuff);
671 
672  if ((paintAll || decorationRegion & Borders) && state == Normal && hasBorder) {
673  if (hasTitle) { // reduce flicker
674  QRect rect(widget->rect());
675  QRect r(rect.left(), rect.top() - titleHeight,
676  rect.width(), titleHeight);
677  painter->setClipRegion(oldClipRegion - r);
678  }
679  QRect br = QDecoration::region(widget).boundingRect();
680  if (porterDuff)
682  qDrawWinPanel(painter, br.x(), br.y(), br.width(),
683  br.height(), pal, false,
684  &pal.brush(QPalette::Window));
685  if (porterDuff)
687  handled |= true;
688  }
689 
690  if ((paintAll || decorationRegion & Title && titleWidth > 0) && state == Normal && hasTitle) {
691  painter->setClipRegion(oldClipRegion);
692  QBrush titleBrush;
693  QPen titlePen;
694 
695  if (widget == qApp->activeWindow()) {
696  titleBrush = pal.brush(QPalette::Highlight);
697  titlePen = pal.color(QPalette::HighlightedText);
698  } else {
699  titleBrush = pal.brush(QPalette::Window);
700  titlePen = pal.color(QPalette::Text);
701  }
702 
703  if (porterDuff)
705  qDrawShadePanel(painter,
706  titleRect.x(), titleRect.y(), titleRect.width(), titleRect.height(),
707  pal, true, 1, &titleBrush);
708  if (porterDuff)
710 
711  painter->setPen(titlePen);
712  painter->drawText(titleRect.x() + 4, titleRect.y(),
713  titleRect.width() - 8, titleRect.height(),
715  handled |= true;
716  }
717 
718  if (state != Hover) {
719  painter->setClipRegion(oldClipRegion);
720  if ((paintAll || decorationRegion & Menu) && hasSysMenu) {
721  paintButton(painter, widget, Menu, state, pal);
722  handled |= true;
723  }
724 
725  if ((paintAll || decorationRegion & Help) && hasContextHelp) {
726  paintButton(painter, widget, Help, state, pal);
727  handled |= true;
728  }
729 
730  if ((paintAll || decorationRegion & Minimize) && hasMinimize) {
731  paintButton(painter, widget, Minimize, state, pal);
732  handled |= true;
733  }
734 
735  if ((paintAll || decorationRegion & Maximize) && hasMaximize) {
736  paintButton(painter, widget,
737  ((widget->windowState() & Qt::WindowMaximized)? Normalize : Maximize),
738  state, pal);
739  handled |= true;
740  }
741 
742  if (paintAll || decorationRegion & Close) {
743  paintButton(painter, widget, Close, state, pal);
744  handled |= true;
745  }
746  }
747  return handled;
748 }
749 
766  const QWidget *widget,
767  int buttonRegion,
768  DecorationState state,
769  const QPalette &pal)
770 {
771  int xoff = 2;
772  int yoff = 2;
773 
774  const QPixmap pm = pixmapFor(widget, buttonRegion, xoff, yoff);
775  QRect brect(QDecoration::region(widget, buttonRegion).boundingRect());
776  bool porterDuff = painter->paintEngine()->hasFeature(QPaintEngine::PorterDuff);
777 
778  if (state & QDecoration::Pressed) {
779  if (porterDuff)
781  qDrawWinPanel(painter, brect, pal, true, &pal.brush(QPalette::Window));
782  if (porterDuff)
784  ++xoff;
785  ++yoff;
786  } else {
787  painter->fillRect(brect, pal.brush(QPalette::Window));
788  }
789 
790  if (!pm.isNull())
791  painter->drawPixmap(brect.x() + xoff, brect.y() + yoff, pm);
792 }
793 
795 
800 {
802 }
803 
804 #endif // QT_NO_QWS_DECORATION_DEFAULT
805 
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:86
virtual void paintButton(QPainter *painter, const QWidget *widget, int buttonRegion, DecorationState state, const QPalette &pal)
Paints a region of the top-level widget.
#define BORDER_WIDTH
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QPointer< QWidget > widget
static const char *const default_maximize_xpm[]
Qt::WindowStates windowState() const
Returns the current window state.
Definition: qwidget.cpp:3086
QDecorationDefault()
Default constructor.
virtual QRegion region(const QWidget *widget, const QRect &rect, int decorationRegion=All)
Returns the region specified by decorationRegion for the top-level widget.
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
virtual bool paint(QPainter *painter, const QWidget *widget, int decorationRegion=All, DecorationState state=Normal)
Paints the border and title decoration for the top-level widget using the painter provided and the de...
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
static const char *const default_normalize_xpm[]
static QPixmap * staticNormalizePixmap
static QPalette palette()
Returns the application palette.
QRect boundingRect() const
Returns the bounding rectangle of this region.
Definition: qregion.cpp:4363
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
The QString class provides a Unicode character string.
Definition: qstring.h:83
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
Definition: qpalette.h:107
The QPen class defines how a QPainter should draw lines and outlines of shapes.
Definition: qpen.h:64
QIcon windowIcon
the widget&#39;s icon
Definition: qwidget.h:199
virtual QRegion region(const QWidget *w, const QRect &rect, int decorationRegion=All)=0
Implement this function to return the region specified by decorationRegion for the given top level wi...
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
static QPixmap * staticMenuPixmap
The QDecoration class is a base class for window decorations in Qt for Embedded Linux.
static const QRectF boundingRect(const QPointF *points, int pointCount)
static QFontMetrics fontMetrics()
Returns display (screen) font metrics for the application font.
virtual ~QDecorationDefault()
The constructor deletes the static pixmaps.
QRegion clipRegion() const
Returns the currently set clip region.
Definition: qpainter.cpp:2562
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
virtual int titleBarHeight(const QWidget *widget)
Returns the title bar height in pixels for the given widget.
static QPixmap * staticHelpPixmap
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
virtual const char ** xpmForRegion(int region)
Returns a pointer to the X pixmap for the icon specified by region.
void qDrawWinPanel(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, const QBrush *fill)
Definition: qdrawutil.cpp:475
#define qApp
static const char *const default_minimize_xpm[]
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
Definition: qicon.cpp:769
static const char *const default_close_xpm[]
static const char *const default_menu_xpm[]
QString windowTitle
the window title (caption)
Definition: qwidget.h:198
QPaintEngine * paintEngine() const
Returns the paint engine that the painter is currently operating on if the painter is active; otherwi...
Definition: qpainter.cpp:1991
void qDrawShadePanel(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, const QBrush *fill)
Definition: qdrawutil.cpp:303
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
static QPixmap * staticMinimizePixmap
const QBrush & brush(ColorGroup cg, ColorRole cr) const
Returns the brush in the specified color group, used for the given color role.
Definition: qpalette.cpp:874
bool isMaximized() const
Definition: qwidget.cpp:3074
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
QString windowTitleFor(const QWidget *widget) const
void setClipRegion(const QRegion &, Qt::ClipOperation op=Qt::ReplaceClip)
Sets the clip region to the given region using the specified clip operation.
Definition: qpainter.cpp:2917
int right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:246
void setCompositionMode(CompositionMode mode)
Sets the composition mode to the given mode.
Definition: qpainter.cpp:2422
QRect rect
the internal geometry of the widget excluding any window frame
Definition: qwidget.h:168
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
static const char *const default_help_xpm[]
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
virtual QPixmap pixmapFor(const QWidget *widget, int decorationRegion, int &xoff, int &yoff)
Returns a pointer to the QPixmap for the widget specified by widget and decorationRegion.
#define BOTTOM_BORDER_WIDTH
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
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
DecorationState
This enum describes the various states of a decoration region.
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
#define CORNER_GRAB
QPixmap pixmap(const QSize &size, Mode mode=Normal, State state=Off) const
Returns a pixmap with the requested size, mode, and state, generating one if necessary.
Definition: qicon.cpp:693
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device...
Definition: qpainter.cpp:5619
Qt::WindowFlags windowFlags() const
Window flags are a combination of a type (e.
Definition: qwidget.h:939
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
Definition: qpixmap.cpp:615
static QPixmap * staticMaximizePixmap
#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
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
Definition: qpainter.cpp:7420
static QPixmap * staticClosePixmap
bool hasFeature(PaintEngineFeatures feature) const
Returns true if the paint engine supports the specified feature; otherwise returns false...
Definition: qpaintengine.h:229
QString qt_setWindowTitle_helperHelper(const QString &, const QWidget *)
Returns a modified window title with the [*] place holder replaced according to the rules described i...
Definition: qwidget.cpp:6240
The QPalette class contains color groups for each widget state.
Definition: qpalette.h:61