首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > QT开发 >

震惊!小弟我发现Qt有一个致命Bug!

2012-03-15 
震惊!!我发现Qt有一个致命Bug!!绝对不是标题党,在ui文件中拖入pushbutton,lineEdit 和 textEdit;在构造函

震惊!!我发现Qt有一个致命Bug!!
绝对不是标题党,在ui文件中拖入pushbutton,lineEdit 和 textEdit;在构造函数中设置窗口,代码如下:

C/C++ code
    ui.setupUi(this);    this->setWindowFlags(        Qt::FramelessWindowHint |         Qt::WindowMinimizeButtonHint |        Qt::WindowSystemMenuHint);        setAttribute(Qt::WA_TranslucentBackground);    connect(ui.miniButton, SIGNAL(clicked()), this, SLOT(showMinimized()));

当你点击最小化,然后再复原时,lineEdit 和 textEdit 无法聚焦了

[解决办法]
问题搞定,方法简答,重载Dialog的ShowEvent事件。
加上下面2行:
if ( this->isVisible())
this->repaint();

热点排行