Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.2k Topics 77.9k Posts
  • 0 Votes
    1 Posts
    19 Views
    No one has replied
  • Using stackview with qrc

    Solved
    5
    0 Votes
    5 Posts
    41 Views
    EwaldVDME
    Thank you! I got rid of the .qrc file: https://forum.qt.io/topic/145308/qt-6-5-qml-in-qrc-vs-qt_add_qml_module-what-is-better/3 CMakeLists.txt: set_source_files_properties(qml/MyApp/Main.qml PROPERTIES QT_RESOURCE_ALIAS "Main.qml") set_source_files_properties(qml/MyApp/pages/LoginPage.qml PROPERTIES QT_RESOURCE_ALIAS "pages/LoginPage.qml") qt_add_qml_module(appultiphone URI MyApp VERSION 1.0 RESOURCE_PREFIX "/" QML_FILES qml/MyApp/Main.qml qml/MyApp/pages/LoginPage.qml RESOURCES assets/fonts/Fredoka/Fredoka-Regular.ttf assets/icons/logo.png ) StackView { id: stack anchors.fill: parent initialItem: "qrc:/MyApp/pages/LoginPage.qml" <-------------- } So, as I understand it, we specify the URI MyApp (Which gets loaded in main.cpp as a module) and then append the alias you give it in the set_source_file_properties()
  • 0 Votes
    1 Posts
    18 Views
    No one has replied
  • 0 Votes
    4 Posts
    56 Views
    SGaistS
    Hi and welcome to devnet, Glad a solution has been found and thanks for the follow-up ! You can mark the thread as solved yourself using the "Topic Tools" button or the three dotted menu beside the answer your deem correct :-)
  • QML MaximumBlockCount on TextArea

    Unsolved
    10
    0 Votes
    10 Posts
    2k Views
    Z
    const QQuickItem *rootObject = m_logWidget->rootObject(); m_logTextArea = rootObject->findChild<QObject *>("logTextArea"); const auto *quickTextDocument = qvariant_cast<QQuickTextDocument *>(m_logTextArea->property("textDocument")); auto *textDocument = quickTextDocument->textDocument(); textDocument->setMaximumBlockCount(10); Setting on C++ side works for me.
  • Macos theme 6.9.2 to 6.10 broken?

    Unsolved
    1
    0 Votes
    1 Posts
    30 Views
    No one has replied
  • Correct way for a popup or overlay?

    Unsolved
    2
    0 Votes
    2 Posts
    62 Views
    GrecKoG
    I'm not sure what is the question. You are creating a Popup and that's the correct approach to have something above the rest of your content. You also set the close policy according to what I assume is what you want. As you also identified, your dynamic object creation can be improved. My rule of thumb: don't ever use Qt.createComponent, and use createObject lightly. I'd argue here that using createObject is the correct approach for creating a popup. You can just use a declaratively created Component instead. As for creating items from a list, you should use a ListView or a Repeater instead. With a DelegateChooser if you need different delegates.
  • Qt.callLater() and invalid context

    Unsolved
    2
    0 Votes
    2 Posts
    52 Views
    SGaistS
    Hi, Intuitively, I would say you are using it correctly Likely an unintended consequence I would think so You should check the bug report system to see if this is something known. If not please open a new ticket containing a complete minimal buildable example showing this.
  • QRhi dynamic uniform buffer scope

    Unsolved
    2
    0 Votes
    2 Posts
    200 Views
    S
    Did you get that to work in the end? From: https://doc.qt.io/qt-6/qrhi.html "writing to a dynamic buffer multiple times within a frame, in case such buffers are backed by host-visible memory, will result in making the results of all writes are visible to all draw calls in the command buffer of the frame, regardless of when the dynamic buffer update was recorded relative to a draw call"
  • Dialog standardButtons localization

    Unsolved
    3
    0 Votes
    3 Posts
    115 Views
    CattivikC
    Thanks @Bandler for your reply. I started a test application from this example: https://doc.qt.io/qt-6/qtlinguist-localizedclock-example.html. I'm doing the same to load myApp_xx.qm and then the other translator: I think that button texts are translated in qtbase_xx.qm file (qtquickcontrols was changed into qtdeclarative according to this, but it does not contain what I need). In my application I have a button to open a standard message dialog like this: MessageDialog { title: qsTr("This is a standard message dialog") text: qsTr("The document has been modified.") informativeText: qsTr("Do you want to save your changes?") buttons: MessageDialog.Yes | MessageDialog.No } and a dropdown to change language and locale dynamically. Something strange happens in two cases. Case #1 run application (default language is english) open the message (button texts are Yes and No) every attempt to change language fails for message buttons: all other application texts are correctly translated but message button texts remain in english. Case #2 run application (english default) change language to japanese (for example) open the message, and yes, now button text are in japanese! BUT every attempt to change language again fails from now on: message button texts still remain in japanese while all other texts in the app are correctly translated. For that reason I can imagine that MessageDialog component doesn't support dynamic translation, maybe. Hope this helps. -C
  • QML Repeater with Qt Graphs Invalid Y Values

    Unsolved qabstractmodel qml c++ qml qt graphs repeater
    1
    0 Votes
    1 Posts
    48 Views
    No one has replied
  • 0 Votes
    5 Posts
    252 Views
    G
    Thanks a lot @Pl45m4 for your time ! With this link (https://doc.qt.io/qtforpython-6/examples/index.html) i found some good examples ! However i face a big problem it seems impossible to embed QWidgets (like PyQtGraph or Matplotlib plots) directly in a QML panel. I'm looking for alternatives or solution but nothing ... Thanks
  • Qt6.8 QML ListView Bug: Cannot click item in the list while scrolling ListView

    Solved
    2
    0 Votes
    2 Posts
    103 Views
    J
    This bug has been fixed in Qt6.10.1 https://bugreports.qt.io/browse/QTBUG-135931 Reg[6.8.2-6.9.0]ListView containing AbstractSeries does not scroll on Drag
  • 0 Votes
    2 Posts
    108 Views
    GrecKoG
    https://doc.qt.io/qt-6/qtquickcontrols-customize.html#customization-reference Note: The macOS and Windows styles are not suitable for customizing. It is instead recommended to always base a customized control on top of a single style that is available on all platforms, e.g Basic Style, Fusion Style, Imagine Style, Material Style, Universal Style. By doing so, you are guaranteed that it will always look the same, regardless of which style the application is run with. To learn how to use a different style, see Using Styles in Qt Quick Controls. Alternatively, you can create your own style. If you want to customize a control the best way is to do an explicit style import (import QtQuick.Controls.Basic for example vs import QtQuick.Controls).
  • SVG is not supported on preview mod

    Unsolved
    4
    0 Votes
    4 Posts
    154 Views
    SGaistS
    Can you start Qt Creator from the command line using the QT_DEBUG_PLUGINS environment variable set to one and then use the preview mode ? I am wondering whether the svg plugin gets lost somehow.
  • Can not use flexboxlayout

    Solved
    8
    0 Votes
    8 Posts
    361 Views
    A
    Hi, This was the problem! I also just found out, I typed it and it worked and could not see what was the difference. I had to use a hexdump to see the error ! 46 6C 65 78 62 6F 78 4C 61 79 6F 75 74 20 7B 46 6C 65 78 42 6F 78 4C 61 79 6F 75 74 20 7B 62 and 42. Thanks a lot for your help :) Emmanuel
  • Qt Graphs lacking functionalities - Axes range

    Unsolved
    17
    1 Votes
    17 Posts
    2k Views
    T
    FYI: https://bugreports.qt.io/browse/QTBUG-142046 Thanks @mklisiewicz for bringing this into our attention.
  • 0 Votes
    5 Posts
    211 Views
    JKSHJ
    @timafaer said in QML: Functions inside var-array model become undefined after switching Repeater model: JavaScript functions are not supported as model data, so when the array is wrapped into this internal model, any function properties are effectively lost or become non-callable. That’s why inside the delegate typeof modelData.handler (or modelData[1]) is no longer "function". That was the case in Qt 5.15, but that's no longer true in Qt 6.5+. As I mentioned before, your code works just fine with a recent version of Qt.
  • QMouseEvent bug?

    Unsolved
    7
    0 Votes
    7 Posts
    339 Views
    Axel SpoerlA
    There is no bug with QMouseEvent, unless you provide a minimal reproducer showing that there is one :-) The VNC based issue looks more than a desktop or client/server compatibility issue to me.
  • This topic is deleted!

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