跳到內容

QML and Qt Quick

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

    5
    0 評價
    5 貼文
    2k 瀏覽
    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 評價
    2 貼文
    879 瀏覽
    SGaistS
    Hi, It should rather be: @engine.rootContext()->setContextProperty("TheCalc", &calc);@ Hope it helps
  • Analog of modal QDialog in QML

    6
    0 評價
    6 貼文
    3k 瀏覽
    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 評價
    5 貼文
    4k 瀏覽
    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 評價
    7 貼文
    2k 瀏覽
    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 評價
    6 貼文
    4k 瀏覽
    p3c0P
    You're Welcome. Have fun :)
  • Adding a new component definition in a class method to the scene

    2
    0 評價
    2 貼文
    690 瀏覽
    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 評價
    14 貼文
    8k 瀏覽
    SGaistS
    Hi, What exact error are you getting ?
  • How can I propagate onPositionChanged() to a child MouseArea?

    1
    0 評價
    1 貼文
    595 瀏覽
    尚無回覆
  • Get screen size from QML

    14
    1 評價
    14 貼文
    38k 瀏覽
    A
    Good...so tag thread's title with [SOLVED]
  • How to detect a gesture in QQuickItem

    1
    0 評價
    1 貼文
    710 瀏覽
    尚無回覆
  • [SOLVED]MouseArea not rectangular, fit like opacitymask

    3
    0 評價
    3 貼文
    815 瀏覽
    K
    Exactly what I was looking for. Thanks
  • Not able to access members in QML File

    2
    0 評價
    2 貼文
    777 瀏覽
    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 評價
    7 貼文
    2k 瀏覽
    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 評價
    17 貼文
    5k 瀏覽
    H
    Thanks very much.
  • QML application crashes, How to debug it?

    10
    0 評價
    10 貼文
    7k 瀏覽
    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 評價
    3 貼文
    3k 瀏覽
    S
    thank you, override the onComplete method works for me
  • How to set text to TextInput from C++

    6
    0 評價
    6 貼文
    3k 瀏覽
    SGaistS
    Yes there is: "Extending QML - Signal Support Example" in Qt's documentation
  • How I can use queue of requests in QNetworkAccessManager?

    1
    0 評價
    1 貼文
    1k 瀏覽
    尚無回覆
  • [SOLVED] Clipping of a QML item object slightly bigger than the text itself

    11
    0 評價
    11 貼文
    7k 瀏覽
    K
    Yep, thx!