contactengine/detailsgv.h
changeset 34 93c5a58496b6
equal deleted inserted replaced
33:f6cf541961ad 34:93c5a58496b6
       
     1 #ifndef DETAILSGV_H
       
     2 #define DETAILSGV_H
       
     3 
       
     4 #include <QHash>
       
     5 #include <QObject>
       
     6 #include <QGraphicsView>
       
     7 #include <QGraphicsProxyWidget>
       
     8 #include <QPushButton>
       
     9 
       
    10 /*
       
    11  * This class is a mock up of how the Graphics View architecture might be
       
    12  * used to present the details of a contact. It encapsulates all information
       
    13  * about Graphics View except the UI Design defines and asks the view itself to the
       
    14  * QStackedView.
       
    15  *
       
    16  * It has no knowledge of the QMainWindow. Widgets in this calls can emit a signal to
       
    17  * communicate with the QMainWindow.
       
    18  */
       
    19 
       
    20 class DetailsGV : public QObject
       
    21 {
       
    22     Q_OBJECT
       
    23 public:
       
    24     explicit DetailsGV(QObject *parent, QGraphicsView *gv);
       
    25 
       
    26 signals:
       
    27     void closeMe();
       
    28     void backToList();
       
    29 
       
    30 public slots:
       
    31 
       
    32 private:
       
    33     // We can use normal widgets in a Graphics View. This one creates some push buttons.
       
    34     void createWidgets();
       
    35     // If you use normal widgets, you'll need to use a proxy to communite between them and the graphics view.
       
    36     void createProxyWidgets();
       
    37     void createLayout();
       
    38     // customize the view
       
    39     void customizeView();
       
    40     void createConnections();
       
    41 
       
    42 private:
       
    43     QGraphicsScene *scene;
       
    44     QGraphicsView *view;
       
    45     QPushButton *callMe;
       
    46     QPushButton *textMe;
       
    47     QPushButton *back;
       
    48     QPushButton *exitApp;
       
    49 
       
    50     QHash<QString, QGraphicsProxyWidget*> proxyForName;
       
    51 };
       
    52 
       
    53 #endif // DETAILSGV_H