Changeset 99351b7 in subsurface for desktop-widgets/modeldelegates.h


Ignore:
Timestamp:
Mar 26, 2017, 9:53:57 PM (9 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
0b59954
Parents:
cdcbeea5
git-author:
Robert C. Helling <helling@…> (03/26/17 14:47:21)
git-committer:
Dirk Hohndel <dirk@…> (03/26/17 21:53:57)
Message:

Allow cylinder names to be edited

The same ComboBoxDelegate? is used for picking a cylinder model
and picking a gas in the planner waypoint table. In the former
case we want to allow the user to edit the string in the second
we don't.

The difference is not if we are in the planner but which use of
the class. So add a bool allowEdit to the constructor.

Fixes #272

Signed-off-by: Robert C. Helling <helling@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • desktop-widgets/modeldelegates.h

    rf0bd39c r99351b7  
    3131        Q_OBJECT
    3232public:
    33         explicit ComboBoxDelegate(QAbstractItemModel *model, QObject *parent = 0);
     33        explicit ComboBoxDelegate(QAbstractItemModel *model, QObject *parent = 0, bool allowEdit = true);
    3434        virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
    3535        virtual void setEditorData(QWidget *editor, const QModelIndex &index) const;
     
    4444        void fixTabBehavior();
    4545        virtual void revertModelData(QWidget *widget, QAbstractItemDelegate::EndEditHint hint) = 0;
    46 
     46private:
     47        bool editable;
    4748protected:
    4849        QAbstractItemModel *model;
Note: See TracChangeset for help on using the changeset viewer.