Qt的一个bug 5.5.1还有啊



  • 调用窗体中的一个widget的winId()这个函数,然后就出现问题了

    1、如果在窗体MainWindow的构造函数中调用this->setWindowFlags(Qt::FramelessWindowHint);和widget->winId();然后show出来的界面就会卡死,里面的按钮什么的都无法点击。比如点击一个按钮然后按钮上的文字改变的事件。

    2、如果先调用this->setWindowFlags(Qt::FramelessWindowHint);然后在窗体show之后调用widget->winId();这样开始正常,然后将窗体最小化再回复就会出现上面卡死的状况。

    3、窗体卡死后点击一个按钮发现无反应(比如点击一个按钮然后按钮上的文字改变的事件。),然后最小化窗体再回复发现刚才点击的事件响应了,然后还是卡死。



  • Native Widgets vs Alien Widgets

    Introduced in Qt 4.4, alien widgets are widgets unknown to the windowing system. They do not have a native window handle associated with them. This feature significantly speeds up widget painting, resizing, and removes flicker.

    Should you require the old behavior with native windows, you can choose one of the following options:

    Use the QT_USE_NATIVE_WINDOWS=1 in your environment.
    Set the Qt::AA_NativeWindows attribute on your application. All widgets will be native widgets.
    Set the Qt::WA_NativeWindow attribute on widgets: The widget itself and all of its ancestors will become native (unless Qt::WA_DontCreateNativeAncestors is set).
    Call QWidget::winId to enforce a native window (this implies 3).
    Set the Qt::WA_PaintOnScreen attribute to enforce a native window (this implies 3).




 

走马观花

最近的回复

关注我们

微博
QQ群











召唤伊斯特瓦尔