Changeset 15 in flair-src for trunk/tools/FlairGCS/src/XmlWidget.h
- Timestamp:
- 04/08/16 15:40:57 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/FlairGCS/src/XmlWidget.h
r10 r15 14 14 class ConnectionLayout; 15 15 16 class XmlWidget:public QObject 17 { 18 Q_OBJECT 16 class XmlWidget : public QObject { 17 Q_OBJECT 19 18 20 21 XmlWidget(QString name,QString type,XmlWidget*parent);22 23 24 25 void GetFullXml(QDomElement*doc);26 void GetUpdateXml(QDomElement*doc);27 28 virtual bool IsUptodate(void){return true;};29 30 31 19 public: 20 XmlWidget(QString name, QString type, XmlWidget *parent); 21 ~XmlWidget(); 22 QDomDocument XmlDoc(void); 23 void ParseXml(QDomElement to_parse); 24 void GetFullXml(QDomElement *doc); 25 void GetUpdateXml(QDomElement *doc); 26 void ResetAllChilds(void); 27 virtual bool IsUptodate(void) { return true; }; 28 void LoadXml(QDomElement to_parse); 29 void RenamedFrom(QString old_name); 30 QString Name(void); 32 31 33 private: 34 QDomDocument document; 35 QDomElement write_elem; 36 XmlWidget* GetXmlWidget(QString name,QString type); 37 static void merge(QDomElement* from,QDomElement* into); 38 bool isExpandable;//true if we can receive extra frame for this widget (ex combobox, plots, layout) 39 bool isContainer;//true if it can contain other widget (ex layout), isExpandable is also true in this case 40 virtual void SetUptodate(void){}; 41 virtual void Reset(void){}; 42 XmlWidget* parent_widget; 32 private: 33 QDomDocument document; 34 QDomElement write_elem; 35 XmlWidget *GetXmlWidget(QString name, QString type); 36 static void merge(QDomElement *from, QDomElement *into); 37 bool isExpandable; // true if we can receive extra frame for this widget (ex 38 // combobox, plots, layout) 39 bool isContainer; // true if it can contain other widget (ex layout), 40 // isExpandable is also true in this case 41 virtual void SetUptodate(void){}; 42 virtual void Reset(void){}; 43 XmlWidget *parent_widget; 43 44 44 protected: 45 QList<XmlWidget*> *childs; 46 ConnectionLayout* connectionLayout(void); 47 QWidget* visible_widget; 48 QPalette red_pal,red_pal_greyed; 49 QPalette black_pal,black_pal_greyed; 50 void SetIsContainer(bool status); 51 void SetIsExpandable(bool status); 52 virtual void XmlEvent(QDomElement dom){}; 53 virtual void LoadEvent(QDomElement dom){}; 54 QDomElement* AddXmlChild(QString type); 55 void RemoveXmlChild(QDomElement* element); 56 void ClearDoc(void); 57 void SetValue(QString value); 58 void SetAttribute(const QString& name, const QString& value); 59 void SetAttribute(const QString& name, qlonglong value); 60 void SetAttribute(const QString& name, qulonglong value); 61 inline void SetAttribute(const QString& name, int value) 62 { SetAttribute(name, qlonglong(value)); } 63 inline void SetAttribute(const QString& name, uint value) 64 { SetAttribute(name, qulonglong(value)); } 65 void SetAttribute(const QString& name, float value); 66 void SetAttribute(const QString& name, double value); 67 void RemoveAttribute(const QString& name); 45 protected: 46 QList<XmlWidget *> *childs; 47 ConnectionLayout *connectionLayout(void); 48 QWidget *visible_widget; 49 QPalette red_pal, red_pal_greyed; 50 QPalette black_pal, black_pal_greyed; 51 void SetIsContainer(bool status); 52 void SetIsExpandable(bool status); 53 virtual void XmlEvent(QDomElement dom){}; 54 virtual void LoadEvent(QDomElement dom){}; 55 QDomElement *AddXmlChild(QString type); 56 void RemoveXmlChild(QDomElement *element); 57 void ClearDoc(void); 58 void SetValue(QString value); 59 void SetAttribute(const QString &name, const QString &value); 60 void SetAttribute(const QString &name, qlonglong value); 61 void SetAttribute(const QString &name, qulonglong value); 62 inline void SetAttribute(const QString &name, int value) { 63 SetAttribute(name, qlonglong(value)); 64 } 65 inline void SetAttribute(const QString &name, uint value) { 66 SetAttribute(name, qulonglong(value)); 67 } 68 void SetAttribute(const QString &name, float value); 69 void SetAttribute(const QString &name, double value); 70 void RemoveAttribute(const QString &name); 68 71 }; 69 72
Note:
See TracChangeset
for help on using the changeset viewer.