Changeset View
Changeset View
Standalone View
Standalone View
plugin/kquickstyleitem_p.h
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | |||||
45 | #include <QtGui/qimage.h> | 45 | #include <QtGui/qimage.h> | ||
46 | #include <QtQuick/qquickitem.h> | 46 | #include <QtQuick/qquickitem.h> | ||
47 | #include <QtQuick/qquickimageprovider.h> | 47 | #include <QtQuick/qquickimageprovider.h> | ||
48 | #include "kquickpadding_p.h" | 48 | #include "kquickpadding_p.h" | ||
49 | #include <QPointer> | 49 | #include <QPointer> | ||
50 | 50 | | |||
51 | class QWidget; | 51 | class QWidget; | ||
52 | class QStyleOption; | 52 | class QStyleOption; | ||
53 | class QStyle; | ||||
53 | 54 | | |||
54 | namespace Kirigami { | 55 | namespace Kirigami { | ||
55 | class PlatformTheme; | 56 | class PlatformTheme; | ||
56 | } | 57 | } | ||
57 | 58 | | |||
58 | class QQuickTableRowImageProvider1 : public QQuickImageProvider | 59 | class QQuickTableRowImageProvider1 : public QQuickImageProvider | ||
59 | { | 60 | { | ||
60 | public: | 61 | public: | ||
Show All 16 Lines | 68 | { | |||
77 | Q_PROPERTY( bool on READ on WRITE setOn NOTIFY onChanged) | 78 | Q_PROPERTY( bool on READ on WRITE setOn NOTIFY onChanged) | ||
78 | Q_PROPERTY( bool hover READ hover WRITE setHover NOTIFY hoverChanged) | 79 | Q_PROPERTY( bool hover READ hover WRITE setHover NOTIFY hoverChanged) | ||
79 | Q_PROPERTY( bool horizontal READ horizontal WRITE setHorizontal NOTIFY horizontalChanged) | 80 | Q_PROPERTY( bool horizontal READ horizontal WRITE setHorizontal NOTIFY horizontalChanged) | ||
80 | Q_PROPERTY( bool isTransient READ isTransient WRITE setTransient NOTIFY transientChanged) | 81 | Q_PROPERTY( bool isTransient READ isTransient WRITE setTransient NOTIFY transientChanged) | ||
81 | 82 | | |||
82 | Q_PROPERTY( QString elementType READ elementType WRITE setElementType NOTIFY elementTypeChanged) | 83 | Q_PROPERTY( QString elementType READ elementType WRITE setElementType NOTIFY elementTypeChanged) | ||
83 | Q_PROPERTY( QString text READ text WRITE setText NOTIFY textChanged) | 84 | Q_PROPERTY( QString text READ text WRITE setText NOTIFY textChanged) | ||
84 | Q_PROPERTY( QString activeControl READ activeControl WRITE setActiveControl NOTIFY activeControlChanged) | 85 | Q_PROPERTY( QString activeControl READ activeControl WRITE setActiveControl NOTIFY activeControlChanged) | ||
85 | Q_PROPERTY( QString style READ style NOTIFY styleChanged) | 86 | Q_PROPERTY( QString styleName READ styleName NOTIFY styleChanged) | ||
86 | Q_PROPERTY( QVariantMap hints READ hints WRITE setHints NOTIFY hintChanged RESET resetHints) | 87 | Q_PROPERTY( QVariantMap hints READ hints WRITE setHints NOTIFY hintChanged RESET resetHints) | ||
87 | Q_PROPERTY( QVariantMap properties READ properties WRITE setProperties NOTIFY propertiesChanged) | 88 | Q_PROPERTY( QVariantMap properties READ properties WRITE setProperties NOTIFY propertiesChanged) | ||
88 | Q_PROPERTY( QFont font READ font NOTIFY fontChanged) | 89 | Q_PROPERTY( QFont font READ font NOTIFY fontChanged) | ||
89 | 90 | | |||
90 | // For range controls | 91 | // For range controls | ||
91 | Q_PROPERTY( int minimum READ minimum WRITE setMinimum NOTIFY minimumChanged) | 92 | Q_PROPERTY( int minimum READ minimum WRITE setMinimum NOTIFY minimumChanged) | ||
92 | Q_PROPERTY( int maximum READ maximum WRITE setMaximum NOTIFY maximumChanged) | 93 | Q_PROPERTY( int maximum READ maximum WRITE setMaximum NOTIFY maximumChanged) | ||
93 | Q_PROPERTY( int value READ value WRITE setValue NOTIFY valueChanged) | 94 | Q_PROPERTY( int value READ value WRITE setValue NOTIFY valueChanged) | ||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | 108 | public: | |||
170 | int paintMargins() const { return m_paintMargins; } | 171 | int paintMargins() const { return m_paintMargins; } | ||
171 | 172 | | |||
172 | QString elementType() const { return m_type; } | 173 | QString elementType() const { return m_type; } | ||
173 | QString text() const { return m_text; } | 174 | QString text() const { return m_text; } | ||
174 | QString activeControl() const { return m_activeControl; } | 175 | QString activeControl() const { return m_activeControl; } | ||
175 | QVariantMap hints() const { return m_hints; } | 176 | QVariantMap hints() const { return m_hints; } | ||
176 | QVariantMap properties() const { return m_properties; } | 177 | QVariantMap properties() const { return m_properties; } | ||
177 | QFont font() const { return m_font;} | 178 | QFont font() const { return m_font;} | ||
178 | QString style() const; | 179 | QString styleName() const; | ||
179 | 180 | | |||
180 | void setSunken(bool sunken) { if (m_sunken != sunken) {m_sunken = sunken; emit sunkenChanged();}} | 181 | void setSunken(bool sunken) { if (m_sunken != sunken) {m_sunken = sunken; emit sunkenChanged();}} | ||
181 | void setRaised(bool raised) { if (m_raised!= raised) {m_raised = raised; emit raisedChanged();}} | 182 | void setRaised(bool raised) { if (m_raised!= raised) {m_raised = raised; emit raisedChanged();}} | ||
182 | void setActive(bool active) { if (m_active!= active) {m_active = active; emit activeChanged();}} | 183 | void setActive(bool active) { if (m_active!= active) {m_active = active; emit activeChanged();}} | ||
183 | void setSelected(bool selected) { if (m_selected!= selected) {m_selected = selected; emit selectedChanged();}} | 184 | void setSelected(bool selected) { if (m_selected!= selected) {m_selected = selected; emit selectedChanged();}} | ||
184 | void sethasFocus(bool focus) { if (m_focus != focus) {m_focus = focus; emit hasFocusChanged();}} | 185 | void sethasFocus(bool focus) { if (m_focus != focus) {m_focus = focus; emit hasFocusChanged();}} | ||
185 | void setOn(bool on) { if (m_on != on) {m_on = on ; emit onChanged();}} | 186 | void setOn(bool on) { if (m_on != on) {m_on = on ; emit onChanged();}} | ||
186 | void setHover(bool hover) { if (m_hover != hover) {m_hover = hover ; emit hoverChanged();}} | 187 | void setHover(bool hover) { if (m_hover != hover) {m_hover = hover ; emit hoverChanged();}} | ||
Show All 27 Lines | |||||
214 | void setTextureWidth(int w); | 215 | void setTextureWidth(int w); | ||
215 | 216 | | |||
216 | int textureHeight() const { return m_textureHeight; } | 217 | int textureHeight() const { return m_textureHeight; } | ||
217 | void setTextureHeight(int h); | 218 | void setTextureHeight(int h); | ||
218 | 219 | | |||
219 | QQuickItem *control() const; | 220 | QQuickItem *control() const; | ||
220 | void setControl(QQuickItem *control); | 221 | void setControl(QQuickItem *control); | ||
221 | 222 | | |||
223 | static QStyle *style(); | ||||
224 | | ||||
222 | public Q_SLOTS: | 225 | public Q_SLOTS: | ||
223 | int pixelMetric(const QString&); | 226 | int pixelMetric(const QString&); | ||
224 | QVariant styleHint(const QString&); | 227 | QVariant styleHint(const QString&); | ||
225 | void updateSizeHint(); | 228 | void updateSizeHint(); | ||
226 | void updateRect(); | 229 | void updateRect(); | ||
227 | void updateBaselineOffset(); | 230 | void updateBaselineOffset(); | ||
228 | void updateItem(){polish();} | 231 | void updateItem(){polish();} | ||
229 | QString hitTest(int x, int y); | 232 | QString hitTest(int x, int y); | ||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Line(s) | 279 | protected: | |||
309 | 312 | | |||
310 | int m_textureWidth; | 313 | int m_textureWidth; | ||
311 | int m_textureHeight; | 314 | int m_textureHeight; | ||
312 | 315 | | |||
313 | Qt::FocusReason m_lastFocusReason; | 316 | Qt::FocusReason m_lastFocusReason; | ||
314 | 317 | | |||
315 | QImage m_image; | 318 | QImage m_image; | ||
316 | KQuickPadding m_border; | 319 | KQuickPadding m_border; | ||
320 | | ||||
321 | static QStyle *s_style; | ||||
317 | }; | 322 | }; | ||
318 | 323 | | |||
319 | 324 | | |||
320 | #endif // QQUICKSTYLEITEM_P_H | 325 | #endif // QQUICKSTYLEITEM_P_H |