summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop-widgets/modeldelegates.cpp9
-rw-r--r--desktop-widgets/modeldelegates.h8
2 files changed, 8 insertions, 9 deletions
diff --git a/desktop-widgets/modeldelegates.cpp b/desktop-widgets/modeldelegates.cpp
index f03008324..417ae2cdb 100644
--- a/desktop-widgets/modeldelegates.cpp
+++ b/desktop-widgets/modeldelegates.cpp
@@ -38,7 +38,6 @@ QSize DiveListDelegate::sizeHint(const QStyleOptionViewItem&, const QModelIndex&
// Gets the index of the model in the currentRow and column.
// currCombo is defined below.
#define IDX(_XX) mymodel->index(currCombo.currRow, (_XX))
-static bool keyboardFinished = false;
StarWidgetsDelegate::StarWidgetsDelegate(QWidget *parent) : QStyledItemDelegate(parent),
parentWidget(parent)
@@ -101,14 +100,6 @@ void ComboBoxDelegate::setEditorData(QWidget *editor, const QModelIndex &index)
c->lineEdit()->setSelection(0, c->lineEdit()->text().length());
}
-static struct CurrSelected {
- QComboBox *comboEditor;
- int currRow;
- QString activeText;
- QAbstractItemModel *model;
- bool ignoreSelection;
-} currCombo;
-
QWidget *ComboBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem&, const QModelIndex &index) const
{
QComboBox *comboDelegate = new QComboBox(parent);
diff --git a/desktop-widgets/modeldelegates.h b/desktop-widgets/modeldelegates.h
index d539c0384..1b4c525d0 100644
--- a/desktop-widgets/modeldelegates.h
+++ b/desktop-widgets/modeldelegates.h
@@ -48,8 +48,16 @@ slots:
virtual void editorClosed(QWidget *widget, QAbstractItemDelegate::EndEditHint hint) = 0;
private:
bool editable;
+ mutable bool keyboardFinished;
protected:
QAbstractItemModel *model;
+ mutable struct CurrSelected {
+ QComboBox *comboEditor;
+ int currRow;
+ QString activeText;
+ QAbstractItemModel *model;
+ bool ignoreSelection;
+ } currCombo;
};
class TankInfoDelegate : public ComboBoxDelegate {