qtquick2

CMAKE_PREFIX_PATH doesn't help CMake in finding Qt5

依然范特西╮ 提交于 2020-07-04 13:49:26
问题 From here: https://stackoverflow.com/a/28327499/462608 I tried this: cmake_minimum_required(VERSION 2.8.12) project(qtquick_hello_cmake) set(CMAKE_PREFIX_PATH "/opt/Qt5.9.1/5.9.1/") set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) find_package(Qt5 COMPONENTS Quick Core REQUIRED) qt5_add_resources(RESOURCES qml.qrc) add_executable(${PROJECT_NAME} "main.cpp" "qml.qrc") qt5_use_modules(${PROJECT_NAME} Quick Core) target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5:

Qt error : The program has unexpectedly finished. The process was ended forcefully

戏子无情 提交于 2020-06-17 13:33:30
问题 I Started new project with Qt5 , and tried Qt Quick Project( QML ) on Windows10(64bit). Because I want to use various animations & effects. But I hit a brick wall, that I can't run & debug QML projects. First, I want to use swiping so I try swipe example, but the project makes an error. The run error is first image, and the debug error is second image. p.s - I tried somthing to solve the errors, which are updating NVIDIA driver, trying to release mode and making a new Qt Quick Application

Qt error : The program has unexpectedly finished. The process was ended forcefully

浪尽此生 提交于 2020-06-17 13:33:25
问题 I Started new project with Qt5 , and tried Qt Quick Project( QML ) on Windows10(64bit). Because I want to use various animations & effects. But I hit a brick wall, that I can't run & debug QML projects. First, I want to use swiping so I try swipe example, but the project makes an error. The run error is first image, and the debug error is second image. p.s - I tried somthing to solve the errors, which are updating NVIDIA driver, trying to release mode and making a new Qt Quick Application

What's the difference between QQuickView and QQuickWindow?

旧街凉风 提交于 2020-04-09 05:18:53
问题 I am currently working with Qt 5.2.1... and I have a (maybe stupid?) question: What is the difference between QQuickView and QQuickWindow ? I read the documentation but it is still not clear to me... 回答1: From the Qt documentation: The QQuickView class provides a window for displaying a Qt Quick user interface. QQuickView is a convenience subclass of QQuickWindow which will automatically load and display a QML scene when given the URL of the main source file. So QQuickView is a subclass of

Use Qt Design Studio QML with PySide2

人盡茶涼 提交于 2020-03-16 09:16:49
问题 I am new to Qt Designer Studio. I just created a simple button in Qt Design Studio and I am trying to use the QML file with PySide2 but I am getting multiple import errors. Is there a specific way to implement Qt Design Studio qml files with PySide2. The project name is Demo that I created in Qt Design Studio The Demo Project structure: Demo.qml Demo.qmlproject Demo.qmlproject.qtds imports qtquickcontrols2.conf Screen01.ui.qml The PySide2 project structure (main.py files includes the code):

ComboBox disable an item at a particular index

我只是一个虾纸丫 提交于 2020-03-02 08:56:06
问题 I have a combobox in qml in a as a TableViewColummn and I define it as follows: import QtQuick 2.3 import QtQuick.Window 2.2 import QtQuick.Layouts 1.1 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 ListModel { id: comboModel ListElement { text: "" Index: -1 Dims: -1 } } TableViewColumn { id: imageTypeList role: "ImageType" title: "Image Type" width: 100 delegate: Rectangle { ComboBox { anchors.verticalCenter: parent.verticalCenter anchors.margins: 2 model: comboModel

Is there a native data model from TreeView in QML?

烈酒焚心 提交于 2020-02-23 04:12:57
问题 The QT document had implied that any implementation of QAbstractItemModel can be used for TreeView. These models are usually in C++, which is inconvenient for now. So is there an native QML model which can be utilized in treeview? Can I set a QStandardItemModel model from C++, and use this model in qml? 回答1: The QStandardItemModel reference gives an example of how to use it for a TreeView: QStandardItemModel model; QStandardItem *parentItem = model.invisibleRootItem(); for (int i = 0; i < 4;

Is there a native data model from TreeView in QML?

拟墨画扇 提交于 2020-02-23 04:12:44
问题 The QT document had implied that any implementation of QAbstractItemModel can be used for TreeView. These models are usually in C++, which is inconvenient for now. So is there an native QML model which can be utilized in treeview? Can I set a QStandardItemModel model from C++, and use this model in qml? 回答1: The QStandardItemModel reference gives an example of how to use it for a TreeView: QStandardItemModel model; QStandardItem *parentItem = model.invisibleRootItem(); for (int i = 0; i < 4;

Qt : How to monitor a Q_PROPERTY change on C++ side instead of QML

独自空忆成欢 提交于 2020-02-06 11:28:51
问题 I am using Qt 5.9.3. I have following property declared in my app's main.qml Code: //main.qml MyQuickItem { property color nextColor onNextColorChanged: { console.log("The next color will be: " + nextColor.toString()) } } // MyQuickItem.h class MyQuickItem : public QQuickItem { } Question: How can I make onNextColorChanged be defined in the C++ side? I know that I can also make nextColor as a property inside C++ class MyQuickItem . like so // MyQuickItem.h class MyQuickItem : public

Qt : How to monitor a Q_PROPERTY change on C++ side instead of QML

随声附和 提交于 2020-02-06 11:27:19
问题 I am using Qt 5.9.3. I have following property declared in my app's main.qml Code: //main.qml MyQuickItem { property color nextColor onNextColorChanged: { console.log("The next color will be: " + nextColor.toString()) } } // MyQuickItem.h class MyQuickItem : public QQuickItem { } Question: How can I make onNextColorChanged be defined in the C++ side? I know that I can also make nextColor as a property inside C++ class MyQuickItem . like so // MyQuickItem.h class MyQuickItem : public