X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=gui%2Fargumentseditor.h;h=73cd45803cb3036689865e704804625232eafbad;hb=0ae84f58eee1c239d5bc2cc148a1d007b328d2e1;hp=e6b3d8fd65f01043ad5072787d0a622a18a90d44;hpb=661842de4c97a5d1660b7148022fdbd6fd473827;p=apitrace diff --git a/gui/argumentseditor.h b/gui/argumentseditor.h index e6b3d8f..73cd458 100644 --- a/gui/argumentseditor.h +++ b/gui/argumentseditor.h @@ -8,6 +8,12 @@ #include #include #include +#include +#include + +#include +#include + class ApiTraceCall; @@ -21,12 +27,124 @@ public: bool value() const; }; -class ArgumentsItemEditorFactory : public QItemEditorFactory + +class BooleanComboBoxEditorCreator : public BooleanComboBox +{ + Q_OBJECT + Q_PROPERTY(bool value READ value WRITE setValue USER true) +public: + BooleanComboBoxEditorCreator(QWidget *widget = 0) : BooleanComboBox(widget) + { + this->setFrame(false); + }; +}; + +class UIntEditorCreator : public QSpinBox +{ + Q_OBJECT + Q_PROPERTY(int value READ value WRITE setValue USER true) +public: + UIntEditorCreator(QWidget *widget = 0) : QSpinBox(widget) + { + this->setFrame(false); + this->setMaximum(INT_MAX); + }; +}; + +class IntEditorCreator : public QSpinBox +{ + Q_OBJECT + Q_PROPERTY(int value READ value WRITE setValue USER true) +public: + IntEditorCreator(QWidget *widget = 0) : QSpinBox(widget) + { + this->setFrame(false); + this->setMinimum(INT_MIN); + this->setMaximum(INT_MAX); + }; +}; + +class ULongLongEditorCreator : public QSpinBox +{ + Q_OBJECT + Q_PROPERTY(int value READ value WRITE setValue USER true) +public: + ULongLongEditorCreator(QWidget *widget = 0) : QSpinBox(widget) + { + this->setFrame(false); + this->setMaximum(INT_MAX); + }; +}; + +class LongLongEditorCreator : public QSpinBox +{ + Q_OBJECT + Q_PROPERTY(int value READ value WRITE setValue USER true) +public: + LongLongEditorCreator(QWidget *widget = 0) : QSpinBox(widget) + { + this->setFrame(false); + this->setMinimum(INT_MIN); + this->setMaximum(INT_MAX); + }; +}; + +class PixmapEditorCreator : public QLabel { + Q_OBJECT + Q_PROPERTY(QString text READ text WRITE setText USER true) +public: + PixmapEditorCreator(QWidget *widget = 0) : QLabel (widget) + { + }; +}; + +class FloatEditorCreator : public QDoubleSpinBox +{ + Q_OBJECT + Q_PROPERTY(double value READ value WRITE setValue USER true) +public: + FloatEditorCreator(QWidget *widget = 0) : QDoubleSpinBox(widget) + { + this->setFrame(false); + this->setMinimum(-FLT_MAX); + this->setMaximum(FLT_MAX); + this->setDecimals(8); + }; +}; + +class DoubleEditorCreator : public QDoubleSpinBox +{ + Q_OBJECT + Q_PROPERTY(double value READ value WRITE setValue USER true) +public: + DoubleEditorCreator(QWidget *widget = 0) : QDoubleSpinBox(widget) + { + this->setFrame(false); + this->setMinimum(-DBL_MAX); + this->setMaximum(DBL_MAX); + this->setDecimals(8); + }; +}; + +class StringEditorCreator : public QTextEdit +{ + Q_OBJECT + Q_PROPERTY(QString plainText READ toPlainText WRITE setPlainText USER true) +public: + StringEditorCreator(QWidget *widget = 0) : QTextEdit(widget) + { + }; +}; + +class InvalidEditorCreator : public QLabel +{ + Q_OBJECT + Q_PROPERTY(QString text READ text WRITE setText USER true) public: - ArgumentsItemEditorFactory(); - QWidget *createEditor(QVariant::Type type, QWidget *parent) const; - QByteArray valuePropertyName(QVariant::Type) const; + InvalidEditorCreator(QWidget *widget = 0) : QLabel(widget) + { + }; }; class ArgumentsEditor : public QDialog @@ -49,7 +167,7 @@ private slots: private: void init(); void setupCall(); - void setupShaderEditor(const QList &sources); + void setupShaderEditor(const QVector &sources); QVariant valueForName(const QString &name, const QVariant &orignalValue, bool *changed) const;