qt

How to set initial value of a custom slider in qml?

陌路散爱 提交于 2021-02-08 04:07:46
问题 I am using Qt 5.4.1. I have made a custom slider element to be used in other qml components like so: Slider.qml import QtQuick 2.4 import QtQuick.Controls 1.3 import QtQuick.Controls.Styles 1.3 Item { id: root width: 150 height: 30 property int val: slider.value property int maxVal: slider.maximumValue property int minVal: slider.minimumValue property int step: slider.stepSize Slider { id: slider anchors.margins: 20 stepSize: step maximumValue: maxVal minimumValue: minVal style: customStyle /

How to set initial value of a custom slider in qml?

…衆ロ難τιáo~ 提交于 2021-02-08 04:07:34
问题 I am using Qt 5.4.1. I have made a custom slider element to be used in other qml components like so: Slider.qml import QtQuick 2.4 import QtQuick.Controls 1.3 import QtQuick.Controls.Styles 1.3 Item { id: root width: 150 height: 30 property int val: slider.value property int maxVal: slider.maximumValue property int minVal: slider.minimumValue property int step: slider.stepSize Slider { id: slider anchors.margins: 20 stepSize: step maximumValue: maxVal minimumValue: minVal style: customStyle /

How to set initial value of a custom slider in qml?

时光怂恿深爱的人放手 提交于 2021-02-08 04:06:47
问题 I am using Qt 5.4.1. I have made a custom slider element to be used in other qml components like so: Slider.qml import QtQuick 2.4 import QtQuick.Controls 1.3 import QtQuick.Controls.Styles 1.3 Item { id: root width: 150 height: 30 property int val: slider.value property int maxVal: slider.maximumValue property int minVal: slider.minimumValue property int step: slider.stepSize Slider { id: slider anchors.margins: 20 stepSize: step maximumValue: maxVal minimumValue: minVal style: customStyle /

QT QML how to change only one feature of a, say, button style

大兔子大兔子 提交于 2021-02-08 04:01:12
问题 changing the style of a component, seems to replace all the features of the default style. is there a way to change only one feature? For example, suppose i want a red button; import QtQuick 2.7 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 ApplicationWindow { visible: true width: 640 height: 480 Button { height: 200 width: 200 text: "Press me" style: ButtonStyle { // changes background but also throws away everything else // in standard button style background: Rectangle {

Using QtWebDriver to create Qt's automated tests

我只是一个虾纸丫 提交于 2021-02-08 03:59:52
问题 I would like to create automated tests for a Qt's app with selenium + QtWebDriver . I have read the QtWebDriver's wiki , and some questions on stackoverflow like this one However, I'm still not able to use QtWebDriver . I don't understand how to link selenium and QtWebDriver together. there are a lot of questions that I can't answer. How can I use Python to create automated tests for my own Qt's App based on selenium + QtWebDriver ? How can I link my Qt's app with selenium + QtWebDriver ?

Force QMediaPlayer to update position accurately for video scrubbing application?

∥☆過路亽.° 提交于 2021-02-07 22:48:19
问题 I am writing an application which will allow the user to scrub through an open video. Developing on Windows 7/8 with Qt 5.3, I have been using QMediaPlayer and QVideoWidget following the qvideowidget example project. The result has been pretty good, except that the QVideoWidget seems only to update during idle time. Still, it's a good start and it's usable. However, when I build on Mac OS 10.10 (again with Qt 5.3), scrubbing behaves as though there were only one frame per second in the video.

Force QMediaPlayer to update position accurately for video scrubbing application?

Deadly 提交于 2021-02-07 22:48:19
问题 I am writing an application which will allow the user to scrub through an open video. Developing on Windows 7/8 with Qt 5.3, I have been using QMediaPlayer and QVideoWidget following the qvideowidget example project. The result has been pretty good, except that the QVideoWidget seems only to update during idle time. Still, it's a good start and it's usable. However, when I build on Mac OS 10.10 (again with Qt 5.3), scrubbing behaves as though there were only one frame per second in the video.

Vertical QToolBar from MainWindow

不想你离开。 提交于 2021-02-07 21:57:25
问题 What I want: http://puu.sh/3oUjh.jpg What I have: http://puu.sh/3oUnI.png The toolbar is made in mainwindow.ui, ive tried ui->_toolbar->setLayoutDirection(Qt::LeftToolBarArea); But I get this error: no matching function for call to 'QToolBar::setLayoutDirection(Qt::ToolBarArea)' 回答1: You can use QToolBar::orientation property: ui->myToolbar->setOrientation(Qt::Vertical); You can also use QMainWindow::addToolBar : addToolBar(Qt::LeftToolBarArea, ui->myToolbar); Note that by default the user is

Show Toast in Android by sending string from c++ JNI in qt

会有一股神秘感。 提交于 2021-02-07 21:13:57
问题 I am trying display a toast on the Java method call from C++ side I have managed to call that method and even getting string but Toast is not working I have tried almost everything with context and all C++ Side JavaVMAttachArgs args = { JNI_VERSION_1_6, NULL, NULL }; vm->AttachCurrentThread( &env, &args ); activityConstructor = env->GetMethodID(activity, "<init>", "()V"); jobject object = env->NewObject(activity, activityConstructor); toastID = env->GetMethodID(activity, "toast", "(Ljava/lang

How to interface QML and Java?

感情迁移 提交于 2021-02-07 20:54:10
问题 If QML is used for GUI and Java for developing API for a linux based device,How to interface QML with Java? 回答1: One approach for cross platform integration is using web service. I would probably expose my Java code as a RESTful web service (See JAX-RS) and invoke it from QML using XMLHttpRequest. It's also worth mentioning Java GUI library such as swing / JavaFX has cross platform capability, so it should still run on Linux (and whichever platform runs Java). You might not need to write QML