FreeCAD

Форк
0
1676 строк · 57.2 Кб
1
/***************************************************************************
2
 *   Copyright (c) 2006 Werner Mayer <werner.wm.mayer@gmx.de>              *
3
 *                                                                         *
4
 *   This file is part of the FreeCAD CAx development system.              *
5
 *                                                                         *
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.      *
10
 *                                                                         *
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.                  *
15
 *                                                                         *
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                                *
20
 *                                                                         *
21
 ***************************************************************************/
22

23

24
#include <QtDesigner/QDesignerContainerExtension>
25
#include <QtDesigner/QDesignerFormEditorInterface>
26
#include <QtDesigner/QDesignerFormWindowInterface>
27
#include <QtDesigner/QDesignerPropertySheetExtension>
28
#include <QtDesigner/QExtensionFactory>
29
#include <QtDesigner/QExtensionManager>
30

31
#include <QIcon>
32
#include <QtGui>
33
#include <QtPlugin>
34

35
#include "customwidgets.h"
36
#include "plugin.h"
37

38

39
/* XPM */
40
static const char* urllabel_pixmap[] = {"22 22 3 1",
41
                                        "# c #000000",
42
                                        "x c #ffffff",
43
                                        ". c None",
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
                                        "......##########......"};
66

67
class UrlLabelPlugin: public QDesignerCustomWidgetInterface
68
{
69
    Q_INTERFACES(QDesignerCustomWidgetInterface)
70
public:
71
    UrlLabelPlugin()
72
    {}
73
    QWidget* createWidget(QWidget* parent)
74
    {
75
        return new Gui::UrlLabel(parent);
76
    }
77
    QString group() const
78
    {
79
        return QLatin1String("Display Widgets");
80
    }
81
    QIcon icon() const
82
    {
83
        return QIcon(QPixmap(urllabel_pixmap));
84
    }
85
    QString includeFile() const
86
    {
87
        return QLatin1String("Gui/Widgets.h");
88
    }
89
    QString toolTip() const
90
    {
91
        return QLatin1String("Url label");
92
    }
93
    QString whatsThis() const
94
    {
95
        return QLatin1String("A widget to display a url in a text label.");
96
    }
97
    bool isContainer() const
98
    {
99
        return false;
100
    }
101
    //    QString codeTemplate() const;
102
    QString domXml() const
103
    {
104
        return "<ui language=\"c++\">\n"
105
               " <widget class=\"Gui::UrlLabel\" name=\"urlLabel\">\n"
106
               " </widget>\n"
107
               "</ui>";
108
    }
109
    QString name() const
110
    {
111
        return QLatin1String("Gui::UrlLabel");
112
    }
113
};
114

115
class LocationWidgetPlugin: public QDesignerCustomWidgetInterface
116
{
117
    Q_INTERFACES(QDesignerCustomWidgetInterface)
118
public:
119
    LocationWidgetPlugin()
120
    {}
121
    QWidget* createWidget(QWidget* parent)
122
    {
123
        return new Gui::LocationWidget(parent);
124
    }
125
    QString group() const
126
    {
127
        return QLatin1String("Display Widgets");
128
    }
129
    QIcon icon() const
130
    {
131
        return QIcon(QPixmap(urllabel_pixmap));
132
    }
133
    QString includeFile() const
134
    {
135
        return QLatin1String("Gui/InputVector.h");
136
    }
137
    QString toolTip() const
138
    {
139
        return QLatin1String("Location");
140
    }
141
    QString whatsThis() const
142
    {
143
        return QLatin1String("A widget to define a location.");
144
    }
145
    bool isContainer() const
146
    {
147
        return false;
148
    }
149
    QString domXml() const
150
    {
151
        return "<ui language=\"c++\">\n"
152
               " <widget class=\"Gui::LocationWidget\" name=\"locationWidget\">\n"
153
               " </widget>\n"
154
               "</ui>";
155
    }
156
    QString name() const
157
    {
158
        return QLatin1String("Gui::LocationWidget");
159
    }
160
};
161

162
static const char* filechooser_pixmap[] = {"22 22 8 1",
163
                                           "  c Gray100",
164
                                           ". c Gray97",
165
                                           "X c #4f504f",
166
                                           "o c #00007f",
167
                                           "O c Gray0",
168
                                           "+ c none",
169
                                           "@ c Gray0",
170
                                           "# c Gray0",
171
                                           "++++++++++++++++++++++",
172
                                           "++++++++++++++++++++++",
173
                                           "++++++++++++++++++++++",
174
                                           "++++++++++++++++++++++",
175
                                           "+OOOOOOOOOOOOOOOOOOOO+",
176
                                           "OOXXXXXXXXXXXXXXXXXXOO",
177
                                           "OXX.          OO OO  O",
178
                                           "OX.      oo     O    O",
179
                                           "OX.      oo     O   .O",
180
                                           "OX  ooo  oooo   O    O",
181
                                           "OX    oo oo oo  O    O",
182
                                           "OX  oooo oo oo  O    O",
183
                                           "OX oo oo oo oo  O    O",
184
                                           "OX oo oo oo oo  O    O",
185
                                           "OX  oooo oooo   O    O",
186
                                           "OX            OO OO  O",
187
                                           "OO..................OO",
188
                                           "+OOOOOOOOOOOOOOOOOOOO+",
189
                                           "++++++++++++++++++++++",
190
                                           "++++++++++++++++++++++",
191
                                           "++++++++++++++++++++++",
192
                                           "++++++++++++++++++++++"};
