equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
4 * |
9 * Initial Contributors: |
5 * This program is free software: you can redistribute it and/or modify |
10 * Nokia Corporation - initial contribution. |
6 * it under the terms of the GNU Lesser General Public License as published by |
|
7 * the Free Software Foundation, version 2.1 of the License. |
11 * |
8 * |
12 * Contributors: |
9 * This program is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU Lesser General Public License for more details. |
13 * |
13 * |
14 * Description: |
14 * You should have received a copy of the GNU Lesser General Public License |
|
15 * along with this program. If not, |
|
16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". |
|
17 * |
|
18 * Description: |
15 * |
19 * |
16 */ |
20 */ |
17 |
|
18 |
|
19 #ifndef __gva_slidingwidget_h__ |
21 #ifndef __gva_slidingwidget_h__ |
20 #define __gva_slidingwidget_h__ |
22 #define __gva_slidingwidget_h__ |
21 |
23 |
22 #include <QtGui> |
24 #include <QtGui> |
23 |
25 |
30 public: |
32 public: |
31 SlidingWidget(QGraphicsItem* parent = 0); |
33 SlidingWidget(QGraphicsItem* parent = 0); |
32 virtual ~SlidingWidget(); |
34 virtual ~SlidingWidget(); |
33 void setWindow(QGraphicsWidget* window); |
35 void setWindow(QGraphicsWidget* window); |
34 qreal slide(qreal delta); |
36 qreal slide(qreal delta); |
|
37 qreal shrink(qreal delta); |
|
38 void setShrinkMax(qreal value) {m_shrinkMax = value;} |
35 void attachItem(QGraphicsWidget * item); |
39 void attachItem(QGraphicsWidget * item); |
36 void detachItem(QGraphicsWidget * item); |
40 void detachItem(QGraphicsWidget * item); |
37 protected: |
41 protected: |
38 virtual void resizeEvent(QGraphicsSceneResizeEvent *ev); |
42 virtual void resizeEvent(QGraphicsSceneResizeEvent *ev); |
39 private: |
43 private: |
41 QGraphicsWidget *m_window; |
45 QGraphicsWidget *m_window; |
42 QGraphicsWidget *m_bottom; |
46 QGraphicsWidget *m_bottom; |
43 QGraphicsAnchorLayout *m_layout; |
47 QGraphicsAnchorLayout *m_layout; |
44 qreal m_slidePos; |
48 qreal m_slidePos; |
45 qreal m_slideMax; |
49 qreal m_slideMax; |
|
50 qreal m_shrinked; |
|
51 qreal m_shrinkMax; |
|
52 QSizeF m_windowSize; |
46 }; |
53 }; |
47 |
54 |
48 } // end of namespace GVA |
55 } // end of namespace GVA |
49 |
56 |
50 #endif |
57 #endif |
|
58 |