Want more features on Pastebin? Sign Up, it's FREE!
Guest

ariya

By: a guest on Jun 22nd, 2009  |  syntax: C++  |  size: 0.66 KB  |  views: 273  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <QtGui>
  2.  
  3. class ConfigWindow: public QWidget
  4. {
  5. public:
  6.     ConfigWindow(): QWidget() {
  7.         resize(320, 200);
  8.         setWindowTitle("ConfigWindow");
  9.     }
  10. };
  11.  
  12. class MainWindow: public QMainWindow
  13. {
  14. public:
  15.     MainWindow(): QMainWindow() {
  16.         setWindowFlags(Qt::Tool | Qt::FramelessWindowHint);
  17.         ConfigWindow *ConfWindow = new ConfigWindow();
  18.         ConfWindow->show();
  19.         setStyleSheet("background-color: blue;");
  20.         raise();
  21.     }
  22. };
  23.  
  24. int main(int argc, char *argv[])
  25. {
  26.     QApplication app(argc, argv);
  27.  
  28.     app.setQuitOnLastWindowClosed(false);
  29.  
  30.     MainWindow m;
  31.     m.show();
  32.  
  33.     return app.exec();
  34. }
clone this paste RAW Paste Data