193

194
class FileChooserPlugin: public QDesignerCustomWidgetInterface
195
{
196
    Q_INTERFACES(QDesignerCustomWidgetInterface)
197
public:
198
    FileChooserPlugin()
199
    {}
200
    QWidget* createWidget(QWidget* parent)
201
    {
202
        return new Gui::FileChooser(parent);
203
    }
204
    QString group() const
205
    {
206
        return QLatin1String("Input Widgets");
207
    }
208
    QIcon icon() const
209
    {
210
        return QIcon(QPixmap(filechooser_pixmap));
211
    }
212
    QString includeFile() const
213
    {
214
        return QLatin1String("Gui/FileDialog.h");
215
    }
216
    QString toolTip() const
217
    {
218
        return QLatin1String("File Chooser");
219
    }
220
    QString whatsThis() const
221
    {
222
        return QLatin1String("A widget to choose a file or directory.");
223
    }
224
    bool isContainer() const
225
    {
226
        return false;
227
    }
228
    //    QString codeTemplate() const;
229
    QString domXml() const
230
    {
231
        return "<ui language=\"c++\">\n"
232
               " <widget class=\"Gui::FileChooser\" name=\"fileChooser\">\n"
233
               " </widget>\n"
234
               "</ui>";
235
    }
236
    QString name() const
237
    {
238
        return QLatin1String("Gui::FileChooser");
239
    }
240
};
241

242
class PrefFileChooserPlugin: public QDesignerCustomWidgetInterface
243
{
244
    Q_INTERFACES(QDesignerCustomWidgetInterface)
245
public:
246
    PrefFileChooserPlugin()
247
    {}
248
    QWidget* createWidget(QWidget* parent)
249
    {
250
        return new Gui::PrefFileChooser(parent);
251
    }
252
    QString group() const
253
    {
254
        return QLatin1String("Preference Widgets");
255
    }
256
    QIcon icon() const
257
    {
258
        return QIcon(QPixmap(filechooser_pixmap));
259
    }
260
    QString includeFile() const
261
    {
262
        return QLatin1String("Gui/PrefWidgets.h");
263
    }
264
    QString toolTip() const
265
    {
266
        return QLatin1String("File Chooser");
267
    }
268
    QString whatsThis() const
269
    {
270
        return QLatin1String("A widget to choose a file or directory.");
271
    }
272
    bool isContainer() const
273
    {
274
        return false;
275
    }
276
    QString domXml() const
277
    {
278
        return "<ui language=\"c++\">\n"
279
               " <widget class=\"Gui::PrefFileChooser\" name=\"fileChooser\">\n"
280
               " </widget>\n"
281
               "</ui>";
282
    }
283
    QString name() const
284
    {
285
        return QLatin1String("Gui::PrefFileChooser");
286
    }
287
};
288

289
/* XPM */
290
static const char* lineedit_pixmap[] = {"22 22 6 1",
291
                                        "a c #000000",
292
                                        "# c #000080",
293
                                        "b c #008080",
294
                                        "c c #808080",
295
                                        "d c #c0c0c0",
296
                                        ". c #ffffff",
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
                                        "......................"};
319

320
class AccelLineEditPlugin: public QDesignerCustomWidgetInterface
321
{
322
    Q_INTERFACES(QDesignerCustomWidgetInterface)
323
public:
324
    AccelLineEditPlugin()
325
    {}
326
    QWidget* createWidget(QWidget* parent)
327
    {
328
        return new Gui::AccelLineEdit(parent);
329
    }
330
    QString group() const
331
    {
332
        return QLatin1String("Input Widgets");
333
    }
334
    QIcon icon() const
335
    {
336
        return QIcon(QPixmap(lineedit_pixmap));
337
    }
338
    QString includeFile() const
339
    {
340
        return QLatin1String("Gui/Widgets.h");
341
    }
342
    QString toolTip() const
343
    {
344
        return QLatin1String("Accelerator Line Edit");
345
    }
346
    QString whatsThis() const
347
    {
348
        return QLatin1String("A widget to specify accelerator keys.");
349
    }
350
    bool isContainer() const
351
    {
352
        return false;
353
    }
354
    QString domXml() const
355
    {
356
        return "<ui language=\"c++\">\n"
357
               " <widget class=\"Gui::AccelLineEdit\" name=\"accelEdit\">\n"
358
               " </widget>\n"
359
               "</ui>";
360
    }
361
    QString name() const
362
    {
363
        return QLatin1String("Gui::AccelLineEdit");
364
    }
365
};
366

367
/* XPM */
368
static const char* actionselector_pixmap[] = {"22 22 6 1",
369
                                              "a c #000000",
370
                                              "# c #000080",
371
                                              "b c #008080",
372
                                              "c c #808080",
373
                                              "d c #c0c0c0",
374
                                              ". c #ffffff",
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
                                              "......................"};
397

