1
/***************************************************************************
2
* Copyright (c) 2006 Werner Mayer <werner.wm.mayer@gmx.de> *
4
* This file is part of the FreeCAD CAx development system. *
6
* This library is free software; you can redistribute it and/or *
7
* modify it under the terms of the GNU Library General Public *
8
* License as published by the Free Software Foundation; either *
9
* version 2 of the License, or (at your option) any later version. *
11
* This library is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU Library General Public License for more details. *
16
* You should have received a copy of the GNU Library General Public *
17
* License along with this library; see the file COPYING.LIB. If not, *
18
* write to the Free Software Foundation, Inc., 59 Temple Place, *
19
* Suite 330, Boston, MA 02111-1307, USA *
21
***************************************************************************/
24
#include <QtDesigner/QDesignerContainerExtension>
25
#include <QtDesigner/QDesignerFormEditorInterface>
26
#include <QtDesigner/QDesignerFormWindowInterface>
27
#include <QtDesigner/QDesignerPropertySheetExtension>
28
#include <QtDesigner/QExtensionFactory>
29
#include <QtDesigner/QExtensionManager>
35
#include "customwidgets.h"
40
static const char* urllabel_pixmap[] = {"22 22 3 1",
44
"......................",
45
".......##.............",
46
"......#xx#............",
47
"......#xx#............",
48
"......#xx#............",
49
"......#xx#............",
50
"......#xx###..........",
51
"......#xx#xx###.......",
52
"......#xx#xx#xx##.....",
53
"...##.#xx#xx#xx#x#....",
54
"..#xx##xx#xx#xx#x#....",
55
"..#xxx#xxxxxxxxxx#....",
56
"...#xxxxxxxxxxxxx#....",
57
"....#xxxxxxxxxxxx#....",
58
"....#xxxxxxxxxxxx#....",
59
".....#xxxxxxxxxx#.....",
60
".....#xxxxxxxxxx#.....",
61
"......#xxxxxxxx#......",
62
"......#xxxxxxxx#......",
63
"......##########......",
64
"......##########......",
65
"......##########......"};
67
class UrlLabelPlugin: public QDesignerCustomWidgetInterface
69
Q_INTERFACES(QDesignerCustomWidgetInterface)
73
QWidget* createWidget(QWidget* parent)
75
return new Gui::UrlLabel(parent);
79
return QLatin1String("Display Widgets");
83
return QIcon(QPixmap(urllabel_pixmap));
85
QString includeFile() const
87
return QLatin1String("Gui/Widgets.h");
89
QString toolTip() const
91
return QLatin1String("Url label");
93
QString whatsThis() const
95
return QLatin1String("A widget to display a url in a text label.");
97
bool isContainer() const
101
// QString codeTemplate() const;
102
QString domXml() const
104
return "<ui language=\"c++\">\n"
105
" <widget class=\"Gui::UrlLabel\" name=\"urlLabel\">\n"
111
return QLatin1String("Gui::UrlLabel");
115
class LocationWidgetPlugin: public QDesignerCustomWidgetInterface
117
Q_INTERFACES(QDesignerCustomWidgetInterface)
119
LocationWidgetPlugin()
121
QWidget* createWidget(QWidget* parent)
123
return new Gui::LocationWidget(parent);
125
QString group() const
127
return QLatin1String("Display Widgets");
131
return QIcon(QPixmap(urllabel_pixmap));
133
QString includeFile() const
135
return QLatin1String("Gui/InputVector.h");
137
QString toolTip() const
139
return QLatin1String("Location");
141
QString whatsThis() const
143
return QLatin1String("A widget to define a location.");
145
bool isContainer() const
149
QString domXml() const
151
return "<ui language=\"c++\">\n"
152
" <widget class=\"Gui::LocationWidget\" name=\"locationWidget\">\n"
158
return QLatin1String("Gui::LocationWidget");
162
static const char* filechooser_pixmap[] = {"22 22 8 1",
171
"++++++++++++++++++++++",
172
"++++++++++++++++++++++",
173
"++++++++++++++++++++++",
174
"++++++++++++++++++++++",
175
"+OOOOOOOOOOOOOOOOOOOO+",
176
"OOXXXXXXXXXXXXXXXXXXOO",
183
"OX oo oo oo oo O O",
184
"OX oo oo oo oo O O",
187
"OO..................OO",
188
"+OOOOOOOOOOOOOOOOOOOO+",
189
"++++++++++++++++++++++",
190
"++++++++++++++++++++++",
191
"++++++++++++++++++++++",
192
"++++++++++++++++++++++"};
194
class FileChooserPlugin: public QDesignerCustomWidgetInterface
196
Q_INTERFACES(QDesignerCustomWidgetInterface)
200
QWidget* createWidget(QWidget* parent)
202
return new Gui::FileChooser(parent);
204
QString group() const
206
return QLatin1String("Input Widgets");
210
return QIcon(QPixmap(filechooser_pixmap));
212
QString includeFile() const
214
return QLatin1String("Gui/FileDialog.h");
216
QString toolTip() const
218
return QLatin1String("File Chooser");
220
QString whatsThis() const
222
return QLatin1String("A widget to choose a file or directory.");
224
bool isContainer() const
228
// QString codeTemplate() const;
229
QString domXml() const
231
return "<ui language=\"c++\">\n"
232
" <widget class=\"Gui::FileChooser\" name=\"fileChooser\">\n"
238
return QLatin1String("Gui::FileChooser");
242
class PrefFileChooserPlugin: public QDesignerCustomWidgetInterface
244
Q_INTERFACES(QDesignerCustomWidgetInterface)
246
PrefFileChooserPlugin()
248
QWidget* createWidget(QWidget* parent)
250
return new Gui::PrefFileChooser(parent);
252
QString group() const
254
return QLatin1String("Preference Widgets");
258
return QIcon(QPixmap(filechooser_pixmap));
260
QString includeFile() const
262
return QLatin1String("Gui/PrefWidgets.h");
264
QString toolTip() const
266
return QLatin1String("File Chooser");
268
QString whatsThis() const
270
return QLatin1String("A widget to choose a file or directory.");
272
bool isContainer() const
276
QString domXml() const
278
return "<ui language=\"c++\">\n"
279
" <widget class=\"Gui::PrefFileChooser\" name=\"fileChooser\">\n"
285
return QLatin1String("Gui::PrefFileChooser");
290
static const char* lineedit_pixmap[] = {"22 22 6 1",
297
"......................",
298
"......................",
299
"......................",
300
"...#aaaaaaaaaaaaaa#...",
301
".baccccccccccccccccab.",
302
".acccddddddddddddddca.",
303
"#ccd................d#",
304
"acc.................da",
305
"acd.......d....ca.ac.a",
306
"acd......db......a...a",
307
"acd.dbbb.dbbbd...a...a",
308
"acd.ccdbddb.db...a...a",
309
"acd.dbbbddb..b...a...a",
310
"acd.bd.bddb..b...a...a",
311
"acd.bbbbddbbbc...a...a",
312
"acd..d.....dd..ca.acda",
313
"#cd.................d#",
314
".ac................da.",
315
".badd............dda#.",
316
"...#aaaaaaaaaaaaaa#...",
317
"......................",
318
"......................"};
320
class AccelLineEditPlugin: public QDesignerCustomWidgetInterface
322
Q_INTERFACES(QDesignerCustomWidgetInterface)
324
AccelLineEditPlugin()
326
QWidget* createWidget(QWidget* parent)
328
return new Gui::AccelLineEdit(parent);
330
QString group() const
332
return QLatin1String("Input Widgets");
336
return QIcon(QPixmap(lineedit_pixmap));
338
QString includeFile() const
340
return QLatin1String("Gui/Widgets.h");
342
QString toolTip() const
344
return QLatin1String("Accelerator Line Edit");
346
QString whatsThis() const
348
return QLatin1String("A widget to specify accelerator keys.");
350
bool isContainer() const
354
QString domXml() const
356
return "<ui language=\"c++\">\n"
357
" <widget class=\"Gui::AccelLineEdit\" name=\"accelEdit\">\n"
363
return QLatin1String("Gui::AccelLineEdit");
368
static const char* actionselector_pixmap[] = {"22 22 6 1",
375
"......................",
376
"......................",
377
"......................",
378
"...#aaaaaaaaaaaaaa#...",
379
".baccccccccccccccccab.",
380
".acccddddddddddddddca.",
381
"#ccd................d#",
382
"acc.................da",
383
"acd.......d....ca.ac.a",
384
"acd......db......a...a",
385
"acd.dbbb.dbbbd...a...a",
386
"acd.ccdbddb.db...a...a",
387
"acd.dbbbddb..b...a...a",
388
"acd.bd.bddb..b...a...a",
389
"acd.bbbbddbbbc...a...a",
390
"acd..d.....dd..ca.acda",
391
"#cd.................d#",
392
".ac................da.",
393
".badd............dda#.",
394
"...#aaaaaaaaaaaaaa#...",
395
"......................",
396
"......................"};
398
class ActionSelectorPlugin: public QDesignerCustomWidgetInterface
400
Q_INTERFACES(QDesignerCustomWidgetInterface)
402
ActionSelectorPlugin()
404
QWidget* createWidget(QWidget* parent)
406
return new Gui::ActionSelector(parent);
408
QString group() const
410
return QLatin1String("Input Widgets");
414
return QIcon(QPixmap(actionselector_pixmap));
416
QString includeFile() const
418
return QLatin1String("Gui/Widgets.h");
420
QString toolTip() const
422
return QLatin1String("Action Selector");
424
QString whatsThis() const
426
return QLatin1String("A widget to select actions.");
428
bool isContainer() const
432
QString domXml() const
434
return "<ui language=\"c++\">\n"
435
" <widget class=\"Gui::ActionSelector\" name=\"actionSelector\">\n"
441
return QLatin1String("Gui::ActionSelector");
446
static const char* inputfield_pixmap[] = {"22 22 6 1",
453
"......................",
454
"......................",
455
"......................",
456
"...#aaaaaaaaaaaaaa#...",
457
".baccccccccccccccccab.",
458
".acccddddddddddddddca.",
459
"#ccd................d#",
460
"acc.................da",
461
"acd.......d....ca.ac.a",
462
"acd......db......a...a",
463
"acd.dbbb.dbbbd...a...a",
464
"acd.ccdbddb.db...a...a",
465
"acd.dbbbddb..b...a...a",
466
"acd.bd.bddb..b...a...a",
467
"acd.bbbbddbbbc...a...a",
468
"acd..d.....dd..ca.acda",
469
"#cd.................d#",
470
".ac................da.",
471
".badd............dda#.",
472
"...#aaaaaaaaaaaaaa#...",
473
"......................",
474
"......................"};
476
class InputFieldPlugin: public QDesignerCustomWidgetInterface
478
Q_INTERFACES(QDesignerCustomWidgetInterface)
482
QWidget* createWidget(QWidget* parent)
484
return new Gui::InputField(parent);
486
QString group() const
488
return QLatin1String("Input Widgets");
492
return QIcon(QPixmap(inputfield_pixmap));
494
QString includeFile() const
496
return QLatin1String("Gui/InputField.h");
498
QString toolTip() const
500
return QLatin1String("Input Field");
502
QString whatsThis() const
504
return QLatin1String("A widget to work with quantities.");
506
bool isContainer() const
510
QString domXml() const
512
return "<ui language=\"c++\">\n"
513
" <widget class=\"Gui::InputField\" name=\"inputField\">\n"
514
" <property name=\"unit\" stdset=\"0\">\n"
515
" <string notr=\"true\"></string>\n"
522
return QLatin1String("Gui::InputField");
527
static const char* quantityspinbox_pixmap[] = {"22 22 6 1",
534
"...#aaaaaaaaaaaaaa#...",
535
".baccccccccccccccccab.",
536
".acccddddddddddddddca.",
537
"#ccd................d#",
538
"acc.............dcd.da",
539
"acd.............dbd..a",
540
"acd............dcbbd.a",
541
"acd.d..dd..d...dbbbc.a",
542
"acddb.dbbdcbb.dbbb#bda",
543
"acd.b.d.cc..b.bb###bda",
544
"acd.b...bd.cb.dddccdda",
545
"acd.b...b..db...dddd.a",
546
"acd.b..cd...bdddccbbda",
547
"acd.b.dbbccdb.ccbbbbda",
548
"acddd.ddd.dd..dbbb#cda",
549
"acd............bb##cda",
550
"acd............db#cd.a",
551
"acd.............bbcdda",
552
"#cd.............ddd.d#",
553
".ac................da.",
554
".badd............dda#.",
555
"...#aaaaaaaaaaaaaa#..."};
557
class QuantitySpinBoxPlugin: public QDesignerCustomWidgetInterface
559
Q_INTERFACES(QDesignerCustomWidgetInterface)
561
QuantitySpinBoxPlugin()
563
QWidget* createWidget(QWidget* parent)
565
return new Gui::QuantitySpinBox(parent);
567
QString group() const
569
return QLatin1String("Input Widgets");
573
return QIcon(QPixmap(quantityspinbox_pixmap));
575
QString includeFile() const
577
return QLatin1String("Gui/QuantitySpinBox.h");
579
QString toolTip() const
581
return QLatin1String("Quantity spin box");
583
QString whatsThis() const
585
return QLatin1String("A widget to work with quantities.");
587
bool isContainer() const
591
QString domXml() const
593
return "<ui language=\"c++\">\n"
594
" <widget class=\"Gui::QuantitySpinBox\" name=\"quantitySpinBox\">\n"
595
" <property name=\"unit\" stdset=\"0\">\n"
596
" <string notr=\"true\"></string>\n"
603
return QLatin1String("Gui::QuantitySpinBox");
607
class PrefUnitSpinBoxPlugin: public QDesignerCustomWidgetInterface
609
Q_INTERFACES(QDesignerCustomWidgetInterface)
611
PrefUnitSpinBoxPlugin()
613
QWidget* createWidget(QWidget* parent)
615
return new Gui::PrefUnitSpinBox(parent);
617
QString group() const
619
return QLatin1String("Preference Widgets");
623
return QIcon(QPixmap(quantityspinbox_pixmap));
625
QString includeFile() const
627
return QLatin1String("Gui/PrefWidgets.h");
629
QString toolTip() const
631
return QLatin1String("Quantity Spin Box");
633
QString whatsThis() const
635
return QLatin1String("Quantity Spin box widget.");
637
bool isContainer() const
641
QString domXml() const
643
return "<ui language=\"c++\">\n"
644
" <widget class=\"Gui::PrefUnitSpinBox\" name=\"unitSpinBox\">\n"
650
return QLatin1String("Gui::PrefUnitSpinBox");
654
class PrefQuantitySpinBoxPlugin: public QDesignerCustomWidgetInterface
656
Q_INTERFACES(QDesignerCustomWidgetInterface)
658
PrefQuantitySpinBoxPlugin()
660
QWidget* createWidget(QWidget* parent)
662
return new Gui::PrefQuantitySpinBox(parent);
664
QString group() const
666
return QLatin1String("Preference Widgets");
670
return QIcon(QPixmap(quantityspinbox_pixmap));
672
QString includeFile() const
674
return QLatin1String("Gui/PrefWidgets.h");
676
QString toolTip() const
678
return QLatin1String("Preference Quantity Spin Box");
680
QString whatsThis() const
682
return QLatin1String("Preference Quantity Spin Box Widget.");
684
bool isContainer() const
688
QString domXml() const
690
return "<ui language=\"c++\">\n"
691
" <widget class=\"Gui::PrefQuantitySpinBox\" name=\"unitSpinBox\">\n"
697
return QLatin1String("Gui::PrefQuantitySpinBox");
702
static const char* iconview_pixmap[] = {"22 22 10 1",
713
"...################...",
714
".a#bbccccccccccccbb#a.",
715
".#bcc..............b#.",
716
"#bb......c.....c....c#",
717
"#bbbbc..cbbc...bbbc.c#",
718
"#cccdd....bdb..ccdd..#",
719
"#cbcb#c.cbcbd..bcb#c.#",
720
"#cbbb#b..bbb#..cbb#c.#",
721
"#c..c##...cb#c...c##.#",
722
"#c...................#",
723
"#ccbbc..c#bbc..cbbcc.#",
724
"#c...................#",
725
"#cbbbaa.cb..cc..c.bb.#",
726
"#cbccca.c#ccb..cecf#.#",
727
"#cbcgba..c#b...bfbfh.#",
728
"#cacbba..bb#c..bbhb#.#",
729
"#caaaaa.bc.bb..bb###.#",
730
"#b..................c#",
731
"#b.bbcc..cbbbb.cbbc.c#",
732
".#b................c#.",
733
".a#cc............cc##.",
734
"...################..."};
736
class CommandIconViewPlugin: public QDesignerCustomWidgetInterface
738
Q_INTERFACES(QDesignerCustomWidgetInterface)
740
CommandIconViewPlugin()
742
QWidget* createWidget(QWidget* parent)
744
return new Gui::CommandIconView(parent);
746
QString group() const
748
return QLatin1String("View Widgets");
752
return QIcon(QPixmap(iconview_pixmap));
754
QString includeFile() const
756
return QLatin1String("Gui/Widgets.h");
758
QString toolTip() const
760
return QLatin1String("Command View");
762
QString whatsThis() const
764
return QLatin1String("Area with movable and labeled icons.");
766
bool isContainer() const
770
QString domXml() const
772
return "<ui language=\"c++\">\n"
773
" <widget class=\"Gui::CommandIconView\" name=\"iconView\">\n"
779
return QLatin1String("Gui::CommandIconView");
784
static const char* spinbox_pixmap[] = {"22 22 6 1",
791
"...#aaaaaaaaaaaaaa#...",
792
".baccccccccccccccccab.",
793
".acccddddddddddddddca.",
794
"#ccd................d#",
795
"acc.............dcd.da",
796
"acd.............dbd..a",
797
"acd............dcbbd.a",
798
"acd.d..dd..d...dbbbc.a",
799
"acddb.dbbdcbb.dbbb#bda",
800
"acd.b.d.cc..b.bb###bda",
801
"acd.b...bd.cb.dddccdda",
802
"acd.b...b..db...dddd.a",
803
"acd.b..cd...bdddccbbda",
804
"acd.b.dbbccdb.ccbbbbda",
805
"acddd.ddd.dd..dbbb#cda",
806
"acd............bb##cda",
807
"acd............db#cd.a",
808
"acd.............bbcdda",
809
"#cd.............ddd.d#",
810
".ac................da.",
811
".badd............dda#.",
812
"...#aaaaaaaaaaaaaa#..."};
814
class UIntSpinBoxPlugin: public QDesignerCustomWidgetInterface
816
Q_INTERFACES(QDesignerCustomWidgetInterface)
820
QWidget* createWidget(QWidget* parent)
822
return new Gui::UIntSpinBox(parent);
824
QString group() const
826
return QLatin1String("Input Widgets");
830
return QIcon(QPixmap(spinbox_pixmap));
832
QString includeFile() const
834
return QLatin1String("Gui/SpinBox.h");
836
QString toolTip() const
838
return QLatin1String("Unsigned Spin Box");
840
QString whatsThis() const
842
return QLatin1String("Spin box widget (spin button).");
844
bool isContainer() const
848
QString domXml() const
850
return "<ui language=\"c++\">\n"
851
" <widget class=\"Gui::UIntSpinBox\" name=\"uintSpinBox\">\n"
857
return QLatin1String("Gui::UIntSpinBox");
861
class IntSpinBoxPlugin: public QDesignerCustomWidgetInterface
863
Q_INTERFACES(QDesignerCustomWidgetInterface)
867
QWidget* createWidget(QWidget* parent)
869
return new Gui::IntSpinBox(parent);
871
QString group() const
873
return QLatin1String("Input Widgets");
877
return QIcon(QPixmap(spinbox_pixmap));
879
QString includeFile() const
881
return QLatin1String("Gui/SpinBox.h");
883
QString toolTip() const
885
return QLatin1String("Spin Box");
887
QString whatsThis() const
889
return QLatin1String("Spin box widget (spin button).");
891
bool isContainer() const
895
QString domXml() const
897
return "<ui language=\"c++\">\n"
898
" <widget class=\"Gui::IntSpinBox\" name=\"intSpinBox\">\n"
904
return QLatin1String("Gui::IntSpinBox");
908
class DoubleSpinBoxPlugin: public QDesignerCustomWidgetInterface
910
Q_INTERFACES(QDesignerCustomWidgetInterface)
912
DoubleSpinBoxPlugin()
914
QWidget* createWidget(QWidget* parent)
916
return new Gui::DoubleSpinBox(parent);
918
QString group() const
920
return QLatin1String("Input Widgets");
924
return QIcon(QPixmap(spinbox_pixmap));
926
QString includeFile() const
928
return QLatin1String("Gui/SpinBox.h");
930
QString toolTip() const
932
return QLatin1String("Double Spin Box");
934
QString whatsThis() const
936
return QLatin1String("Spin box widget (spin button).");
938
bool isContainer() const
942
QString domXml() const
944
return "<ui language=\"c++\">\n"
945
" <widget class=\"Gui::DoubleSpinBox\" name=\"doubleSpinBox\">\n"
951
return QLatin1String("Gui::DoubleSpinBox");
955
class PrefSpinBoxPlugin: public QDesignerCustomWidgetInterface
957
Q_INTERFACES(QDesignerCustomWidgetInterface)
961
QWidget* createWidget(QWidget* parent)
963
return new Gui::PrefSpinBox(parent);
965
QString group() const
967
return QLatin1String("Preference Widgets");
971
return QIcon(QPixmap(spinbox_pixmap));
973
QString includeFile() const
975
return QLatin1String("Gui/PrefWidgets.h");
977
QString toolTip() const
979
return QLatin1String("Spin Box");
981
QString whatsThis() const
983
return QLatin1String("Spin box widget (spin button).");
985
bool isContainer() const
989
QString domXml() const
991
return "<ui language=\"c++\">\n"
992
" <widget class=\"Gui::PrefSpinBox\" name=\"spinBox\">\n"
998
return QLatin1String("Gui::PrefSpinBox");
1003
static const char* colorbutton_pixmap[] = {"21 21 7 1",
1011
".....................",
1012
".#abbbbbbbbbbbbbba#c.",
1013
"c#c..............c##.",
1014
"#c................ca.",
1015
"#..................b.",
1016
"#...ddddddddddd....b.",
1017
"#...deeeeeeeeed....b.",
1018
"#...deeeeeeeeed....b.",
1019
"#...deeeeeeeeed....b.",
1020
"#...deeeeeeeeed....b.",
1021
"#...deeeeeeeeed....b.",
1022
"#...deeeeeeeeed....b.",
1023
"#...deeeeeeeeed....b.",
1024
"#...deeeeeeeeed....b.",
1025
"#...deeeeeeeeed....b.",
1026
"#...ddddddddddd....b.",
1027
"#..................b.",
1028
"#.................cb.",
1029
"#cccccccccccccccccca.",
1030
"c#cccccccccccccccc##.",
1031
".cccccccccccccccccc.."};
1033
class ColorButtonPlugin: public QDesignerCustomWidgetInterface
1035
Q_INTERFACES(QDesignerCustomWidgetInterface)
1039
QWidget* createWidget(QWidget* parent)
1041
return new Gui::ColorButton(parent);
1043
QString group() const
1045
return QLatin1String("Buttons");
1049
return QIcon(QPixmap(colorbutton_pixmap));
1051
QString includeFile() const
1053
return QLatin1String("Gui/Widgets.h");
1055
QString toolTip() const
1057
return QLatin1String("Color Button");
1059
QString whatsThis() const
1061
return QLatin1String("A button to choose a color.");
1063
bool isContainer() const
1067
QString domXml() const
1069
return "<ui language=\"c++\">\n"
1070
" <widget class=\"Gui::ColorButton\" name=\"colorButton\">\n"
1074
QString name() const
1076
return QLatin1String("Gui::ColorButton");
1080
class PrefColorButtonPlugin: public QDesignerCustomWidgetInterface
1082
Q_INTERFACES(QDesignerCustomWidgetInterface)
1084
PrefColorButtonPlugin()
1086
QWidget* createWidget(QWidget* parent)
1088
return new Gui::PrefColorButton(parent);
1090
QString group() const
1092
return QLatin1String("Preference Widgets");
1096
return QIcon(QPixmap(colorbutton_pixmap));
1098
QString includeFile() const
1100
return QLatin1String("Gui/PrefWidgets.h");
1102
QString toolTip() const
1104
return QLatin1String("Color Button");
1106
QString whatsThis() const
1108
return QLatin1String("A button to choose a color.");
1110
bool isContainer() const
1114
QString domXml() const
1116
return "<ui language=\"c++\">\n"
1117
" <widget class=\"Gui::PrefColorButton\" name=\"colorButton\">\n"
1121
QString name() const
1123
return QLatin1String("Gui::PrefColorButton");
1128
static const char* slider_pixmap[] = {"22 22 5 1",
1134
"......................",
1135
"......................",
1136
"......................",
1137
"......................",
1138
"......................",
1139
".........#............",
1140
"........a##...........",
1141
"........a##...........",
1142
"........a##...........",
1143
"..bbbb..a#bbbbbbbbbb..",
1144
".bbbbb..a#bbbbbbbbbbc.",
1145
".bb###..a#b########c#.",
1146
".bbb##..a#b########aa.",
1147
"..cc##..a#b########a..",
1148
"........a##...........",
1149
"........a##...........",
1150
"........a##...........",
1151
"......#####...........",
1152
".......####...........",
1153
"......................",
1154
"......................",
1155
"......................"};
1157
class PrefSliderPlugin: public QDesignerCustomWidgetInterface
1159
Q_INTERFACES(QDesignerCustomWidgetInterface)
1163
QWidget* createWidget(QWidget* parent)
1165
return new Gui::PrefSlider(parent);
1167
QString group() const
1169
return QLatin1String("Preference Widgets");
1173
return QIcon(QPixmap(slider_pixmap));
1175
QString includeFile() const
1177
return QLatin1String("Gui/PrefWidgets.h");
1179
QString toolTip() const
1181
return QLatin1String("Slider");
1183
QString whatsThis() const
1185
return QLatin1String("Vertical or horizontal slider.");
1187
bool isContainer() const
1191
QString domXml() const
1193
return "<ui language=\"c++\">\n"
1194
" <widget class=\"Gui::PrefSlider\" name=\"slider\">\n"
1198
QString name() const
1200
return QLatin1String("Gui::PrefSlider");
1205
static const char* radiobutton_pixmap[] = {"22 22 4 1",
1210
"......................",
1211
"......................",
1212
"......................",
1213
"......................",
1214
".......########.......",
1215
"......#####aaa##......",
1216
".....#b##a...aaa#.....",
1217
"....###aa.aa....a#....",
1218
"....###a.####a...a....",
1219
"....##a.####bba..a....",
1220
"....##.a###bbb#.......",
1221
"....#a.a##bbbb#.......",
1222
"....#a..bbbbbba.......",
1223
"....#aa.abbbb#...a....",
1224
"....##a..a##a....a....",
1225
".....#a.........a.....",
1226
"......#a.......a......",
1227
".......#aa...aa.......",
1228
"......................",
1229
"......................",
1230
"......................",
1231
"......................"};
1233
class PrefRadioButtonPlugin: public QDesignerCustomWidgetInterface
1235
Q_INTERFACES(QDesignerCustomWidgetInterface)
1237
PrefRadioButtonPlugin()
1239
QWidget* createWidget(QWidget* parent)
1241
return new Gui::PrefRadioButton(parent);
1243
QString group() const
1245
return QLatin1String("Preference Widgets");
1249
return QIcon(QPixmap(radiobutton_pixmap));
1251
QString includeFile() const
1253
return QLatin1String("Gui/PrefWidgets.h");
1255
QString toolTip() const
1257
return QLatin1String("Radio Button");
1259
QString whatsThis() const
1261
return QLatin1String("Radio button with a text or pixmap label.");
1263
bool isContainer() const
1267
QString domXml() const
1269
return "<ui language=\"c++\">\n"
1270
" <widget class=\"Gui::PrefRadioButton\" name=\"radioButton\">\n"
1274
QString name() const
1276
return QLatin1String("Gui::PrefRadioButton");
1281
static const char* checkbox_pixmap[] = {"22 22 4 1",
1286
"......................",
1287
"......................",
1288
"......................",
1289
"......................",
1290
"....###########aaa....",
1291
"....##aaaaaaaaaabb....",
1292
"....#aabbbbbbbbbbb....",
1293
"....#abbbbbbbbaa......",
1294
"....#abbbbbbba#a......",
1295
"....#ababbbba##a......",
1296
"....#ab#abba###a......",
1297
"....#ab##aa###ab......",
1298
"....#ab######abb......",
1299
"....#abb####abbb......",
1300
"....#abbb##abbbb......",
1301
"....aabbbbabbbb.......",
1302
"....abb......b........",
1303
"....abb...............",
1304
"......................",
1305
"......................",
1306
"......................",
1307
"......................"};
1309
class PrefCheckBoxPlugin: public QDesignerCustomWidgetInterface
1311
Q_INTERFACES(QDesignerCustomWidgetInterface)
1313
PrefCheckBoxPlugin()
1315
QWidget* createWidget(QWidget* parent)
1317
return new Gui::PrefCheckBox(parent);
1319
QString group() const
1321
return QLatin1String("Preference Widgets");
1325
return QIcon(QPixmap(checkbox_pixmap));
1327
QString includeFile() const
1329
return QLatin1String("Gui/PrefWidgets.h");
1331
QString toolTip() const
1333
return QLatin1String("Check Box");
1335
QString whatsThis() const
1337
return QLatin1String("Checkbox with a text label.");
1339
bool isContainer() const
1343
QString domXml() const
1345
return "<ui language=\"c++\">\n"
1346
" <widget class=\"Gui::PrefCheckBox\" name=\"checkBox\">\n"
1350
QString name() const
1352
return QLatin1String("Gui::PrefCheckBox");
1357
static const char* combobox_pixmap[] = {"22 22 8 1",
1366
".#aaaaaaaaaaaaaaaaaa#.",
1367
"#bbccccccccccccccccdd#",
1368
"accee#########e.addfaa",
1369
"#c..............a.fa.#",
1370
"e#aaaaaaaaaaaaaaaaaa#e",
1371
"....#c...............#",
1372
"....ac...............a",
1373
"....ac.ccbbbbbbbbeb..a",
1374
"....ac.bbbeeeeeee##c.a",
1375
"....ac.bee########ac.a",
1376
"....ac..cccccccccccc.a",
1377
"....ac.ccccccccccbec.a",
1378
"....ac.cccccccccbbec.a",
1379
"....ac.bcbbbbbbbbbec.a",
1380
"....ac..cccccccccccc.a",
1381
"....ac.cbbeeeeeee#bc.a",
1382
"....ac.bee########ac.a",
1383
"....ab.b##aaaaaaaaacca",
1384
"....#bc.ccccccccccccc#",
1385
".....ab............ca.",
1386
".....eacc.........ca#.",
1387
".......#aaaaaaaaaa#..."};
1389
class PrefComboBoxPlugin: public QDesignerCustomWidgetInterface
1391
Q_INTERFACES(QDesignerCustomWidgetInterface)
1393
PrefComboBoxPlugin()
1395
QWidget* createWidget(QWidget* parent)
1397
return new Gui::PrefComboBox(parent);
1399
QString group() const
1401
return QLatin1String("Preference Widgets");
1405
return QIcon(QPixmap(combobox_pixmap));
1407
QString includeFile() const
1409
return QLatin1String("Gui/PrefWidgets.h");
1411
QString toolTip() const
1413
return QLatin1String("Combo Box");
1415
QString whatsThis() const
1417
return QLatin1String("Combined button and popup list.");
1419
bool isContainer() const
1423
QString domXml() const
1425
return "<ui language=\"c++\">\n"
1426
" <widget class=\"Gui::PrefComboBox\" name=\"comboBox\">\n"
1430
QString name() const
1432
return QLatin1String("Gui::PrefComboBox");
1436
class PrefLineEditPlugin: public QDesignerCustomWidgetInterface
1438
Q_INTERFACES(QDesignerCustomWidgetInterface)
1440
PrefLineEditPlugin()
1442
QWidget* createWidget(QWidget* parent)
1444
return new Gui::PrefLineEdit(parent);
1446
QString group() const
1448
return QLatin1String("Preference Widgets");
1452
return QIcon(QPixmap(lineedit_pixmap));
1454
QString includeFile() const
1456
return QLatin1String("Gui/PrefWidgets.h");
1458
QString toolTip() const
1460
return QLatin1String("Line Edit");
1462
QString whatsThis() const
1464
return QLatin1String("One-line text editor.");
1466
bool isContainer() const
1470
QString domXml() const
1472
return "<ui language=\"c++\">\n"
1473
" <widget class=\"Gui::PrefLineEdit\" name=\"lineEdit\">\n"
1477
QString name() const
1479
return QLatin1String("Gui::PrefLineEdit");
1483
class PrefDoubleSpinBoxPlugin: public QDesignerCustomWidgetInterface
1485
Q_INTERFACES(QDesignerCustomWidgetInterface)
1487
PrefDoubleSpinBoxPlugin()
1489
QWidget* createWidget(QWidget* parent)
1491
return new Gui::PrefDoubleSpinBox(parent);
1493
QString group() const
1495
return QLatin1String("Preference Widgets");
1499
return QIcon(QPixmap(spinbox_pixmap));
1501
QString includeFile() const
1503
return QLatin1String("Gui/PrefWidgets.h");
1505
QString toolTip() const
1507
return QLatin1String("Double Spin Box");
1509
QString whatsThis() const
1511
return QLatin1String("Spin box widget that can work with doubles.");
1513
bool isContainer() const
1517
QString domXml() const
1519
return "<ui language=\"c++\">\n"
1520
" <widget class=\"Gui::PrefDoubleSpinBox\" name=\"doubleSpinBox\">\n"
1524
QString name() const
1526
return QLatin1String("Gui::PrefDoubleSpinBox");
1532
static const char* fontbox_pixmap[] = {"22 22 8 1",
1541
".#aaaaaaaaaaaaaaaaaa#.",
1542
"#bbccccccccccccccccdd#",
1543
"accee#########e.addfaa",
1544
"#c..............a.fa.#",
1545
"e#aaaaaaaaaaaaaaaaaa#e",
1546
"....#c...............#",
1547
"....ac...............a",
1548
"....ac.ccbbbbbbbbeb..a",
1549
"....ac.bbbeeeeeee##c.a",
1550
"....ac.bee########ac.a",
1551
"....ac..cccccccccccc.a",
1552
"....ac.ccccccccccbec.a",
1553
"....ac.cccccccccbbec.a",
1554
"....ac.bcbbbbbbbbbec.a",
1555
"....ac..cccccccccccc.a",
1556
"....ac.cbbeeeeeee#bc.a",
1557
"....ac.bee########ac.a",
1558
"....ab.b##aaaaaaaaacca",
1559
"....#bc.ccccccccccccc#",
1560
".....ab............ca.",
1561
".....eacc.........ca#.",
1562
".......#aaaaaaaaaa#..."};
1564
class PrefFontBoxPlugin: public QDesignerCustomWidgetInterface
1566
Q_INTERFACES(QDesignerCustomWidgetInterface)
1570
QWidget* createWidget(QWidget* parent)
1572
return new Gui::PrefFontBox(parent);
1574
QString group() const
1576
return QLatin1String("Preference Widgets");
1580
return QIcon(QPixmap(fontbox_pixmap));
1582
QString includeFile() const
1584
return QLatin1String("Gui/PrefWidgets.h");
1586
QString toolTip() const
1588
return QLatin1String("Font Box");
1590
QString whatsThis() const
1592
return QLatin1String("Font box widget (spin button).");
1594
bool isContainer() const
1598
QString domXml() const
1600
return "<ui language=\"c++\">\n"
1601
" <widget class=\"Gui::PrefFontBox\" name=\"fontBox\">\n"
1605
QString name() const
1607
return QLatin1String("Gui::PrefFontBox");
1613
static char *listbox_pixmap[]={
1621
".####################.",
1622
"#aabbbbbbbbbbbbb#abb.#",
1623
"#abcccccccccccdb#b#a.#",
1624
"#b..............#....#",
1625
"c####################c",
1626
"#b...............#...#",
1627
"#b...............#...#",
1628
"#b.###########a..#...#",
1629
"#b...............#.#.#",
1630
"#b.cccccccccccd..#.#.#",
1631
"#b...............#.#.#",
1632
"#b.cccccccccccd..#.#.#",
1633
"#b...............#.#.#",
1634
"#b.###########a..#.#.#",
1635
"#b...............#...#",
1636
"#b.###########a..#...#",
1637
"#b...............#...#",
1638
"#a.###########a..#..b#",
1639
"#a...............#..b#",
1640
".#a..............#.b#.",
1641
".c#bb............#b##.",
1642
"...################..."};
1644
CustomWidgetPlugin::CustomWidgetPlugin(QObject* parent)
1648
QList<QDesignerCustomWidgetInterface*> CustomWidgetPlugin::customWidgets() const
1650
QList<QDesignerCustomWidgetInterface*> cw;
1651
cw.append(new UrlLabelPlugin);
1652
cw.append(new LocationWidgetPlugin);
1653
cw.append(new FileChooserPlugin);
1654
cw.append(new AccelLineEditPlugin);
1655
cw.append(new ActionSelectorPlugin);
1656
cw.append(new InputFieldPlugin);
1657
cw.append(new QuantitySpinBoxPlugin);
1658
cw.append(new CommandIconViewPlugin);
1659
cw.append(new UIntSpinBoxPlugin);
1660
cw.append(new IntSpinBoxPlugin);
1661
cw.append(new DoubleSpinBoxPlugin);
1662
cw.append(new ColorButtonPlugin);
1663
cw.append(new PrefFileChooserPlugin);
1664
cw.append(new PrefSpinBoxPlugin);
1665
cw.append(new PrefColorButtonPlugin);
1666
cw.append(new PrefSliderPlugin);
1667
cw.append(new PrefRadioButtonPlugin);
1668
cw.append(new PrefCheckBoxPlugin);
1669
cw.append(new PrefComboBoxPlugin);
1670
cw.append(new PrefLineEditPlugin);
1671
cw.append(new PrefDoubleSpinBoxPlugin);
1672
cw.append(new PrefFontBoxPlugin);
1673
cw.append(new PrefUnitSpinBoxPlugin);
1674
cw.append(new PrefQuantitySpinBoxPlugin);