1
/****************************************************************************
3
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4
** All rights reserved.
5
** Contact: Nokia Corporation (qt-info@nokia.com)
7
** This file is part of the Qt Components project on Qt Labs.
10
** This file contains pre-release code and may not be distributed.
11
** You may use this file in accordance with the terms and conditions contained
12
** in the Technology Preview License Agreement accompanying this package.
14
** GNU Lesser General Public License Usage
15
** Alternatively, this file may be used under the terms of the GNU Lesser
16
** General Public License version 2.1 as published by the Free Software
17
** Foundation and appearing in the file LICENSE.LGPL included in the
18
** packaging of this file. Please review the following information to
19
** ensure the GNU Lesser General Public License version 2.1 requirements
20
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
22
** If you have questions regarding the use of this file, please contact
23
** Nokia at qt-info@nokia.com.
25
****************************************************************************/
27
#ifndef QTSPLITTERBASE_H
28
#define QTSPLITTERBASE_H
30
#include <QtDeclarative>
33
class QtSplitterAttached : public QObject
36
Q_PROPERTY(qreal minimumWidth READ minimumWidth WRITE setMinimumWidth NOTIFY minimumWidthChanged)
37
Q_PROPERTY(qreal maximumWidth READ maximumWidth WRITE setMaximumWidth NOTIFY maximumWidthChanged)
38
Q_PROPERTY(qreal minimumHeight READ minimumHeight WRITE setMinimumHeight NOTIFY minimumHeightChanged)
39
Q_PROPERTY(qreal maximumHeight READ maximumHeight WRITE setMaximumHeight NOTIFY maximumHeightChanged)
40
Q_PROPERTY(qreal percentageSize READ percentageSize WRITE setPercentageSize NOTIFY percentageWidthSize)
41
Q_PROPERTY(bool expanding READ expanding WRITE setExpanding NOTIFY expandingChanged)
42
Q_PROPERTY(int itemIndex READ itemIndex WRITE setItemIndex NOTIFY itemIndexChanged)
45
explicit QtSplitterAttached(QObject *object);
47
qreal minimumWidth() const { return m_minimumWidth; }
48
void setMinimumWidth(qreal width);
50
qreal maximumWidth() const { return m_maximumWidth; }
51
void setMaximumWidth(qreal width);
53
qreal minimumHeight() const { return m_minimumHeight; }
54
void setMinimumHeight(qreal width);
56
qreal maximumHeight() const { return m_maximumHeight; }
57
void setMaximumHeight(qreal width);
59
bool expanding() const { return m_expanding; }
60
void setExpanding(bool expanding);
62
qreal percentageSize() const { return m_percentageSize; }
64
int itemIndex() const { return m_itemIndex; }
66
void setPercentageSize(qreal arg) { m_percentageSize = arg; }
67
void setItemIndex(int arg) {
68
if (m_itemIndex != arg) {
70
emit itemIndexChanged(arg);
75
void minimumWidthChanged(qreal arg);
76
void maximumWidthChanged(qreal arg);
77
void minimumHeightChanged(qreal arg);
78
void maximumHeightChanged(qreal arg);
79
void expandingChanged(bool arg);
80
void percentageWidthSize(qreal arg);
81
void itemIndexChanged(int arg);
86
qreal m_minimumHeight;
87
qreal m_maximumHeight;
88
qreal m_percentageSize;
92
friend class QtSplitterBase;
96
class QtSplitterBase : public QDeclarativeItem
100
explicit QtSplitterBase(QDeclarativeItem *parent = 0);
103
static QtSplitterAttached *qmlAttachedProperties(QObject *object);
106
QML_DECLARE_TYPEINFO(QtSplitterBase, QML_HAS_ATTACHED_PROPERTIES)
108
#endif // QTSPLITTERBASE_H