Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.6k Posts
  • 0 Votes
    6 Posts
    5k Views
    P
    Please post additional information about the issues you are facing, specifically as described in - http://gpupowered.org/node/27
  • QProcess not running command correctly & freezing gui

    5
    0 Votes
    5 Posts
    2k Views
    M
    Still only launches easystroke and freezes :(.
  • 0 Votes
    1 Posts
    2k Views
    No one has replied
  • 0 Votes
    4 Posts
    1k Views
    D
    Thanks, seems it is ok
  • 0 Votes
    5 Posts
    2k Views
    A
    Thanks fonzi337, yours is a nice solution but unfortunately doesn't solve all my problems. [quote author="fonzi337" date="1386355198"] The if check in commitExposure() also ensures you avoid an infinite loop when the user modifies the exposure value using the SpinBox. [/quote] In commitExposure i can't check the current value because the camera code is running on another thread connected through signals. Maybe i can keep a copy of the state of the camera on the GUI thread and/or expose a camera object directly to QML. It sound like a lot of unneeded complications. It's the spinbox that knows the cause of the valueChange event, it's so strange this information is discarded and now i must guess it studying the variation of the values. Update: I'm continuing testing possible solutions so i update the post just in case someone else have a similar problem. I was trying to connect the camera object directly to QML to avoid too many signal/slot connections. This is the result: @QQmlEngine: Illegal attempt to connect to Camera(0x22fd88) that is in a different thread than the QML engine QQmlApplicationEngine(0x22fe70).@ So I think this option is not viable.
  • [solved] Image with rounded corner

    4
    0 Votes
    4 Posts
    1k Views
    p3c0P
    That's great :) You can mark the post as solved. Just edit the title and prepend [solved]
  • Is QML Guaranteed to be Processed serially?

    2
    0 Votes
    2 Posts
    925 Views
    sierdzioS
    QML is read first, then it's being processed in an event loop. You can't depend on that being sequential. But if your model is done properly, the engine will detect that "rectangles" has hanged and will be updated once the changes are done.
  • Is it possible to set the root object of an QQuickView?

    1
    0 Votes
    1 Posts
    700 Views
    No one has replied
  • PropagateComposedEvents to ComboBox not work

    1
    0 Votes
    1 Posts
    970 Views
    No one has replied
  • [SOLVED] writing function for onClicked signal of nested button

    5
    0 Votes
    5 Posts
    2k Views
    L
    Also note that signals can have arguments inside them which can potentially be very useful, e.g. for passing strings or numbers etc.
  • Interview Question and Answer for Qt

    12
    0 Votes
    12 Posts
    33k Views
    IamSumitI
    Hello everyone... I want to add some opinion on this topic.. If we talk about interview questions in Qt So it would be very difficult to provide FAQ. because the behavior of Qt can't be experienced theoretically it could be realized practically..once you cleared the things in Qt, you don't need to have FAQ. and also to learn Qt one not require to be expertise in C++. If you have basic knowledge of C++ then anyone can easily understand the stuff of Qt.
  • [solved] QML from resource system

    6
    0 Votes
    6 Posts
    8k Views
    P
    The link to the solution is broken
  • QML Quick2 WebView and zoom in/out

    2
    0 Votes
    2 Posts
    2k Views
    S
    Any solution for that? been looking for hours. I have: @ import QtQuick 2.0 import QtWebKit 3.0 Rectangle { width: 300; height: 300 Text { anchors.fill: parent anchors.leftMargin: parent.width / 2 text: "<h1>title</h1>" } WebView { anchors.fill: parent anchors.rightMargin: parent.width / 2 url: "file:///Users/sandy/test.html" } } @ where test.html contains : "<h1>title</h1>" and I want both side to behave the same (like Text) when I resize the window. With Qt5.1.1 the WebView scaling change as I resize. So basically, I want to have a WebView that behaves like a browser window or as it was in Qt4.8.x.
  • Exposing custom type class instance to QML code

    11
    0 Votes
    11 Posts
    3k Views
    F
    Thank you very much for the test code but it didn't seem to do the trick for me. Anyway, I will try to compile the sample code once in a while. Currently I have a problem with the type recognition of my context property. I keep on getting the following error during execution: @main.qml:35: TypeError: Object #<error> has no method 'rows'@ Before running the application I am doing this: @ qmlRegisterType<Level>("Level", 1, 0, "Level"); Level* pLevel = new Level(); viewer.rootContext()->setContextProperty("_currentLevel", pLevel);@ Level is a subclass of QObject. Qt Creator recognizes the context property "_currentLevel" as well as it's Q_INVOKABLE-marked functions and properties correctly. However, during execution I am still getting the error from above. Seems like to "Level" type is unknown to the QML part. Do you have any idea?
  • Noob question about Properties and Scopes

    4
    0 Votes
    4 Posts
    1k Views
    sierdzioS
    Hm, that is a good question. I don't think you should depend upon it, as it is possible to remove an item from the middle of the list - the index might jump then. But I am not sure. If you have a use case where you are certain the list will not be reordered, and that nothing will be removed from it, I think you can assume the index will stay valid.
  • Metaobject Reflect child classes from base classes in C++

    9
    0 Votes
    9 Posts
    3k Views
    C
    Thanks grl, This is definitely an option to keep in mind.
  • Is the QML realtime preview away?

    2
    0 Votes
    2 Posts
    2k Views
    M
    Do you mean something like this: http://www.youtube.com/watch?v=ymy94i11Noo or this http://qt-project.org/videos/watch/livecoding-video-effects-with-qt5 It is not part of the qtcreator. Its a C++ program which checks and reloads certain qml files in a certain duration. You can test your qml files with qmlscene. Or you implement live coding into you app.
  • How to load a piece of an image to QML-form on timer signal

    11
    0 Votes
    11 Posts
    5k Views
    G
    [quote author="stereomatching" date="1385677858"] What I mean is "please give me a full example which could reproduce your problem with minimum lines of codes"[/quote] I thought you need less. [quote author="Sergei Eliseev" date="1385743150"] What thread calls MyItem::myItem_update_Slot()?[/quote] MyItem::myItem_update_Slot() calls on timer signal. I don't use multi-threading in my code. Here I connect timer with update(): @ MyModel::MyModel( QObject *parent ) : QObject( parent ) { myitem = new MyItem(); mytimer = new QTimer; mytimer -> setInterval( 100 ); connect(mytimer, SIGNAL(timeout()), myitem, SLOT(myItem_update_Slot())); mytimer -> start(); } @ And the less of the code once again: @ void MyItem::myItem_update_Slot() { x = rand() % 1400; y = rand() % 1400; j = rand() % 100; k = rand() % 100; update(); } void MyItem::paint( QPainter *painter ) { img = sourceImage.copy( x, y, 100, 100 ); painter -> drawImage( QPoint( j, k ), img ); // flying rect // painter -> fillRect( j, k, 50, 50, Qt::black ); } // main.qml import QtQuick 2.0 import MyItem 1.0 Rectangle { width: 360 height: 360 MyItem{ width: 300 height: 300 } } @ [quote author="Sergei Eliseev" date="1385743150"] For test's sake put an animated object[/quote] Thanks for the idea, I've checked it as demonstrated above (if I got it right). update() is being called, but repaint isn't done. I suspect that it can be related to the visibility scope of vars inside paint() during update() calling.
  • Model from C++ to QML

    7
    0 Votes
    7 Posts
    2k Views
    J
    So, the problem was that I was filling the model from a background thread, which doesn't work. I implemented a signal and a slot in main GUI thread, which fills the model and now it works fine. I got the help in "this thread":http://qt-project.org/forums/viewthread/28884/.
  • QML Code modularization (re-use)

    2
    0 Votes
    2 Posts
    862 Views
    sierdzioS
    Put separate components into separate QML files. It's all written in the documentation. As long as the file name follows the convention (starts with upper case), QML will allow you to import that file and use it in your code straigt away. There are also more advanced options available, like creating custom component sets.