Element editor: revamped ElementScene::zItems() to fulfil the needs of ElementScene::managePrimitivesGroups()

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2029 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2013-02-08 22:05:20 +00:00
parent 1ba32a5b27
commit e78b0d5804
4 changed files with 57 additions and 28 deletions

View File

@@ -42,7 +42,17 @@ class ElementScene : public QGraphicsScene {
Q_OBJECT
// enum
public:
enum Behavior { Normal, Line, Rectangle, Circle, Ellipse, Polygon, Text, Terminal, Arc, TextField, PasteArea };
enum ItemOption {
SortByZValue = 1,
IncludeTerminals = 2,
IncludeHelperItems = 4,
Selected = 8,
NonSelected = 16,
SelectedOrNot = 24
};
Q_DECLARE_FLAGS(ItemOptions, ItemOption);
// constructors, destructor
public:
@@ -130,7 +140,7 @@ class ElementScene : public QGraphicsScene {
virtual void fromXml(const QDomDocument &, const QPointF & = QPointF(), bool = true, ElementContent * = 0);
virtual void reset();
virtual QList<CustomElementPart *> primitives() const;
virtual QList<QGraphicsItem *> zItems(bool = false) const;
virtual QList<QGraphicsItem *> zItems(ItemOptions options = ItemOptions(SortByZValue | IncludeTerminals | SelectedOrNot)) const;
virtual ElementContent selectedContent() const;
virtual void getPasteArea(const QRectF &);
QRectF borderRect() const;
@@ -209,6 +219,8 @@ class ElementScene : public QGraphicsScene {
void pasteAreaDefined(const QRectF &);
};
Q_DECLARE_OPERATORS_FOR_FLAGS(ElementScene::ItemOptions)
/**
@param wid the new width for the currently edited element
*/