qml

Deploying Qt Qml app to Windows 8 shows me a blank window

空扰寡人 提交于 2019-12-25 02:46:17
问题 I'm trying to deploy a QML app, but I keep getting a blank small window instead of my qml based window. The things I've tried: I added my qml in the resources, in Mac the deployment now works... but even if I copy the qml dir to my .exe dir, it doesn't work I've copied the qwindows.dll to the platforms dir in my .exe dir I've copied all the dependencies dll: icudt51.dll, icuin51.dll, icuuc51.dll, libEGL.dll, libGLESv2.dll, Qt5Core.dll, Qt5Gui.dll, Qt5Network.dll, Qt5Qml.dll, Qt5Quick.dll I've

OpenCV + QML (grabbing frame from another thread)

荒凉一梦 提交于 2019-12-25 01:33:48
问题 I have a problem to read OpenCv Mat from other thread and display it in QML. Firstly I create Mat in other thread and prevent update it until QML will not display it: void DesktopVideoProducer::process(){ while(true){ if(!camera.isOpened()) camera.open("http://192.168.43.1:8080/video"); camera >> mat; if(!frameReady && !mat.empty()){ outMat = cv::Mat(10, 10, 1); qDebug() << "!!!! = " << outMat.data; frameReady = true; } } } In qDebug() << "!!!! = " << outMat.data; I see that outMat has data !

TreeView Delegate with MouseArea: propagate mouse

谁说胖子不能爱 提交于 2019-12-25 01:09:14
问题 I have a TreeView with a custom delegate. The delegate uses a ToolTip , which will be shown if the delegates mouseArea is hovered. However, this mouseArea breaks selecting a row in my TreeView . I suppose that a click is not propagated to the TreeView 's mouseArea. I tried propagateComposedEvents and mouse.accepted=false but selection does still not work. TreeView { id: view anchors.fill: parent sortIndicatorVisible: true model: fileSystemModel rootIndex: rootPathIndex selection: sel

Cast a shadow with Popup

与世无争的帅哥 提交于 2019-12-25 00:58:16
问题 Here is my MWE: import QtQuick.Window 2.2 import QtQuick.Controls 2.1 import QtQuick 2.0 import QtGraphicalEffects 1.0 ApplicationWindow { id: window width: 400 height: 400 visible: true Button { text: "Open" onClicked: popup.open() } Popup { id: popup x: 100 y: 100 width: 200 height: 300 modal: true focus: true closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside Rectangle { id: popRect; color: "red"; //anchors.centerIn: parent width: parent.width; height: parent.height; } }

Trouble using QML material design: “QtQuick.Controls.Material” is not installed

末鹿安然 提交于 2019-12-25 00:47:59
问题 I'm following this tutorial and I'm having a lot of QML module errors. I had to modify to QtQuick.Controls 1.1 because 2.0, 2.1, 2.3 wouldn't work. Here's my QML now: import QtQuick.Window 2.1 import QtQuick 2.0 import QtQuick.Controls 1.1 import QtQuick.Controls.Material 2.1 Now I get only "QtQuick.Controls.Material" is not installed I'm using Ubuntu 17.10.1 and my PyQt reports version 5.7 . Qt's website says: Import Statement: import QtQuick.Controls.Material 2.3 Since: Qt 5.7 but it won't

Connect QAbstractTableModel with QML TableView

我的梦境 提交于 2019-12-25 00:37:40
问题 I have subclassed the QAbstractItemModel in order to create a very generic model, here are the files: cvartablemodel.h #ifndef CVARTABLEMODEL_H #define CVARTABLEMODEL_H #include <QObject> #include <QAbstractTableModel> #include <QList> #include <QVariant> /** * @brief Provides a QAbstractTableModel override class that implements the * API for MDE variables storing, reading and writing. */ class CVarTableModel : public QAbstractTableModel { public: /** * @brief An enumeration class providing

Maximize Rectangle to fit application window QML

為{幸葍}努か 提交于 2019-12-25 00:31:12
问题 I need to make one Rectangle in QML maximize when user make double click on it. To do that, I define a Rectangle that contains MouseArea with onDoubleClicked handle. My question is: What I need to put in this handle to make Rectangle fit with app window maximized (not fullscreen, maximized). Rectangle { id: rectangle MouseArea{ onDoubleClicked:{ // TODO HERE } } } EDIT 1: I have added two states ("MINIMIZED" and "MAXIMIZED") and one reversible transition. 回答1: Assuming no anchoring is set

How to dynamically update a child combobox from parent combobox

可紊 提交于 2019-12-25 00:25:44
问题 I have a QML app that has two combo boxes, one is parent (country) combo box, other one is child (city) combo box. When selecting a country, the child combo box should have cities of the country at the same time. I have a code that first combo box selects country but it doesn't set the list model of city's combo box. It sets after reopening the app. import QtQuick 2.11 import QtQuick.Window 2.11 import QtQuick.Controls 2.4 import QtQuick.Layouts 1.3 import Qt.labs.settings 1.0

How to get Clicked or Pressed event on QML TableView header?

空扰寡人 提交于 2019-12-25 00:23:05
问题 I I´m trying get the click or press event on QML TableView Header. I have tried on HeaderDelegate create a MouseArea with width, height and anchors.fill from the parent, and get the onClicked or onPressed events, but don´t work. Example: MouseArea { width: parent.width height: parent.height anchors.fill: parent onClicked: { console.debug("CLICKED: "+styleData.pressed) console.debug("COLUMN: "+ styleData.column) } onPressed: { console.debug("PRESSED: "+styleData.pressed) console.debug("COLUMN:

Accessing Structure inside a structure in QML

白昼怎懂夜的黑 提交于 2019-12-24 20:49:08
问题 Previously I posted a question on how to access structures in QML and got perfect answers from some awesome people and now i need to know is there any way to access structure inside a structure in QML , Following is the code : //MyNewStruct struct MyNewStruct { Q_GADGET float m_range; Q_PROPERTY(float range MEMBER m_range) }; //MyStruct struct MyStruct { Q_GADGET int m_val; QString m_name1; QString m_name2; QString m_name3; QString m_name4; MyNewStruct m_newStr; //**new Struct declaration Q