Qt 4.8
qcommonstyle_p.h
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 #ifndef QCOMMONSTYLE_P_H
43 #define QCOMMONSTYLE_P_H
44 
45 #include "qcommonstyle.h"
46 #include "qstyle_p.h"
47 
48 #include "qstyleoption.h"
49 
51 
52 //
53 // W A R N I N G
54 // -------------
55 //
56 // This file is not part of the Qt API. It exists for the convenience
57 // of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
58 // file may change from version to version without notice, or even be removed.
59 //
60 // We mean it.
61 //
62 
63 class QStringList;
64 
65 // Private class
67 {
69 public:
71 #ifndef QT_NO_ITEMVIEWS
72  : cachedOption(0)
73 #endif
74  { }
75 
76 #ifndef QT_NO_ITEMVIEWS
78  {
79  delete cachedOption;
80  }
81  void viewItemDrawText(QPainter *p, const QStyleOptionViewItemV4 *option, const QRect &rect) const;
83  QRect *pixmapRect, QRect *textRect, bool sizehint) const;
84  QSize viewItemSize(const QStyleOptionViewItemV4 *option, int role) const;
85 
88  bool isViewItemCached(const QStyleOptionViewItemV4 &option) const {
89  return cachedOption && (option.rect == cachedOption->rect
90  && option.direction == cachedOption->direction
91  && option.state == cachedOption->state
92  && option.displayAlignment == cachedOption->displayAlignment
93  && option.decorationAlignment == cachedOption->decorationAlignment
94  && option.decorationPosition == cachedOption->decorationPosition
95  && option.decorationSize == cachedOption->decorationSize
96  && option.font == cachedOption->font
97  && option.features == cachedOption->features
98  && option.widget == cachedOption->widget
99  && option.index == cachedOption->index
100  && option.icon.isNull() == cachedOption->icon.isNull()
101  && option.text == cachedOption->text
102  && option.viewItemPosition == cachedOption->viewItemPosition);
103  }
104 #endif
106 #ifndef QT_NO_TABBAR
107  void tabLayout(const QStyleOptionTabV3 *opt, const QWidget *widget, QRect *textRect, QRect *pixmapRect) const;
108 #endif
109 };
110 
112 
113 #endif //QCOMMONSTYLE_P_H
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:86
bool isViewItemCached(const QStyleOptionViewItemV4 &option) const
QFont font
the font used for the item
Definition: qstyleoption.h:552
Qt::Alignment decorationAlignment
the alignment of the decoration for the item
Definition: qstyleoption.h:548
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QPointer< QWidget > widget
QIcon icon
The icon (if any) to be drawn in the view item.
Definition: qstyleoption.h:617
QStyle::State state
the style flags that are used when drawing the control
Definition: qstyleoption.h:88
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
The QStyleOptionViewItemV4 class is used to describe the parameters necessary for drawing a frame in ...
Definition: qstyleoption.h:609
Position decorationPosition
the position of the decoration for the item
Definition: qstyleoption.h:550
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
void tabLayout(const QStyleOptionTabV3 *opt, const QWidget *widget, QRect *textRect, QRect *pixmapRect) const
ViewItemFeatures features
a bitwise OR of the features that describe this view item
Definition: qstyleoption.h:577
void viewItemDrawText(QPainter *p, const QStyleOptionViewItemV4 *option, const QRect &rect) const
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
Definition: qicon.cpp:769
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
void viewItemLayout(const QStyleOptionViewItemV4 *opt, QRect *checkRect, QRect *pixmapRect, QRect *textRect, bool sizehint) const
Set sizehint to false to layout the elements inside opt->rect.
ViewItemPosition viewItemPosition
Gives the position of this view item relative to other items.
Definition: qstyleoption.h:619
#define Q_DECLARE_PUBLIC(Class)
Definition: qglobal.h:2477
const QWidget * widget
Definition: qstyleoption.h:596
QSize viewItemSize(const QStyleOptionViewItemV4 *option, int role) const
QModelIndex index
The model index that is to be drawn.
Definition: qstyleoption.h:615
Qt::Alignment displayAlignment
the alignment of the display value for the item
Definition: qstyleoption.h:547
The QCommonStyle class encapsulates the common Look and Feel of a GUI.
Definition: qcommonstyle.h:54
QSize decorationSize
the size of the decoration for the item
Definition: qstyleoption.h:551
The QStyleOptionTabV3 class is used to describe the parameters necessary for drawing a tabs in Qt 4...
Definition: qstyleoption.h:347
Qt::LayoutDirection direction
the text layout direction that should be used when drawing text in the control
Definition: qstyleoption.h:89
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
QStyleOptionViewItemV4 * cachedOption
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
QRect rect
the area that should be used for various calculations and painting
Definition: qstyleoption.h:90
QString text
The text (if any) to be drawn in the view item.
Definition: qstyleoption.h:618
The QIcon class provides scalable icons in different modes and states.
Definition: qicon.h:60