From 3671c991e82715279791bf1ec37367cae64352a4 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 3 Feb 2015 20:53:25 -0200 Subject: Don't allow the Cylinder option be edited in PLAN / ADD mode This sets the combobox to disabled if the profile is in any mode besides PROFILE. Fixes #824 Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/modeldelegates.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp index 46103ec3f..ee7dc6cf5 100644 --- a/qt-ui/modeldelegates.cpp +++ b/qt-ui/modeldelegates.cpp @@ -87,6 +87,7 @@ struct CurrSelected { QWidget *ComboBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const { + MainWindow *m = MainWindow::instance(); QComboBox *comboDelegate = new QComboBox(parent); comboDelegate->setModel(model); comboDelegate->setEditable(true); @@ -95,6 +96,8 @@ QWidget *ComboBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewI comboDelegate->completer()->setCompletionMode(QCompleter::PopupCompletion); comboDelegate->view()->setEditTriggers(QAbstractItemView::AllEditTriggers); comboDelegate->lineEdit()->installEventFilter(const_cast(qobject_cast(this))); + if ((m->graphics()->currentState != ProfileWidget2::PROFILE)) + comboDelegate->lineEdit()->setEnabled(false); comboDelegate->view()->installEventFilter(const_cast(qobject_cast(this))); QAbstractItemView *comboPopup = comboDelegate->lineEdit()->completer()->popup(); comboPopup->setMouseTracking(true); -- cgit v1.2.3-70-g09d2