Dock properties editor : when selection change dock try to stay in the same tab with the new selection (if possible)

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3990 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2015-05-25 10:22:00 +00:00
parent 175029dc2d
commit db173a1c39
14 changed files with 234 additions and 47 deletions

View File

@@ -31,22 +31,15 @@
* @param parent
*/
MasterPropertiesWidget::MasterPropertiesWidget(Element *elmt, QWidget *parent) :
PropertiesEditorWidget(parent),
AbstractElementPropertiesEditorWidget(parent),
ui(new Ui::MasterPropertiesWidget),
m_element(elmt),
m_showed_element (nullptr),
m_project(nullptr)
{
if(Q_LIKELY(elmt->diagram() && elmt->diagram()->project()))
{
m_project = elmt->diagram()->project();
connect(m_project, SIGNAL(diagramRemoved(QETProject*,Diagram*)), this, SLOT(diagramWasdeletedFromProject()));
}
ui->setupUi(this);
connect(ui->free_list, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(showElementFromLWI(QListWidgetItem*)));
connect(ui->linked_list, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(showElementFromLWI(QListWidgetItem*)));
buildInterface();
setElement(elmt);
}
/**
@@ -68,6 +61,15 @@ void MasterPropertiesWidget::setElement(Element *element)
{
if (m_element == element) return;
if (m_showed_element) {m_showed_element->setHighlighted(false); m_showed_element = nullptr;}
if (m_project) disconnect(m_project, SIGNAL(diagramRemoved(QETProject*,Diagram*)), this, SLOT(diagramWasdeletedFromProject()));
if(Q_LIKELY(element->diagram() && element->diagram()->project()))
{
m_project = element->diagram()->project();
connect(m_project, SIGNAL(diagramRemoved(QETProject*,Diagram*)), this, SLOT(diagramWasdeletedFromProject()));
}
else m_project = nullptr;
m_element = element;
buildInterface();
}