This is the main function. I run my app on a Mac and it works (although when closing it it crashes). But on Windows it does'n show up.
	
	- #include <QApplication> 
- #include <QDesktopWidget> 
-   
- #include "SDIWindow.h" 
-   
- int main(int argc, char *argv[]) 
- { 
-  SdiWindow window; 
-  window.resize(window.sizeHint()); 
-   
-  window.showMaximized(); 
-  return app.exec(); 
- } 
        #include <QApplication>
#include <QDesktopWidget>
#include "SDIWindow.h"
int main(int argc, char *argv[])
{
 QApplication app(argc, argv);
 SdiWindow window;
 window.resize(window.sizeHint());
 window.showMaximized();
 return app.exec();
}
To copy to clipboard, switch view to plain text mode 
  
The code is copy-pasted from the hellogl example with a small change done to make the render context occupy the whole window.
Here is the code of the hellogl main function.
	
	- #include <QApplication> 
-  #include <QDesktopWidget> 
-   
-  #include "window.h" 
-   
-  int main(int argc, char *argv[]) 
-  { 
-      Window window; 
-      window.resize(window.sizeHint()); 
-      int widgetArea = window.width() * window.height(); 
-      if (((float)widgetArea / (float)desktopArea) < 0.75f) 
-          window.show(); 
-      else 
-          window.showMaximized(); 
-      return app.exec(); 
-  } 
        #include <QApplication>
 #include <QDesktopWidget>
 #include "window.h"
 int main(int argc, char *argv[])
 {
     QApplication app(argc, argv);
     Window window;
     window.resize(window.sizeHint());
     int desktopArea = QApplication::desktop()->width() *
                      QApplication::desktop()->height();
     int widgetArea = window.width() * window.height();
     if (((float)widgetArea / (float)desktopArea) < 0.75f)
         window.show();
     else
         window.showMaximized();
     return app.exec();
 }
To copy to clipboard, switch view to plain text mode 
  
				
			
Bookmarks