summaryrefslogtreecommitdiff
path: root/src/plugins/qmldesigner/components/propertyeditor/originwidget.h
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@nokia.com>2010-04-13 12:01:53 +0200
committerThomas Hartmann <Thomas.Hartmann@nokia.com>2010-04-13 12:13:11 +0200
commit41b3a9a952b7fa28f01d498658788b74ce2ca791 (patch)
treeb763ae833b8ad295a19b44a6731b1e0ea5545b45 /src/plugins/qmldesigner/components/propertyeditor/originwidget.h
parentd633ec2094c78e2b0782290c62add03f68bbd105 (diff)
downloadqt-creator-41b3a9a952b7fa28f01d498658788b74ce2ca791.tar.gz
QmlDesigner.propertyEditor: adding widget for transformOrigin
Diffstat (limited to 'src/plugins/qmldesigner/components/propertyeditor/originwidget.h')
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/originwidget.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/components/propertyeditor/originwidget.h b/src/plugins/qmldesigner/components/propertyeditor/originwidget.h
new file mode 100644
index 0000000000..14a9175f02
--- /dev/null
+++ b/src/plugins/qmldesigner/components/propertyeditor/originwidget.h
@@ -0,0 +1,78 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** Commercial Usage
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+**
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://qt.nokia.com/contact.
+**
+**************************************************************************/
+
+#ifndef ORIGINWIDGET_H
+#define ORIGINWIDGET_H
+
+#include <QtGui/QWidget>
+
+namespace QmlDesigner {
+
+class OriginWidget: public QWidget {
+
+Q_OBJECT
+
+Q_PROPERTY(QString origin READ origin WRITE setOrigin NOTIFY originChanged)
+Q_PROPERTY(bool marked READ marked WRITE setMarked)
+
+public:
+ OriginWidget(QWidget *parent = 0);
+
+ QString origin() const
+ { return m_originString; }
+
+ void setOrigin(const QString& newOrigin);
+
+ bool marked() const
+ { return m_marked; }
+
+ void setMarked(bool newMarked)
+ { m_marked = newMarked; }
+
+ static void registerDeclarativeType();
+
+signals:
+ void originChanged();
+
+protected:
+ void paintEvent(QPaintEvent *event);
+ void mouseReleaseEvent(QMouseEvent * event);
+ void mousePressEvent(QMouseEvent * event);
+ bool event(QEvent *event);
+private:
+ QString m_originString;
+ bool m_pressed;
+ int m_index;
+ bool m_marked;
+};
+
+} // QmlDesigner
+
+
+#endif //ORIGINWIDGET_H