V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Arctic2021
V2EX  ›  Qt

求指点 QtWidget 程序如何改善 Wayland 下的兼容性?

  •  
  •   Arctic2021 · Feb 10, 2023 · 3969 views
    This topic created in 1176 days ago, the information mentioned may be changed or developed.

    我用 QtWidget 写了一个 C++ 程序,在 X11 下一切正常,在 Wayland 下亦可运行。美中不足之处,它在 Wayland 环境下的消息弹窗等子窗口位置,不是如 X11 下般铺在主程序上层,而是偏移到很远的地方。

    熟悉 Qt 的大佬指点一下,如何改善 QtWidget 的 Wayland 兼容性。

    pic

    4 replies    2023-02-10 15:53:54 +08:00
    CrazyRain0001
        1
    CrazyRain0001  
       Feb 10, 2023
    手动移一下?
    Arctic2021
        2
    Arctic2021  
    OP
       Feb 10, 2023
    @CrazyRain0001 大佬是指?因为这个是工具性的小程序,有很多消息对话框和按钮弹窗……所以挺迷茫的,不知道别人是怎么兼容 wayland 的,目前其它功能都正常,只有弹窗偏离主程序这个问题,不知由何引起,也不知如何解决。
    kaedeair
        3
    kaedeair  
       Feb 10, 2023
    程序自己控制弹出位置就没有兼容性问题了吧
    Arctic2021
        4
    Arctic2021  
    OP
       Feb 10, 2023
    写了一个简单的 Demo ,确认这应该是 Qt 的 bug


    ```
    void MainWindow::on_pushButton_clicked()
    {
    QMessageBox::information(this,"提示消息","已成功读档!");
    }

    ```

    ![pic]( https://raw.githubusercontent.com/yanhuacuo/98wubi-etymons/master/%E6%88%AA%E5%9B%BE%202023-02-10%2015-41-22.png)
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2438 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 11:53 · PVG 19:53 · LAX 04:53 · JFK 07:53
    ♥ Do have faith in what you're doing.