diff options
author | Yoann Lopes <yoann.lopes@nokia.com> | 2009-12-11 15:41:00 (GMT) |
---|---|---|
committer | Yoann Lopes <yoann.lopes@nokia.com> | 2009-12-11 15:41:00 (GMT) |
commit | 6a1cff7c47e1f47161f765ba2f7094b55aaa13c5 (patch) | |
tree | b08e01c0242a72d0ff44d8e33e34e19074df1e7d /tests/manual/qgraphicsitemgroup/customitem.h | |
parent | 9e5c5e2c68f3aefd60571551664936465dd04913 (diff) | |
download | Qt-6a1cff7c47e1f47161f765ba2f7094b55aaa13c5.zip Qt-6a1cff7c47e1f47161f765ba2f7094b55aaa13c5.tar.gz Qt-6a1cff7c47e1f47161f765ba2f7094b55aaa13c5.tar.bz2 |
Fixes Graphicsitem transformation problems when grouping/ungrouping.
New transformation properties added in 4.6, such as rotation or
transformOriginPoint were not taken into account in addTogroup and
removeFromGroup.
Autotest and manual test included.
Task-number: QTBUG-5071
Reviewed-by: bnilsen
Diffstat (limited to 'tests/manual/qgraphicsitemgroup/customitem.h')
-rw-r--r-- | tests/manual/qgraphicsitemgroup/customitem.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/tests/manual/qgraphicsitemgroup/customitem.h b/tests/manual/qgraphicsitemgroup/customitem.h new file mode 100644 index 0000000..387c8ce --- /dev/null +++ b/tests/manual/qgraphicsitemgroup/customitem.h @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef CUSTOMITEM_H +#define CUSTOMITEM_H + +#include <QGraphicsItem> +#include <QBrush> +#include <QGraphicsScene> + +class CustomGroup : public QGraphicsItemGroup +{ +public: + CustomGroup(); + virtual ~CustomGroup() { } + +protected: + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + virtual QRectF boundingRect() const; +}; + +class CustomItem : public QGraphicsRectItem +{ +public: + CustomItem(qreal x, qreal y, qreal width, qreal height, const QBrush & brush = QBrush()); + virtual ~CustomItem() { } +}; + +class CustomScene : public QGraphicsScene +{ + Q_OBJECT +public: + CustomScene() : QGraphicsScene() { } + + QList<CustomItem*> selectedCustomItems() const; + QList<CustomGroup*> selectedCustomGroups() const; +}; + +#endif // CUSTOMITEM_H |