398
class ActionSelectorPlugin: public QDesignerCustomWidgetInterface
399
{
400
    Q_INTERFACES(QDesignerCustomWidgetInterface)
401
public:
402
    ActionSelectorPlugin()
403
    {}
404
    QWidget* createWidget(QWidget* parent)
405
    {
406
        return new Gui::ActionSelector(parent);
407
    }
408
    QString group() const
409
    {
410
        return QLatin1String("Input Widgets");
411
    }
412
    QIcon icon() const
413
    {
414
        return QIcon(QPixmap(actionselector_pixmap));
415
    }
416
    QString includeFile() const
417
    {
418
        return QLatin1String("Gui/Widgets.h");
419
    }
420
    QString toolTip() const
421
    {
422
        return QLatin1String("Action Selector");
423
    }
424
    QString whatsThis() const
425
    {
426
        return QLatin1String("A widget to select actions.");
427
    }
428
    bool isContainer() const
429
    {
430
        return false;
431
    }
432
    QString domXml() const
433
    {
434
        return "<ui language=\"c++\">\n"
435
               " <widget class=\"Gui::ActionSelector\" name=\"actionSelector\">\n"
436
               " </widget>\n"
437
               "</ui>";
438
    }
439
    QString name() const
440
    {
441
        return QLatin1String("Gui::ActionSelector");
442
    }
443
};
444

445
/* XPM */
446
static const char* inputfield_pixmap[] = {"22 22 6 1",
447
                                          "a c #000000",
448
                                          "# c #000080",
449
                                          "b c #008080",
450
                                          "c c #808080",
451
                                          "d c #c0c0c0",
452
                                          ". c #ffffff",
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
                                          "......................"};
475

476
class InputFieldPlugin: public QDesignerCustomWidgetInterface
477
{
478
    Q_INTERFACES(QDesignerCustomWidgetInterface)
479
public:
480
    InputFieldPlugin()
481
    {}
482
    QWidget* createWidget(QWidget* parent)
483
    {
484
        return new Gui::InputField(parent);
485
    }
486
    QString group() const
487
    {
488
        return QLatin1String("Input Widgets");
489
    }
490
    QIcon icon() const
491
    {
492
        return QIcon(QPixmap(inputfield_pixmap));
493
    }
494
    QString includeFile() const
495
    {
496
        return QLatin1String("Gui/InputField.h");
497
    }
498
    QString toolTip() const
499
    {
500
        return QLatin1String("Input Field");
501
    }
502
    QString whatsThis() const
503
    {
504
        return QLatin1String("A widget to work with quantities.");
505
    }
506
    bool isContainer() const
507
    {
508
        return false;
509
    }
510
    QString domXml() const
511
    {
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"
516
               "  </property>\n"
517
               " </widget>\n"
518
               "</ui>";
519
    }
520
    QString name() const
521
    {
522
        return QLatin1String("Gui::InputField");
523
    }
524
};
525

