Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.6k Posts
  • Flickable in SwipeView in Popup cancells overshoot movement on mouse scroll

    Unsolved
    2
    0 Votes
    2 Posts
    164 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
    679 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
    421 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
    659 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
    186 Views
    No one has replied
  • Qt Quick Windows slightly jerky

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

    Solved
    8
    0 Votes
    8 Posts
    624 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
    447 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.
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    54 Views
  • Multiple QSortFilterProxyModel on single data model segmentation fault

    Unsolved
    3
    0 Votes
    3 Posts
    303 Views
    S
    @SGaist I have been able to create a minimal example that shows the problem i am running into. Drive link here. Not that is i set the data directly on the source model, the segfault disappears but then the external window shows no layout at all. // Replacing this with setting the data directly in teh source model causes the external window ui not to display view_id = window_view_id // model.sourceModel.setData(item_index, window_view_id, 257) Regards, Sisco
  • inserting spaces between GridView delegates

    Solved
    4
    0 Votes
    4 Posts
    360 Views
    jeremy_kJ
    @mzimmers said in inserting spaces between GridView delegates: Thanks, @jeremy_k -- the missing ingredient was the intermediate Item in the delegate. I decided to implement it with a Pane instead: That's your choice of course, but a Pane with a transparent Rectangle background is more overhead than an Item. At minimum, it's two container items per delegate instance instead of one. May I ask why you chose the syntax: GridView { delegate: Item { width: GridView.view.cellWidth Using the attached property gives the delegate greater independence from the particular context. It doesn't need to change if the GridView id changes. Think about it in the same way as using anchors.fill: parent instead of anchors.fill: <id of parent item>.
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    60 Views
    No one has replied
  • Speed gauge needle malfunction

    Unsolved
    5
    0 Votes
    5 Posts
    422 Views
    S
    and this is the content of needle file : import QtQuick 6.2 Item { id: speedNeedle property int value: 0 property int startAngle: 0 property real angleLength: 1.0 width: parent.width height: parent.height Rectangle { id: needle width: speedNeedle.width * 0.02 height: speedNeedle.height * 0.45 color: "red" anchors.horizontalCenter: parent.horizontalCenter antialiasing: true y: id_root.height * 0.05 transform: Rotation { origin.x: needle.width / 2 origin.y: needle.height angle: speedNeedle.startAngle + speedNeedle.value * speedNeedle.angleLength } } }
  • Qt5 QML Unknown component

    Solved
    7
    0 Votes
    7 Posts
    756 Views
    P
    @sierdzio Thank you for your answer to solve my doubts. I think we can try qmldir or discuss with colleagues about switching the project back to use qmake. XD
  • How to play video using QML with start video any time?

    Unsolved
    1
    0 Votes
    1 Posts
    118 Views
    No one has replied
  • ESRI map plugin not working / shows solid gray map

    Unsolved
    5
    0 Votes
    5 Posts
    615 Views
    P
    I faced similar problem. Not only esri but also with mapbox and here map. I can only display the OSM and Mapbox GLmap. I am not sure why. I usually use Here map plugin but I found this problem and it occurs on Esri as well. With Mapbox, I got the error: " Problem with tile image" but I got no error for esri. Weird.
  • Show VirtualKeyboard in Dialog. Loop detected

    Unsolved
    1
    0 Votes
    1 Posts
    114 Views
    No one has replied
  • Can't use ConicalGradient as Shape stroke color in Qt 6

    Unsolved
    1
    0 Votes
    1 Posts
    403 Views
    No one has replied