Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    22 Views
    No one has replied
  • Issue with Array.IsArray in Qt6.5

    Unsolved
    4
    0 Votes
    4 Posts
    395 Views
    GrecKoG
    The consensus seems to not have to rely on Array.isArray : https://bugreports.qt.io/browse/QTBUG-125289
  • QtQuick3D RuntimeLoader: material missing using qrc

    Unsolved
    7
    0 Votes
    7 Posts
    511 Views
    Axel SpoerlA
    @feli223 This post doesn't say anything about how the resources have actually been populated. That's where it went wrong. The fact that it works without the colon means, that an in-source build finds the file somewhere in the source tree. If the application is deployed without its sources, it won't work any more. I don't know where, how, and why it went wrong, because this part of the code is missing. That means I can't help you, probably nobody can. But I do know that the resource system works seamlessly. So I pointed you to the documentation, because my feeling is that you haven't read it fully and made a small mistake..
  • User defined QML objects as arguments

    Unsolved
    2
    0 Votes
    2 Posts
    148 Views
    dheerendraD
    Better you provide one sample. Difficult to imagine what you would like to achieve. It is possible to do. One simple example is here. main.qml Window { width: 640 height: 480 visible: true title: qsTr("Hello World") MyQmlPropertyMap{ id : owner} Text { text : owner.name } MyButton{ b1 : y1 } YourButton{ id : y1 visible: false } } MyButton.qml Rectangle { width: 200;height: 200 color: "blue" property var b1 MouseArea{ anchors.fill: parent onClicked: { b1.visible = true } } } YourButton.qml Rectangle { width: 100;height: 100 color: "red" }
  • ListView not displaying results of a QSortFilterProxyModel.

    Solved
    15
    0 Votes
    15 Posts
    1k Views
    mzimmersM
    It turns out that I was using the wrong call on my proxy model. This works: void SanitizerModel::setSpaceIndex(int index) { if (m_spaceIndex == index) { qDebug() << "SanitizerModel::setSpaceIndex: skipped"; return; } m_spaceIndex = index; invalidateFilter(); // *** NOT invalidateModel() *** } Thanks to all who looked at this.
  • What is the problem in this qml file?

    Unsolved
    7
    0 Votes
    7 Posts
    556 Views
    GrecKoG
    @CKurdu said in What is the problem in this qml file?: The problem is that my coworker insists that the lines below are correct. Connections { target: videoRecords visible: false pageManager.show("videoRecordsPage") } What is this even supposed to do? Connections is meant to connect to signals declared in its target. Note that there is little reason to use a Connection inside the declaration on its target. There's no visible property in Connections, it's not a visible item. Writing pageManager.show("videoRecordsPage") here is syntactically incorrect in QML. You also have a duplicate object id. The correct syntax for Connections is : Connections { target: object function onSignalName() { // do stuff } } Here you don't need Connections to handle a signal of videoRecords, you could do: VideoRecords { id: videoRecords visible: false modal: true on<YourSignalName>: pageManager.show("videoRecordsPage") } This is assuming that you want to handle a signal in VideoRecords and show the videoRecordsPage after. You are the one knowing if it does make sense in your code. As for the visible: false in Connections, maybe it was meant to be the enabled property? Your tell us (or your colleague tells you).
  • Qt Design Studio - examples not available

    Unsolved
    1
    0 Votes
    1 Posts
    90 Views
    No one has replied
  • nmea plugin in Qt6

    Solved
    4
    0 Votes
    4 Posts
    304 Views
    SGaistS
    It's in Qt Positioning.
  • Newbie Question: RenderDoc Performance Monitoring with Qt C++

    Unsolved
    3
    0 Votes
    3 Posts
    359 Views
    K
    Thank you for your reply. Yes, I'm currently running the example(simplerhiwidget) for testing purposes and I am sure that my app started and running normally. Is there any parameter I need to modify to enable RenderDoc to inject its DLL into the executable? Also, in the remote host manager, there's nothing I can select; is this normal behavior? [image: 61a883da-e55c-43c9-9ad1-93009acca5d3.PNG]
  • Weird shadow map with texture

    Unsolved qt quick 3d texture shadow
    2
    0 Votes
    2 Posts
    330 Views
    J
    If you are trying to create a cube then it looks like your cube data is wrong as you can see from this picture: [image: 2567a1f1-8200-4647-8e5d-026f709ee0a4.png]
  • How to load a umd js ?

    Unsolved
    1
    0 Votes
    1 Posts
    95 Views
    No one has replied
  • Custom document layout for QML Text Edit

    Unsolved
    1
    0 Votes
    1 Posts
    116 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Binding Loop Width/Height

    Solved
    3
    0 Votes
    3 Posts
    217 Views
    R
    After removing anchors.centerIn: parent from the Label and changed it to anchors.fill: parent the problem was fixed.
  • Reverse the path of PathInterpolator

    Solved
    2
    0 Votes
    2 Posts
    159 Views
    MarkkyboyM
    I solved this after a few attempts using ChatGPT, not what I wanted ultimately, but manually I really struggled with this.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    10 Views
    No one has replied
  • How to set the margin for the header and content of a QML ListView?

    Unsolved
    2
    0 Votes
    2 Posts
    200 Views
    GrecKoG
    You could add this margin in the header component itself. ListView leftMargin can't be used here since it puts the margin on the left of header. If using a Control as the header you could use rightPadding or rightInset to easily add a inside margin.
  • This topic is deleted!

    Unsolved
    3
    0 Votes
    3 Posts
    95 Views
    No one has replied
  • Detec U-Disk Insert and Remove

    Unsolved
    11
    0 Votes
    11 Posts
    811 Views
    Z
    @J-Hilk Thank you for your reply, Indeed, after I discovered that the "nativeEvent" inherits from the "QWidget", I tried something else, as you said, using the "NativeEventFilter" that inherits from the "QCoreApplication ", but the problem remained. How can I modify and adjust it
  • Creating custom modules

    Solved
    8
    0 Votes
    8 Posts
    1k Views
    KoryK
    Thanks for the help, I appreciate it. First time using modules and I'm learning a lot What I've learnt so far: Using qt_add_qml_module automatically makes a qmldir and QResources file Cmake file for our project needs this to include a module with our library add_subdirectory(<FolderOfModule>) target_link_libraries(<applicationLibrary> PRIVATE <UriOfModule>plugin) Our module needs to be in it's own folder. Put CMake file, QML files, and resource files we're using for that module Cmake file for our QML module needs this qt_add_qml_module(<NameOfModule>) URI <ImportNameOfModule> VERSION <VersionNumber> RESOURCE_PREFIX <Prefix> QML_FILES <QML_Files> RESOURCES <Resource_Files> Perhaps it also needs this qt_add_library(<NameOfModule> STATIC) set_target_properties(<NameOfModule> PROPERTIES AUTOMOC ON) target_link_libraries(<NameOfModule> PRIVATE Qt6::Quick ) Can optionally specify an output directory too it seems QML file where we include our module needs this import <ImportNameOfModule> <VersionNumber> Then if we want to use a custom QML element from our module, we refer to it by it's like filename without the extension Will also need to make this addition to our main.cpp file engine.addImportPath("qrc:/"); Without this, we'll get a "is not a type" error If there's anything else I might not know about modules, let me know and I'll check it out. Think I've made some progress with them now at least. Was using import paths before but modules are what I'm trying to replace all of that with Got a module in one's actual project to work as opposed to a project consisting merely of a test module. So many things to get right between the cpp, qml, cmakelists, auto generated QResourceFile, and sci file too in this case My module was a text input module. It has a text input base QML file and email text input QML file that inherits from this base. And it uses a border image so that's why there's a .sci resource for that [image: d39cf436-86a1-4e68-8bcb-824d3743b4be.png] Now I'll have to do all of the other modules too