526
/* XPM */
527
static const char* quantityspinbox_pixmap[] = {"22 22 6 1",
528
                                               "a c #000000",
529
                                               "# c #000080",
530
                                               "b c #008080",
531
                                               "c c #808080",
532
                                               "d c #c0c0c0",
533
                                               ". c #ffffff",
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#..."};
556

557
class QuantitySpinBoxPlugin: public QDesignerCustomWidgetInterface
558
{
559
    Q_INTERFACES(QDesignerCustomWidgetInterface)
560
public:
561
    QuantitySpinBoxPlugin()
562
    {}
563
    QWidget* createWidget(QWidget* parent)
564
    {
565
        return new Gui::QuantitySpinBox(parent);
566
    }
567
    QString group() const
568
    {
569
        return QLatin1String("Input Widgets");
570
    }
571
    QIcon icon() const
572
    {
573
        return QIcon(QPixmap(quantityspinbox_pixmap));
574
    }
575
    QString includeFile() const
576
    {
577
        return QLatin1String("Gui/QuantitySpinBox.h");
578
    }
579
    QString toolTip() const
580
    {
581
        return QLatin1String("Quantity spin box");
582
    }
583
    QString whatsThis() const
584
    {
585
        return QLatin1String("A widget to work with quantities.");
586
    }
587
    bool isContainer() const
588
    {
589
        return false;
590
    }
591
    QString domXml() const
592
    {
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"
597
               "  </property>\n"
598
               " </widget>\n"
599
               "</ui>";
600
    }
601
    QString name() const
602
    {
603
        return QLatin1String("Gui::QuantitySpinBox");
604
    }
605
};
606

607
class PrefUnitSpinBoxPlugin: public QDesignerCustomWidgetInterface
608
{
609
    Q_INTERFACES(QDesignerCustomWidgetInterface)
610
public:
611
    PrefUnitSpinBoxPlugin()
612
    {}
613
    QWidget* createWidget(QWidget* parent)
614
    {
615
        return new Gui::PrefUnitSpinBox(parent);
616
    }
617
    QString group() const
618
    {
619
        return QLatin1String("Preference Widgets");
620
    }
621
    QIcon icon() const
622
    {
623
        return QIcon(QPixmap(quantityspinbox_pixmap));
624
    }
625
    QString includeFile() const
626
    {
627
        return QLatin1String("Gui/PrefWidgets.h");
628
    }
629
    QString toolTip() const
630
    {
631
        return QLatin1String("Quantity Spin Box");
632
    }
633
    QString whatsThis() const
634
    {
635
        return QLatin1String("Quantity Spin box widget.");
636
    }
637
    bool isContainer() const
638
    {
639
        return false;
640
    }
641
    QString domXml() const
642
    {
643
        return "<ui language=\"c++\">\n"
644
               " <widget class=\"Gui::PrefUnitSpinBox\" name=\"unitSpinBox\">\n"
645
               " </widget>\n"
646
               "</ui>";
647
    }
648
    QString name() const
649
    {
650
        return QLatin1String("Gui::PrefUnitSpinBox");
651
    }
652
};
653

654
class PrefQuantitySpinBoxPlugin: public QDesignerCustomWidgetInterface
655
{
656
    Q_INTERFACES(QDesignerCustomWidgetInterface)
657
public:
658
    PrefQuantitySpinBoxPlugin()
659
    {}
660
    QWidget* createWidget(QWidget* parent)
661
    {
662
        return new Gui::PrefQuantitySpinBox(parent);
663
    }
664
    QString group() const
665
    {
666
        return QLatin1String("Preference Widgets");
667
    }
668
    QIcon icon() const
669
    {
670
        return QIcon(QPixmap(quantityspinbox_pixmap));
671
    }
672
    QString includeFile() const
673
    {
674
        return QLatin1String("Gui/PrefWidgets.h");
675
    }
676
    QString toolTip() const
677
    {
678
        return QLatin1String("Preference Quantity Spin Box");
679
    }
680
    QString whatsThis() const
681
    {
682
        return QLatin1String("Preference Quantity Spin Box Widget.");
683
    }
684
    bool isContainer() const
685
    {
686
        return false;
687
    }
688
    QString domXml() const
689
    {
690
        return "<ui language=\"c++\">\n"
691
               " <widget class=\"Gui::PrefQuantitySpinBox\" name=\"unitSpinBox\">\n"
692
               " </widget>\n"
693
               "</ui>";
694
    }
695
    QString name() const
696
    {
697
        return QLatin1String("Gui::PrefQuantitySpinBox");
698
    }
699
};
700

701
/* XPM */
702
static const char* iconview_pixmap[] = {"22 22 10 1",
703
                                        "# c #000000",
704
                                        "h c #000080",
705
                                        "f c #0000ff",
706
                                        "d c #008000",
707
                                        "e c #008080",
708
                                        "a c #800000",
709
                                        "b c #808080",
710
                                        "c c #c0c0c0",
711
                                        "g c #ff0000",
712
                                        ". c #ffffff",
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
                                        "...################..."};
735

736
class CommandIconViewPlugin: public QDesignerCustomWidgetInterface
737
{
738
    Q_INTERFACES(QDesignerCustomWidgetInterface)
739
public:
740
    CommandIconViewPlugin()
741
    {}
742
    QWidget* createWidget(QWidget* parent)
743
    {
744
        return new Gui::CommandIconView(parent);
745
    }
746
    QString group() const
747
    {
748
        return QLatin1String("View Widgets");
749
    }
750
    QIcon icon() const
751
    {
752
        return QIcon(QPixmap(iconview_pixmap));
753
    }
754
    QString includeFile() const
755
    {
756
        return QLatin1String("Gui/Widgets.h");
757
    }
758
    QString toolTip() const
759
    {
760
        return QLatin1String("Command View");
761
    }
762
    QString whatsThis() const
763
    {
764
        return QLatin1String("Area with movable and labeled icons.");
765
    }
766
    bool isContainer() const
767
    {
768
        return false;
769
    }
770
    QString domXml() const
771
    {
772
        return "<ui language=\"c++\">\n"
773
               " <widget class=\"Gui::CommandIconView\" name=\"iconView\">\n"
774
               " </widget>\n"
775
               "</ui>";
776
    }
777
    QString name() const
778
    {
779
        return QLatin1String("Gui::CommandIconView");
780
    }
781
};
782

783
/* XPM */
784
static const char* spinbox_pixmap[] = {"22 22 6 1",
785
                                       "a c #000000",
786
                                       "# c #000080",
787
                                       "b c #008080",
788
                                       "c c #808080",
789
                                       "d c #c0c0c0",
790
                                       ". c #ffffff",
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#..."};
813

814
class UIntSpinBoxPlugin: public QDesignerCustomWidgetInterface
815
{
816
    Q_INTERFACES(QDesignerCustomWidgetInterface)
817
public:
818
    UIntSpinBoxPlugin()
819
    {}
820
    QWidget* createWidget(QWidget* parent)
821
    {
822
        return new Gui::UIntSpinBox(parent);
823
    }
824
    QString group() const
825
    {
826
        return QLatin1String("Input Widgets");
827
    }
828
    QIcon icon() const
829
    {
830
        return QIcon(QPixmap(spinbox_pixmap));
831
    }
832
    QString includeFile() const
833
    {
834
        return QLatin1String("Gui/SpinBox.h");
835
    }
836
    QString toolTip() const
837
    {
838
        return QLatin1String("Unsigned Spin Box");
839
    }
840
    QString whatsThis() const
841
    {
842
        return QLatin1String("Spin box widget (spin button).");
843
    }
844
    bool isContainer() const
845
    {
846
        return false;
847
    }
848
    QString domXml() const
849
    {
850
        return "<ui language=\"c++\">\n"
851
               " <widget class=\"Gui::UIntSpinBox\" name=\"uintSpinBox\">\n"
852
               " </widget>\n"
853
               "</ui>";
854
    }
855
    QString name() const
856
    {
857
        return QLatin1String("Gui::UIntSpinBox");
858
    }
859
};
860

861
class IntSpinBoxPlugin: public QDesignerCustomWidgetInterface
862
{
863
    Q_INTERFACES(QDesignerCustomWidgetInterface)
864
public:
865
    IntSpinBoxPlugin()
866
    {}
867
    QWidget* createWidget(QWidget* parent)
868
    {
869
        return new Gui::IntSpinBox(parent);
870
    }
871
    QString group() const
872
    {
873
        return QLatin1String("Input Widgets");
874
    }
875
    QIcon icon() const
876
    {
877
        return QIcon(QPixmap(spinbox_pixmap));
878
    }
879
    QString includeFile() const
880
    {
881
        return QLatin1String("Gui/SpinBox.h");
882
    }
883
    QString toolTip() const
884
    {
885
        return QLatin1String("Spin Box");
886
    }
887
    QString whatsThis() const
888
    {
889
        return QLatin1String("Spin box widget (spin button).");
890
    }
891
    bool isContainer() const
892
    {
893
        return false;
894
    }
895
    QString domXml() const
896
    {
897
        return "<ui language=\"c++\">\n"
898
               " <widget class=\"Gui::IntSpinBox\" name=\"intSpinBox\">\n"
899
               " </widget>\n"
900
               "</ui>";
901
    }
902
    QString name() const
903
    {
904
        return QLatin1String("Gui::IntSpinBox");
905
    }
906
};
907

908
class DoubleSpinBoxPlugin: public QDesignerCustomWidgetInterface
909
{
910
    Q_INTERFACES(QDesignerCustomWidgetInterface)
911
public:
912
    DoubleSpinBoxPlugin()
913
    {}
914
    QWidget* createWidget(QWidget* parent)
915
    {
916
        return new Gui::DoubleSpinBox(parent);
917
    }
918
    QString group() const
919
    {
920
        return QLatin1String("Input Widgets");
921
    }
922
    QIcon icon() const
923
    {
924
        return QIcon(QPixmap(spinbox_pixmap));
925
    }
926
    QString includeFile() const
927
    {
928
        return QLatin1String("Gui/SpinBox.h");
929
    }
930
    QString toolTip() const
931
    {
932
        return QLatin1String("Double Spin Box");
933
    }
934
    QString whatsThis() const
935
    {
936
        return QLatin1String("Spin box widget (spin button).");
937
    }
938
    bool isContainer() const
939
    {
940
        return false;
941
    }
942
    QString domXml() const
943
    {
944
        return "<ui language=\"c++\">\n"
945
               " <widget class=\"Gui::DoubleSpinBox\" name=\"doubleSpinBox\">\n"
946
               " </widget>\n"
947
               "</ui>";
948
    }
949
    QString name() const
950
    {
951
        return QLatin1String("Gui::DoubleSpinBox");
952
    }
953
};
954

955
class PrefSpinBoxPlugin: public QDesignerCustomWidgetInterface
956
{
957
    Q_INTERFACES(QDesignerCustomWidgetInterface)
958
public:
959
    PrefSpinBoxPlugin()
960
    {}
961
    QWidget* createWidget(QWidget* parent)
962
    {
963
        return new Gui::PrefSpinBox(parent);
964
    }
965
    QString group() const
966
    {
967
        return QLatin1String("Preference Widgets");
968
    }
969
    QIcon icon() const
970
    {
971
        return QIcon(QPixmap(spinbox_pixmap));
972
    }
973
    QString includeFile() const
974
    {
975
        return QLatin1String("Gui/PrefWidgets.h");
976
    }
977
    QString toolTip() const
978
    {
979
        return QLatin1String("Spin Box");
980
    }
981
    QString whatsThis() const
982
    {
983
        return QLatin1String("Spin box widget (spin button).");
984
    }
985
    bool isContainer() const
986
    {
987
        return false;
988
    }
989
    QString domXml() const
990
    {
991
        return "<ui language=\"c++\">\n"
992
               " <widget class=\"Gui::PrefSpinBox\" name=\"spinBox\">\n"
993
               " </widget>\n"
994
               "</ui>";
995
    }
996
    QString name() const
997
    {
998
        return QLatin1String("Gui::PrefSpinBox");
999
    }
1000
};
1001

1002
/* XPM */
1003
static const char* colorbutton_pixmap[] = {"21 21 7 1",
1004
                                           "d c #000000",
1005
                                           "b c #000080",
1006
                                           "e c #0000ff",
1007
                                           "a c #008080",
1008
                                           "# c #808080",
1009
                                           "c c #c0c0c0",
1010
                                           ". c #ffffff",
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.."};
1032

1033
class ColorButtonPlugin: public QDesignerCustomWidgetInterface
1034
{
1035
    Q_INTERFACES(QDesignerCustomWidgetInterface)
1036
public:
1037
    ColorButtonPlugin()
1038
    {}
1039
    QWidget* createWidget(QWidget* parent)
1040
    {
1041
        return new Gui::ColorButton(parent);
1042
    }
1043
    QString group() const
1044
    {
1045
        return QLatin1String("Buttons");
1046
    }
1047
    QIcon icon() const
1048
    {
1049
        return QIcon(QPixmap(colorbutton_pixmap));
1050
    }
1051
    QString includeFile() const
1052
    {
1053
        return QLatin1String("Gui/Widgets.h");
1054
    }
1055
    QString toolTip() const
1056
    {
1057
        return QLatin1String("Color Button");
1058
    }
1059
    QString whatsThis() const
1060
    {
1061
        return QLatin1String("A button to choose a color.");
1062
    }
1063
    bool isContainer() const
1064
    {
1065
        return false;
1066
    }
1067
    QString domXml() const
1068
    {
1069
        return "<ui language=\"c++\">\n"
1070
               " <widget class=\"Gui::ColorButton\" name=\"colorButton\">\n"
1071
               " </widget>\n"
1072
               "</ui>";
1073
    }
1074
    QString name() const
1075
    {
1076
        return QLatin1String("Gui::ColorButton");
1077
    }
1078
};
1079

1080
class PrefColorButtonPlugin: public QDesignerCustomWidgetInterface
1081
{
1082
    Q_INTERFACES(QDesignerCustomWidgetInterface)
1083
public:
1084
    PrefColorButtonPlugin()
1085
    {}
1086
    QWidget* createWidget(QWidget* parent)
1087
    {
1088
        return new Gui::PrefColorButton(parent);
1089
    }
1090
    QString group() const
1091
    {
1092
        return QLatin1String("Preference Widgets");
1093
    }
1094
    QIcon icon() const
1095
    {
1096
        return QIcon(QPixmap(colorbutton_pixmap));
1097
    }
1098
    QString includeFile() const
1099
    {
1100
        return QLatin1String("Gui/PrefWidgets.h");
1101
    }
1102
    QString toolTip() const
1103
    {
1104
        return QLatin1String("Color Button");
1105
    }
1106
    QString whatsThis() const
1107
    {
1108
        return QLatin1String("A button to choose a color.");
1109
    }
1110
    bool isContainer() const
1111
    {
1112
        return false;
1113
    }
1114
    QString domXml() const
1115
    {
1116
        return "<ui language=\"c++\">\n"
1117
               " <widget class=\"Gui::PrefColorButton\" name=\"colorButton\">\n"
1118
               " </widget>\n"
1119
               "</ui>";
1120
    }
1121
    QString name() const
1122
    {
1123
        return QLatin1String("Gui::PrefColorButton");
1124
    }
1125
};
1126

1127
/* XPM */
1128
static const char* slider_pixmap[] = {"22 22 5 1",
1129
                                      "b c #000000",
1130
                                      "c c #008080",
1131
                                      "# c #808080",
1132
                                      "a c #c0c0c0",
1133
                                      ". c #ffffff",
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
                                      "......................"};
1156

1157
class PrefSliderPlugin: public QDesignerCustomWidgetInterface
1158
{
1159
    Q_INTERFACES(QDesignerCustomWidgetInterface)
1160
public:
1161
    PrefSliderPlugin()
1162
    {}
1163
    QWidget* createWidget(QWidget* parent)
1164
    {
1165
        return new Gui::PrefSlider(parent);
1166
    }
1167
    QString group() const
1168
    {
1169
        return QLatin1String("Preference Widgets");
1170
    }
1171
    QIcon icon() const
1172
    {
1173
        return QIcon(QPixmap(slider_pixmap));
1174
    }
1175
    QString includeFile() const
1176
    {
1177
        return QLatin1String("Gui/PrefWidgets.h");
1178
    }
1179
    QString toolTip() const
1180
    {
1181
        return QLatin1String("Slider");
1182
    }
1183
    QString whatsThis() const
1184
    {
1185
        return QLatin1String("Vertical or horizontal slider.");
1186
    }
1187
    bool isContainer() const
1188
    {
1189
        return false;
1190
    }
1191
    QString domXml() const
1192
    {
1193
        return "<ui language=\"c++\">\n"
1194
               " <widget class=\"Gui::PrefSlider\" name=\"slider\">\n"
1195
               " </widget>\n"
1196
               "</ui>";
1197
    }
1198
    QString name() const
1199
    {
1200
        return QLatin1String("Gui::PrefSlider");
1201
    }
1202
};
1203

1204
/* XPM */
1205
static const char* radiobutton_pixmap[] = {"22 22 4 1",
1206
                                           "b c #000000",
1207
                                           "# c #808080",
1208
                                           "a c #c0c0c0",
1209
                                           ". c #ffffff",
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
                                           "......................"};
1232

1233
class PrefRadioButtonPlugin: public QDesignerCustomWidgetInterface
1234
{
1235
    Q_INTERFACES(QDesignerCustomWidgetInterface)
1236
public:
1237
    PrefRadioButtonPlugin()
1238
    {}
1239
    QWidget* createWidget(QWidget* parent)
1240
    {
1241
        return new Gui::PrefRadioButton(parent);
1242
    }
1243
    QString group() const
1244
    {
1245
        return QLatin1String("Preference Widgets");
1246
    }
1247
    QIcon icon() const
1248
    {
1249
        return QIcon(QPixmap(radiobutton_pixmap));
1250
    }
1251
    QString includeFile() const
1252
    {
1253
        return QLatin1String("Gui/PrefWidgets.h");
1254
    }
1255
    QString toolTip() const
1256
    {
1257
        return QLatin1String("Radio Button");
1258
    }
1259
    QString whatsThis() const
1260
    {
1261
        return QLatin1String("Radio button with a text or pixmap label.");
1262
    }
1263
    bool isContainer() const
1264
    {
1265
        return false;
1266
    }
1267
    QString domXml() const
1268
    {
1269
        return "<ui language=\"c++\">\n"
1270
               " <widget class=\"Gui::PrefRadioButton\" name=\"radioButton\">\n"
1271
               " </widget>\n"
1272
               "</ui>";
1273
    }
1274
    QString name() const
1275
    {
1276
        return QLatin1String("Gui::PrefRadioButton");
1277
    }
1278
};
1279

1280
/* XPM */
1281
static const char* checkbox_pixmap[] = {"22 22 4 1",
1282
                                        "# c #000000",
1283
                                        "a c #808080",
1284
                                        "b c #c0c0c0",
1285
                                        ". c #ffffff",
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
                                        "......................"};
1308

1309
class PrefCheckBoxPlugin: public QDesignerCustomWidgetInterface
1310
{
1311
    Q_INTERFACES(QDesignerCustomWidgetInterface)
1312
public:
1313
    PrefCheckBoxPlugin()
1314
    {}
1315
    QWidget* createWidget(QWidget* parent)
1316
    {
1317
        return new Gui::PrefCheckBox(parent);
1318
    }
1319
    QString group() const
1320
    {
1321
        return QLatin1String("Preference Widgets");
1322
    }
1323
    QIcon icon() const
1324
    {
1325
        return QIcon(QPixmap(checkbox_pixmap));
1326
    }
1327
    QString includeFile() const
1328
    {
1329
        return QLatin1String("Gui/PrefWidgets.h");
1330
    }
1331
    QString toolTip() const
1332
    {
1333
        return QLatin1String("Check Box");
1334
    }
1335
    QString whatsThis() const
1336
    {
1337
        return QLatin1String("Checkbox with a text label.");
1338
    }
1339
    bool isContainer() const
1340
    {
1341
        return false;
1342
    }
1343
    QString domXml() const
1344
    {
1345
        return "<ui language=\"c++\">\n"
1346
               " <widget class=\"Gui::PrefCheckBox\" name=\"checkBox\">\n"
1347
               " </widget>\n"
1348
               "</ui>";
1349
    }
1350
    QString name() const
1351
    {
1352
        return QLatin1String("Gui::PrefCheckBox");
1353
    }
1354
};
1355

1356
/* XPM */
1357
static const char* combobox_pixmap[] = {"22 22 8 1",
1358
                                        "a c #000000",
1359
                                        "# c #000080",
1360
                                        "e c #008080",
1361
                                        "f c #800000",
1362
                                        "b c #808080",
1363
                                        "c c #c0c0c0",
1364
                                        "d c #ff0000",
1365
                                        ". c #ffffff",
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#..."};
1388

1389
class PrefComboBoxPlugin: public QDesignerCustomWidgetInterface
1390
{
1391
    Q_INTERFACES(QDesignerCustomWidgetInterface)
1392
public:
1393
    PrefComboBoxPlugin()
1394
    {}
1395
    QWidget* createWidget(QWidget* parent)
1396
    {
1397
        return new Gui::PrefComboBox(parent);
1398
    }
1399
    QString group() const
1400
    {
1401
        return QLatin1String("Preference Widgets");
1402
    }
1403
    QIcon icon() const
1404
    {
1405
        return QIcon(QPixmap(combobox_pixmap));
1406
    }
1407
    QString includeFile() const
1408
    {
1409
        return QLatin1String("Gui/PrefWidgets.h");
1410
    }
1411
    QString toolTip() const
1412
    {
1413
        return QLatin1String("Combo Box");
1414
    }
1415
    QString whatsThis() const
1416
    {
1417
        return QLatin1String("Combined button and popup list.");
1418
    }
1419
    bool isContainer() const
1420
    {
1421
        return false;
1422
    }
1423
    QString domXml() const
1424
    {
1425
        return "<ui language=\"c++\">\n"
1426
               " <widget class=\"Gui::PrefComboBox\" name=\"comboBox\">\n"
1427
               " </widget>\n"
1428
               "</ui>";
1429
    }
1430
    QString name() const
1431
    {
1432
        return QLatin1String("Gui::PrefComboBox");
1433
    }
1434
};
1435

1436
class PrefLineEditPlugin: public QDesignerCustomWidgetInterface
1437
{
1438
    Q_INTERFACES(QDesignerCustomWidgetInterface)
1439
public:
1440
    PrefLineEditPlugin()
1441
    {}
1442
    QWidget* createWidget(QWidget* parent)
1443
    {
1444
        return new Gui::PrefLineEdit(parent);
1445
    }
1446
    QString group() const
1447
    {
1448
        return QLatin1String("Preference Widgets");
1449
    }
1450
    QIcon icon() const
1451
    {
1452
        return QIcon(QPixmap(lineedit_pixmap));
1453
    }
1454
    QString includeFile() const
1455
    {
1456
        return QLatin1String("Gui/PrefWidgets.h");
1457
    }
1458
    QString toolTip() const
1459
    {
1460
        return QLatin1String("Line Edit");
1461
    }
1462
    QString whatsThis() const
1463
    {
1464
        return QLatin1String("One-line text editor.");
1465
    }
1466
    bool isContainer() const
1467
    {
1468
        return false;
1469
    }
1470
    QString domXml() const
1471
    {
1472
        return "<ui language=\"c++\">\n"
1473
               " <widget class=\"Gui::PrefLineEdit\" name=\"lineEdit\">\n"
1474
               " </widget>\n"
1475
               "</ui>";
1476
    }
1477
    QString name() const
1478
    {
1479
        return QLatin1String("Gui::PrefLineEdit");
1480
    }
1481
};
1482

1483
class PrefDoubleSpinBoxPlugin: public QDesignerCustomWidgetInterface
1484
{
1485
    Q_INTERFACES(QDesignerCustomWidgetInterface)
1486
public:
1487
    PrefDoubleSpinBoxPlugin()
1488
    {}
1489
    QWidget* createWidget(QWidget* parent)
1490
    {
1491
        return new Gui::PrefDoubleSpinBox(parent);
1492
    }
1493
    QString group() const
1494
    {
1495
        return QLatin1String("Preference Widgets");
1496
    }
1497
    QIcon icon() const
1498
    {
1499
        return QIcon(QPixmap(spinbox_pixmap));
1500
    }
1501
    QString includeFile() const
1502
    {
1503
        return QLatin1String("Gui/PrefWidgets.h");
1504
    }
1505
    QString toolTip() const
1506
    {
1507
        return QLatin1String("Double Spin Box");
1508
    }
1509
    QString whatsThis() const
1510
    {
1511
        return QLatin1String("Spin box widget that can work with doubles.");
1512
    }
1513
    bool isContainer() const
1514
    {
1515
        return false;
1516
    }
1517
    QString domXml() const
1518
    {
1519
        return "<ui language=\"c++\">\n"
1520
               " <widget class=\"Gui::PrefDoubleSpinBox\" name=\"doubleSpinBox\">\n"
1521
               " </widget>\n"
1522
               "</ui>";
1523
    }
1524
    QString name() const
1525
    {
1526
        return QLatin1String("Gui::PrefDoubleSpinBox");
1527
    }
1528
};
1529

1530

1531
/* XPM */
1532
static const char* fontbox_pixmap[] = {"22 22 8 1",
1533
                                       "a c #000000",
1534
                                       "# c #000080",
1535
                                       "e c #008080",
1536
                                       "f c #800000",
1537
                                       "b c #808080",
1538
                                       "c c #c0c0c0",
1539
                                       "d c #ff0000",
1540
                                       ". c #ffffff",
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#..."};
1563

1564
class PrefFontBoxPlugin: public QDesignerCustomWidgetInterface
1565
{
1566
    Q_INTERFACES(QDesignerCustomWidgetInterface)
1567
public:
1568
    PrefFontBoxPlugin()
1569
    {}
1570
    QWidget* createWidget(QWidget* parent)
1571
    {
1572
        return new Gui::PrefFontBox(parent);
1573
    }
1574
    QString group() const
1575
    {
1576
        return QLatin1String("Preference Widgets");
1577
    }
1578
    QIcon icon() const
1579
    {
1580
        return QIcon(QPixmap(fontbox_pixmap));
1581
    }
1582
    QString includeFile() const
1583
    {
1584
        return QLatin1String("Gui/PrefWidgets.h");
1585
    }
1586
    QString toolTip() const
1587
    {
1588
        return QLatin1String("Font Box");
1589
    }
1590
    QString whatsThis() const
1591
    {
1592
        return QLatin1String("Font box widget (spin button).");
1593
    }
1594
    bool isContainer() const
1595
    {
1596
        return false;
1597
    }
1598
    QString domXml() const
1599
    {
1600
        return "<ui language=\"c++\">\n"
1601
               " <widget class=\"Gui::PrefFontBox\" name=\"fontBox\">\n"
1602
               " </widget>\n"
1603
               "</ui>";
1604
    }
1605
    QString name() const
1606
    {
1607
        return QLatin1String("Gui::PrefFontBox");
1608
    }
1609
};
1610

1611
/* XPM */
1612
/*
1613
static char *listbox_pixmap[]={
1614
"22 22 6 1",
1615
"# c #000000",
1616
"c c #800000",
1617
"d c #808000",
1618
"a c #808080",
1619
"b c #c0c0c0",
1620
". c #ffffff",
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
"...################..."};
1643
*/
1644
CustomWidgetPlugin::CustomWidgetPlugin(QObject* parent)
1645
    : QObject(parent)
1646
{}
1647

1648
QList<QDesignerCustomWidgetInterface*> CustomWidgetPlugin::customWidgets() const
1649
{
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);
1675
    return cw;
1676
}
1677

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.