mainwindow.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef PREVIEWWINDOW_H
  2. #define PREVIEWWINDOW_H
  3. #include <QtGui/QMainWindow>
  4. #include <QGraphicsScene>
  5. #include "graphicshybridview.h"
  6. #include "pannableview.h"
  7. #include <QDebug>
  8. class QWebFrame;
  9. class QWebView;
  10. class MainWindow : public QMainWindow
  11. {
  12. Q_OBJECT
  13. public:
  14. MainWindow(QString widgetIdentifier, QString filePath, bool panningEnabled, QWidget *parent = 0);
  15. MainWindow(QString debug, QWidget *parent = 0);
  16. QWebFrame *webFrame() { return m_hybridView->page()->mainFrame(); }
  17. void resizeView(int width, int height);
  18. private slots:
  19. void selectFile();
  20. void resizeW240H320();
  21. void resizeW320H240();
  22. void resizeW360H640();
  23. void resizeW640H360();
  24. void resizeW800H480();
  25. void contentsSizeChanged(QSize newSize);
  26. private:
  27. void openWidget(QString widgetIdentifier, QString filePath);
  28. private:
  29. PannableView *m_pannableView;
  30. GraphicsHybridView *m_hybridView;
  31. QGraphicsScene m_scene;
  32. QGraphicsView m_view;
  33. bool m_panningEnabled;
  34. };
  35. #endif // PREVIEWWINDOW_H