Advertisement
Guest User

QMainWindow Wrapper Stuff

a guest
Jul 25th, 2014
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.11 KB | None | 0 0
  1. ////////////////////////
  2. ///MainWindowStruct.h
  3. ///////////////////////
  4.  
  5. #ifndef QTCL_MainWindowStruct_H
  6. #define QTCL_MainWindowStruct_H
  7.  
  8. //Headers
  9. #include <QMainWindow>
  10.  
  11. struct Qt_MainWindow
  12. {
  13.     QMainWindow* This;
  14. };
  15.  
  16. #endif//QTCL_MainWindowStruct_H
  17.  
  18. ////////////////////////
  19. ///MainWindow.h
  20. ///////////////////////
  21.  
  22. #ifndef QTCL_MainWindow_H
  23. #define QTCL_MainWindow_H
  24.  
  25. //Headers
  26. #include <Config.h>
  27.  
  28. typedef struct Qt_MainWindow Qt_MainWindow;
  29.  
  30. QTCL_API Qt_MainWindow* Qt_MainWindow_create();
  31.  
  32. QTCL_API void Qt_MainWindow_show(Qt_MainWindow* window);
  33.  
  34. QTCL_API void Qt_MainWindow_destroy(Qt_MainWindow* window);
  35.  
  36. #endif//QTCL_MainWindow_H
  37.  
  38. ////////////////////////
  39. ///MainWindow.cpp
  40. ///////////////////////
  41.  
  42. //Headers
  43. #include <MainWindow.h>
  44. #include <MainWindowStruct.h>
  45.  
  46.  
  47. Qt_MainWindow* Qt_MainWindow_create()
  48. {
  49.     Qt_MainWindow* temp = new Qt_MainWindow;
  50.  
  51.     temp->This = new QMainWindow();
  52.  
  53.     return temp;
  54. }
  55.  
  56. void Qt_MainWindow_show(Qt_MainWindow* window)
  57. {
  58.     window->This->show();
  59. }
  60.  
  61. void Qt_MainWindow_destroy(Qt_MainWindow* window)
  62. {
  63.     delete window->This;
  64.     delete window;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement