Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.1k Posts
  • How to access other QML elements ?

    2
    0 Votes
    2 Posts
    885 Views
    A
    You should read on the "QML Object identifier attribute":http://qt-project.org/doc/qt-5.0/qtqml/qtqml-syntax-objectattributes.html#the-id-attribute, and then also on the "QML Object scope":http://qt-project.org/doc/qt-5.0/qtqml/qtqml-documents-scope.html#component-scope.
  • What is .qmlproject file?

    3
    1 Votes
    3 Posts
    10k Views
    T
    .qmlproject is used by Qt Creator to handle projects that are QML-only. As Tomma already said, these kinds of projects use the Qmlviewer application to show QML files. This is rather convenient to play with small examples, but requires that a qmlviewer is installed. It also makes it close to impossible to use such projects on devices since it is very hard to limit these apps in what they can do. Basically the qmlviewer will need to have all the interesting permissions (access the network, etc.) so that all Qml applications will actually run in it and all these Qml applications will inherit those permissions. That is why bigger non-toy things have a .pro file that builds a small piece of code that is basically a stripped down Qmlviewer application and bundles that with the Qml files. This is a separate binary then which gets its own set of permissions. Since this binary is specific to one Qml application you can limit the program to those it actually needs to function.
  • 0 Votes
    2 Posts
    2k Views
    T
    Please "file bug reports":https://bugreports.qt-project.org/ about regressions. Bugreports will be seen by the developer, while it takes a bit of luck for the issue to get noticed here.
  • OpenGL (QGLWindow) functionality in QDeclarativeView

    7
    0 Votes
    7 Posts
    4k Views
    W
    Just found out that signals in QML (to c++) don't work. Changed QDeclarativeView->setScene etc. to QDeclarativeView->setSource Now it works. QGLWindow overlaps qml page.
  • Importing an existing QScriptExtensionPlugin to QML

    7
    0 Votes
    7 Posts
    3k Views
    T
    Now that I'm finally porting our Qt4 code to Qt5 I need to solve this issue somehow. to QJS[X] seems to be mostly straightforward stuff. Still, solution to the original problem with integrating my custom extensions to QML applications isn't obvious. Could someone elaborate the stuff a bit? I don't believe our need is unique in any way: we just need to be able to use our JavaScript extensions from both JavaScript and QML. I'm really surprised how difficult it really is to extend JavaScript this way in Qt5. It may be due to the lack of documentation, and I may certainly have missed something, but this is how I see it: QtScript seems to be phased out, and it isn't compatible with QML anyway. There is no documented extension mechanism for QJSEngine. There is an extension mechanism for QML, but the JavaScript global object is read-only. The simple question is: how do I add my own JavaScript extensions to QML applications? This is already a bit out of topic, but I have to admit I'm bit lost regarding the integration of C++ and QML code. I cannot see QJSValue appear anywhere in QML documentation. Does this mean QML has its own set of reflection objects to the C++ side? Such as QQmlProperty? Let's assume I have this QML code: @ // main.qml import QtQml 2.0 QtObject { id: test function test() {} } @ Assume I have created an object out of the "test" component: @ QQmlEngine engine; QQmlComponent component(&engine, QUrl::fromLocalFile("main.qml")); QObject* test = component.create(); @ Now I have a QObject pointer in C++. How do I iterate the properties and functions the QML object has? How do I add another function, say test2() to the object? What about adding properties? How do I call test()?
  • I need to connect a ComponentA Signal to a method of another ComponentB

    5
    0 Votes
    5 Posts
    2k Views
    S
    Thank you but i have a new problem with connections. Why i can't sometime access someObject with his unique ID ?
  • Qt MultmediaKit

    9
    0 Votes
    9 Posts
    4k Views
    M
    [quote author="aabc" date="1352733663"]Does it work now ?[/quote] Yes, works fine. I installed this package: http://packages.ubuntu.com/quantal/libdeclarative-multimedia
  • The problem with exception handle in QML 2 plugin

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Load shared library with QML files in resource file

    2
    0 Votes
    2 Posts
    4k Views
    F
    I found out, that putting a DynamicallyLoadedTestItem into the main.qml file did work! But only if the import of the plugin is added in the main.qml, otherwise the same error with type not being found occurs. Here is the source code: @ // main.qml: import QtQuick 1.1 import MyPlugin 1.0 Item { // this DOES WORK! but only if import MyPlugin 1.0 is added in main.qml DynamicallyLoadedTestItem {} // this causes the error "TestItem is not a Type" TestItem {} } // DynamicallyLoadedTestItem.qml: import MyPlugin 1.0 TestItem { } @ It seems that in the first loaded qml file the dynamic library is not loaded, but when another file is loaded it is available. Shouldn't the QML engine take care of completely loading the library before initializing it? Or how can I load it in advance so the library is accessible when the first qml file gets parsed?
  • [SOLVED]Returning a QList<QHash<QString, QString> > to Qml ???

    4
    0 Votes
    4 Posts
    6k Views
    T
    Thank you, it works wonderfully! QVariantList with QVariantMap is exactly what I was looking for :D I just wish I could mark a question as answered, and vote up answers and stuff...
  • Debugging small memory / cpu leaks

    6
    0 Votes
    6 Posts
    2k Views
    A
    Thans for your answer. So yea, "comp" and "p" are created in the constructor and therefore only once. "u" is an array with 4 pictures in it from which i randomly choose. "update" is called from a timer and yes setProperty "src" does work as expected. Valgrind could not point my near any hint since i already know which class is leaking. Disabling that class stops the leaking which makes it pretty obvious. Maybe the *size and &requestedSize properties of the image provider have something to do with this?
  • How to use the javascript in QML

    1
    0 Votes
    1 Posts
    716 Views
    No one has replied
  • [Solved] Error using states to change between pages

    4
    0 Votes
    4 Posts
    2k Views
    J
    Hi oosavu You are right I'm overcomplicating things. Using: @onGameclick: root.state = "game"@ and in main.qml: @PagePanel { id: pagepanel state: "menu" }@ works fine. Thank you
  • [solved] Relative URL when creating a reusable QML PageLoader component

    2
    0 Votes
    2 Posts
    1k Views
    P
    Okay, "Qt.resolvedUrl()" ... pretty simple :) All that time reading about import paths and it was right here all along http://qt-project.org/doc/qt-5.0/qtqml/qml-url.html
  • How to use Qt commercial chart

    6
    0 Votes
    6 Posts
    4k Views
    AndySA
    Assuming you have posted a request via the link that JKSH has provided then we should have seen this appear in our system and depending on when you submitted it then it should have been answered. If you contact me directly on andy DOT shaw AT digia DOT com with the details of the request (i.e. your name, license id and the subject you used for the request) then I can try and track it down for you. We do answer everything within 2 working days, so either it is already answered and I'm just seeing this late, or something has gone awry in our system for some reason.
  • Images disappearing when using translucent OpenGL background

    2
    0 Votes
    2 Posts
    959 Views
    C
    Hi, I can't remember the bug number now, but ISTR Gunnar mentioning something about this in a bug report. Ask him on #qt-graphics and I'm sure he'll be able to point you to the bug. Cheers, Chris.
  • What should I do with QML code ?

    2
    0 Votes
    2 Posts
    855 Views
    C
    First, you need to ask questions which are (a) more precise, (b) more detailed, (c) less vague. What do you trying to achieve? What have you tried so far? What went wrong? Is there any information you can provide (such as error messages which were returned) which might provide some clue as to what went wrong? Second, you need to read the documentation. The documentation (in particular the Qt Quick Application Developer's Guide) contains a lot of information which should be useful to get developers up and running quickly. I'm not going to link you to it directly, as I think you should be able to find it on your own with a couple of minutes Googling or searching these forums (as I have posted the link here multiple times), if you find the Qt Project documentation landing page too complex to navigate directly - as I admit that it can be confusing at first. Cheers, Chris.
  • Qt Desktop Components rendering issues in Windows 7

    3
    0 Votes
    3 Posts
    2k Views
    B
    Awesome! I started looking at the QStyleItem implementation but was not exactly sure what to look for. I modified the QStyleItem::paint implementation for the troubled components (CheckBox, RadioButton, and Button), where no widgets are passed when drawing the control: @qApp->style()->drawControl(QStyle::CE_CheckBox, m_styleoption, painter, NULL);@ Thanks again! This worked out very well with minimal code changes.
  • QML listmodel - search/sort, any helpful documentation?

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • How to disable font kerning in TextEdit

    3
    0 Votes
    3 Posts
    2k Views
    H
    I have solved this problem, thanks. @ import QtQuick 2.1 Rectangle { id: container width: 360 height: 360 TextEdit{ id: textEdit text: "fasjkljklzvjjfopasdj09jropwejofjasdl" color: "red" } Item{ id: testItem anchors.fill: textEdit Component.onCompleted: { for(var i=0;i<textEdit.length;i++) { console.log(textEdit.positionToRectangle(i)); var object = Qt.createQmlObject("import QtQuick 2.0; Text{}",testItem); object.text = textEdit.text[i] object.x = textEdit.positionToRectangle(i).x } } } } @