Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • Understanding QML, C++, and Enumerations

    Unsolved qml c++ enum class enum
    2
    0 Votes
    2 Posts
    547 Views
    sierdzioS
    @james_h_3010 said in Understanding QML, C++, and Enumerations: Does or should qmlRegisterUncreatableType and qRegisterMetaType need to go in main.cpp and be executed after QGuiApplication app? Or is considered best practice, etc.? It does not need to be in main.cpp. It does need to be executed after QGuiApplication. What you wrote is how most people do it. Is it best practice? Well, for big projects I'd say it's good to move that stuff to some other header, just to keep main.cpp cleaner. But it does not matter much, it's only styling "issue". You won't gain or loose performance here. console.log( "Ddddd: ", Support.Ddddd ); works, but I lose the explicit connection to the ETestB datatype. I would prefer to be able to write Support.ETestB.Ddddd or something. Is that possible now or something that might be implemented in a future version? I don't think it's supported and I have not heard of plans to support it. Maybe it will come, though, who knows. If I remove qRegisterMetaType, current behavior remains the same. I am not sure what, exactly, qRegisterMetaType is doing for me here. Can someone provide some insight...? Q_ENUM has already registered it with meta object system. You don't need to do it manually. Let's say that I add: enum class ETestC { Ggggg, Ddddd, Eeeee, Fffff }; Q_ENUM( ETestC ); to the Support class. And qRegisterMetaType<Support::ETestC>( "Support.ETestC" ); to the main function. There is now a namespace collision between ETestC and ETestB. According to some documentation, it seems like I should add Q_CLASSINFO( "RegisterEnumClassesUnscoped", "false" ) to the Support class. However, when I do all of that, I see: qml: Ddddd: undefined qml: Eeeee: undefined qml: Fffff: undefined in the output. Clearly there is something I did not understand from the documentation. I look forward to hearing from anyone who cares to comment so I can understand this system better. I think they would clash, yes. QML engine is very stupid when it comes to understanding enums.
  • Design Studio: show live preview became wrong size

    Unsolved
    1
    0 Votes
    1 Posts
    159 Views
    No one has replied
  • Is it possible to create an Item (qml) with its own Window?

    Solved
    11
    0 Votes
    11 Posts
    2k Views
    M
    @Lucasvct I have posted my current solution in this thread. have you tryed it?
  • QML stylus event handling.

    Unsolved
    1
    0 Votes
    1 Posts
    180 Views
    No one has replied
  • How do I Identify frames in the QML profiler ?

    Unsolved qml qml profiler
    1
    0 Votes
    1 Posts
    272 Views
    No one has replied
  • Emit not fire when client connected to server.

    Moved Solved
    8
    0 Votes
    8 Posts
    500 Views
    MhM93M
    @difix said in Emit not fire when client connected to server.: qmlRegisterUncreatableType really thanks. yes this is my problem. I create socket in main.cpp and also I create it again in qml
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    7 Views
    No one has replied
  • Qt.OpenHandCursor and Qt.ClosedHandCursor Look The Same?

    Unsolved
    3
    0 Votes
    3 Posts
    533 Views
    J
    // These icons are different MouseArea { acceptedButtons: Qt.LeftButton | Qt.RightButton anchors.fill: parent preventStealing: true cursorShape: pressedButtons & Qt.RightButton ? Qt.ClosedHandCursor : Qt.ForbiddenCursor } // The icon is the same pressed or released. Given the behavior above, this can only mean the two icons are identical when they should not be. MouseArea { acceptedButtons: Qt.LeftButton | Qt.RightButton anchors.fill: parent preventStealing: true cursorShape: pressedButtons & Qt.RightButton ? Qt.ClosedHandCursor : Qt.OpenHandCursor }
  • Canvas inside checkbox - how to draw border when checkbox unchecked

    Unsolved
    1
    0 Votes
    1 Posts
    233 Views
    No one has replied
  • Converting Middle Click to Left Click

    Unsolved
    2
    0 Votes
    2 Posts
    322 Views
    No one has replied
  • How to delete row from TableView properly

    Unsolved
    8
    0 Votes
    8 Posts
    2k Views
    S
    I also asked this question here: Even If I used signals and slots to invoke the methods not directly from javascript I still get these errors: https://stackoverflow.com/questions/65328173/how-to-delete-row-from-tableview-properly/65382947?noredirect=1#comment115712152_65382947
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    24 Views
    No one has replied
  • 0 Votes
    8 Posts
    832 Views
    R
    @jsulm Can you elaborate top level widget seq fault. what it seems to be from the stack trace so that i dig up that area. Do you think it is an memory issue?
  • Add widget from C++ to QML

    Unsolved
    11
    0 Votes
    11 Posts
    2k Views
    SGaistS
    I took a look at the DeclarativeChart class and it does use QChart under the hood (but does not inherit from it). Your backend should really be independent of your GUI. Only provide data and then you can update your series in your QML code.
  • Limit to the number of connections qml can have to a c++ interface object

    Unsolved qml
    11
    0 Votes
    11 Posts
    937 Views
    KH-219DesignK
    When I have an executable that is paused in gdb, this is the command I use to get all stack traces of all threads at once: thread apply all bt I'm not sure if that will work on a core file, but I am optimistic that it would. As for stepping into the exec().... Are you literally using the "step" command? "s" or "step"? I would think you could just tell the program to "run" (no stepping). Then pause/break the debugger when the white screen occurs. But that might be what you tried and I am misunderstanding. The helpfulness of the stack traces is going to depend on whether your Qt libraries contain symbols. Anyhow, sorry to say it, but I'm about run out of ideas. It does seem like a "clue" that your application still works in the desktop edition and is only misbehaving in the QNX edition. Are there any "knobs you can turn" in QNX? Give the program more memory or more cores/threads? Loosen the program's timing goals/constraints? (Again, I have no direct experience with QNX). Maybe there are QNX system tools that would be instructive? Ways to ask QNX to tell you information about the running app? Maybe QNX would report that the app has been frozen by the kernel for some reason?
  • 0 Votes
    12 Posts
    1k Views
    Pablo J. RoginaP
    @Tryhard said in Is there a QT project-specific configuration file available ? There is the .pro.user file, but that can't go cross platform.: Yep that should do it !! Thanks y'all ! Are you calling your issue solved? If so, please don't forget to mark your post as such! Thanks.
  • Invoke slot of child of child of QQmlPropertyMap?

    Unsolved qml binding qqmlpropertymap
    3
    0 Votes
    3 Posts
    661 Views
    jwernernyJ
    @jeremy_k I'm now looking at a template based solution as suggested on the SO question (https://stackoverflow.com/a/65401996/447438). The ideas has been in my head for a couple of days, and the post pushed me to look more deeply into it.
  • How to break property bindings to c++ QObjects

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    fcarneyF
    Look into conditional binding: https://doc.qt.io/qt-5/qml-qtqml-binding.html#conditional-bindings At some point you bind to the value based upon a condition. That would be in the when clause: Binding { target: myMainObject.myTarget property: "someProperty" value: thisComboBox.currentIndex when: <some condition> } You might want to look at restoreMode in case you have a value or binding you need to restore.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    6 Views
    No one has replied
  • Dialog with Text as contentItem: Binding loop for property implicitWidth

    Unsolved
    2
    1 Votes
    2 Posts
    2k Views
    C
    @maxwell31 Add in Dialog component Dialog { width: 400 ... The error will go away.