2016-04-28 9 views
0

私は、画面全体を占めるメインウィンドウとシミュレーションコントロールを含む子ウィンドウを持つC++ Qtアプリケーションを作成しています。Qt5.6 RHELフルスクリーンアプリケーションウィンドウと子ウィンドウ

私はQt 5.6でRHEL 7.2を使用しています。問題は、タスクリストに表示されている子ウィンドウがディスプレイに表示されないことです。シミュレーションウィンドウから

clsMainWin::clsMainWin(QRect rctScr, QWidget *parent) : QMainWindow(parent) 
                ,ui(new Ui::clsMainWin) { 
     ui->setupUi(this); 
    //Set-up window container background and size 
     setWindowFlags(Qt::Window | Qt::FramelessWindowHint); 
     setWindowIcon(QPixmap(1,1))); 
     setGeometry(rctScr); 
    //Display the window container 
     showFullScreen(); 
    #ifdef SIM_WINDOW 
     mpobjSimWin = NULL; 
    #endif 
    } 
    void clsMainWin::paintEvent(QPaintEvent* pEvt) { 
    //Prevent compiler warning! 
     pEvt = pEvt; 
    //Get painter context 
     QPainter objPainter(this); 
    //Fill the root area with the chosen colour 
     objPainter.fillRect(geometry(), 
      QColor(mpobjRoot->strGetAttr(mcszXMLattrColorBg))); 
    #ifdef SIM_WINDOW 
     if (mpobjSimWin == NULL) { 
      mpobjSimWin = new clsSimWin(this); 
      mpobjSimWin->setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive); 
      mpobjSimWin->raise(); // for MacOS 
      mpobjSimWin->activateWindow(); // for Windows 
     } 
    #endif 
    } 

コンストラクタスニペットは:

clsSimWin::clsSimWin(QWidget *parent) : QDialog(parent) 
            ,ui(new Ui::clsSimWin) { 
     assert(parent != NULL); 

     ui->setupUi(this); 
    //Set the window title 
     this->setStyleSheet("background-color: white;"); 
     setWindowTitle("Data simulator"); 
    //Set-up window 
     Qt::WindowFlags flags = (Qt::Window 
           | Qt::WindowTitleHint 
           | Qt::CustomizeWindowHint) 
           & ~Qt::WindowMaximizeButtonHint; 
     setWindowFlags(flags); 
     setFixedSize(mcintWindowWidth, mcintWindowHeight); 
    //Display the window 
     show(); 
    } 

これは、すべてのコードではありませんが、うまくいけば、十分な問題は何ができるか、私がやったと場所を示すために?

答えて

0

showメソッドの呼び出しをコンストラクタの外に移動することで修正されました。

関連する問題