Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qquickcommonstyle_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QCOMMONSTYLE_P_H
5#define QCOMMONSTYLE_P_H
6
7#include "qquickcommonstyle.h"
8#include "qquickstyle_p.h"
9#include "qquickstyleoption.h"
10
12
13//
14// W A R N I N G
15// -------------
16//
17// This file is not part of the Qt API. It exists for the convenience
18// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
19// file may change from version to version without notice, or even be removed.
20//
21// We mean it.
22//
23
24class QTextOption;
25
26namespace QQC2 {
27
29{
30 Q_DECLARE_PUBLIC(QCommonStyle)
31public:
32
34 {
35 delete cachedOption;
36 }
37
38 QString calculateElidedText(const QString &text, const QTextOption &textOption,
39 const QFont &font, const QRect &textRect, const Qt::Alignment valign,
40 Qt::TextElideMode textElideMode, int flags,
41 bool lastVisibleLineShouldBeElided, QPointF *paintStartPosition) const;
42 void viewItemDrawText(QPainter *p, const QStyleOptionViewItem *option, const QRect &rect) const;
44 QRect *pixmapRect, QRect *textRect, bool sizehint) const;
45 QSize viewItemSize(const QStyleOptionViewItem *option, int role) const;
46
50 return cachedOption
52 && option.state == cachedOption->state
53 && option.rect == cachedOption->rect
54 && option.text == cachedOption->text
55 && option.direction == cachedOption->direction
56 && option.displayAlignment == cachedOption->displayAlignment
57 && option.decorationAlignment == cachedOption->decorationAlignment
58 && option.decorationPosition == cachedOption->decorationPosition
59 && option.decorationSize == cachedOption->decorationSize
60 && option.features == cachedOption->features
61 && option.icon.isNull() == cachedOption->icon.isNull()
62 && option.font == cachedOption->font
63 && option.viewItemPosition == cachedOption->viewItemPosition;
64 }
66 const QRect &textRect, int flags) const;
67
69 virtual void tabLayout(const QStyleOptionTab *opt, QRect *textRect, QRect *pixmapRect) const;
70};
71
72} // namespace QQC2
73
75
76#endif //QCOMMONSTYLE_P_H
\reentrant
Definition qfont.h:20
The QIcon class provides scalable icons in different modes and states.
Definition qicon.h:20
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
Definition qicon.cpp:973
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
\inmodule QtCore\reentrant
Definition qpoint.h:214
QString calculateElidedText(const QString &text, const QTextOption &textOption, const QFont &font, const QRect &textRect, const Qt::Alignment valign, Qt::TextElideMode textElideMode, int flags, bool lastVisibleLineShouldBeElided, QPointF *paintStartPosition) const
bool isViewItemCached(const QStyleOptionViewItem &option) const
QString toolButtonElideText(const QStyleOptionToolButton *toolbutton, const QRect &textRect, int flags) const
void viewItemLayout(const QStyleOptionViewItem *opt, QRect *checkRect, QRect *pixmapRect, QRect *textRect, bool sizehint) const
virtual void tabLayout(const QStyleOptionTab *opt, QRect *textRect, QRect *pixmapRect) const
QSize viewItemSize(const QStyleOptionViewItem *option, int role) const
QStyleOptionViewItem * cachedOption
void viewItemDrawText(QPainter *p, const QStyleOptionViewItem *option, const QRect &rect) const
Qt::LayoutDirection direction
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
\reentrant
Definition qtextoption.h:18
QString text
rect
[4]
QStyleOptionButton opt
QRect textRect
Combined button and popup list for selecting options.
TextElideMode
Definition qnamespace.h:187
GLbitfield flags
GLfloat GLfloat p
[1]
GLuint GLenum option