qml

Moving qml Item out of left side of window

三世轮回 提交于 2020-01-05 07:34:39
问题 I want to move a qml Item out of the left side of the app window. While this task works perfectly for the right side of the window by defining a state like this states: State { name: "hidden" when: is_hidden == true AnchorChanges { target: right_item_to_move anchors.right: undefined } PropertyChanges { target: right_item_to_move x: main_window.width } } and defining the appropriate Transition, I can't get it to work on the left side of the main window because negative x coordinates are not

Qt Canvas3D: Calling gl.colorMask or gl.depthMask, even with gl.TRUE for all args, breaks all further rendering

烈酒焚心 提交于 2020-01-05 06:51:28
问题 I've distilled this to a completely trivial testcase. First I setup all low-level stuff like shaders, vertex buffers and matrices. Then I enable all four arguments of gl.colorMask . Then I draw a white triangle. The results is a window that alternates between all black and white (flickers) at a high frequency. I.e. completely buggy. Removing the gl.colorMask call fixes it, and, in my real app, lets all other GL functionality work fine. Side note: the described result is from my minimal

How to Remove a dynamically created item from Column QML Element

依然范特西╮ 提交于 2020-01-05 03:34:10
问题 [EDIT] : I want to remove some controls which are created in Column QML type dynamically and also how to access the children of a layout? .Following is the code which is not dynamic and is just for reference: import QtQuick 2.6 import QtQuick.controls 2.2 Item { Column { id:col spacing: 2 //Initially Adding controls. Rectangle { color: "red"; width: 50; height: 50 } Rectangle { color: "green"; width: 20; height: 50 } Rectangle { color: "blue"; width: 50; height: 20 } } Button { id:button

How to hide a QML Window when opening a other QML Window

喜夏-厌秋 提交于 2020-01-05 02:57:42
问题 I need to hide The QML Window when opening the another QML Window while clicking the button,I use Loader to open the another QML Window and its only hide the QML form components not QML Window,but I currently use window component to opens the QML Window Here is my code : Button { id: button2 x: 19 y: 54 width: 114 height: 25 text: qsTr("DIFF-R") style: ButtonStyle { background: Rectangle { implicitWidth: 10 implicitHeight: 25 border.width: control.activeFocus ? 2 : 1 border.color: "#555"

How does the QML ListView estimates the height/width of it's contentItem

荒凉一梦 提交于 2020-01-04 09:48:50
问题 I am wondering how the ListView estimates the height/width of it's contentItem , though the delegate is a Component that you can't ask, and the size might vary from one delegate-instance to another. It does not use the average size of the current instances. Otherwise in Example 1 , if one element is pressed, the estimated size would be 3055.5 if all instances are counted, or 3125 if only those in the view are counted. It estimates 2845 It does not use the maximums size of all current

How to set values in qml using PyQt5?

安稳与你 提交于 2020-01-04 09:43:13
问题 From PyQt5 i want to write values into qml. This values change dynamically. For example it in rectangle text value is filed from Pyqt5 Rectangle { width: 75 height: 75 text { values from PyQt5 } } 回答1: If you want to modify a QML property from python you must create a Class that inherits from QObject and that is a qproperty , then export it to QML using setContextProperty() . main.py import sys from PyQt5.QtCore import QObject, pyqtSignal, pyqtProperty, QUrl, QTimer, QDateTime from PyQt5

How to set values in qml using PyQt5?

时光怂恿深爱的人放手 提交于 2020-01-04 09:42:17
问题 From PyQt5 i want to write values into qml. This values change dynamically. For example it in rectangle text value is filed from Pyqt5 Rectangle { width: 75 height: 75 text { values from PyQt5 } } 回答1: If you want to modify a QML property from python you must create a Class that inherits from QObject and that is a qproperty , then export it to QML using setContextProperty() . main.py import sys from PyQt5.QtCore import QObject, pyqtSignal, pyqtProperty, QUrl, QTimer, QDateTime from PyQt5

How to set values in qml using PyQt5?

依然范特西╮ 提交于 2020-01-04 09:42:01
问题 From PyQt5 i want to write values into qml. This values change dynamically. For example it in rectangle text value is filed from Pyqt5 Rectangle { width: 75 height: 75 text { values from PyQt5 } } 回答1: If you want to modify a QML property from python you must create a Class that inherits from QObject and that is a qproperty , then export it to QML using setContextProperty() . main.py import sys from PyQt5.QtCore import QObject, pyqtSignal, pyqtProperty, QUrl, QTimer, QDateTime from PyQt5

Qt TextField is not invoking the keyboard when launched on Android device

时间秒杀一切 提交于 2020-01-04 08:19:13
问题 I have simple QML app, that shows only one TextField : Rectangle { color: "#00000000" TextField { anchors.centerIn: parent } } I thought, that Android keyboard will be shown automatically, when I touch on TextField , but it's not happening. I tried to use focus , Qt.inputMethod.show() , forceActiveFocus() inside Component.onCompleted of TextField and many other methods, but keyboard not shown anyway. Tried to use app on other devices and Android 4.1-4.4 versions, but result always the same ))

propagateComposedEvents: mouse data not accurate?

两盒软妹~` 提交于 2020-01-04 06:48:06
问题 Update: Isn't it often the way: you ask a question and then discover the answer on your own a short time later. It seems I have some confusion between referencing mouseX and mouseY in a MouseArea and getting the mouse data from the MouseEvent If I change my code below to: var pt = Qt.point( mouse.x, mouse.y) from what I had: var pt = Qt.point(mouseX, mouseY) Then the newly created sprites are located at the click point. That's great but I am still not understanding the difference,