mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
propertieseditordockwidget : remove button box. (become unused with live edit mode)
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4014 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -19,8 +19,6 @@
|
||||
#include "ui_propertieseditordockwidget.h"
|
||||
#include "propertieseditorwidget.h"
|
||||
|
||||
#include <QAbstractButton>
|
||||
|
||||
/**
|
||||
* @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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include <QDockWidget>
|
||||
|
||||
class PropertiesEditorWidget;
|
||||
class QAbstractButton;
|
||||
|
||||
namespace Ui {
|
||||
class PropertiesEditorDockWidget;
|
||||
@@ -41,12 +40,6 @@ class PropertiesEditorDockWidget : public QDockWidget
|
||||
bool addEditor (PropertiesEditorWidget *editor, int index = 0);
|
||||
QList<PropertiesEditorWidget *> 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 <PropertiesEditorWidget *> m_editor_list;
|
||||
|
||||
@@ -31,18 +31,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="m_main_vlayout">
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Apply|QDialogButtonBox::RestoreDefaults</set>
|
||||
</property>
|
||||
<property name="centerButtons">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<layout class="QVBoxLayout" name="m_main_vlayout"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
||||
Reference in New Issue
Block a user