Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.1k Posts
  • Get/Set cookies from qml

    16 Mar 2013, 07:03
    0 Votes
    6 Posts
    4k Views
    Exactly. While there is no reason why that shouldn't be possible using pure QML. P.S. Maybe that's possible using webkit but that's different topic.
  • Rectangles & padding

    18 Mar 2013, 00:43
    1 Votes
    4 Posts
    24k Views
    It is the anchors which define how the child rectangle fills the parent rectangle. Remember, in QML, just because an object instance is declared within another one does NOT mean that it is visually located inside that other one. The positioning (either via anchors, or some other positioning method) define where it "appears" and thus the positioning also defines the spacing / padding. So, to implement what you want, just add an "anchors.margins: 10" to your anchors declaration. Note that the margin can also be specified separately for each edge; see http://doc-snapshot.qt-project.org/qt5-stable/qtquick/qtquick-positioning-anchors.html for more information. Cheers, Chris.
  • 0 Votes
    6 Posts
    2k Views
    Thank you. That was what I was doing but there was a typo blush
  • QML Drag Outside of Window

    9 Mar 2013, 19:38
    0 Votes
    7 Posts
    3k Views
    Just cloned it. Thanks a lot
  • 0 Votes
    9 Posts
    6k Views
    Done! Thanks:)
  • UI Designer for Qml

    15 Nov 2011, 09:29
    0 Votes
    6 Posts
    9k Views
    Unfortunately the available plugin for Photoshop does not generate clean code and its much easier to write everything from scratch (besides Adobe Fieworks in my opinion its much better at UI). I design professional interfaces, and QML is by far my favorite language. He simply outclasses HTML5 with hisanchor based layout and and performance. Feel free to write me: "www.userinterfacedesigner.pl":http://www.userinterfacedesigner.pl/
  • 0 Votes
    2 Posts
    3k Views
    Hi, This is actually a really interesting question, and one I didn't know the answer to - I had to ask Andrew den Exter who explained it to me. Basically, it means that because (with this ctor) the type doesn't have a chance to define the append / clear / whatever functions, anyone who modifies the content of the list does so "without informing the owner of the list". This means that if the content of list is owned by the owner of the list property, that content will be leaked if it is cleared. Similarly, if content is appended to the list and it has no owner (and thus the list property owner "should" take ownership via QObject parenting), that will not happen either. In short: "it allows the content of the QList to be modified without any notification to the owner of that list". Aside from that issue, QDeclarativeListProperty is a tricky beast which (imo) needs careful consideration when writing new code, even when the "safe" API is used. For example: @ // imagine TWDLP is a "type with declarative list property" which has a DLP called "filters". // the "filters" property takes a list of Filter instances, say. // and imagine that TWDLP offers a Q_INVOKABLE QString matches(const QVariantMap &trie) const; // which uses the filters property to return a concat string of things which match the filters. TWDLP { id: root property var trie: { "a": ["abcde", "abdef"], "d": ["defab", "deabf"] } Filter { id: filterOne criteria: "abc" } Filter { id: filterTwo criteria: "def" } Text { text: root.matches(trie) } Button { id: toggleFilter property int whichFilter: 2 onClicked: { if (whichFilter == 1) { root.filters = [ filterTwo ] whichFilter = 2 } else { root.filters = [ filterOne ] whichFilter = 1 } } } } @ In this instance, the assignment is an interesting one, since you definitely do not want to delete the existing contents of the list if it had a QObject parent when it was originally assigned - even if that parent is the owner of the list property (as in this case). I hit this issue a while ago in an API I was writing, which is why it stuck in my memory. See https://github.com/nemomobile/nemo-qml-plugins/commit/fe175e122294b0c0f98396b239353b91d0bb4bd9 for that one ;-) Cheers, Chris.
  • 0 Votes
    4 Posts
    3k Views
    Excellent thanks, I think we started off with with pulling QML into qt widgets because it was easier, but we are separating the UI with our back end now, we might swap it for the distinction.
  • Qt Quick 1.1 ScrollBar

    8 Mar 2013, 11:31
    0 Votes
    5 Posts
    2k Views
    thanx utcenter for providing me the link...i'll try this...
  • QML component assignation

    11 Mar 2013, 16:47
    0 Votes
    7 Posts
    2k Views
    thanks mutaphysis I'll try your approach
  • 0 Votes
    1 Posts
    819 Views
    No one has replied
  • 0 Votes
    13 Posts
    9k Views
    Here are video taken from the following example: "QmlTestLag.zip":http://www.filehosting.org/file/details/425271/TEstLagQtQuick2.zip My graphic cards are Nvidia Quadro NVS 450, Mosaic Is activated, though Widows See only one big screen in its setup: "Video Qt4Quick1":http://www.youtube.com/watch?v=p9le7cVfQug Qt4, Quick1, 1 HD Screen qmlviewer: ~12%CPU Animation is smooth Qt4, Quick1, 4 HD Screen qmlviewer : ~12%CPU Animation is smooth "Video Qt5Quick2":http://www.youtube.com/watch?v=VNEfkWkjDPE Qt5, Quick2, 1 HD Screen qmlscene : ~4%CPU Animation is very smooth Qt5, Quick2, 4 HD Screen qmlscene : ~12%CPU Animation is really lagging I have the same behavior when I use our custom main to display the QPML Application, so I think it is a good example. What I would Conclude: Quick2 is more CPU consumption friendly CPU is no the limit Qt Render even the part which does not need to be updated
  • 0 Votes
    4 Posts
    2k Views
    Qt Location does not currently support 3D maps.
  • 0 Votes
    1 Posts
    777 Views
    No one has replied
  • Playing video in a loop

    11 Mar 2013, 21:28
    0 Votes
    2 Posts
    1k Views
    Got it, all I need to do is to set the video source again.
  • 0 Votes
    5 Posts
    2k Views
    I honestly think that it has nothing to do with the Qt Creator experience (I just tried compiling it in Qt Creator and it compiles without a problem, but then still does not work), but compiler version, that might be the problem, you might be right - my version of the compiler (MinGW) is from June 2012 while 4.4 is almost four years old. Actually, that is why I asked for a favor rather than an advice - there have to be people developing for Windows in QML and then they most likely have a build (binary) of Qt Desktop Components they could share (even in an official manner). Or everyone who wants to develop in QML for Windows desktop needs to obtain obscure, 4 years old libraries and dive into Windows' dependency hell just to get the basis for their app? I thought that the components are in place exactly for this reason - to enable faster development across platforms. Sorry, I don't want to be rude, I am thankful for those advices... But I just don't understand Windows' environment (and that is why I develop in system agnostic Python+QML) - for example I am a maintainer of Qt Desktop Components in Chakra Linux ( http://chakra-linux.org/ccr/packages.php?ID=4676 ) and my build provides these components in a simple install for everyone who wants to develop. I just believe there's someone willing to do the similar favor for others on another system.
  • 0 Votes
    10 Posts
    9k Views
    I added the example in the bugreport system: "https://bugreports.qt-project.org/browse/QTCOMPONENTS-1310?focusedCommentId=197529#comment-197529":https://bugreports.qt-project.org/browse/QTCOMPONENTS-1310?focusedCommentId=197529#comment-197529 It is a simple example to produce the Issue, Few files; In Panels directory just open the "PanelDebug2Puppet.qml" file in the designer I am on Windows 7 64 bit Professionnal, QT5.0.1, qtcretor 2.7-rc, Qtquick2
  • Integrating a QAxObject in qml

    11 Mar 2013, 15:56
    0 Votes
    1 Posts
    873 Views
    No one has replied
  • Get object, which have received signal

    10 Mar 2013, 00:20
    0 Votes
    2 Posts
    1k Views
    Just use "QObject::sender()":http://qt-project.org/doc/qt-4.8/qobject.html#sender, if the code you posted above is inside a slot that received a signal and the object you're looking for is the sender of the signal. Then you could do something like this: @ if(qobject_cast<QWidget*>(QObject::sender())) // cast to the appropriate class here, QWidget is just as an example { CMainWindow.tryLoadFromNetwork(qobject_cast<QWidget*>(QObject::sender()).desc_text) // cast to the appropriate class here, QWidget is just as an example } @
  • How does QML id property work?

    6 Mar 2013, 17:14
    0 Votes
    4 Posts
    5k Views
    This is done, with V4 bindings. If it's resolvable at compile time, and the binding is V4able, then the IR generated for the expression involves the lookup by index directly. However, in general, this can't be done, as the symbol may resolve to something else depending on the current context. As an aside, this is also why every binding in the context gets re-evaluated if a context property is set at runtime. Cheers, Chris.