23 #include <qvalidator.h>
24 #include <qcolordialog.h>
25 #include <qlineedit.h>
26 #include <qpushbutton.h>
27 #include <qcombobox.h>
31 : QDialog(parent, name)
33 setCaption(tr(
"Edit Arrow Properties"));
34 val100 =
new QIntValidator(0, 100,
this);
36 all =
new QGridLayout(
this, 5,4,3,3);
39 all->addWidget(
new QLabel(tr(
"Head Length: "),
this), 0,0);
46 all->addWidget(
new QLabel(tr(
" Head Width: "),
this), 0,2);
54 all->addWidget(
new QLabel(tr(
"Line color: "),
this), 1,0);
56 ColorButt->setPaletteBackgroundColor(QColor(0,0,0));
57 connect(
ColorButt, SIGNAL(clicked()), SLOT(slotSetColor()));
60 all->addWidget(
new QLabel(tr(
" Line Width: "),
this), 1,2);
68 all->addWidget(
new QLabel(tr(
"Line style: "),
this), 2,0);
70 StyleBox->insertItem(tr(
"solid line"));
71 StyleBox->insertItem(tr(
"dash line"));
72 StyleBox->insertItem(tr(
"dot line"));
73 StyleBox->insertItem(tr(
"dash dot line"));
74 StyleBox->insertItem(tr(
"dash dot dot line"));
75 connect(
StyleBox, SIGNAL(activated(
int)), SLOT(slotSetStyle(
int)));
79 all->addWidget(
new QLabel(tr(
"Arrow head: "),
this), 3,0);
86 QHBox *h1 =
new QHBox(
this);
87 all->addMultiCellWidget(h1, 4,4,0,3);
88 QPushButton *ButtOK =
new QPushButton(tr(
"OK"), h1);
89 connect(ButtOK, SIGNAL(clicked()), SLOT(accept()));
90 QPushButton *ButtCancel =
new QPushButton(tr(
"Cancel"), h1);
91 connect(ButtCancel, SIGNAL(clicked()), SLOT(reject()));
103 void ArrowDialog::slotSetColor()
105 QColor
c = QColorDialog::getColor(
ColorButt->paletteBackgroundColor(),
this);
106 if(c.isValid())
ColorButt->setPaletteBackgroundColor(c);
110 void ArrowDialog::slotSetStyle(
int index)
132 case Qt::SolidLine :
StyleBox->setCurrentItem(0);
134 case Qt::DashLine :
StyleBox->setCurrentItem(1);
136 case Qt::DotLine :
StyleBox->setCurrentItem(2);
138 case Qt::DashDotLine :
StyleBox->setCurrentItem(3);
140 case Qt::DashDotDotLine :
StyleBox->setCurrentItem(4);