Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • [Solved] How can I capture Command+Q in a Qt Quick application?

    5
    0 Votes
    5 Posts
    2k Views
    C
    Since our application always runs full-screen, the only time it gets hidden is when it gets closed - so I subclassed QQuickView with my own MainView and wrote my own override hideEvent() that did the necessary shutdown.
  • Touble calling a simple c++ function in QML

    2
    0 Votes
    2 Posts
    879 Views
    SGaistS
    Hi, It should rather be: @engine.rootContext()->setContextProperty("TheCalc", &calc);@ Hope it helps
  • Analog of modal QDialog in QML

    6
    0 Votes
    6 Posts
    3k Views
    B
    I just read "this post":http://www.qtcentre.org/archive/index.php/t-41193.html?s=4f0051811b94e81a668de909e4c9df15, which suggested that to get the blocking semantics you should implement a QDialog with blocking semantics, having your QML as the contents of the QDialog. That might give the blocking semantics, but I don't think it would give you the benefit of a native dialog look-and-feel that QML Dialog ought to give you.
  • The order of property initialization of a QML component

    5
    0 Votes
    5 Posts
    4k Views
    benlauB
    [quote author="onek24" date="1417697726"]Hey benlau, I would say the same, i'll look into it if i find some time today. Keep us up to date if you found out something new :)[/quote] well , It is better to let Qt developer to declare an official document about the order. Otherwise, what we did is just a dirty hack .. In fact, I have encountered the problem of initalization sequence for several times already.
  • How i can check what parent is existing?

    7
    0 Votes
    7 Posts
    2k Views
    N
    yes, it is. parent is object type which is have the "width"' property, but the parent himself is wasn't created
  • [solved] setContextProperty not updated dynamically

    6
    0 Votes
    6 Posts
    4k Views
    p3c0P
    You're Welcome. Have fun :)
  • Adding a new component definition in a class method to the scene

    2
    0 Votes
    2 Posts
    690 Views
    p3c0P
    Hi, If I'm not mistaken you can pass the engine object to the class and then find the root object there. @ //main.qml Window { visible: true width: 640 height: 480 title: qsTr("Hello World") } //main.cpp QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:///main.qml"))); QObject *rootObject= engine.rootObjects().first(); //rootObject will point to Window @ In your case you can either pass rootObject to your class or pass engine to the class so that you can find root element there.
  • [Solved] Is QT Quick the right tool for Raspberry Pi

    14
    0 Votes
    14 Posts
    8k Views
    SGaistS
    Hi, What exact error are you getting ?
  • How can I propagate onPositionChanged() to a child MouseArea?

    1
    0 Votes
    1 Posts
    595 Views
    No one has replied
  • Get screen size from QML

    14
    1 Votes
    14 Posts
    38k Views
    A
    Good...so tag thread's title with [SOLVED]
  • How to detect a gesture in QQuickItem

    1
    0 Votes
    1 Posts
    710 Views
    No one has replied
  • [SOLVED]MouseArea not rectangular, fit like opacitymask

    3
    0 Votes
    3 Posts
    815 Views
    K
    Exactly what I was looking for. Thanks
  • Not able to access members in QML File

    2
    0 Votes
    2 Posts
    777 Views
    p3c0P
    Hi, Few problems here: Use QUrl to load the file from Resource. @ QQmlComponent component(&engine,QUrl("qrc:///main.qml")); @ component.create() will return 0 if the component is not created. Don't directly go for accessing properties. Always check if it is created beforehand. You cannot directly access the child item's property(property int someNumber) directly. You will need to find it first. In your case move someNumber to ApplicationWindow.
  • Control screen luminosity

    7
    0 Votes
    7 Posts
    2k Views
    D
    Try to add this new method on example qtandroidextras-notification-example in the file NotificationClient.java @ public static void keepScreenOn() { Window w = m_instance.getWindow(); if ( w == null ) { Log.v(TAG, "null window"); } else { w.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); } } @ Add these imports in the file NotificationClient.java @ import android.view.WindowManager; import android.view.Window; import android.util.Log; @ Call it in main.cpp just after QGuiApplication. @ QAndroidJniObject::callStaticMethod<void>("org/qtproject/example/notification/NotificationClient", "keepScreenOn");@ I tried to add it after line @QQuickView view;@ and after line @view.show();@ but it not works for me.
  • Cannot connect MyClass::data(QVariant) to (null)::updateData(QVariant)

    17
    0 Votes
    17 Posts
    5k Views
    H
    Thanks very much.
  • QML application crashes, How to debug it?

    10
    0 Votes
    10 Posts
    7k Views
    sierdzioS
    Some info is available here: "link":http://blog.qt.digia.com/blog/2014/11/20/qt-weekly-20-completing-the-offering-qopenglwindow-and-qrasterwindow/. Apart from that, there is the documentation. QQuickWidget indeed does have it's limitations.
  • [SOLVED]add child to a QQuickItem

    3
    0 Votes
    3 Posts
    3k Views
    S
    thank you, override the onComplete method works for me
  • How to set text to TextInput from C++

    6
    0 Votes
    6 Posts
    3k Views
    SGaistS
    Yes there is: "Extending QML - Signal Support Example" in Qt's documentation
  • How I can use queue of requests in QNetworkAccessManager?

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • [SOLVED] Clipping of a QML item object slightly bigger than the text itself

    11
    0 Votes
    11 Posts
    7k Views
    K
    Yep, thx!