From a3a382cc355077903d902d36e0b0ba89467fa820 Mon Sep 17 00:00:00 2001 From: Glenn Campigli Date: Mon, 24 Jun 2013 21:29:06 +1000 Subject: [PATCH] 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. --- .../src/plugins/uavobjectbrowser/uavobjectbrowserwidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjectbrowserwidget.cpp b/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjectbrowserwidget.cpp index 9ada2e9fa..178499c14 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjectbrowserwidget.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjectbrowserwidget.cpp @@ -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; }