1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
16 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** In addition, as a special exception, Nokia gives you certain additional
26 ** rights. These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
32 **************************************************************************/
34 #ifndef QPROXYLAYOUTITEM_H
35 #define QPROXYLAYOUTITEM_H
37 #include <qdeclarative.h>
38 #include <QGraphicsLayout>
44 QT_MODULE(Declarative)
46 class QProxyLayout : public QObject, public QGraphicsLayout
49 Q_INTERFACES(QGraphicsLayout QGraphicsLayoutItem)
50 Q_PROPERTY(QGraphicsLayout *layout READ layout WRITE setLayout)
52 QProxyLayout(QObject *parent=0);
54 void setLayout(QGraphicsLayout *);
55 QGraphicsLayout *layout() const;
57 virtual void setGeometry(const QRectF &);
58 virtual int count() const;
59 virtual QGraphicsLayoutItem *itemAt(int) const;
60 virtual void removeAt(int);
61 virtual void updateGeometry();
64 virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const;
68 QGraphicsLayout *proxy;
71 class QProxyLayoutItem : public QObject, public QGraphicsLayoutItem
74 Q_INTERFACES(QGraphicsLayoutItem)
75 Q_PROPERTY(QGraphicsLayoutItem *widget READ item WRITE setItem)
77 QProxyLayoutItem(QGraphicsLayoutItem * = 0);
79 virtual void setGeometry(const QRectF &);
81 QGraphicsLayoutItem *item() const;
82 void setItem(QGraphicsLayoutItem *);
84 void setEnabled(bool);
86 static void registerDeclarativeTypes();
89 virtual QSizeF sizeHint(Qt::SizeHint, const QSizeF &) const;
94 QGraphicsLayoutItem *other;
99 QML_DECLARE_TYPE(QProxyLayout)
100 QML_DECLARE_TYPE(QProxyLayoutItem)
104 #endif // QPROXYLAYOUTITEM_H