1
0
Fork 0
flightgear/utils/fgqcanvas/fgcanvasgroup.h
James Turner bd5a266e9f Qt-based remote canvas application.
Work-in-progress, currently performance is sub-optimal (software
rendering via QPainter API).
2016-12-17 14:24:28 +00:00

49 lines
1.2 KiB
C++

#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;
signals:
void childAdded();
void childRemoved(int index);
protected:
virtual void doPaint(FGCanvasPaintContext* context) const override;
bool onChildAdded(LocalProp *prop) override;
bool onChildRemoved(LocalProp *prop) override;
virtual void markStyleDirty() override;
private:
void markClipDirty();
void markCachedSymbolDirty();
int indexOfChildWithProp(LocalProp *prop) const;
private:
mutable FGCanvasElementVec _children;
mutable bool _clipDirty = true;
mutable bool _hasClip = false;
mutable QRectF _clipRect;
mutable bool _zIndicesDirty = false;
mutable bool _cachedSymbolDirty = false;
};
#endif // FGCANVASGROUP_H