2016-12-03 14:14:06 +00:00
|
|
|
#ifndef FGCANVASGROUP_H
|
|
|
|
#define FGCANVASGROUP_H
|
|
|
|
|
|
|
|
#include "fgcanvaselement.h"
|
|
|
|
|
|
|
|
class FGCanvasGroup : public FGCanvasElement
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit FGCanvasGroup(FGCanvasGroup* pr, LocalProp* prop);
|
|
|
|
|
|
|
|
const FGCanvasElementVec& children() const;
|
|
|
|
|
|
|
|
void markChildZIndicesDirty() const;
|
|
|
|
|
|
|
|
bool hasChilden() const;
|
|
|
|
|
|
|
|
unsigned int childCount() const;
|
|
|
|
|
|
|
|
FGCanvasElement* childAt(unsigned int index) const;
|
|
|
|
|
|
|
|
unsigned int indexOfChild(const FGCanvasElement* e) const;
|
|
|
|
|
2017-01-09 16:55:03 +00:00
|
|
|
CanvasItem* createQuickItem(QQuickItem *parent) override;
|
|
|
|
CanvasItem* quickItem() const override
|
|
|
|
{ return _quick; }
|
|
|
|
|
2017-11-28 22:54:12 +00:00
|
|
|
void removeChild(FGCanvasElement* child);
|
2016-12-03 14:14:06 +00:00
|
|
|
signals:
|
|
|
|
void childAdded();
|
|
|
|
void childRemoved(int index);
|
|
|
|
|
2017-11-03 13:56:43 +00:00
|
|
|
void canvasSizeChanged();
|
2016-12-03 14:14:06 +00:00
|
|
|
protected:
|
|
|
|
virtual void doPaint(FGCanvasPaintContext* context) const override;
|
|
|
|
|
2017-11-02 17:20:42 +00:00
|
|
|
void doPolish() override;
|
|
|
|
|
2016-12-03 14:14:06 +00:00
|
|
|
bool onChildAdded(LocalProp *prop) override;
|
|
|
|
bool onChildRemoved(LocalProp *prop) override;
|
|
|
|
|
|
|
|
virtual void markStyleDirty() override;
|
2017-11-28 22:54:12 +00:00
|
|
|
|
|
|
|
void doDestroy() override;
|
2016-12-03 14:14:06 +00:00
|
|
|
private:
|
|
|
|
void markCachedSymbolDirty();
|
|
|
|
int indexOfChildWithProp(LocalProp *prop) const;
|
2017-11-03 15:31:57 +00:00
|
|
|
void resetChildQuickItemZValues();
|
2016-12-03 14:14:06 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
mutable FGCanvasElementVec _children;
|
|
|
|
mutable bool _zIndicesDirty = false;
|
|
|
|
mutable bool _cachedSymbolDirty = false;
|
2017-01-09 16:55:03 +00:00
|
|
|
|
2017-11-02 17:20:42 +00:00
|
|
|
|
2017-01-09 16:55:03 +00:00
|
|
|
CanvasItem* _quick = nullptr;
|
2016-12-03 14:14:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FGCANVASGROUP_H
|