Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.6k Posts
  • always tips "Expected token :"

    Unsolved
    4
    0 Votes
    4 Posts
    895 Views
    J.HilkJ
    space is usually irrelevant, especially behind an assignment :
  • Pane not sizing properly based on childrenRect

    Solved
    6
    0 Votes
    6 Posts
    462 Views
    mzimmersM
    I got it working. The problem was I had various objects in the pane that were competing for available height (I think it confused the QML engine). This works: Pane { id: expandingRow property var hiddenContent property int collapsedHeight: 40 property bool expanded: false implicitHeight: expanded ? Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding) : collapsedHeight contentItem: ColumnLayout { id: columnLayout height: expandingRow.availableHeight width: expandingRow.availableWidth Pane { id: visiblePane Layout.preferredHeight: collapsedHeight - (expandingRow.padding * 2) Layout.preferredWidth: expandingRow.availableWidth Button { onClicked: expandingRow.expanded = !expandingRow.expanded } } Pane { id: hiddenPane contentChildren: hiddenContent visible: expandingRow.expanded Layout.preferredHeight: hiddenContent.height + (padding * 2) Layout.preferredWidth: expandingRow.availableWidth } } } Thanks to everyone who looked.
  • Proxy Model for Combining Table Models

    Unsolved
    11
    0 Votes
    11 Posts
    2k Views
    F
    @GrecKo This is what I'm working on implementing right now. Would there be a reason to use QAbstractTableModel over QSqlQueryModel?
  • How to check a variant valid or not in qml?

    Unsolved
    2
    0 Votes
    2 Posts
    517 Views
    F
    Use 'undefined' instead. var invalidValue = backend.GetInvalidQVar(); if (invalidValue == undefined) { console.log("Invalid"); } else { console.log("Valid"); }
  • "Unknown component. (M300)" for custom QML class

    Solved
    9
    0 Votes
    9 Posts
    26k Views
    e.sinohehE
    @shaan7 Works like magic
  • Doesn't seem Window in Design

    Unsolved
    1
    0 Votes
    1 Posts
    102 Views
    No one has replied
  • Custom Model with QML_ELEMENT

    Unsolved
    3
    0 Votes
    3 Posts
    238 Views
    S
    @GrecKo said in Custom Model with QML_ELEMENT: Maybe try explicitly exposing QSortFilterProxyModel? struct QSortFilterProxyModelForeign { Q_GADGET QML_FOREIGN(QSortFilterProxyModel) QML_NAMED_ELEMENT(QSortFilterProxyModel) // or QML_ANONYMOUS }; I tried without success...
  • "TypeError: Cannot read property..." on app quit while using custom QML elements

    Solved
    9
    1 Votes
    9 Posts
    4k Views
    KH-219DesignK
    @GrecKo you are a life-saver. Not only is your method simpler, but it works for my cursed Singletons, too! app.aboutToQuit.connect(engine.deleteLater) or in my case (because this is a hybrid app that embeds a QML view inside a larger widgets app): QtWidgets.QApplication.instance().aboutToQuit.connect(qml_view.rootContext().engine().deleteLater)
  • [SOLVED] Time Conversion

    15
    0 Votes
    15 Posts
    18k Views
    JonBJ
    @__mk__ said in [SOLVED] Time Conversion: Unfortunately, you cannot construct a QTime object directly from a millisecond value What about (untested) QTime QTime::fromMSecsSinceStartOfDay(int msecs) Returns a new QTime instance with the time set to the number of msecs since the start of the day, i.e. since 00:00:00. ?
  • Thumb wheel control?

    Solved
    3
    0 Votes
    3 Posts
    357 Views
    R
    Thank you so much! This gets me 95% of the way there.
  • Video plays on a new Window while launched through gstreamer in Qt6 qml application

    Unsolved
    20
    0 Votes
    20 Posts
    2k Views
    SGaistS
    You would have to build the plugin yourself and link against it.
  • Newbie help with integrating GUI into existing CLI app

    Unsolved
    2
    0 Votes
    2 Posts
    185 Views
    SGaistS
    Hi and welcome to devnet, I would suggest you take a look at Qt's network module examples. Especially the fortune client and server. This should give you a starting point.
  • QtVirtualKeyboard in a QQuickWidget

    Unsolved
    1
    0 Votes
    1 Posts
    114 Views
    No one has replied
  • QML Camera error

    Unsolved camera camerabin
    1
    0 Votes
    1 Posts
    276 Views
    No one has replied
  • Qt6 - show in ComboBox specified column

    Solved
    2
    0 Votes
    2 Posts
    262 Views
    freaksddF
    i got it! The Solution was so simple. For the reimplementation of the QSqlRelationalTableModel i have to define the roleNames. But i doesn't misunderstood the roleTypes. The RoleTypes are pre-defined by Qt like Qt::UserRole or Qt::DisplayRole. To define roles by my self i can use the values over Qt::UserRole (like Qt::UserRole + i). I add simply the first role {Qt::DisplayRole, "display"} to my roleNames and after that my specified roleNames for the other columns. To different the roles to show the correct data yout will reimplement data(...) and figure it out, which roleName the ui be asking for. That's all
  • Qt6 QML Loader doesn't work with CaptureSession

    Unsolved
    1
    0 Votes
    1 Posts
    172 Views
    No one has replied
  • User interface for restaraunts

    Unsolved
    5
    0 Votes
    5 Posts
    437 Views
    P
    what you need to do is install QT design Studio, and make the User Interface there
  • Plasma Wallpaper Plugin using QtWebEngine

    Unsolved
    3
    0 Votes
    3 Posts
    296 Views
    A
    Thanks @SGaist I will try to post it there then
  • Checking installation and properly using Qt6.3.2 Platform plug-in

    Unsolved
    1
    0 Votes
    1 Posts
    149 Views
    No one has replied
  • Implementing proper C++ model for QML

    Solved
    6
    0 Votes
    6 Posts
    565 Views
    GrecKoG
    @bidjiz said in Implementing proper C++ model for QML: Is also important. It should not be on stack. It can be on the stack, it just has to be constructed before the engine.