22 #include <QColorDialog>
25 #include <QPushButton>
28 #include <QGridLayout>
29 #include <QVBoxLayout>
30 #include <QHBoxLayout>
38 all =
new QVBoxLayout(
this);
39 QTabWidget *t =
new QTabWidget(
this);
43 QWidget *Tab1 =
new QWidget(t);
44 QGridLayout *gp1 =
new QGridLayout(Tab1,3,2,5,5);
46 gp1->addWidget(
new QLabel(tr(
"Line Width: "), Tab1), 0,0);
47 val100 =
new QIntValidator(0,100,
this);
54 gp1->addWidget(
new QLabel(tr(
"Line Color: "), Tab1), 1,0);
56 ColorButt->setPaletteBackgroundColor(QColor(0,0,0));
60 gp1->addWidget(
new QLabel(tr(
"Line Style: "), Tab1), 2,0);
62 StyleBox->insertItem(tr(
"solid line"));
63 StyleBox->insertItem(tr(
"dash line"));
64 StyleBox->insertItem(tr(
"dot line"));
65 StyleBox->insertItem(tr(
"dash dot line"));
66 StyleBox->insertItem(tr(
"dash dot dot line"));
70 t->addTab(Tab1, tr(
"Line Style"));
74 QWidget *Tab2 =
new QWidget(t);
75 QGridLayout *gp2 =
new QGridLayout(Tab2,3,2,5,5);
77 CheckFilled =
new QCheckBox(tr(
"enable filling"),Tab2);
82 FillLabel1 =
new QLabel(tr(
"Fill Color: "), Tab2);
89 FillLabel2 =
new QLabel(tr(
"Fill Style: "), Tab2);
110 t->addTab(Tab2, tr(
"Filling Style"));
113 QWidget *Butts =
new QWidget(
this);
114 QHBoxLayout *ButtsLayout =
new QHBoxLayout();
116 ButtsLayout->setSpacing(5);
117 ButtsLayout->setMargin(5);
119 QPushButton *ButtOK =
new QPushButton(tr(
"OK"));
120 ButtsLayout->addWidget(ButtOK);
121 connect(ButtOK, SIGNAL(clicked()), SLOT(accept()));
122 QPushButton *ButtCancel =
new QPushButton(tr(
"Cancel"),Butts);
123 ButtsLayout->addWidget(ButtCancel);
124 connect(ButtCancel, SIGNAL(clicked()), SLOT(reject()));
126 Butts->setLayout(ButtsLayout);
127 all->addWidget(Butts);
130 ButtOK->setDefault(
true);
143 QColor c = QColorDialog::getColor(
ColorButt->paletteBackgroundColor(),
this);
144 if(c.isValid())
ColorButt->setPaletteBackgroundColor(c);
151 QColorDialog::getColor(
FillColorButt->paletteBackgroundColor(),
this);
FillDialog(const QString &_Caption, bool show=true, QWidget *parent=0)
void slotCheckFilled(bool on)
QPushButton * FillColorButt