qtquickcontrols2

How to set currentIndex of SwipeView to currentIndex of TabBar “by reference” after going to specific page?

早过忘川 提交于 2019-12-05 11:05:07
I'm getting started with QtQuick Controls 2.0. I have experience with C++ and a small amount of experience with Qt, but I have not worked with QML before. I have a TabBar and a SwipeView that are linked to each other. What I mean by this is that when you select a page on the TabBar , the SwipeView goes to that page. When you swipe to a page from the SwipeView , the TabBar updates itself to reflect that. As a learning exercise, I decided to create a button that would send the user to the second page. The issue is that I can't seem to find a way to do so without messing up the link between the

System tray icon without widgets

China☆狼群 提交于 2019-12-05 05:43:42
I'm wondering if there's a way to implement system tray icon + menu functionality without widgets module? jpnurmi Qt 5.8 introduces a SystemTrayIcon QML type in the experimental Qt Labs Platform module, as part of the Qt Quick Controls 2 offering. It uses a native implementation directly from the Qt Platform Abstraction layer where available, and Qt Widgets as a fallback on other platforms. 来源: https://stackoverflow.com/questions/41095630/system-tray-icon-without-widgets

Qt Quick Controls 2 and TableView

霸气de小男生 提交于 2019-11-30 14:57:16
问题 Is it OK to use TableView in Quick Controls 2.0 application? This will require to have both imports: import QtQuick.Controls 1.4 import QtQuick.Controls 2.0 Will I get any side effects? Another related question: it seems that TableView belongs to Quick Controls 1.0 set. Is it? Does it mean that if it's possible to use TableView then it's possible to use all the Quick Controls 1.0 controls in Quick Controls 2.0 application? 回答1: While it is possible to mix Qt Quick Controls 1 and 2 in the same

Strange //! comment syntax in Quick Controls 2.0 QML source [duplicate]

僤鯓⒐⒋嵵緔 提交于 2019-11-28 09:09:09
问题 This question already has an answer here : //! [0] in Qt source code (1 answer) Closed 3 years ago . While looking through Quick Controls 2.0 sources, I came upon a peculiar comment syntax that I can't seem to find in docs: //! [property] property: ... ... //! [property] for example, pairs of //! [contentItem] , //! [background] could be seen in TabButton.qml . I wonder if this is just a convention chosen by the developers to delimit regions of code, or does it indeed have some special

How do I apply the style to a TextField in QML? It seems “style” attribute isn't available

做~自己de王妃 提交于 2019-11-28 01:15:02
I am trying to apply some styles to a new qt 5.7 application I am working on and the following is not working at all. It gives the error: qrc:/SignInView.qml:67 Cannot assign to non-existent property "style" And I can't edit it in design mode for the same reasons. import QtQuick 2.7 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.1 import QtQuick.Controls.Styles 1.4 Page { id: page1 ColumnLayout { id: columnLayout1 height: 100 anchors.right: parent.right anchors.left: parent.left anchors.top: parent.top Label { text: qsTr("Label") font.pointSize: 16 horizontalAlignment: Text.AlignHCenter