tests/manual/qgraphicsitemgroup/widget.h
changeset 3 41300fa6a67c
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the test suite of the Qt Toolkit.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    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
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #ifndef WIDGET_H
       
    43 #define WIDGET_H
       
    44 
       
    45 #include "customitem.h"
       
    46 
       
    47 #include <QWidget>
       
    48 #include <QGraphicsItemGroup>
       
    49 #include <QPainter>
       
    50 
       
    51 namespace Ui {
       
    52     class Widget;
       
    53 }
       
    54 
       
    55 class QGraphicsOpacityEffect;
       
    56 class QPropertyAnimation;
       
    57 
       
    58 class Widget : public QWidget
       
    59 {
       
    60     Q_OBJECT
       
    61 public:
       
    62     Widget(QWidget *parent = 0);
       
    63     ~Widget();
       
    64 
       
    65 protected Q_SLOTS:
       
    66     void on_rotate_valueChanged(int value);
       
    67     void on_scale_valueChanged(int value);
       
    68     void on_rotateItem_valueChanged(int value);
       
    69     void on_scaleItem_valueChanged(int value);
       
    70     void on_group_clicked();
       
    71     void on_dismantle_clicked();
       
    72     void on_merge_clicked();
       
    73     void onSceneSelectionChanged();
       
    74     void on_ungroup_clicked();
       
    75     void on_buttonGroup_buttonClicked();
       
    76 
       
    77 private:
       
    78     void updateUngroupButton();
       
    79     CustomItem * checkedItem() const;
       
    80 
       
    81     Ui::Widget *ui;
       
    82     CustomScene *scene;
       
    83     CustomItem *rectBlue;
       
    84     CustomItem *rectRed;
       
    85     CustomItem *rectGreen;
       
    86     CustomItem *rectYellow;
       
    87     QGraphicsOpacityEffect* effect;
       
    88     QPropertyAnimation *fadeIn;
       
    89     QPropertyAnimation *fadeOut;
       
    90     int previousSelectionCount;
       
    91 };
       
    92 
       
    93 #endif // WIDGET_H