1 #ifndef ARGUMENTSEDITOR_H
2 #define ARGUMENTSEDITOR_H
4 #include "apitracecall.h"
5 #include "ui_argumentseditor.h"
9 #include <QItemEditorFactory>
10 #include <QStandardItemModel>
20 class BooleanComboBox : public QComboBox
23 Q_PROPERTY(bool value READ value WRITE setValue USER true)
25 BooleanComboBox(QWidget *parent);
31 class BooleanComboBoxEditorCreator : public BooleanComboBox
34 Q_PROPERTY(bool value READ value WRITE setValue USER true)
36 BooleanComboBoxEditorCreator(QWidget *widget = 0) : BooleanComboBox(widget)
38 this->setFrame(false);
42 class UIntEditorCreator : public QSpinBox
45 Q_PROPERTY(int value READ value WRITE setValue USER true)
47 UIntEditorCreator(QWidget *widget = 0) : QSpinBox(widget)
49 this->setFrame(false);
50 this->setMaximum(INT_MAX);
54 class IntEditorCreator : public QSpinBox
57 Q_PROPERTY(int value READ value WRITE setValue USER true)
59 IntEditorCreator(QWidget *widget = 0) : QSpinBox(widget)
61 this->setFrame(false);
62 this->setMinimum(INT_MIN);
63 this->setMaximum(INT_MAX);
67 class ULongLongEditorCreator : public QSpinBox
70 Q_PROPERTY(int value READ value WRITE setValue USER true)
72 ULongLongEditorCreator(QWidget *widget = 0) : QSpinBox(widget)
74 this->setFrame(false);
75 this->setMaximum(INT_MAX);
79 class LongLongEditorCreator : public QSpinBox
82 Q_PROPERTY(int value READ value WRITE setValue USER true)
84 LongLongEditorCreator(QWidget *widget = 0) : QSpinBox(widget)
86 this->setFrame(false);
87 this->setMinimum(INT_MIN);
88 this->setMaximum(INT_MAX);
92 class PixmapEditorCreator : public QLabel
95 Q_PROPERTY(QString text READ text WRITE setText USER true)
97 PixmapEditorCreator(QWidget *widget = 0) : QLabel (widget)
102 class FloatEditorCreator : public QDoubleSpinBox
105 Q_PROPERTY(double value READ value WRITE setValue USER true)
107 FloatEditorCreator(QWidget *widget = 0) : QDoubleSpinBox(widget)
109 this->setFrame(false);
110 this->setMinimum(-FLT_MAX);
111 this->setMaximum(FLT_MAX);
112 this->setDecimals(8);
116 class DoubleEditorCreator : public QDoubleSpinBox
119 Q_PROPERTY(double value READ value WRITE setValue USER true)
121 DoubleEditorCreator(QWidget *widget = 0) : QDoubleSpinBox(widget)
123 this->setFrame(false);
124 this->setMinimum(-DBL_MAX);
125 this->setMaximum(DBL_MAX);
126 this->setDecimals(8);
130 class StringEditorCreator : public QTextEdit
133 Q_PROPERTY(QString plainText READ toPlainText WRITE setPlainText USER true)
135 StringEditorCreator(QWidget *widget = 0) : QTextEdit(widget)
140 class InvalidEditorCreator : public QLabel
143 Q_PROPERTY(QString text READ text WRITE setText USER true)
145 InvalidEditorCreator(QWidget *widget = 0) : QLabel(widget)
150 class ArgumentsEditor : public QDialog
154 ArgumentsEditor(QWidget *parent=0);
158 virtual void accept();
160 void setCall(ApiTraceCall *call);
161 ApiTraceCall *call() const;
164 void currentSourceChanged(int idx);
165 void sourceChanged();
170 void setupShaderEditor(const QVector<QVariant> &sources);
171 QVariant valueForName(const QString &name,
172 const QVariant &orignalValue,
173 bool *changed) const;
174 QVariant arrayFromIndex(const QModelIndex &index,
175 const ApiArray &array,
176 bool *changed) const;
177 QVariant arrayFromEditor(const ApiArray &origArray,
178 bool *changed) const;
180 Ui_ArgumentsEditor m_ui;
181 QStandardItemModel *m_model;
183 ApiTraceCall *m_call;