QT Ubuntu 窗口处于活动状态但不可见 [英] QT Ubuntu Window is active but invisible

查看:57
本文介绍了QT Ubuntu 窗口处于活动状态但不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

工作代码从 Qt4 Debian 移至 Qt 5.5.1 Ubuntu 16.04.2.传输没有问题,直到出现一个主要问题(Qt 或 Ubuntu 中可能存在错误).目标是从 MainWindow 打开第二个窗口.同样,在 Qt4 中工作没有问题,但在 Qt5 中,第二个窗口已创建并存在但不可见.前一个屏幕是完全可见的,如果 MainWindow hide() 则是桌面,但第二个窗口位于顶部"并处于活动状态.我知道控件应该在哪里,当我按下它们时,它们表现正常.下部"屏幕可见,但由于窗口位于顶部,因此没有活动控件.代码:

Working code moved from Qt4 Debian to Qt 5.5.1 Ubuntu 16.04.2 . Transfer was without issue until one major problem (possible bug in Qt or Ubuntu). Objective is to open second window from MainWindow. Again, works without problem in Qt4 but Qt5 the second window is created and present but invisible. The previous screen is fully visible, or desktop if MainWindow hide(), but second window is on 'top' and active. I know where the controls should be and when I press them they act normal. The 'lower' screen is visible but no controls are active because of the window on top. Code:

Utility *utilitywindow = new Utility();
//this->hide();                     //test line; hides MainWindow, does not help
utilitywindow->showFullScreen();    //same results if you use show();
//utilitywindow->repaint();         //test line; does not help

简单的代码,适用于 Qt4 但不适用于 Ubuntu 的 Qt5.setVisible 没有帮助.关于问题的任何想法?感谢您的帮助.

Simple code, works in Qt4 but not Qt5 on Ubuntu. setVisible does not help. Any thoughts as to problem? Thank you for your help.

推荐答案

我怀疑是操作系统的问题,而不是 Qt.我将桌面从 KDE 更改为 LXDE,现在它可以工作了!你一定会喜欢它.

I suspected it was problem with OS rather than Qt. I changed desktop from KDE to LXDE and now it works! You gotta love it.

这篇关于QT Ubuntu 窗口处于活动状态但不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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