Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
19.9k Topics 77.1k Posts
  • Translation values returned from C++ models

    Solved
    7
    0 Votes
    7 Posts
    107 Views
    M
    Seems to work with qsTranslate in qml and QT_TRANSLATE_NOOP in the vector (inspired by http://imaginativethinking.ca/how-the-heck-can-i-use-qstr-with-variables/). Thank you all.
  • Qt Multimedia QAbstractVideoFilter Missing in Qt 6.9

    Unsolved
    4
    0 Votes
    4 Posts
    103 Views
    jsulmJ
    @track said in Qt Multimedia QAbstractVideoFilter Missing in Qt 6.9: The SBarcodeDecoder works in the sense that it doesn't throw exceptions anymore, but it also doesn't detect any barcodes. Did you check the content of the frames you're passing to SBarcodeDecoder? Store them as images and see what's inside.
  • Possible memory leak of gradient animation

    Unsolved
    13
    0 Votes
    13 Posts
    842 Views
    JKSHJ
    The problem is that every unique value of grAnim causes a new texture to be generated and stored in the cache: https://bugreports.qt.io/browse/QTBUG-136553
  • RTTI problem with MSVC

    Unsolved
    1
    0 Votes
    1 Posts
    40 Views
    No one has replied
  • QmlSingletonRegisterType and QmlSingletonRegisterIstance

    Unsolved
    4
    0 Votes
    4 Posts
    104 Views
    F
    The existing answers are correct, but to amend them: With qmlRegisterSingletonInstance, the same instance is shared by all engines (which can be somewhat problematic when there's more than one), whereas with qmlRegisterSingletonType, each engine will end up with its own instance. Please see also https://doc.qt.io/qt-6/qml-singleton.html , especially the sections on "Exposing an existing object as a singleton", "Imperative type registration" and "Guidelines for (not) using singletons".
  • Move object to another qml

    Unsolved
    4
    0 Votes
    4 Posts
    107 Views
    C
    Improperly explained problems lead to bad answers. I'm not sure I properly understand what you are asking so I probably won't answer it either and each time I read your question I understand a completely different thing of the previous read. I've read five times and I'm still unsure about what I should understand. If I'm understanding it right, you might be willing to instanciate an object outside a Loader, but be able to access it within it ? if yes then you need to use a binding. Item { id: rootItem SerialData { id: serialData } Loader { id: loader source: someCondition ? "page1.qml" : "page2.qml" } Binding { target: loader property: "serialData" // the property name as it will be available inside the loader WITHIN PARENTHESES value: data } } and inside your loader you can access your property classically via rootItem.serialData other option : you want to instantiate your SerialData component inside some component and make it accessible to it's parent. Then you can declare it as a property inside the component that instanciates it and thus make it available to the parent component. Doing this for data properties is fine, but injecting out an object is bad architecture. That's a very bad choice. It is much cleaner to create it in the main page and inject it into the subpages rather than creating it in a subpage and injecting it out to the main page and back to the siblings.
  • How can i version check, download new version and install from own server in QML

    Unsolved
    7
    0 Votes
    7 Posts
    127 Views
    V
    @JoeCFD Hi, Do you know of any sample code?
  • Bring Window to the 2nd Monitor

    Unsolved
    5
    1 Votes
    5 Posts
    153 Views
    C
    You're right, thanks. Running with paramter "-platform xcb" works. (Then, of course, it is no longer Wayland)
  • Segfault after moving project from Ubuntu 22.04 to RHEL 8.10

    Unsolved
    9
    0 Votes
    9 Posts
    115 Views
    D
    Hi all, The issue is now resolved. The project I was porting required glibc 2.29, whereas RHEL 8.10 only supports up to glibc 2.28. When I installed Qt using the online installer, it was expecting 2.29, rather than the system provided version. I couldn't find any precompiled Qt libraries for my version of RHEL, so I rebuilt Qt from source using the system provided version of glibc, and now there is no crash. Thanks for the responses!
  • Can't get roundJoin to work in qml.

    Unsolved
    1
    0 Votes
    1 Posts
    32 Views
    No one has replied
  • how to access signals from diferrent qml pages of different directories

    Unsolved
    3
    0 Votes
    3 Posts
    52 Views
    C
    you should import modules, not directories. Question : are those directories part of one single module ? Or different modules ? in first case, they all just should be declared in your CMakeLists.txt in the qt_add_qml_module directive, optionnaly a qmldir file in each directory if you load from source dir instead of resources (hot reloader for example) and you shouldn't have to import anything, as it's same module. in second case you have to import module in caller's CMakeLists.txt first via classically via target_link_directories and target_link_libraries before you can import in QML.
  • 0 Votes
    4 Posts
    424 Views
    Aleksey_KA
    QTBUG-136489
  • Qt5 Cmake project create qmldir

    Unsolved
    2
    0 Votes
    2 Posts
    56 Views
    S
    The QML files and the qmldir file must be placed inside a module folder, e.g., qml/MyModule/. The qmldir file must be added to the .qrc resource file along with all the QML files it references. The qmldir file must include: A module declaration: module MyModule A list of all QML types with version and filename: Example: MyItem 1.0 MyItem.qml In C++, you must call engine.addImportPath("qrc:/qml"); This tells the QML engine to look for modules inside the .qrc resource system. In your qml.qrc, you must include all files in the correct relative path: <file>qml/MyModule/qmldir</file> <file>qml/MyModule/MyItem.qml</file> Use the module in QML with the correct name and version, as defined in qmldir: import MyModule 1.0 Filenames in qmldir must match exactly (case-sensitive) with the actual file names. CMake must include the .qrc file using qt5_add_resources() and link against Qt5::Qml and Qt5::Quick.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • OpacityMask reduces Image quality

    Unsolved
    5
    0 Votes
    5 Posts
    187 Views
    C
    @Shankarlinga-M sorry for the late reply and thank you. Indeed, I found that the issue is related to the fact that the Screen.DevicePixelRatio is rounded up. When I set the display scaling to 120% the value of Screen.DevicePixelRatio is set to 2 instead of 1.2. Replacing Screen.DevicePixelRatio in the code with 1.2 makes the image look fine. I found also an other thread about this issue https://forum.qt.io/topic/160425/wayland-and-fractional-screen-scaling-reported-as-integer-by-wayland-info-and-q-screen/3
  • Canvas memory leak

    Unsolved
    2
    0 Votes
    2 Posts
    81 Views
    J
    Please create a bugreport over at https://bugreports.qt.io
  • 0 Votes
    10 Posts
    186 Views
    JoeCFDJ
    @Arpitha said in Facing issue in disabling up and down arrow buttons on user selecting 2 values, please hlep me to fix this.: console.info(" ARPITHA " +(flightsDataManager.selectedEffModel.getNavigationRestricted)) if NavigatioRestricted is defined inside selectedEffModel, the access is like the following console.info(" ARPITHA " + flightsDataManager.selectedEffModel. NavigatioRestricted ) //not sure how NavigatioRestricted is defined. and func getNavigationRestricted call is not needed. You need to show some code here and read some basic doc about binding of qml and c++ class.
  • Ctrl+Click on QML Object in QtCreator 15 opens QML file from build tmp directory

    Unsolved
    5
    0 Votes
    5 Posts
    324 Views
    ekkescornerE
    perhaps this bug https://bugreports.qt.io/browse/QTBUG-131920 fixed in 6.8.2 / 6.9.0
  • Edge barrier and real mouse coordinate off

    Unsolved
    1
    0 Votes
    1 Posts
    31 Views
    No one has replied
  • QML Mouse drag laggy

    Unsolved qml draghandler mousearea
    6
    0 Votes
    6 Posts
    451 Views
    Z
    I v solve this problem: insert this 2 line code in main.cpp before create QGuiApplication object: qputenv("QSG_RENDER_LOOP", "basic" ); QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);