1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

Scientific and Categorized modes disconnect the "currentChanged" signal.

Reconnected the signals after configuring Scientific or Categorized notation.

Used "UniqueConnection" to avoid signal's triggering the same slot multiple times unintentionally.
This commit is contained in:
Glenn Campigli 2013-06-24 21:29:06 +10:00
parent bbf501ea54
commit a3a382cc35

View File

@ -56,7 +56,7 @@ UAVObjectBrowserWidget::UAVObjectBrowserWidget(QWidget *parent) : QWidget(parent
m_browser->treeView->setEditTriggers(QAbstractItemView::AllEditTriggers);
m_browser->treeView->setSelectionBehavior(QAbstractItemView::SelectItems);
showMetaData(m_viewoptions->cbMetaData->isChecked());
connect(m_browser->treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(currentChanged(QModelIndex, QModelIndex)));
connect(m_browser->treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(currentChanged(QModelIndex, QModelIndex)), Qt::UniqueConnection);
connect(m_viewoptions->cbMetaData, SIGNAL(toggled(bool)), this, SLOT(showMetaData(bool)));
connect(m_viewoptions->cbCategorized, SIGNAL(toggled(bool)), this, SLOT(categorize(bool)));
connect(m_browser->saveSDButton, SIGNAL(clicked()), this, SLOT(saveObject()));
@ -108,6 +108,7 @@ void UAVObjectBrowserWidget::categorize(bool categorize)
m_model->setOnlyHilightChangedValues(m_onlyHilightChangedValues);
m_browser->treeView->setModel(m_model);
showMetaData(m_viewoptions->cbMetaData->isChecked());
connect(m_browser->treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(currentChanged(QModelIndex, QModelIndex)), Qt::UniqueConnection);
delete tmpModel;
}
@ -127,6 +128,7 @@ void UAVObjectBrowserWidget::useScientificNotation(bool scientific)
m_model->setRecentlyUpdatedTimeout(m_recentlyUpdatedTimeout);
m_browser->treeView->setModel(m_model);
showMetaData(m_viewoptions->cbMetaData->isChecked());
connect(m_browser->treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(currentChanged(QModelIndex, QModelIndex)), Qt::UniqueConnection);
delete tmpModel;
}