You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Qt Quick布局按钮在窗口获焦时不显示文本问题求助

Qt QML按钮文本在Mac OS Ventura窗口获焦时消失的问题

在Mac OS Ventura系统下,使用Qt 6.5.2(也曾尝试Qt 6.4.3)遇到如下异常:

  • 当应用窗口处于激活焦点状态时,布局内的按钮文本完全无法显示
  • 切换到其他应用(如Qt Creator)后,按钮文本恢复正常显示

即使使用极简测试代码新建项目,问题依然复现,测试代码如下:

import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Layouts

Window {
    width: 640
    height: 480
    visible: true
    title: qsTr("Busy Indicator Control")

    RowLayout {
        width: parent.width
        height: parent.height
            Button {
                id: button1
                text: "Running"
                Layout.fillWidth: true
                onClicked: {
                    console.log("button pressed")
                }
            }
            Button {
                id: button2
                text: "Not Running"
                Layout.fillWidth: true
            }
        }
    }

对应现象截图:

  • 应用获焦时:应用获焦时按钮文本不显示
  • 聚焦Qt Creator时:聚焦其他应用时按钮文本正常

内容的提问来源于stack exchange,提问作者Christian Niekler

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 01:23:32