Changeset View
Changeset View
Standalone View
Standalone View
plugins/qt/designer/KisGradientSliderPlugin.cpp
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright (c) 2018 Victor Wåhlström <victor.wahlstrom@initiali.se> | ||||
3 | * | ||||
4 | * This program is free software; you can redistribute it and/or modify | ||||
5 | * it under the terms of the GNU General Public License as published by | ||||
6 | * the Free Software Foundation; either version 2 of the License, or | ||||
7 | * (at your option) any later version. | ||||
8 | * | ||||
9 | * This program is distributed in the hope that it will be useful, | ||||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
12 | * GNU General Public License for more details. | ||||
13 | * | ||||
14 | * You should have received a copy of the GNU General Public License | ||||
15 | * along with this program; if not, write to the Free Software | ||||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
17 | */ | ||||
18 | | ||||
19 | #include "KisGradientSliderPlugin.h" | ||||
20 | #include <KisGradientSlider.h> | ||||
21 | | ||||
22 | | ||||
23 | KisGradientSliderPlugin::KisGradientSliderPlugin(QObject *parent) | ||||
24 | : QObject(parent), | ||||
25 | m_initialized(false) | ||||
26 | { | ||||
27 | } | ||||
28 | | ||||
29 | void KisGradientSliderPlugin::initialize(QDesignerFormEditorInterface*) | ||||
30 | { | ||||
31 | if (m_initialized) | ||||
32 | return; | ||||
33 | | ||||
34 | m_initialized = true; | ||||
35 | } | ||||
36 | | ||||
37 | bool KisGradientSliderPlugin::isInitialized() const | ||||
38 | { | ||||
39 | return m_initialized; | ||||
40 | } | ||||
41 | | ||||
42 | QWidget* KisGradientSliderPlugin::createWidget(QWidget *parent) | ||||
43 | { | ||||
44 | return new KisGradientSlider(parent); | ||||
45 | } | ||||
46 | | ||||
47 | QString KisGradientSliderPlugin::name() const | ||||
48 | { | ||||
49 | return "KisGradientSlider"; | ||||
50 | } | ||||
51 | | ||||
52 | QString KisGradientSliderPlugin::group() const | ||||
53 | { | ||||
54 | return "Krita"; | ||||
55 | } | ||||
56 | | ||||
57 | QIcon KisGradientSliderPlugin::icon() const | ||||
58 | { | ||||
59 | return QIcon(); | ||||
60 | } | ||||
61 | | ||||
62 | QString KisGradientSliderPlugin::toolTip() const | ||||
63 | { | ||||
64 | return tr("A gradient slider."); | ||||
65 | } | ||||
66 | | ||||
67 | QString KisGradientSliderPlugin::whatsThis() const | ||||
68 | { | ||||
69 | return tr("A gradient slider."); | ||||
70 | } | ||||
71 | | ||||
72 | bool KisGradientSliderPlugin::isContainer() const | ||||
73 | { | ||||
74 | return false; | ||||
75 | } | ||||
76 | | ||||
77 | QString KisGradientSliderPlugin::domXml() const | ||||
78 | { | ||||
79 | return "<ui language=\"c++\">\n" | ||||
80 | " <widget class=\"KisGradientSlider\" name=\"gradientSlider\">\n" | ||||
81 | " <property name=\"geometry\">\n" | ||||
82 | " <rect>\n" | ||||
83 | " <x>0</x>\n" | ||||
84 | " <y>0</y>\n" | ||||
85 | " <width>100</width>\n" | ||||
86 | " <height>25</height>\n" | ||||
87 | " </rect>\n" | ||||
88 | " </property>\n" | ||||
89 | " <property name=\"toolTip\" >\n" | ||||
90 | " <string></string>\n" | ||||
91 | " </property>\n" | ||||
92 | " <property name=\"whatsThis\" >\n" | ||||
93 | " <string></string>\n" | ||||
94 | " </property>\n" | ||||
95 | " </widget>\n" | ||||
96 | "</ui>\n"; | ||||
97 | } | ||||
98 | | ||||
99 | QString KisGradientSliderPlugin::includeFile() const | ||||
100 | { | ||||
101 | return "<KisGradientSlider.h>"; | ||||
102 | } |