跳到內容

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k 主題 77.2k 貼文
  • [SOLVED] Load new View

    8
    0 評價
    8 貼文
    3k 瀏覽
    M
    Thanks, it works ;-) the z values did the trick! @ ApplicationWindow { id: applicationWindow1 visible: true width: 1200 height: 1920 title: qsTr("whatsOn") Loader { id: pageLoader anchors.fill: parent z: 1 } // signal qmlSignal(string msg) menuBar: MenuBar { Menu { title: qsTr("File") MenuItem { text: qsTr("Verbindung"); onTriggered: pageLoader.source = "MyItem.qml"; } MenuSeparator {} MenuItem { text: qsTr("Exit") onTriggered: Qt.quit(); } } } Timeline{z: 0} } @
  • [SOLVED]Does XMLHttpRequest read local files, that are not declared in resources?

    3
    0 評價
    3 貼文
    10k 瀏覽
    G
    I see. That's not exactly what I wanted, as it is not going to work starting program with @Component.onCompleted:@ Apparently XMLHttpRequest can read local files directly when they are included in resources and since I'm updating that file with QFile, then I have to read it with QFile as well. The question was raised, because "http://qmlbook.org/ch11/index.html#local-files":http://qmlbook.org/ch11/index.html#local-files and other examples doesn't mention this restriction regarding location of these files.
  • Load qml-files inside a folder as tabs in a TabView

    5
    0 評價
    5 貼文
    1k 瀏覽
    D
    Please add [SOLVED] to all your solved threads because for other users it's a nice help to see if a thread is solved.
  • [SOLVED] clearing FrameBuffer

    2
    0 評價
    2 貼文
    2k 瀏覽
    D
    OK, i solved the problem. The magical part is this: @ this->_fbo->bind(); glClear(GL_COLOR_BUFFER_BIT); this->_fbo->release(); @
  • QQuickView not active before being clicked once

    8
    0 評價
    8 貼文
    2k 瀏覽
    P
    No, raise() does not help. I´ve tried lots of things on QQuickItem , setFocus, forceActiveFocus, setAcceptedMouseButtons...and even sending MouseButtonPress/Release events. But nothing works... Thans for your help.
  • Unable to change parent and child window Z order after calling loader

    3
    0 評價
    3 貼文
    3k 瀏覽
    R
    I think what happens is once you reload, the main window becomes active. Then calling raise and lower is raising and lower the main window (and its child) relative to the other windows in the OS. I just experimented and found that changing your onTopChildChanged handler as follows results in the desired behavior (at least under windows 7): @ onChildOnTopChanged: { if (childOnTop) { winNew.requestActivate() winNew.raise(); } else { winNew.requestActivate() winNew.lower(); } }@
  • [SOLVED] QML: QListView / QListModel force repainting listview / delegates

    6
    0 評價
    6 貼文
    10k 瀏覽
    D
    Please add solved to your thread title
  • Qml camera initialisation

    4
    0 評價
    4 貼文
    1k 瀏覽
    p3c0P
    "QTBUG-41467":https://bugreports.qt-project.org/browse/QTBUG-41467 seems to be a closer to your problem or you could report this one too with more specific details.
  • 'QQmlListProperty<int>' is not registered?

    6
    0 評價
    6 貼文
    6k 瀏覽
    L
    @chrisadams that works thank you. After reading your post, I realise that it is actually mentioned in the docs: http://qt-project.org/doc/qt-5/qtqml-cppintegration-exposecppattributes.html [quote] Properties containing lists of QObject-derived types can also be exposed to QML. For this purpose, however, one should use QQmlListProperty rather than QList<T> as the property type. [/quote] I was not reading the docs in enough detail to see on my first 5 readings :-} [quote author="chrisadams" date="1411524542"]Hi, Instead of using QQmlListProperty, can you simply define a Q_PROPERTY of the QList<int> type? You should still be able to access elements of the sequence via subscript operator / index, and the metatypes should definitely be registered by the engine. Thanks, Chris. http://www.qinetic.com.au/ - The Qt And QML User Experience Specialists[/quote]
  • [SOLVED] Add (and change) a component in a placeholder

    6
    0 評價
    6 貼文
    2k 瀏覽
    J
    [quote author="p3c0" date="1411450523"]Hi, If I understood you correctly you will need "qqmlcomponent":http://qt-project.org/doc/qt-5/qqmlcomponent.html to create component from C++ side, then after "beginCreate":http://qt-project.org/doc/qt-5/qqmlcomponent.html#beginCreate cast it to QQuickItem and set it's parent as per your needs.[/quote] It seems to be what I was looking for. I just figured out the difference between a parent (in the QObject's parent hierarchy) and a visual parent, and thus use setParentItem(). Thank you for your help.
  • Crash when trying to add inline component in non-inline component

    4
    0 評價
    4 貼文
    959 瀏覽
    D
    OK. https://bugreports.qt-project.org/browse/QTBUG-41486
  • Bindings bug or feature

    5
    0 評價
    5 貼文
    1k 瀏覽
    C
    Hi, One important feature of a declarative language is that you don't know in which order the declarations will be applied in, or the order the side-effects (signal handlers, binding expressions) will be evaluated in. In practice, there is an order defined by the engine implementation, but it is best not to rely on that, as it is an implementation detail rather than a well-specified behaviour (ie, API contract). To ensure that an imperative expression is evaluated after a binding evaluation occurs, you can trigger the imperative function via a Timer started as a side-effect of the binding expression. Example: @ property bool triggerUpdate: false property var someProperty: { var newValue = Math.random(); if (triggerUpdate) { timer.start(); } return newValue; } Timer { id: timer interval: 0 // will trigger upon returning to the Qt Event Loop onTriggered: { updateViews() // or whatever } } Component.onCompleted: triggerUpdate = true; // will trigger re-evaluation of someProperty binding, and anything bound to someProperty @ In the preceding case, the updateViews() function is guaranteed to be called after ALL binding expressions involving someProperty have been re-evaluated, since the Timer's onTriggered handler will be invoked at some point in the future via the Qt Event Loop. I hope this helps! Cheers, Chris Adams. http://www.qinetic.com.au - The Qt And QML Experts
  • [SOLVED] How to use QML to test which OS/platform the app is running on?

    5
    0 評價
    5 貼文
    3k 瀏覽
    Q
    Awesome. Thanks. Must have missed it.
  • QML MessageBox onYes called two times after click

    3
    0 評價
    3 貼文
    2k 瀏覽
    K
    @ MessageDialog { id: messageDialog text: "Czy chcesz pobrać ten wiersz?" onYes: { console.log("MessageDialog onYes") } standardButtons: StandardButton.Yes | StandardButton.No Component.onCompleted: visible = false }@ and this gives me such log @DefaultMessageBox onClicked MessageDialog onYes MessageDialog onYes@ I added debug message in the DefaultMessageDialog.qml to be sure that there is only one MessageDialog and only one Button. As I said before, the dialog works correct on my Mac that I started the project, but whenever I clone repo to any other computer the issue exists. I tried to update Qt, Qt Creator but with no effect.
  • [SOLVED] Canvas and Context2D

    4
    0 評價
    4 貼文
    893 瀏覽
    D
    So please add solved to the thread title
  • Error "use of undeclared identifier 'qmlRegisterType'"

    10
    0 評價
    10 貼文
    16k 瀏覽
    jeremy_kJ
    [quote author="beanhead" date="1411234589"]as soleyla suggested, I tried: @#include <QtQml>@ For me, this worked without having to make any of the other changes listed above in the previous posts...[/quote] That's the intended route. The documentation is confusing. The various incarnations of qmlRegisterType are documented as related non-members of QQmlEngine (For Qt 5.3 anyway). Searching and then scrolling to the top of the page leads to the impression that <QQmlEngine> in the correct header file. Some of the qmlRegister* function documentation snippets do mention including <QtQml>. It is easy to overlook, and violates the usual pattern.
  • Audio stops unexpectedly

    1
    0 評價
    1 貼文
    459 瀏覽
    尚無回覆
  • [solved] problem with the DropShadow

    6
    0 評價
    6 貼文
    1k 瀏覽
    A
    thank you guys
  • [SOLVED]How to limit the text width with the restriction of parent width

    4
    0 評價
    4 貼文
    2k 瀏覽
    A
    Hi Vikas, "clip:true" worked fine for me. "elide" didn't solve the issue. This Label used inside Column. Thanks.
  • Problem with DropShadow radius

    1
    0 評價
    1 貼文
    763 瀏覽
    尚無回覆