Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Chinese
  4. 在Windows平台的部分机型中MenuBar渲染异常
Forum Updated to NodeBB v4.3 + New Features

在Windows平台的部分机型中MenuBar渲染异常

Scheduled Pinned Locked Moved Unsolved Chinese
2 Posts 2 Posters 354 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LyLamp
    wrote on last edited by
    #1

    使用Qt Quick来开发界面

    版本:Qt 6.6

    代码示例

    import QtQuick
    import Qt.labs.platform
    import QtQuick.Controls
    
    ApplicationWindow {
        id: appRoot
    
        color: "#090F17"
        height: 480
        visible: true
        width: 640
    
        MenuBar {
            id: editorMainWindowMenu
    
            Menu {
                id: fileMenu
    
                title: qsTr("File")
    
            }
    
            //菜单-编辑
            Menu {
                id: editorMenu
    
                title: qsTr("Editor")
    
                MenuItem {
                }
            }
    
    
            //菜单-窗口
            Menu {
                id: windowMenu
    
                title: qsTr("Window")
    
                MenuItem {
                }
            }
            //菜单-帮助
            Menu {
                id: helpMenu
    
                title: qsTr("Help")
    
                MenuItem {
                }
            }
        }
    
        Rectangle {
            color: "green"
        }
    
    
    }
    
    

    效果
    f14df4dc-8a4b-4b7d-b464-10474a163689-捕获.PNG

    jsulmJ 1 Reply Last reply
    0
    • L LyLamp

      使用Qt Quick来开发界面

      版本:Qt 6.6

      代码示例

      import QtQuick
      import Qt.labs.platform
      import QtQuick.Controls
      
      ApplicationWindow {
          id: appRoot
      
          color: "#090F17"
          height: 480
          visible: true
          width: 640
      
          MenuBar {
              id: editorMainWindowMenu
      
              Menu {
                  id: fileMenu
      
                  title: qsTr("File")
      
              }
      
              //菜单-编辑
              Menu {
                  id: editorMenu
      
                  title: qsTr("Editor")
      
                  MenuItem {
                  }
              }
      
      
              //菜单-窗口
              Menu {
                  id: windowMenu
      
                  title: qsTr("Window")
      
                  MenuItem {
                  }
              }
              //菜单-帮助
              Menu {
                  id: helpMenu
      
                  title: qsTr("Help")
      
                  MenuItem {
                  }
              }
          }
      
          Rectangle {
              color: "green"
          }
      
      
      }
      
      

      效果
      f14df4dc-8a4b-4b7d-b464-10474a163689-捕获.PNG

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @LyLamp If you want to post in Chinese please do it here: https://forum.qt.io/category/37/chinese

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • SGaistS SGaist moved this topic from General and Desktop on

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved