1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
#ifndef FLAGROWOBJ_H
#define FLAGROWOBJ_H
#include <QMainWindow>
#include "mapobj.h"
#include "flagobj.h"
/*! \brief A collection of flags (FlagObj).
The flags are aligned horizontally in a row on the map.
A toolbar can be created from the flags in this row.
*/
class FlagRowObj:public MapObj {
public:
FlagRowObj ();
FlagRowObj (QGraphicsScene *);
~FlagRowObj ();
virtual void init ();
virtual void copy (FlagRowObj*);
virtual void clone(FlagRowObj*);
virtual void move (double,double);
virtual void moveBy (double,double);
virtual void setVisibility(bool);
virtual FlagObj* addFlag (FlagObj *fo); // make deep copy of FlagObj
virtual void positionBBox();
virtual void calcBBoxSize();
virtual QString getFlagName (const QPointF &p); // Find flag by position
bool isActive(const QString&);
void toggle (const QString&,bool);
void activate(const QString&);
void deactivate(const QString&);
void deactivateAll();
void deactivateGroup(FlagObj *);
void setToolBar (QToolBar *);
void setEnabled (bool);
void setShowFlags (bool);
void resetUsedCounter();
QString saveToDir (const QString &,const QString &,bool);
void setName (const QString&); // prefix for exporting flags to dir
void makeToolbar (QMainWindow*, const QString &); // Create Toolbar buttons
void updateToolbar(); // Update Toolbar buttons
private:
FlagRowObj* parentRow; // look for flags in this row
FlagObj* findFlag (const QString&);
QList <FlagObj*> flag;
QToolBar *toolbar;
QString name;
bool showFlags; // FloatObjects want to hide their flags
};
#endif
|