Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. MenuBar touch problem
Forum Updated to NodeBB v4.3 + New Features

MenuBar touch problem

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 1 Posters 884 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.
  • M Offline
    M Offline
    miguelorenes
    wrote on last edited by miguelorenes
    #1

    I have a really easy application based on QtQuick 2:

    import QtQuick 2.7
    import QtQuick.Window 2.2
    import QtQuick.Controls 1.4
    
    ApplicationWindow {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
    
        menuBar: MenuBar {
                Menu {
                    title: qsTr("File")
                    MenuItem {
                        text: qsTr("&Open")
                        onTriggered: console.log("Open action triggered");
                    }
                    MenuItem {
                        text: qsTr("Exit")
                        onTriggered: Qt.quit();
                    }
                    onAboutToHide: console.log("onAboutToHide");
                    onAboutToShow: console.log("onAboutToShow");
                }
            }
    }
    

    When I use the mouse, all is working with no issues. But when I try in a touch screen, I am not able to show the menu bar and I can see in the Application Log:

    QML debugging is enabled. Only use this in a safe environment.
    qml: onAboutToShow
    qml: onAboutToHide
    qml: onAboutToShow
    qml: onAboutToHide
    qml: onAboutToShow
    qml: onAboutToHide
    qml: onAboutToShow
    qml: onAboutToHide
    

    It is very strange as look like impossible to use a QML MenuBar in a touch screen.

    EDIT:
    QT version: Qt5.7.1
    OS: WIndows

    M 1 Reply Last reply
    0
    • M miguelorenes

      I have a really easy application based on QtQuick 2:

      import QtQuick 2.7
      import QtQuick.Window 2.2
      import QtQuick.Controls 1.4
      
      ApplicationWindow {
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
      
          menuBar: MenuBar {
                  Menu {
                      title: qsTr("File")
                      MenuItem {
                          text: qsTr("&Open")
                          onTriggered: console.log("Open action triggered");
                      }
                      MenuItem {
                          text: qsTr("Exit")
                          onTriggered: Qt.quit();
                      }
                      onAboutToHide: console.log("onAboutToHide");
                      onAboutToShow: console.log("onAboutToShow");
                  }
              }
      }
      

      When I use the mouse, all is working with no issues. But when I try in a touch screen, I am not able to show the menu bar and I can see in the Application Log:

      QML debugging is enabled. Only use this in a safe environment.
      qml: onAboutToShow
      qml: onAboutToHide
      qml: onAboutToShow
      qml: onAboutToHide
      qml: onAboutToShow
      qml: onAboutToHide
      qml: onAboutToShow
      qml: onAboutToHide
      

      It is very strange as look like impossible to use a QML MenuBar in a touch screen.

      EDIT:
      QT version: Qt5.7.1
      OS: WIndows

      M Offline
      M Offline
      miguelorenes
      wrote on last edited by
      #2

      I modified to application to be executed in QT5.4

      import QtQuick 2.2
      import QtQuick.Window 2.2
      import QtQuick.Controls 1.2
      
      ApplicationWindow {
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
      
          menuBar: MenuBar {
                  Menu {
                      title: qsTr("File")
                      MenuItem {
                          text: qsTr("&Open")
                          onTriggered: console.log("Open action triggered");
                      }
                      MenuItem {
                          text: qsTr("Exit")
                          onTriggered: Qt.quit();
                      }
                  }
              }
      }
      

      And the issue dissapear.
      But If I execute with Qt5.7.1 kit, it is failing.

      1 Reply Last reply
      0

      • Login

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