diff --git a/sources/PropertiesEditor/propertieseditordockwidget.cpp b/sources/PropertiesEditor/propertieseditordockwidget.cpp index e20d7ced2..8a407f5fd 100644 --- a/sources/PropertiesEditor/propertieseditordockwidget.cpp +++ b/sources/PropertiesEditor/propertieseditordockwidget.cpp @@ -19,8 +19,6 @@ #include "ui_propertieseditordockwidget.h" #include "propertieseditorwidget.h" -#include - /** * @brief PropertiesEditorDockWidget::PropertiesEditorDockWidget * Constructor @@ -31,9 +29,6 @@ PropertiesEditorDockWidget::PropertiesEditorDockWidget(QWidget *parent) : ui(new Ui::PropertiesEditorDockWidget) { ui->setupUi(this); - ui->m_main_vlayout->setAlignment(ui->buttonBox, Qt::AlignBottom); - ui->buttonBox->setDisabled(true); - ui->buttonBox->setVisible (false); } /** @@ -61,8 +56,6 @@ void PropertiesEditorDockWidget::clear() } m_editor_list.clear(); - - ui->buttonBox->setDisabled(true); } /** @@ -101,7 +94,6 @@ bool PropertiesEditorDockWidget::addEditor(PropertiesEditorWidget *editor, int i ui -> m_main_vlayout -> insertWidget(index, editor); m_editor_list << editor; - setEnabledButtonBox(true); return true; } @@ -126,44 +118,5 @@ bool PropertiesEditorDockWidget::removeEditor(PropertiesEditorWidget *editor) if (result) ui -> m_main_vlayout -> removeWidget(editor); - if (m_editor_list.isEmpty()) - setDisabledButtonBox(true); return result; } - -/** - * @brief PropertiesEditorDockWidget::setDisabledButtonBox - * Disabled the button box at bottom of dock - * @param b - */ -void PropertiesEditorDockWidget::setDisabledButtonBox(bool b) { - ui -> buttonBox -> setDisabled(b); -} - -/** - * @brief PropertiesEditorDockWidget::setEnabledButtonBox - * Enabled button box at bottom of dock - * @param b - */ -void PropertiesEditorDockWidget::setEnabledButtonBox(bool b) { - ui -> buttonBox -> setEnabled(b); -} - -/** - * @brief PropertiesEditorDockWidget::on_buttonBox_clicked - * Action when button box button is clciked. - * If button is ApplyRole : call the apply() method - * If button is ResetRole : call the reset() method - * @param button - */ -void PropertiesEditorDockWidget::on_buttonBox_clicked(QAbstractButton *button) -{ - int answer = ui->buttonBox->buttonRole(button); - - switch (answer) - { - case QDialogButtonBox::ApplyRole: apply(); break; - case QDialogButtonBox::ResetRole: reset(); break; - default: break; - } -} diff --git a/sources/PropertiesEditor/propertieseditordockwidget.h b/sources/PropertiesEditor/propertieseditordockwidget.h index c3f8bd8a0..ea29b23c3 100644 --- a/sources/PropertiesEditor/propertieseditordockwidget.h +++ b/sources/PropertiesEditor/propertieseditordockwidget.h @@ -21,7 +21,6 @@ #include class PropertiesEditorWidget; -class QAbstractButton; namespace Ui { class PropertiesEditorDockWidget; @@ -41,12 +40,6 @@ class PropertiesEditorDockWidget : public QDockWidget bool addEditor (PropertiesEditorWidget *editor, int index = 0); QList editors() const; bool removeEditor (PropertiesEditorWidget *editor); - void setDisabledButtonBox(bool b = true); - void setEnabledButtonBox (bool b = true); - - - private slots: - void on_buttonBox_clicked(QAbstractButton *button); protected: QList m_editor_list; diff --git a/sources/PropertiesEditor/propertieseditordockwidget.ui b/sources/PropertiesEditor/propertieseditordockwidget.ui index 1eaf839ab..24d32f7c0 100644 --- a/sources/PropertiesEditor/propertieseditordockwidget.ui +++ b/sources/PropertiesEditor/propertieseditordockwidget.ui @@ -31,18 +31,7 @@ 0 - - - - - QDialogButtonBox::Apply|QDialogButtonBox::RestoreDefaults - - - false - - - - +