diff --git a/sources/editor/ui/dynamictextfieldeditor.cpp b/sources/editor/ui/dynamictextfieldeditor.cpp index 6b8e59bbb..8471de8b7 100644 --- a/sources/editor/ui/dynamictextfieldeditor.cpp +++ b/sources/editor/ui/dynamictextfieldeditor.cpp @@ -32,13 +32,16 @@ #include #include -DynamicTextFieldEditor::DynamicTextFieldEditor( - QETElementEditor *editor, PartDynamicTextField *text_field, QWidget *parent) : +DynamicTextFieldEditor::DynamicTextFieldEditor(QETElementEditor *editor, + PartDynamicTextField *text_field, + QWidget *parent) : ElementItemEditor(editor, parent), - ui(new Ui::DynamicTextFieldEditor) { + ui(new Ui::DynamicTextFieldEditor) +{ ui -> setupUi(this); ui -> m_composite_text_pb -> setDisabled(true); ui -> m_elmt_info_cb -> setDisabled(true); + setupWidget(); if(text_field) { setPart(text_field); } @@ -137,7 +140,7 @@ void DynamicTextFieldEditor::updateForm() ui -> m_size_sb -> setValue(m_text_field.data() -> font().pointSize()); #ifdef BUILD_WITHOUT_KF5 #else - ui -> m_color_kpb -> setColor(m_text_field.data() -> color()); + m_color_kpb -> setColor(m_text_field.data() -> color()); #endif ui -> m_width_sb -> setValue(m_text_field.data() -> textWidth()); ui -> m_font_pb -> setText(m_text_field -> font().family()); @@ -162,6 +165,20 @@ void DynamicTextFieldEditor::updateForm() } } +void DynamicTextFieldEditor::setupWidget() +{ +#ifdef BUILD_WITHOUT_KF5 +#else + m_color_kpb = new KColorButton(this); + m_color_kpb->setObjectName(QString::fromUtf8("m_color_kpb")); + + connect(m_color_kpb, &KColorButton::changed, + this, &DynamicTextFieldEditor::on_m_color_kpb_changed); + + ui->m_main_grid_layout->addWidget(m_color_kpb, 7, 1, 1, 2); +#endif +} + void DynamicTextFieldEditor::setUpConnections() { assert(m_connection_list.isEmpty()); diff --git a/sources/editor/ui/dynamictextfieldeditor.h b/sources/editor/ui/dynamictextfieldeditor.h index aa5b7b3d6..25c335c4a 100644 --- a/sources/editor/ui/dynamictextfieldeditor.h +++ b/sources/editor/ui/dynamictextfieldeditor.h @@ -21,6 +21,11 @@ #include "../elementitemeditor.h" #include "../graphicspart/partdynamictextfield.h" +#ifdef BUILD_WITHOUT_KF5 +#else +# include +#endif + namespace Ui { class DynamicTextFieldEditor; } @@ -43,6 +48,7 @@ class DynamicTextFieldEditor : public ElementItemEditor { void updateForm() override; private: + void setupWidget(); void fillInfoComboBox(); void setUpConnections(); void disconnectConnections(); @@ -68,6 +74,11 @@ class DynamicTextFieldEditor : public ElementItemEditor { QPointer m_text_field; QList m_parts; QList m_connection_list; + + #ifdef BUILD_WITHOUT_KF5 + #else + KColorButton* m_color_kpb = nullptr; + #endif }; #endif // DYNAMICTEXTFIELDEDITOR_H diff --git a/sources/editor/ui/dynamictextfieldeditor.ui b/sources/editor/ui/dynamictextfieldeditor.ui index 5a8fc1f27..4e8cfbab7 100644 --- a/sources/editor/ui/dynamictextfieldeditor.ui +++ b/sources/editor/ui/dynamictextfieldeditor.ui @@ -13,7 +13,7 @@ Form - + @@ -206,18 +206,8 @@ - - - - - - KColorButton - QPushButton -
kcolorbutton.h
-
-