qt-quick

QML window resize/move flicker

坚强是说给别人听的谎言 提交于 2019-12-06 18:18:22
问题 I'm developing a simple QML application right now and I noticed that resizing and moving a QML window generates an ugly flicker compared to a QtWidgets window, for instance. So I created 2 test applications to show the difference: QWidgets: QML: As you can see the QML version of the application flickers pretty ugly while the QtWidgets one is clean. Now this gets pretty ugly when your UI grows in complexity. Do you have any knowledge about this? Is this a bug? Is there any fix/workaround for

QtQuick animation freezing on list and open serial ports

旧时模样 提交于 2019-12-06 15:25:14
问题 I wrote a C++ method to find all serial ports, open, write and close and use to Q_INVOKABLE to call this method from a QML. At QML, first I push a LoadingPage.qml to StackView and then I call the find() Serial Ports, inside the onClicked: Button slot. The problem: It is a freezing on push a LoadingPage.qml to StackView if there are many serial ports connected, the animation start and then immediately freezes, when the function find finish the animation start again. [SerialPort.qml] How is it

how to integrate qml file into qt-widgets app?

荒凉一梦 提交于 2019-12-06 14:19:43
问题 I have an qt widgets application. I want to add the switch control to my form. I added to my form QDeclarative widget and add this line to the code but nothing shown. ui->declarativeView->setSource(QUrl::fromLocalFile("test.qml")); This is the content of the qml file (I added this file to the resources) It display in qtcreator under resources/[project_name.qrc]/test.qml import QtQuick 2.4 import QtQuick.Controls 1.3 Button{ text:aaaa } I added the pro file : qt += declarative What am i doing

Getting an all-white screen on deploying Qt Quick demo app Minehunt

老子叫甜甜 提交于 2019-12-06 08:15:12
To test the deployment process I am trying to deploy the included demo app Minehunt. I am able to get it to run, no crashing or errors, but the screen is all white. I believe this generally means that I am missing plugins. Dependency walker reports no problems, and I even tried including ALL the plugins from the Qt MingW plugins directory, but no such luck. Here is what I am including so far; Can anyone advise what else I need to add to get it to run? Your dlls don't look bad at all. I think, too, that it's your plugins. Even if they are there, there is a good chance, that your program don't

QML - main window position on start (screen center)

别说谁变了你拦得住时间么 提交于 2019-12-06 02:49:01
问题 How I can do following: I’d like show my main window on start on the center screen. 回答1: You'll need to setGeometry on your top-level widget before you show it. The easiest way I can think of to work out what geometry you need is via QDesktopWidget. Try the example below (create a QPushButton , press it while moving the widget around various screens) and you'll see what I mean: MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); connect

Creating a scalable, glossy/shiny button with Qt Quick

穿精又带淫゛_ 提交于 2019-12-06 01:59:39
问题 I'd like to create the glossy button below with Qt Quick (preferably with pure QML, no C++): It needs to be scalable, so I can't use PNGs, etc. My code so far: import QtQuick 2.3 import QtQuick.Controls 1.2 import QtQuick.Controls.Styles 1.2 ApplicationWindow { id: window color: "#cccccc" width: 200 height: 200 Button { id: button width: Math.min(window.width, window.height) - 20 height: width * 0.3 anchors.centerIn: parent text: "Button" style: ButtonStyle { background: Rectangle { gradient:

QtQuick: cannot playback any video on embedded linux

喜夏-厌秋 提交于 2019-12-05 21:28:03
I cross compiled Qt 5.2.1 for TI AM335x board using the toolchain provided by TI together with their SDK 6.00.00. Unluckily I am not able to reproduce any video in QML... The debug console tells: defaultServiceProvider::requestService(): no service found for – “org.qt-project.qt.mediaplayer” Is there something that I am missing in cross-compilation? maybe some dependencies? Can somebody help me in determining what I am missing? You can find here my cross-compilation configuration and here the full trace of messages produced by the application when setting the environment variable QT_DEBUG

Set common property value in QML such as QSS

大城市里の小女人 提交于 2019-12-05 16:39:53
For example i have 2 different QML elemnts with common property such as: import QtQuick 2.0 Rectangle { width: 360 height: 360 Text { id: t color: "red" text: qsTr("Hello World") anchors.top: parent.top } TextInput { text: qsTr("Hello all!") color: "red" anchors.top: t.bottom } } You can see, that Text and TextInput have equal property called "color" with equal value. In QSS i can use common property value, for example: QWidget { background: "red" } and all QWidgets, that belong the qss widget also will have red background. Is way for set common property in QML? There is no support for

Scaling pixel art with Qt Quick

喜夏-厌秋 提交于 2019-12-05 16:29:19
I have a Qt Quick game that uses pixel art. For example: import QtQuick 2.2 import QtQuick.Controls 1.1 ApplicationWindow { id: window visible: true width: 300 height: 300 title: qsTr("PixelArt") Image { source: "http://upload.wikimedia.org/wikipedia/commons/f/f0/Pixelart-tv-iso.png" anchors.centerIn: parent } } I want to scale the art, so I increase the size: import QtQuick 2.2 import QtQuick.Controls 1.1 ApplicationWindow { id: window visible: true width: 300 height: 300 title: qsTr("PixelArt") Image { source: "http://upload.wikimedia.org/wikipedia/commons/f/f0/Pixelart-tv-iso.png" anchors

QML Code Coverage Analysis

耗尽温柔 提交于 2019-12-05 12:31:07
问题 Are there any tools for performing code coverage analysis on QML code? Is such a question even applicable to a declarative language like QML? 回答1: There was a talk recently on QtCon about C++ and QML code coverage. https://conf.qtcon.org/en/qtcon/public/events/407 (Open the page and click on video link to watch) The talk was by Harri Porten who is co-founder and co-CEO of froglogic GmbH, a company which sells automated GUI testing tools. They also have a blog post about QML code coverage http