Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • Shadow around an Item

    Unsolved 30 minutes ago
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • Display rotated -> qt/qml application not visible

    Solved about 6 hours ago
    0 Votes
    4 Posts
    25 Views
    Changes in /boot/config.txt solved this problem.
  • 0 Votes
    2 Posts
    586 Views
    For future readers: you need to set the extra module as static in order for it to link with the main executable. I don't know why this is. It's very hidden in the Qt guide qt_add_library(UiComponents STATIC) qt_add_qml_module(UiComponents URI "Muse.UiComponents" VERSION 1.0 NO_PLUGIN QML_FILES ....
  • Setting x11 Window properties

    Unsolved about 15 hours ago
    0 Votes
    2 Posts
    17 Views
    @Berg You could check how KDE does that.
  • setContextProperty "TypeError: Cannot call method"

    Unsolved a day ago
    0 Votes
    3 Posts
    30 Views
    @SGaist simple code in main.cpp int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQuickStyle::setStyle("Basic"); QQmlApplicationEngine engine; QObject::connect( &engine, &QQmlApplicationEngine::objectCreationFailed, &app, []() { QCoreApplication::exit(-1); }, Qt::QueuedConnection); DataManager dataManager; engine.rootContext()->setContextProperty("dataManager", &dataManager); //DataManager* pDataManager = new DataManager; //engine.rootContext()->setContextProperty("dataManager", pDataManager); engine.loadFromModule("Project", "Main"); return app.exec(); }
  • S-Shaped Curve with PathCubic

    Unsolved a day ago
    0 Votes
    1 Posts
    18 Views
    No one has replied
  • QMLlint warning for ids

    Unsolved 3 days ago
    0 Votes
    3 Posts
    55 Views
    You need required property int index in gridDelegate (see https://doc.qt.io/qt-6/qtquick-modelviewsdata-modelview.html#view-delegates ) deleteIndex is qualified (this is good), but index is unqualified (this is bad). Qualify index too: root.deleteIndex == gridDelegate.index (see https://doc.qt.io/qt-6/qmllint-warnings-and-errors-unqualified.html )
  • How to make the animation run as expected

    Unsolved 2 days ago
    0 Votes
    2 Posts
    35 Views
    Please learn to format your code correctly. It makes things so much easier for those attempting to help you.
  • QML with VS Code - Builds but fails at runtime (Windows)

    Unsolved 12 days ago
    0 Votes
    3 Posts
    101 Views
    This is helpful thanks
  • 0 Votes
    6 Posts
    959 Views
    Unfortunately, the stackoverflow solution doesn't work if you're depending on mime settings or imageSource (or requires some more effort to make it work), but the delayed binding solution did work.
  • Qmllint Warnings for rootcontextproperty

    Unsolved 3 days ago
    0 Votes
    2 Posts
    44 Views
    Hi, Please use the code (</>) tags. The general advice is to avoid context properties. Embedding C++ Objects into QML with Context Properties spells out a few reasons, including the one noted here. My preferred fix is to declare a property within the item, and then set it using an API such as QQmlComponent::createWithInitialProperties()
  • 0 Votes
    5 Posts
    172 Views
    @Richard-L You're welcome. OK, Qt R&D has fixed the example. You just need to add required property int index to TumblerDelegate.qml (see https://codereview.qt-project.org/c/qt/qtdoc/+/657647/2/examples/tutorials/alarms/TumblerDelegate.qml ) I strongly recommend going back to the Qt 6.9 version of the example and adding that missing line. The older version does not showcase current best practices.
  • MouseArea and WebEngine: Qt6 Bug?

    Unsolved qml webengine mousearea 25 Nov 2022, 14:16
    1 Votes
    3 Posts
    388 Views
    @viliak hi and welcome to devnet, I think you should check and maybe create a ticket on the bug tracker since it's a pretty big change of behavior.
  • 0 Votes
    4 Posts
    594 Views
    Hello @Raphael_PF . Normally you should have a "mock" backend to avoid that errors in order to be able to preview your design. By following this: https://doc.qt.io/qtdesignstudio/robotarm-example.html you will be able to work with both programs. In your qmlproject: importPaths: ["."] mockImports: ["stubs"] You can read here the cmakelist qt design autogeneration: https://github.com/qt-creator/qt-creator/blob/b60337dbaace15ac36d7f44f60d17560111a9ae3/src/plugins/qmlprojectmanager/qmlprojectexporter/cmakegenerator.cpp#L305 [image: 882cf003-42af-4b90-baa9-bfddbf718e0c.png]
  • 0 Votes
    2 Posts
    84 Views
    Answering my own question... Pass WaylandCompositor's property - defaultSeat into C++ as QWaylandSeat*. https://doc.qt.io/archives/qt-5.15/qml-qtwayland-compositor-waylandcompositor.html#defaultSeat-prop WaylandCompositor { id: iCompositor Component.onCompleted: { CppHelper.setDefaultWaylandSeat( iCompositor.defaultSeat ); } } Use QWaylandSeat's setKeyboardFocus(), which takes QWaylandSurface*. https://doc.qt.io/archives/qt-5.15/qwaylandseat.html#setKeyboardFocus QWaylandSurface* can be found in the onIviSurfaceCreated() as iviSurface. You can pass it into C++. IviApplication { onIviSurfaceCreated: { var surfaceArea = iviSurface.iviId === 1337 ? leftArea : rightArea; var item = chromeComponent.createObject(surfaceArea, { "shellSurface": iviSurface } ); item.handleResized(); // Pass QWaylandSurface* into C++. CppHelper.registerIviSurface( iviSurface ); } } The signal keyboardFocusChanged can be used to observe the change. https://doc.qt.io/archives/qt-5.15/qwaylandseat.html#keyboardFocusChanged However, setKeyboardFocus() doesn't work very well. I do get the signal keyboard focus changed, but the focus jump back to the original window if I actually press a keyboard key.
  • Creating a dynamic spline in QML

    Solved 5 days ago
    0 Votes
    4 Posts
    109 Views
    @GrecKo Ah that was a little painfully obvious haha! Thank you for pointing that out. I've been banging my head against the wall learning about shapepaths for hours now, and thought that there was a more explicit object type for the job. Turns out it was right in front of me all along!
  • 1 Votes
    5 Posts
    977 Views
    Best solution, independent from changing the targets manually, is to add: add_dependencies(${PROJECT_NAME} update_translations)
  • .EXE file is not opening and not find exe file

    Unsolved 8 days ago
    0 Votes
    9 Posts
    180 Views
    Okay , @jsulm Thank you I will check it out.
  • 0 Votes
    2 Posts
    58 Views
    @MARUTI-0 said in How can you implement offline mapping in a Qt application using QML and CMake without internet access?": SOLVE THE PROBLEM First describe the problem in an understandable way and then ask for help. People here do not have to solve your problems, this is user forum.
  • Enabling anti-aliasing on QQuickItem or QSGGeometryNode

    Unsolved 15 days ago
    0 Votes
    2 Posts
    125 Views
    I came across this example which uses QRhi (which avoids dependence on OpenGL directly like other people said to use): https://doc.qt.io/qt-6/qtquick-scenegraph-customrendernode-example.html It still seems overly complex but at least it looks like I'm in the right direction. Then, I came across this: https://doc.qt.io/qt-6/qrhirenderbuffer.html#sampleCount where I can set sampleCount to enable anti-aliasing. I don't really understand how QRhiRenderBuffer can be used, but somehow using QRhiRenderBuffer with sampleCount set to 4 or 8 in a QSGRenderNode -derived class seems like the proper way to have cross-platform hardware-accelerated anti-aliased drawing. Feel free to correct me. Until I find code examples showcasing how to bring all these functionalities together I have more important things to work on so I'll use QML Shape / ShapePath for now which makes it super easy to draw simple things (like an anti-aliased triangle).