summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/webgl/qwebglfunctioncall.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/webgl/qwebglfunctioncall.h')
-rw-r--r--src/plugins/platforms/webgl/qwebglfunctioncall.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/plugins/platforms/webgl/qwebglfunctioncall.h b/src/plugins/platforms/webgl/qwebglfunctioncall.h
index 947f583..8d24d80 100644
--- a/src/plugins/platforms/webgl/qwebglfunctioncall.h
+++ b/src/plugins/platforms/webgl/qwebglfunctioncall.h
@@ -34,6 +34,8 @@
#include <QtCore/qscopedpointer.h>
#include <QtCore/qvariant.h>
+#include <tuple>
+
QT_BEGIN_NAMESPACE
class QByteArray;
@@ -64,8 +66,36 @@ public:
void addData(const QByteArray &data);
void addNull();
+ void add(const QString &value) { addString(value); }
+ void add(const char *value) { addString(QString::fromLatin1(value)); }
+ void add(int value) { addInt(value); }
+ void add(uint value) { addUInt(value); }
+ void add(float value) { addFloat(value); }
+ void add(const QByteArray &data) { addData(data); }
+ void add(std::nullptr_t) { addNull(); }
+
+ template<class...Ts>
+ void addParameters(Ts&&... arguments)
+ {
+ addImpl(arguments...);
+ }
+
QVariantList parameters() const;
+protected:
+ template<typename T>
+ void addImpl(T first)
+ {
+ add(first);
+ }
+
+ template<typename T, typename... Ts>
+ void addImpl(T first, Ts... rest)
+ {
+ add(first);
+ addImpl(rest...);
+ }
+
private:
Q_DISABLE_COPY(QWebGLFunctionCall)
Q_DECLARE_PRIVATE(QWebGLFunctionCall)