19 #include "ui_dynamictextfieldeditor.h" 29 #include <QGraphicsItem> 30 #include <QColorDialog> 37 ui->m_composite_text_pb->setDisabled(
true);
38 ui->m_elmt_info_cb->setDisabled(
true);
65 QGraphicsItem *qgi = part->
toItem();
81 m_connection_list << connect(
m_text_field.data(), &PartDynamicTextField::rotationChanged, [
this](){this->
updateForm();});
115 ui->m_text_from_cb->setCurrentIndex(0);
119 ui->m_text_from_cb->setCurrentIndex(1);
120 ui->m_elmt_info_cb->setCurrentIndex(
ui->m_elmt_info_cb->findData(
m_text_field.data()->infoName()));
124 ui->m_text_from_cb->setCurrentIndex(2);
137 ui->m_elmt_info_cb->clear();
142 if(type.contains(
"report"))
143 strl <<
"function" <<
"tension-protocol";
149 QMap <QString, QString> info_map;
150 for(
const QString& str : strl)
153 for (
const QString& key : info_map.keys())
154 ui->m_elmt_info_cb->addItem(key, info_map.value(key));
160 undo->setText(
tr(
"Déplacer un champ texte"));
168 undo->setText(
tr(
"Déplacer un champ texte"));
176 undo->setText(
tr(
"Pivoter un champ texte"));
184 undo->setText(
tr(
"Modifier le texte d'un champ texte"));
191 font_.setPointSize(
ui->m_size_sb->value());
193 undo->setText(
tr(
"Modifier la police d'un champ texte"));
199 bool frame =
ui->m_frame_cb->isChecked();
204 undo->setText(
tr(
"Modifier le cadre d'un champ texte"));
211 qreal width = (qreal)
ui->m_width_sb->value();
216 undo->setText(
tr(
"Modifier la largeur d'un texte"));
225 QString info =
ui->m_elmt_info_cb->currentData().toString();
230 undo->setText(
tr(
"Modifier l'information d'un texte"));
239 ui->m_user_text_le->setDisabled(
true);
240 ui->m_elmt_info_cb->setDisabled(
true);
241 ui->m_composite_text_pb->setDisabled(
true);
244 ui->m_user_text_le->setEnabled(
true);
246 ui->m_elmt_info_cb->setEnabled(
true);
248 ui->m_composite_text_pb->setEnabled(
true);
258 undo->setText(
tr(
"Modifier la source de texte, d'un texte"));
285 undo->setText(
tr(
"Modifier l'alignement d'un champ texte"));
293 QFont font_ = QFontDialog::getFont(&ok,
m_text_field->font(),
this);
294 if (ok && font_ != this->font())
296 ui->m_font_pb->setText(font_.family());
297 ui->m_size_sb->setValue(font_.pointSize());
300 undo->setText(
tr(
"Modifier la police d'un champ texte"));
307 if(newColor.isValid() && newColor !=
m_text_field.data()->color())
310 undo->setText(
tr(
"Modifier la couleur d'un champ texte"));
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
The CompositeTextEditDialog class CompositeTextEditDialog display a dialog use to write the complex t...
void on_m_color_kpb_changed(const QColor &newColor)
void on_m_font_pb_clicked()
void on_m_rotation_sb_editingFinished()
void on_m_elmt_info_cb_activated(const QString &arg1)
void compositeTextChanged(QString text)
DynamicTextFieldEditor(QETElementEditor *editor, PartDynamicTextField *text_field=nullptr, QWidget *parent=nullptr)
void colorChanged(QColor color)
The DynamicTextFieldEditor class This class provide a widget used to edit the property of a dynamic t...
The PartDynamicTextField class This class represents an editable dynamic text field which may be used...
void textChanged(QString text)
void fillInfoComboBox()
DynamicTextFieldEditor::fillInfoComboBox Fill the combo box "element information".
void on_m_x_sb_editingFinished()
void enableAnimation(bool animate=true)
QPropertyUndoCommand::enableAnimation True to enable animation.
~DynamicTextFieldEditor() override
ElementScene * elementScene() const
virtual QGraphicsItem * toItem()
void fontChanged(QFont font)
void on_m_y_sb_editingFinished()
Ui::DynamicTextFieldEditor * ui
qreal correctAngle(const qreal &)
void on_m_composite_text_pb_clicked()
void on_m_user_text_le_editingFinished()
QList< QMetaObject::Connection > m_connection_list
void textWidthChanged(qreal width)
bool setPart(CustomElementPart *part) override
DynamicTextFieldEditor::setPart Set as current edited part of this widget.
static QStringList elementInfoKeys()
QETApp::elementInfoKeys.
void taggChanged(QString tagg)
void on_m_width_sb_editingFinished()
void textFromChanged(DynamicElementTextItem::TextFrom text_from)
virtual QETElementEditor * elementEditor() const
void infoNameChanged(QString info)
void on_m_text_from_cb_activated(int index)
void on_m_size_sb_editingFinished()
virtual ElementScene * elementScene() const
QString elementType() const
void updateForm() override
QPointer< PartDynamicTextField > m_text_field
void on_m_alignment_pb_clicked()
void on_m_frame_cb_clicked()
static QString elementTranslatedInfoKey(const QString &)
ElementsProperties::translatedInfo Return the translated information key given by If don't match...
void frameChanged(bool frame)
CustomElementPart * currentPart() const override
DynamicTextFieldEditor::currentPart.
QString plainText() const
CompositeTextEditDialog::plainText.
virtual QUndoStack & undoStack() const