Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • 0 Votes
    6 Posts
    1k Views
    Q
    @SGaist You saved my time. Thanks for the input and my application worked after I have recreated the QNAM object and connected the necessary signals and slots into my current context. Thanks for your support.
  • QML and QT Quick error

    Unsolved
    33
    1 Votes
    33 Posts
    9k Views
    T
    @OttoRyynanen Thank you, I added QT_OPENGL=software in the Windows environment. It work
  • Is there a way to call the tableview again?

    Unsolved
    2
    0 Votes
    2 Posts
    156 Views
    jsulmJ
    @Kim-chang-hee Please don't double post! This is same question as in: https://forum.qt.io/topic/136727/how-to-call-tableview-again
  • module "QtQuick.Extras" is not installed

    Solved
    3
    0 Votes
    3 Posts
    2k Views
    A
    Ah, well thanks anyway.
  • Qml list disappeare and not visible sometimes

    Unsolved
    2
    0 Votes
    2 Posts
    160 Views
    MarkkyboyM
    You're not setting a ListView to display the ListModel, see here for answer; https://forum.qt.io/topic/134573/simple-listmodel-example
  • Material.accent color by name, only accepts enumerations?

    Unsolved
    5
    0 Votes
    5 Posts
    486 Views
    M
    @lemons Sorry for a late reply, I will try this tomorrow, thank you!
  • Different Compiler & Build system kit, Different Result.

    Unsolved
    1
    0 Votes
    1 Posts
    110 Views
    No one has replied
  • How to call tableview again?

    Unsolved
    3
    0 Votes
    3 Posts
    255 Views
    K
    @jsulm When I uploaded the code, it was cut off a bit, so I uploaded a capture, but I will upload it again with the code..!
  • Can I populate a TableView's rows with a C++ QVariantList?

    Unsolved
    4
    0 Votes
    4 Posts
    776 Views
    J
    Thanks for providing the update. I'm looking to do something similar at the moment, and am somewhat perplexed by the QAbstractItemModel approach. It seems overly complex for managing some basic data types in a QML TableView, and (from the initial research I've conducted) it seems that the 'roles' have to be pre-defined, which surely makes the use of a generic QAbstractItemModel-based class (i.e. one where the class can be instantiated for multiple QML TableViews within the one application, each with its own set of columns, etc.) either very complicated or not possible?
  • QML TableView delegate row height with multi-line text

    Unsolved
    3
    0 Votes
    3 Posts
    883 Views
    J
    I've made a bit of progress. I found this post on SO, which showed a way of producing a dynamic height for each row within the rowDelegate element: rowDelegate: Rectangle { height: (myModel.get(styleData.row).lineCount || 1) * 20 } I've modified this for my particular use case, and now have the following: rowDelegate: Rectangle { Component.onCompleted: { height = myTableModel.get(styleData.row).data.split("\n").length * 20 } } Note that in the above snippet, my 'myTableModel' refers to a ListModel (in my updated code), not the TableModel shown in my original post. The above code works, but it doesn't provide a complete solution. If my TableView were to be expanded to incorporate additional columns, a Math.max() calculation would have to be performed to process the .split("\n").length value of every single column, which doesn't seem like an efficient solution. The more pressing concern, is that this approach only caters to multi-line text strings that have explicit '\n' newline characters. The solution should also be able to account for text strings that have wrapped. Any ideas?
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    7 Views
    No one has replied
  • I have Qt Creator that has no Qt Quick Qml with C++ only with python

    Solved
    8
    0 Votes
    8 Posts
    804 Views
    M
    btw, I have another qt quick qml catergory here but I think it's different from Qt Quick Application C++ the normal which I find in tutorials I also have inquiry is Qt Qucik is relating to QML project only right? or it has another unique thing for speicifc projects? [image: 495098e5-dc64-4457-ae8d-45d9b70bc2ae.png]
  • Is there a way to create a tableview inside a button click event?

    Unsolved
    2
    0 Votes
    2 Posts
    148 Views
    N
    Im not sure what are you trying to achieve but you cant create objects like this with java script... (since button handlers are js functions and are not evaluated as qml code) , consider using a loader and a check-able button so that when the button is checked you set the loader visible or not visible (though you dont need a loader for that) or change the source component somthing like this: Item{ Button{id: someButton } Loader{ visible: someButton.checked sourceComponent:TableVIew{...} } } Also you might want to read this https://doc.qt.io/qt-5/qtqml-javascript-dynamicobjectcreation.html
  • How to set Qt::WA_AlwaysShowToolTips for QML Tool Window

    Unsolved
    2
    0 Votes
    2 Posts
    258 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    8 Views
    No one has replied
  • Stopping camera blocks ui thread

    Unsolved
    1
    0 Votes
    1 Posts
    151 Views
    No one has replied
  • Qt QML Map Antialiasing Problem

    Unsolved
    1
    0 Votes
    1 Posts
    201 Views
    No one has replied
  • How to adjust text font size relative to parent

    Solved
    2
    0 Votes
    2 Posts
    1k Views
    N
    I have found two possible solution: instead of creating a font property we can create our custom Text and setting the font corresponding to the parent size like this: import QtQuick Text{ property real pixelSize: Theme.fPixelSizeS property bool bold: false property string fontFamily: Theme.fFamily property real minPixelSize: 10 property font _font _font.pixelSize: pixelSize _font.family: fontFamily _font.bold: bold color: Theme.textDefault font: _font anchors.verticalCenter: parent.verticalCenter wrapMode: Text.WordWrap fontSizeMode: Text.HorizontalFit; elide: Text.ElideMiddle } create a binding to the Qt.font function and provide our defaults as primitives like this: QtObject{id: defaults readonly property string fFamily: "Segoe UI Semibold" } Text {id: someText width: parent.width height: parent.height font: Qt.font({ pixelSize: someText.height / 5, fontFamily: defaults.fFamily }) minimumPointSize: 10 fontSizeMode: Text.Fit } note that the second approach for some reason makes the console very chatty.
  • JsonModel/XmlModel vs nested ListModels

    Unsolved
    1
    0 Votes
    1 Posts
    126 Views
    No one has replied
  • How to bind a delegate item property to top-level property

    Unsolved
    13
    0 Votes
    13 Posts
    2k Views
    J
    @GrecKo Thank you for this syntax suggestion!