Crossfire Server, Trunk
CREPrePostConditionDelegate.h
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 2022 the Crossfire Development Team
5  *
6  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7  * welcome to redistribute it under certain conditions. For details, please
8  * see COPYING and LICENSE.
9  *
10  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
11  */
12 
13 #ifndef CREPREPOSTCONDITIONDELEGATE_H
14 #define CREPREPOSTCONDITIONDELEGATE_H
15 
16 #include "CREPrePostList.h"
17 
18 class MessageManager;
19 
23 class CREPrePostSingleConditionDelegate : public QStyledItemDelegate
24 {
25 public:
33 
34  virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
35  virtual void setEditorData(QWidget* editor, const QModelIndex& index) const override;
36  virtual void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override;
37  virtual void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
38 
39 private:
42 };
43 
47 class CREPrePostConditionDelegate : public QStyledItemDelegate
48 {
49 public:
58 
59  virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
60  virtual void setEditorData(QWidget* editor, const QModelIndex& index) const override;
61  virtual void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override;
62  virtual void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
63 
64 private:
67 };
68 
69 #endif /* CREPREPOSTCONDITIONDELEGATE_H */
CREPrePostConditionDelegate::updateEditorGeometry
virtual void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Definition: CREPrePostConditionDelegate.cpp:101
CREPrePostSingleConditionDelegate::myMode
PrePostWidget::Mode myMode
Definition: CREPrePostConditionDelegate.h:40
CREPrePostList.h
CREPrePostConditionDelegate::setModelData
virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
Definition: CREPrePostConditionDelegate.cpp:90
CREPrePostConditionDelegate::CREPrePostConditionDelegate
CREPrePostConditionDelegate(QObject *parent, PrePostWidget::Mode mode, const MessageManager *manager)
Definition: CREPrePostConditionDelegate.cpp:61
CREPrePostConditionDelegate
Definition: CREPrePostConditionDelegate.h:47
CREPrePostConditionDelegate::setEditorData
virtual void setEditorData(QWidget *editor, const QModelIndex &index) const override
Definition: CREPrePostConditionDelegate.cpp:75
CREPrePostSingleConditionDelegate::CREPrePostSingleConditionDelegate
CREPrePostSingleConditionDelegate(QObject *parent, PrePostWidget::Mode mode, const MessageManager *manager)
Definition: CREPrePostConditionDelegate.cpp:18
CREPrePostSingleConditionDelegate::setModelData
virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
Definition: CREPrePostConditionDelegate.cpp:36
CREPrePostSingleConditionDelegate::setEditorData
virtual void setEditorData(QWidget *editor, const QModelIndex &index) const override
Definition: CREPrePostConditionDelegate.cpp:28
CREPrePostSingleConditionDelegate::myMessages
const MessageManager * myMessages
Definition: CREPrePostConditionDelegate.h:41
MessageManager
Definition: MessageManager.h:25
CREPrePostConditionDelegate::myMessages
const MessageManager * myMessages
Definition: CREPrePostConditionDelegate.h:66
CREPrePostConditionDelegate::myMode
PrePostWidget::Mode myMode
Definition: CREPrePostConditionDelegate.h:65
CREPrePostSingleConditionDelegate::updateEditorGeometry
virtual void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Definition: CREPrePostConditionDelegate.cpp:48
CREPrePostConditionDelegate::~CREPrePostConditionDelegate
virtual ~CREPrePostConditionDelegate()
Definition: CREPrePostConditionDelegate.cpp:66
CREPrePostConditionDelegate::createEditor
virtual QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Definition: CREPrePostConditionDelegate.cpp:70
CREPrePostSingleConditionDelegate::createEditor
virtual QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Definition: CREPrePostConditionDelegate.cpp:23
PrePostWidget::Mode
Mode
Definition: CREPrePostList.h:27
CFweardisguise.option
option
Definition: CFweardisguise.py:16
npc_dialog.index
int index
Definition: npc_dialog.py:102
manager
static AssetsManager * manager
Definition: assets.cpp:60
CREPrePostSingleConditionDelegate
Definition: CREPrePostConditionDelegate.h:23