QT开发

作者: Alee丶 | 来源:发表于2021-08-04 14:47 被阅读0次

子窗口// 全屏显示:

this ->setWindowFlags(Qt::Window);

this ->showFullScreen();

// 退出全屏时:

this->setWindowFlags(Qt::SubWindow);

this ->showNormal();

showFullScreen() // Qt全屏显示函数

showMaximized() // Qt最大化显示函数

showMinimized() // Qt最小化显示函数

resize(x, y) // Qt固定尺寸显示函数setMaximumSize(w, h) // Qt设置最大尺寸函数

setMinimumSize(w, h) // Qt设置最小尺寸函数

窗口置顶 与 取消置顶

void MainWindow::on_windowTopButton_clicked()

{

  if (m_flags == NULL)

  {

    m_flags = windowFlags();

    setWindowFlags(m_flags | Qt::WindowStaysOnTopHint);

    this->show();

  }

  else

  {

    m_flags = NULL;

    setWindowFlags(m_flags);

    this->show();

  }

}

相关文章

网友评论

      本文标题:QT开发

      本文链接:https://www.haomeiwen.com/subject/yysuvltx.html