Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qcustompixmapstyle.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#include <QtGui>
5#include <QPixmapStyle>
6
7
8using namespace Qt::StringLiterals;
9
17
18//! [0]
19QCustomPixmapStyle::QCustomPixmapStyle() :
20 QPixmapStyle()
21{
22 //! [1]
23 addDescriptor(PB_Enabled,
24 "://button/core_button_inactive.png"_L1,
25 QMargins(13, 13, 13, 13),
26 QTileRules(Qt::RepeatTile, Qt::StretchTile));
27 //! [1]
28 addDescriptor(PB_Checked,
29 "://button/core_button_enabled_selected.png"_L1,
30 QMargins(13, 13, 13, 13),
31 QTileRules(Qt::RepeatTile, Qt::StretchTile));
32 addDescriptor(PB_Pressed,
33 "://button/core_button_pressed.png"_L1,
34 QMargins(13, 13, 13, 13),
35 QTileRules(Qt::RepeatTile, Qt::StretchTile));
36 addDescriptor(PB_Disabled,
37 "://button/core_button_disabled.png"_L1,
38 QMargins(13, 13, 13, 13),
39 QTileRules(Qt::RepeatTile, Qt::StretchTile));
40 addDescriptor(PB_PressedDisabled,
41 "://button/core_button_disabled_selected.png"_L1,
42 QMargins(13, 13, 13, 13),
43 QTileRules(Qt::RepeatTile, Qt::StretchTile));
44
45 //! [2]
46 addDescriptor(LE_Enabled,
47 "://lineedit/core_textinput_bg.png"_L1,
48 QMargins(8, 8, 8, 8));
49 addDescriptor(LE_Disabled,
50 "://lineedit/core_textinput_bg_disabled.png"_L1,
51 QMargins(8, 8, 8, 8));
52 addDescriptor(LE_Focused,
53 "://lineedit/core_textinput_bg_highlight.png"_L1,
54 QMargins(8, 8, 8, 8));
55
56 copyDescriptor(LE_Enabled, TE_Enabled);
57 copyDescriptor(LE_Disabled, TE_Disabled);
58 copyDescriptor(LE_Focused, TE_Focused);
59 //! [2]
60}
61//! [0]
62
~QCustomPixmapStyle() override
[0]