全屏窗口小部件 [英] Fullscreen widget

查看:169
本文介绍了全屏窗口小部件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题。如何让我的小部件全屏?
我试过这样:

i have a question. How can i make my widget fullscreen? I've tried something like this:

void MainWindow::SetFullScreen()
{
    // Make our window without panels
    this->setWindowFlags( Qt::FramelessWindowHint | Qt::Tool | Qt::WindowStaysOnTopHint );
    // Resize refer to desktop
    this->resize( QApplication::desktop()->size() );

    this->setFocusPolicy( Qt::StrongFocus );
    this->setAttribute(Qt::WA_QuitOnClose, true);

    qApp->processEvents();
    show();
    this->setFocus();
}

但是小部件不在系统面板上。任何其他想法?

But widget isn't over system panels. Any another ideas?

操作系统:Linux

OS: Linux

推荐答案

QWidget :: showFullScreen()是你需要的 - 在Linux + Windows下的工程在我的项目多年 - 但要小心,不应该有两个调用这个函数(例如。首先调用 QMainWindo-> showFullScreen(),然后 MyWidget-> showFullScreen())。

QWidget::showFullScreen() is what you need - works great under Linux+Windows in my projects for years - but be careful, there shouldn't be two calls of this function (eg. first call of QMainWindo->showFullScreen() and then MyWidget->showFullScreen()).

ciao,
Chris

ciao, Chris

这篇关于全屏窗口小部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