MenuBar touch problem
-
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 -
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: WIndowsI 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.