23 #include <QColorDialog>
25 #include <QPushButton>
28 #include <QHBoxLayout>
32 : QDialog(parent, name)
34 setCaption(tr(
"Edit Arrow Properties"));
35 val100 =
new QIntValidator(0, 100,
this);
37 all =
new QGridLayout(
this, 5,4,3,3);
42 all->addWidget(
new QLabel(tr(
"Head Length: "),
this), 0,0);
49 all->addWidget(
new QLabel(tr(
" Head Width: "),
this), 0,2);
57 all->addWidget(
new QLabel(tr(
"Line color: "),
this), 1,0);
59 ColorButt->setPaletteBackgroundColor(QColor(0,0,0));
63 all->addWidget(
new QLabel(tr(
" Line Width: "),
this), 1,2);
71 all->addWidget(
new QLabel(tr(
"Line style: "),
this), 2,0);
73 StyleBox->insertItem(tr(
"solid line"));
74 StyleBox->insertItem(tr(
"dash line"));
75 StyleBox->insertItem(tr(
"dot line"));
76 StyleBox->insertItem(tr(
"dash dot line"));
77 StyleBox->insertItem(tr(
"dash dot dot line"));
82 all->addWidget(
new QLabel(tr(
"Arrow head: "),
this), 3,0);
89 QWidget *h1 =
new QWidget(
this);
90 QHBoxLayout *h1Layout =
new QHBoxLayout();
93 QPushButton *ButtOK =
new QPushButton(tr(
"OK"));
94 h1Layout->addWidget(ButtOK);
95 connect(ButtOK, SIGNAL(clicked()), SLOT(accept()));
96 QPushButton *ButtCancel =
new QPushButton(tr(
"Cancel"));
97 h1Layout->addWidget(ButtCancel);
98 connect(ButtCancel, SIGNAL(clicked()), SLOT(reject()));
100 h1->setLayout(h1Layout);
101 all->addMultiCellWidget(h1, 4,4,0,3);
115 QColor c = QColorDialog::getColor(
ColorButt->paletteBackgroundColor(),
this);
116 if(c.isValid())
ColorButt->setPaletteBackgroundColor(c);
142 case Qt::SolidLine :
StyleBox->setCurrentItem(0);
144 case Qt::DashLine :
StyleBox->setCurrentItem(1);
146 case Qt::DotLine :
StyleBox->setCurrentItem(2);
148 case Qt::DashDotLine :
StyleBox->setCurrentItem(3);
150 case Qt::DashDotDotLine :
StyleBox->setCurrentItem(4);
QComboBox * ArrowStyleBox
ArrowDialog(QWidget *parent=0, const char *name=0)
void SetComboBox(Qt::PenStyle)