Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.5k Posts
  • Change color of QML Button

    Solved
    6
    0 Votes
    6 Posts
    31k Views
    A
    Hi there! dear @Leon_2001, As you've said, by setting the Material.background and other properties of Material attached property in the root Item of the application, All the children components, like buttons and other controls, should use the same background color. but this does not work and I have to set the Material.background for each Item that I am using in my application. I could not find out what causes this to happen while in the documents, it is stated that by setting the background for the root Item, it propagates for all children items. could you clarify this for me?
  • Implement QtWaylandCompositor as part of a bigger QML Application

    Unsolved
    1
    0 Votes
    1 Posts
    107 Views
    No one has replied
  • TableView positionViewAtRow

    Solved
    2
    0 Votes
    2 Posts
    285 Views
    rincewindR
    OK, it seems you have to delay the positionViewAtRow call until the model data is loaded. Timer { id: positionTimer interval: 100 running: false repeat: true onTriggered: { if (dataModel.rowCount > 0) { tableView.positionViewAtRow(dataModel.rowCount - 1, TableView.Contain, 0, Qt.rect(0, 0, 0, 0)); running = false; } } } And activate it. TableView { id: tableView model: dataModel Component.onCompleted: positionTimer.running = true }
  • Render QML to images/buffer in QT6

    Unsolved
    2
    0 Votes
    2 Posts
    209 Views
    J
    Maybe you could use QQuickRenderControl.
  • Using the QML Popup control, the modal: true virtual keyboard cannot be used

    Unsolved
    4
    1 Votes
    4 Posts
    489 Views
    A
    at least this works fine with QtVKB on Windows + Qt 6.7 import QtQuick import QtQuick.Controls Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Popup { id: popup y: 100 modal: true focus: true TextField { } } Button { text: "open" onClicked: popup.open() } }
  • Qt quick Application deploy

    Unsolved
    5
    0 Votes
    5 Posts
    307 Views
    H
    @sierdzio After completing the quick project, I added "WinQt.exe" to the system path, Then cmd executes "windeployqt F:\Qt_project\untitled3\Analyse\Analyse.exe --qmldir F:\Qt_project\untitled3\content"; In order to prevent missing DLLS, I will copy all the DLLS under "D:\QT\6.8.0\llvm-mingw_64\bin", but double-click exe still can not run, cmd no output
  • passing properties into Components

    Solved
    2
    0 Votes
    2 Posts
    211 Views
    B
    I think the issue is that you expect to be using the order property you have defined in your Loader but you have also declared an uninitialised order property in your Component which will hide the order defined in the Loader. If you didn't have the order property in your Component, you would simply be able to refer to order (not innerPane.order) as it would be inherited from the context provided by Loader.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • Vulkan headers

    Unsolved
    3
    0 Votes
    3 Posts
    1k Views
    mzimmersM
    FWIW, I'm on Windows 11 and I used to get those warnings. Installing the Vulkan SDK eliminated them.
  • Accessing StackView in Qt 6.5

    Unsolved
    2
    1 Votes
    2 Posts
    529 Views
    A
    did you find the solution to this? I'm facing the same problem
  • Flickable in SwipeView in Popup cancells overshoot movement on mouse scroll

    Unsolved
    2
    0 Votes
    2 Posts
    163 Views
    S0ulM1keS
    Update: Changing Flickable to ScrollView solved the issue. But still it's unclear why this behavior happens with Flickable
  • How are you creating Qt Quick Test with cmake?

    Unsolved
    2
    1 Votes
    2 Posts
    671 Views
    D
    Hi @CKurdu, I'm a bit late, but I stepped on a solution that worked for me. I wanted to share it here for the benefit of future developers who might be facing the same issue. CMakeList.txt cmake_minimum_required(VERSION 3.20) project(tests) enable_testing() find_package(Qt6 REQUIRED COMPONENTS QuickTest Qml) add_definitions(-DQUICK_TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}") add_executable(${PROJECT_NAME} tst_case.cpp) add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME}) target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::QuickTest Qt6::Qml ) tst_case.cpp #include <QtQuickTest> QUICK_TEST_MAIN(tests) tst_main_component.qml import QtQuick import QtTest TestCase { name: "main" function test_case1() { compare(1 + 1, 2, "sanity check"); verify(true); } }
  • Custom QML Chart (realtime data)

    Solved qml chart plot chartvi
    8
    0 Votes
    8 Posts
    6k Views
    A
    Hi, Thanks for sharing your experience. I tried to lunch the code but it only shows a "crashed" error. @romain-donze would you please (if possible) share this project for me? I'm also a newbie and trying to visualize some real time data in histograph chart.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Using C++ as Value of List Element in QML

    Unsolved
    2
    0 Votes
    2 Posts
    408 Views
    A
    Hi, looks like you haven't read the documentation yet: https://doc.qt.io/qt-6/qml-qtqml-models-listelement.html It clearly says what type of values ListElement accept: Values must be simple constants; either strings (quoted and optionally within a call to QT_TR_NOOP), boolean values (true, false), numbers, or enumeration values (such as AlignText.AlignHCenter). From 5.11 ListElement accepts callable roles: Beginning with Qt 5.11 ListElement also allows assigning a function declaration to a role. This allows the definition of ListElements with callable actions. What you should do is to create a class subclassing from QAbstractListModel to fetch your data and then pass it to QML. Or use ListModel dynamically without declaring any ListElement to manipulate it through its API. https://doc.qt.io/qt-6/qabstractlistmodel.html https://doc.qt.io/qt-6/qml-qtqml-models-listmodel.html
  • Avoiding duplicate `objectName` and `id` in Qml

    Unsolved
    3
    3 Votes
    3 Posts
    641 Views
    GrecKoG
    Not as straight forward as using objectName but you could retrieve the id of an object in a context with QQmlContext::nameForObject. The trick is to get the context you want because an object can have different ids in different contexts.
  • QtQuick3D shown as not installed when it is

    Unsolved
    1
    0 Votes
    1 Posts
    183 Views
    No one has replied
  • Qt Quick Windows slightly jerky

    Unsolved
    1
    0 Votes
    1 Posts
    97 Views
    No one has replied
  • Qt Location and wms flow

    Solved
    8
    0 Votes
    8 Posts
    612 Views
    SGaistS
    AFAIK, yes. Qt support grabbing tiles so if the servers you want to use provides them in a standard way, it should be good.
  • TableView not working correctly at displaying the header's data on qt 6.7.0

    Unsolved
    2
    0 Votes
    2 Posts
    430 Views
    A
    Yes, I see the exact same thing. Looks like a regression. Please file a bug. [EDIT] Several bugs filed on this already: https://bugreports.qt.io/browse/QTBUG-120315?filter=-4&jql=text ~ "headerData" order by created DESC Basically, you need to map the userRole properly... else the QML cannot access. It is correctly using the userNames function now.