]> git.cworth.org Git - apitrace/blob - gui/argumentseditor.h
Make the editor a dialog.
[apitrace] / gui / argumentseditor.h
1 #ifndef ARGUMENTSEDITOR_H
2 #define ARGUMENTSEDITOR_H
3
4 #include "ui_argumentseditor.h"
5 #include <QComboBox>
6 #include <QDialog>
7 #include <QItemEditorFactory>
8 #include <QStandardItemModel>
9
10 class ApiTraceCall;
11
12 class BooleanComboBox : public QComboBox
13 {
14     Q_OBJECT
15     Q_PROPERTY(bool value READ value WRITE setValue USER true)
16 public:
17     BooleanComboBox(QWidget *parent);
18     void setValue(bool);
19     bool value() const;
20 };
21
22 class ArgumentsItemEditorFactory : public QItemEditorFactory
23 {
24 public:
25     ArgumentsItemEditorFactory();
26     QWidget *createEditor(QVariant::Type type, QWidget *parent) const;
27     QByteArray valuePropertyName(QVariant::Type) const;
28 };
29
30 class ArgumentsEditor : public QDialog
31 {
32     Q_OBJECT
33 public:
34     ArgumentsEditor(QWidget *parent=0);
35     ~ArgumentsEditor();
36
37
38     void setCall(ApiTraceCall *call);
39     ApiTraceCall *call() const;
40
41 private slots:
42     void currentSourceChanged(int idx);
43     void sourceChanged();
44 private:
45     void init();
46     void setupCall();
47     void setupShaderEditor(const QList<QVariant> &sources);
48 private:
49     Ui_ArgumentsEditor m_ui;
50     QStandardItemModel *m_model;
51
52     ApiTraceCall *m_call;
53 };
54
55 #endif