QTfrontend/AbstractPage.h
changeset 6042 8b5345758f62
parent 6038 58d9badf3e7f
child 6044 728ce9acbaf7
equal deleted inserted replaced
6040:a740069c21e3 6042:8b5345758f62
    54     signals:
    54     signals:
    55         void goBack();
    55         void goBack();
    56 
    56 
    57     protected:
    57     protected:
    58         // constructor and virtual destructor
    58         // constructor and virtual destructor
    59         AbstractPage(QWidget* parent = 0);
    59         AbstractPage(QWidget * parent = 0);
       
    60 
       
    61         // call this in the constructor of your subclass
       
    62         void initPage();
       
    63 
       
    64         // the following methods are used during page construction
       
    65 
       
    66             // you MUST implement this method in your subclass
       
    67             // only define layout, not behavior in here
       
    68             virtual QLayout * bodyLayoutDefinition() = 0;
       
    69 
       
    70             // you CAN implement this method in your subclass
       
    71             virtual QLayout * footerLayoutDefinition() { return NULL; };
       
    72 
       
    73             // you CAN but most likely want to implement this method in your subclass
       
    74             // keep in mind not to expose twidgets as public!
       
    75             // instead define a signal with a meaningful name and connect the widget
       
    76             // signals to your page signals
       
    77             virtual void connectSignals() {};
       
    78 /*
       
    79 virtual QLayout * bodyLayoutDefinition()\n{\n    return new QGridLayout(); //TODO\n}\n\nvirtual QLayout * footerLayoutDefinition()\n{\n    // return NULL;\n}\n\nvirtual void connectSignals()\n{\n    //TODO\n}\n\n
       
    80 */
       
    81 
    60         virtual ~AbstractPage() {};
    82         virtual ~AbstractPage() {};
    61 
    83 
    62         QPushButton * addButton(const QString & btname, QGridLayout* grid, int wy, int wx, bool hasIcon = false);
    84         QPushButton * addButton(const QString & btname, QGridLayout * grid, int wy, int wx, bool hasIcon = false);
    63         QPushButton * addButton(const QString & btname, QGridLayout* grid, int wy, int wx, int rowSpan, int columnSpan, bool hasIcon = false);
    85         QPushButton * addButton(const QString & btname, QGridLayout * grid, int wy, int wx, int rowSpan, int columnSpan, bool hasIcon = false);
    64         QPushButton * addButton(const QString & btname, QBoxLayout* box, int where, bool hasIcon = false);
    86         QPushButton * addButton(const QString & btname, QBoxLayout * box, int where, bool hasIcon = false);
       
    87 
       
    88         void setBackButtonVisible(bool visible = true);
    65 
    89 
    66         QFont * font14;
    90         QFont * font14;
    67 
    91 
    68     private:
    92     private:
    69         QPushButton * formattedButton(const QString & btname, bool hasIcon);
    93         QPushButton * formattedButton(const QString & btname, bool hasIcon);
       
    94 
       
    95         QPushButton * btnBack;
    70 };
    96 };
    71 
    97 
    72 #endif
    98 #endif
    73 
    99