| 1 | // Copyright (C) 2016 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 QPIXMAPSTYLE_P_H |
| 5 | #define QPIXMAPSTYLE_P_H |
| 6 | |
| 7 | #include <QtWidgets/private/qtwidgetsglobal_p.h> |
| 8 | #include "qpixmapstyle_p.h" |
| 9 | #include "qcommonstyle_p.h" |
| 10 | |
| 11 | QT_BEGIN_NAMESPACE |
| 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 | |
| 24 | struct QPixmapStyleDescriptor |
| 25 | { |
| 26 | QString fileName; |
| 27 | QSize size; |
| 28 | QMargins margins; |
| 29 | QTileRules tileRules; |
| 30 | }; |
| 31 | |
| 32 | struct QPixmapStylePixmap |
| 33 | { |
| 34 | QPixmap pixmap; |
| 35 | QMargins margins; |
| 36 | }; |
| 37 | |
| 38 | class QPixmapStylePrivate : public QCommonStylePrivate |
| 39 | { |
| 40 | Q_DECLARE_PUBLIC(QPixmapStyle) |
| 41 | |
| 42 | public: |
| 43 | QHash<QPixmapStyle::ControlDescriptor, QPixmapStyleDescriptor> descriptors; |
| 44 | QHash<QPixmapStyle::ControlPixmap, QPixmapStylePixmap> pixmaps; |
| 45 | |
| 46 | static QPixmap scale(int w, int h, const QPixmap &pixmap, const QPixmapStyleDescriptor &desc); |
| 47 | |
| 48 | QPixmap getCachedPixmap(QPixmapStyle::ControlDescriptor control, |
| 49 | const QPixmapStyleDescriptor &desc, |
| 50 | const QSize &size) const; |
| 51 | |
| 52 | QSize computeSize(const QPixmapStyleDescriptor &desc, int width, int height) const; |
| 53 | }; |
| 54 | |
| 55 | QT_END_NAMESPACE |
| 56 | |
| 57 | #endif // QPIXMAPSTYLE_P_H |
| 58 | |