26 #include <QPushButton>
27 #include <QMessageBox>
28 #include <QColorDialog>
29 #include <QVBoxLayout>
30 #include <QHBoxLayout>
34 : QDialog(parent, name)
36 setCaption(tr(
"Edit Text Properties"));
38 vert =
new QVBoxLayout(
this);
43 new QLabel(tr(
"Use LaTeX style for special characters, e.g. \\tau")+
45 tr(
"Use _{..} and ^{..} for sub- and super-positions."),
48 text =
new QTextEdit(
this);
49 text->setTextFormat(Qt::PlainText);
50 text->setWordWrapMode(QTextOption::NoWrap);
51 text->setMinimumSize(350,150);
54 QWidget *h1 =
new QWidget(
this);
55 QHBoxLayout *h1Layout =
new QHBoxLayout();
56 h1Layout->setSpacing(5);
57 h1->setLayout(h1Layout);
60 QWidget *h3 =
new QWidget(
this);
61 QHBoxLayout *h3Layout =
new QHBoxLayout();
62 h3Layout->setSpacing(5);
63 h3->setLayout(h3Layout);
67 QPushButton *ButtOK =
new QPushButton(tr(
"&OK"));
68 h3Layout->addWidget(ButtOK);
69 connect(ButtOK, SIGNAL(clicked()), SLOT(
slotOkButton()));
70 QPushButton *ButtCancel =
new QPushButton(tr(
"&Cancel"));
71 h3Layout->addWidget(ButtCancel);
72 connect(ButtCancel, SIGNAL(clicked()), SLOT(reject()));
74 QLabel *tc =
new QLabel(tr(
"Text color: "));
76 h1Layout->addWidget(tc);
78 ColorButt->setPaletteBackgroundColor(QColor(0,0,0));
81 QWidget *place1 =
new QWidget(h1);
82 h1Layout->setStretchFactor(place1,5);
84 val50 =
new QIntValidator(1, 50,
this);
85 QLabel *ts =
new QLabel(tr(
" Text size: "));
86 h1Layout->addWidget(ts);
93 val360 =
new QIntValidator(0, 359,
this);
94 QLabel *ra =
new QLabel(tr(
" Rotation angle: "));
95 h1Layout->addWidget(ra);
96 Angle =
new QLineEdit(
this);
98 Angle->setMaximumWidth(35);
100 h1Layout->addWidget(
Angle);
115 QColor c = QColorDialog::getColor(
ColorButt->paletteBackgroundColor(),
this);
116 if(c.isValid())
ColorButt->setPaletteBackgroundColor(c);
122 if(
text->toPlainText().size() < 1) {
123 QMessageBox::critical(
this, tr(
"Error"), tr(
"The text must not be empty!"));
GraphicTextDialog(QWidget *parent=0, const char *name=0)