【问题标题】:Is there any flag to indicate the QT mainwindow rendering is finished是否有任何标志表明 QT 主窗口渲染已完成
【发布时间】:2023-03-06 07:41:02
【问题描述】:

是否有任何标志表明 QT 已在屏幕上完成渲染。

我希望这个标志通知另一个要显示的窗口。

【问题讨论】:

    标签: c++ qt signals-slots qt-signals


    【解决方案1】:

    不是标志,而是QPaintEngine's isActive function 如果它正在绘制,则返回。从QPaintDevice(例如QWidget)派生的类的实例可以从paintEngine()获取引擎

    【讨论】:

    • 有什么方法可以提高渲染速度,渲染时间是51毫秒左右,每秒20帧左右。
    • @VamsiKrishnaNeelam 看看blog.qt.io/blog/2009/12/16/…
    • 当然有提高性能的方法。您需要先显示性能不佳的代码。
    • void WindowSwitch::switchWindow() { QElapsedTimer renderTime; if (window1->isVisible()) { window1->hide(); renderTime.start(); window2->showFullScreen(); printf("Vamsi:: Window2-Rendering times %lld nano secs, Frame count = %lld\n ",renderTime.nsecsElapsed(),++frameCount); } else { renderTime.restart(); window1->showFullScreen(); printf("Vamsi:: Window1-Rendering times %lld nano secs, Frame count = %lld\n ",renderTime.nsecsElapsed(),++frameCount); window2->hide(); } }@Ober
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-04
    • 1970-01-01
    • 2014-11-02
    相关资源
    最近更新 更多