summaryrefslogtreecommitdiffstats
path: root/tools/designer/src/lib/sdk/abstractintegration.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2010-08-23 14:55:39 +0200
committerFriedemann Kleint <Friedemann.Kleint@nokia.com>2010-08-23 14:55:39 +0200
commit00e954ca817f89958a8a8777d93d3843252dc88c (patch)
tree1e270f03368f967e8cb90b26bb44068009f79936 /tools/designer/src/lib/sdk/abstractintegration.cpp
parent6fc62c47739cedb5f3bc8de3004f68b62de991f2 (diff)
Qt Designer/Integrations: Add properties for use by C++-IDEs.
...such as the header suffix (like ".h") or whether headers should be lowercase only. Allows for using different suffixes and conventions like 'CamelCase.hxx", etc. Reviewed-by: Jarek Kobus <jaroslaw.kobus@nokia.com> API-reviewed-by: Kai Koehne <kai.koehne@nokia.com> Task-number: QTCREATORBUG-163
Diffstat (limited to 'tools/designer/src/lib/sdk/abstractintegration.cpp')
-rw-r--r--tools/designer/src/lib/sdk/abstractintegration.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/tools/designer/src/lib/sdk/abstractintegration.cpp b/tools/designer/src/lib/sdk/abstractintegration.cpp
index c5a60db0e0..e8b0005310 100644
--- a/tools/designer/src/lib/sdk/abstractintegration.cpp
+++ b/tools/designer/src/lib/sdk/abstractintegration.cpp
@@ -42,13 +42,62 @@
#include "abstractintegration.h"
#include "abstractformeditor.h"
+#include <QtCore/QVariant>
+#include <QtCore/QSharedPointer>
+
QT_BEGIN_NAMESPACE
+// Add 'private' struct as a dynamic property.
+
+static const char privatePropertyC[] = "_q_integrationprivate";
+
+struct QDesignerIntegrationInterfacePrivate {
+ QDesignerIntegrationInterfacePrivate() :
+ headerSuffix(QLatin1String(".h")),
+ headerLowercase(true) {}
+
+ QString headerSuffix;
+ bool headerLowercase;
+};
+
+typedef QSharedPointer<QDesignerIntegrationInterfacePrivate> QDesignerIntegrationInterfacePrivatePtr;
+
+Q_DECLARE_METATYPE(QDesignerIntegrationInterfacePrivatePtr)
+
+static QDesignerIntegrationInterfacePrivatePtr integrationD(const QObject *o)
+{
+ const QVariant property = o->property(privatePropertyC);
+ Q_ASSERT(qVariantCanConvert<QDesignerIntegrationInterfacePrivatePtr>(property));
+ return qvariant_cast<QDesignerIntegrationInterfacePrivatePtr>(property);
+}
+
QDesignerIntegrationInterface::QDesignerIntegrationInterface(QDesignerFormEditorInterface *core, QObject *parent)
: QObject(parent),
m_core(core)
{
core->setIntegration(this);
+ const QDesignerIntegrationInterfacePrivatePtr d(new QDesignerIntegrationInterfacePrivate);
+ setProperty(privatePropertyC, qVariantFromValue<QDesignerIntegrationInterfacePrivatePtr>(d));
+}
+
+QString QDesignerIntegrationInterface::headerSuffix() const
+{
+ return integrationD(this)->headerSuffix;
+}
+
+void QDesignerIntegrationInterface::setHeaderSuffix(const QString &headerSuffix)
+{
+ integrationD(this)->headerSuffix = headerSuffix;
+}
+
+bool QDesignerIntegrationInterface::isHeaderLowercase() const
+{
+ return integrationD(this)->headerLowercase;
+}
+
+void QDesignerIntegrationInterface::setHeaderLowercase(bool headerLowercase)
+{
+ integrationD(this)->headerLowercase = headerLowercase;
}
QT_END_NAMESPACE