23 #include <qvalidator.h>
24 #include <qcolordialog.h>
25 #include <qtabwidget.h>
26 #include <qlineedit.h>
27 #include <qpushbutton.h>
28 #include <qcombobox.h>
29 #include <qcheckbox.h>
37 all =
new QVBoxLayout(
this);
38 QTabWidget *
t =
new QTabWidget(
this);
42 QWidget *Tab1 =
new QWidget(t);
43 QGridLayout *gp1 =
new QGridLayout(Tab1,3,2,5,5);
45 gp1->addWidget(
new QLabel(tr(
"Line Width: "), Tab1), 0,0);
46 val100 =
new QIntValidator(0,100,
this);
53 gp1->addWidget(
new QLabel(tr(
"Line Color: "), Tab1), 1,0);
55 ColorButt->setPaletteBackgroundColor(QColor(0,0,0));
56 connect(
ColorButt, SIGNAL(clicked()), SLOT(slotSetColor()));
59 gp1->addWidget(
new QLabel(tr(
"Line Style: "), Tab1), 2,0);
61 StyleBox->insertItem(tr(
"solid line"));
62 StyleBox->insertItem(tr(
"dash line"));
63 StyleBox->insertItem(tr(
"dot line"));
64 StyleBox->insertItem(tr(
"dash dot line"));
65 StyleBox->insertItem(tr(
"dash dot dot line"));
69 t->addTab(Tab1, tr(
"Line Style"));
73 QWidget *Tab2 =
new QWidget(t);
74 QGridLayout *gp2 =
new QGridLayout(Tab2,3,2,5,5);
76 CheckFilled =
new QCheckBox(tr(
"enable filling"),Tab2);
81 FillLabel1 =
new QLabel(tr(
"Fill Color: "), Tab2);
85 connect(
FillColorButt, SIGNAL(clicked()), SLOT(slotSetFillColor()));
88 FillLabel2 =
new QLabel(tr(
"Fill Style: "), Tab2);
109 t->addTab(Tab2, tr(
"Filling Style"));
112 QHBox *Butts =
new QHBox(
this);
113 Butts->setSpacing(5);
115 all->addWidget(Butts);
117 QPushButton *ButtOK =
new QPushButton(tr(
"OK"),Butts);
118 connect(ButtOK, SIGNAL(clicked()), SLOT(accept()));
119 QPushButton *ButtCancel =
new QPushButton(tr(
"Cancel"),Butts);
120 connect(ButtCancel, SIGNAL(clicked()), SLOT(reject()));
123 ButtOK->setDefault(
true);
134 void FillDialog::slotSetColor()
136 QColor
c = QColorDialog::getColor(
ColorButt->paletteBackgroundColor(),
this);
137 if(c.isValid())
ColorButt->setPaletteBackgroundColor(c);
141 void FillDialog::slotSetFillColor()
144 QColorDialog::getColor(
FillColorButt->paletteBackgroundColor(),
this);