mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 22:00:35 +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 "ui_propertieseditordockwidget.h"
|
||||||
#include "propertieseditorwidget.h"
|
#include "propertieseditorwidget.h"
|
||||||
|
|
||||||
#include <QAbstractButton>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief PropertiesEditorDockWidget::PropertiesEditorDockWidget
|
* @brief PropertiesEditorDockWidget::PropertiesEditorDockWidget
|
||||||
* Constructor
|
* Constructor
|
||||||
@@ -31,9 +29,6 @@ PropertiesEditorDockWidget::PropertiesEditorDockWidget(QWidget *parent) :
|
|||||||
ui(new Ui::PropertiesEditorDockWidget)
|
ui(new Ui::PropertiesEditorDockWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
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();
|
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);
|
ui -> m_main_vlayout -> insertWidget(index, editor);
|
||||||
m_editor_list << editor;
|
m_editor_list << editor;
|
||||||
setEnabledButtonBox(true);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,44 +118,5 @@ bool PropertiesEditorDockWidget::removeEditor(PropertiesEditorWidget *editor)
|
|||||||
if (result)
|
if (result)
|
||||||
ui -> m_main_vlayout -> removeWidget(editor);
|
ui -> m_main_vlayout -> removeWidget(editor);
|
||||||
|
|
||||||
if (m_editor_list.isEmpty())
|
|
||||||
setDisabledButtonBox(true);
|
|
||||||
return result;
|
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>
|
#include <QDockWidget>
|
||||||
|
|
||||||
class PropertiesEditorWidget;
|
class PropertiesEditorWidget;
|
||||||
class QAbstractButton;
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class PropertiesEditorDockWidget;
|
class PropertiesEditorDockWidget;
|
||||||
@@ -41,12 +40,6 @@ class PropertiesEditorDockWidget : public QDockWidget
|
|||||||
bool addEditor (PropertiesEditorWidget *editor, int index = 0);
|
bool addEditor (PropertiesEditorWidget *editor, int index = 0);
|
||||||
QList<PropertiesEditorWidget *> editors() const;
|
QList<PropertiesEditorWidget *> editors() const;
|
||||||
bool removeEditor (PropertiesEditorWidget *editor);
|
bool removeEditor (PropertiesEditorWidget *editor);
|
||||||
void setDisabledButtonBox(bool b = true);
|
|
||||||
void setEnabledButtonBox (bool b = true);
|
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void on_buttonBox_clicked(QAbstractButton *button);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QList <PropertiesEditorWidget *> m_editor_list;
|
QList <PropertiesEditorWidget *> m_editor_list;
|
||||||
|
|||||||
@@ -31,18 +31,7 @@
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="m_main_vlayout">
|
<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>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
Reference in New Issue
Block a user