(在Qt 4.8和Ubuntu 12.10上使用C ++进行测试)
我有一个显示QDialog的主窗口。当我将“对话”窗口全屏显示时,即使它似乎是一个适当的窗口,它也似乎始终无法工作。意思是,窗口有时会全屏显示。
有人知道吗?我知道Qt指出它可能无法在所有X环境中使用,但是可以不是那么糟糕,不是吗?
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
QDialog* d = new QDialog();
d->setModal(false);
d->show();
qDebug() << d->isWindow();
// works most of the times, though not always:
// d->showFullScreen();
// sometimes works, sometimes it doesn't:
QTimer::singleShot(2000, d, SLOT(showFullScreen()));
}
Run Code Online (Sandbox Code Playgroud)