使用 Mac系统自带的中文输入法,无论是在 Qt 5.15.18 还是 Qt 6.2.7的 QTextEdit 中,或者在其他可以输入的地方(例如终端),行为是一致的。都会变为 12:30 (中间的冒号会变成英文的冒号,但请注意,在输入 3 之前显示的冒号既不是中文的冒号,也不是英文的冒号。输入 3 之后显示为英文的冒号) 6.2.7 qt.qpa.input.methods: Input source supports ( "zh-Hans" ) qt.qpa.input.methods: Reporting new locale QLocale(Chinese, Simplified Han, China) qt.qpa.input.methods: Focus object changed to QTextEdit(0x600003514cf0, name = "textEdit") qt.qpa.input.methods: Focus object changed to QTextEdit(0x600003514cf0, name = "textEdit") 2025-02-25 17:00:59.711 textedit[7086:164081] +[IMKClient subclass]: chose IMKClient_Modern 2025-02-25 17:00:59.711 textedit[7086:164081] +[IMKInputSession subclass]: chose IMKInputSession_Modern qt.qpa.input.methods: Text input source changed qt.qpa.input.methods: Input source supports ( "zh-Hans" ) qt.qpa.input.methods: Text input source changed qt.qpa.input.methods: Input source supports ( "zh-Hans" ) 2025-02-25 17:01:02.530 textedit[7086:164081] TSM AdjustCapsLockLEDForKeyTransitionHandling - _ISSetPhysicalKeyboardCapsLockLED Inhibit 2025-02-25 17:01:03.983 textedit[7086:164081] error messaging the mach port for IMKCFRunLoopWakeUpReliable 6.2.6 qt.qpa.input.methods: Input source supports ( "zh-Hans" ) qt.qpa.input.methods: Reporting new locale QLocale(Chinese, Simplified Han, China) qt.qpa.input.methods: Focus object changed to QTextEdit(0x600002db2a60, name = "textEdit") qt.qpa.input.methods: Focus object changed to QTextEdit(0x600002db2a60, name = "textEdit") 2025-02-25 17:03:19.038 textedit[7789:167948] +[IMKClient subclass]: chose IMKClient_Modern 2025-02-25 17:03:19.038 textedit[7789:167948] +[IMKInputSession subclass]: chose IMKInputSession_Modern qt.qpa.input.methods: Text input source changed qt.qpa.input.methods: Input source supports ( "zh-Hans" ) qt.qpa.input.methods: Text input source changed qt.qpa.input.methods: Input source supports ( "zh-Hans" ) 2025-02-25 17:03:22.705 textedit[7789:167948] TSM AdjustCapsLockLEDForKeyTransitionHandling - _ISSetPhysicalKeyboardCapsLockLED Inhibit 2025-02-25 17:03:23.851 textedit[7789:167948] error messaging the mach port for IMKCFRunLoopWakeUpReliable 5.15.18 2025-02-25 17:04:50.920 textedit[7842:169514] +[IMKClient subclass]: chose IMKClient_Modern 2025-02-25 17:04:50.920 textedit[7842:169514] +[IMKInputSession subclass]: chose IMKInputSession_Modern 2025-02-25 17:04:55.417 textedit[7842:169514] TSM AdjustCapsLockLEDForKeyTransitionHandling - _ISSetPhysicalKeyboardCapsLockLED Inhibit 2025-02-25 17:04:56.998 textedit[7842:169514] error messaging the mach port for IMKCFRunLoopWakeUpReliable