tools/drawMapTest/drawmapwidget.h
changeset 14375 20178fa3a74a
parent 14374 5cc671f988e7
child 14376 bc29fc6df7a2
equal deleted inserted replaced
14374:5cc671f988e7 14375:20178fa3a74a
     1 #ifndef DRAWMAPWIDGET_H
       
     2 #define DRAWMAPWIDGET_H
       
     3 
       
     4 #include <QWidget>
       
     5 #include <QHBoxLayout>
       
     6 #include <QPushButton>
       
     7 #include <QGraphicsView>
       
     8 #include <QApplication>
       
     9 
       
    10 #include "qaspectratiolayout.h"
       
    11 #include "drawmapscene.h"
       
    12 
       
    13 namespace Ui {
       
    14     class Ui_DrawMapWidget
       
    15     {
       
    16     public:
       
    17         QGraphicsView *graphicsView;
       
    18         QPushButton *pbUndo;
       
    19 
       
    20         void setupUi(QWidget *drawMapWidget)
       
    21         {
       
    22             QAspectRatioLayout * arLayout = new QAspectRatioLayout(drawMapWidget);
       
    23             arLayout->setMargin(0);
       
    24 
       
    25             graphicsView = new QGraphicsView(drawMapWidget);
       
    26             arLayout->addWidget(graphicsView);
       
    27 
       
    28             retranslateUi(drawMapWidget);
       
    29 
       
    30             QMetaObject::connectSlotsByName(drawMapWidget);
       
    31         } // setupUi
       
    32 
       
    33         void retranslateUi(QWidget *drawMapWidget)
       
    34         {
       
    35             Q_UNUSED(drawMapWidget);
       
    36         } // retranslateUi
       
    37 
       
    38     };
       
    39 
       
    40     class DrawMapWidget: public Ui_DrawMapWidget {};
       
    41 }
       
    42 
       
    43 class DrawMapWidget : public QWidget
       
    44 {
       
    45     Q_OBJECT
       
    46 
       
    47 public:
       
    48     explicit DrawMapWidget(QWidget *parent = 0);
       
    49     ~DrawMapWidget();
       
    50 
       
    51     void setScene(DrawMapScene * scene);
       
    52 
       
    53 protected:
       
    54     void changeEvent(QEvent *e);
       
    55     virtual void resizeEvent(QResizeEvent * event);
       
    56 
       
    57 private:
       
    58     Ui::DrawMapWidget *ui;
       
    59 };
       
    60 
       
    61 #endif // DRAWMAPWIDGET_H