1 #ifndef ARGUMENTSEDITOR_H
2 #define ARGUMENTSEDITOR_H
4 #include "apitracecall.h"
5 #include "ui_argumentseditor.h"
9 #include <QItemEditorFactory>
10 #include <QStandardItemModel>
19 class BooleanComboBox : public QComboBox
22 Q_PROPERTY(bool value READ value WRITE setValue USER true)
24 BooleanComboBox(QWidget *parent);
30 class BooleanComboBoxEditorCreator : public BooleanComboBox
33 Q_PROPERTY(bool value READ value WRITE setValue USER true)
35 BooleanComboBoxEditorCreator(QWidget *widget = 0) : BooleanComboBox(widget)
37 this->setFrame(false);
41 class UIntEditorCreator : public QSpinBox
44 Q_PROPERTY(int value READ value WRITE setValue USER true)
46 UIntEditorCreator(QWidget *widget = 0) : QSpinBox(widget)
48 this->setFrame(false);
49 this->setMaximum(INT_MAX);
53 class IntEditorCreator : public QSpinBox
56 Q_PROPERTY(int value READ value WRITE setValue USER true)
58 IntEditorCreator(QWidget *widget = 0) : QSpinBox(widget)
60 this->setFrame(false);
61 this->setMinimum(INT_MIN);
62 this->setMaximum(INT_MAX);
66 class ULongLongEditorCreator : public QSpinBox
69 Q_PROPERTY(int value READ value WRITE setValue USER true)
71 ULongLongEditorCreator(QWidget *widget = 0) : QSpinBox(widget)
73 this->setFrame(false);
74 this->setMaximum(INT_MAX);
78 class LongLongEditorCreator : public QSpinBox
81 Q_PROPERTY(int value READ value WRITE setValue USER true)
83 LongLongEditorCreator(QWidget *widget = 0) : QSpinBox(widget)
85 this->setFrame(false);
86 this->setMinimum(INT_MIN);
87 this->setMaximum(INT_MAX);
91 class PixmapEditorCreator : public QLabel
94 Q_PROPERTY(QString text READ text WRITE setText USER true)
96 PixmapEditorCreator(QWidget *widget = 0) : QLabel (widget)
101 class FloatEditorCreator : public QDoubleSpinBox
104 Q_PROPERTY(double value READ value WRITE setValue USER true)
106 FloatEditorCreator(QWidget *widget = 0) : QDoubleSpinBox(widget)
108 this->setFrame(false);
109 this->setMinimum(-FLT_MAX);
110 this->setMaximum(FLT_MAX);
111 this->setDecimals(8);
115 class DoubleEditorCreator : public QDoubleSpinBox
118 Q_PROPERTY(double value READ value WRITE setValue USER true)
120 DoubleEditorCreator(QWidget *widget = 0) : QDoubleSpinBox(widget)
122 this->setFrame(false);
123 this->setMinimum(-DBL_MAX);
124 this->setMaximum(DBL_MAX);
125 this->setDecimals(8);
129 class InvalidEditorCreator : public QLabel
132 Q_PROPERTY(QString text READ text WRITE setText USER true)
134 InvalidEditorCreator(QWidget *widget = 0) : QLabel(widget)
139 class ArgumentsEditor : public QDialog
143 ArgumentsEditor(QWidget *parent=0);
147 virtual void accept();
149 void setCall(ApiTraceCall *call);
150 ApiTraceCall *call() const;
153 void currentSourceChanged(int idx);
154 void sourceChanged();
159 void setupShaderEditor(const QVector<QVariant> &sources);
160 QVariant valueForName(const QString &name,
161 const QVariant &orignalValue,
162 bool *changed) const;
163 QVariant arrayFromIndex(const QModelIndex &index,
164 const ApiArray &array,
165 bool *changed) const;
166 QVariant arrayFromEditor(const ApiArray &origArray,
167 bool *changed) const;
169 Ui_ArgumentsEditor m_ui;
170 QStandardItemModel *m_model;
172 ApiTraceCall *m_call;