mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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 <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
636376f591
commit
3671c991e8
1 changed files with 3 additions and 0 deletions
|
@ -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 *>(qobject_cast<const QObject *>(this)));
|
||||
if ((m->graphics()->currentState != ProfileWidget2::PROFILE))
|
||||
comboDelegate->lineEdit()->setEnabled(false);
|
||||
comboDelegate->view()->installEventFilter(const_cast<QObject *>(qobject_cast<const QObject *>(this)));
|
||||
QAbstractItemView *comboPopup = comboDelegate->lineEdit()->completer()->popup();
|
||||
comboPopup->setMouseTracking(true);
|
||||
|
|
Loading…
Add table
Reference in a new issue