Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.8k Posts
  • Already mouse grabber

    2
    0 Votes
    2 Posts
    3k Views
    D
    What do you mean by button? qt-components buton or button developed by yourself? In second case it will be good to post code here.
  • Qmainwindow setting

    6
    0 Votes
    6 Posts
    4k Views
    F
    There's the "Basic Layouts Example":http://doc.trolltech.com/latest/layouts-basiclayouts.html and the "Flow Layout Example":http://doc.trolltech.com/latest/layouts-flowlayout.html.
  • [SOLVED]Adding subitems to ListModel

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Need elide to replace word

    2
    0 Votes
    2 Posts
    2k Views
    A
    There is no elide mode to provide this. You'll have to implement this yourself.
  • How to change mouse message routing?

    6
    0 Votes
    6 Posts
    3k Views
    K
    Does any know how can mouse event routed into widget?
  • QML ListView end scrolling animation

    1
    0 Votes
    1 Posts
    6k Views
    No one has replied
  • 0 Votes
    6 Posts
    11k Views
    M
    I have found the solution to my problem and I hope this could help also the latest problem that has been posted. Basically the main mistake I did was to create a new QDeclarativeView when registering my models. Instead I had to use the QDeclarativeView I created in the main since it was the wrapper of my GUI. After that I wrapped in C++ the creation of my models in a class called ModelManager and I made it available in QML by calling setContextProperty. ModelManager has also a Q_INVOKABLE (or a slot. This is fundamental if you want your QML code to be able to called C++ methods) function "QVariant model(int index)", that gets the name of the model that was registered using setContextProperty and then returns the value of the model by calling QDeclarativeContext::contextProperty. Here is the code @ QVariant ModelManager::model(int pos) { Q_ASSERT(pos < m_models->count()); QDeclarativeContext* ctxt = m_view.rootContext(); QString name = m_models->at(pos)->name().toUtf8(); return ctxt->contextProperty(name); } @ Tks Maurizio Edit: Please use @ tags around code sections; Andre
  • Loader child element

    6
    0 Votes
    6 Posts
    5k Views
    B
    Sorry, my mistake - I meant to write, it does indeed change to "bar" instead of "foo". This is the code that I'm trying: SomeItem.qml @ import QtQuick 1.0 Item { property alias product: m_product Text { text: m_product.productName } Item { id: m_product property string productName: "foo" } } @ main.qml @ import QtQuick 1.0 Item { width: 400; height: 400 Loader { id: select_loader } Component.onCompleted: loadDetailScreen("SomeItem.qml") function loadDetailScreen(source) { console.log(source); select_loader.source = source; //load the qml file shown above if(select_loader.status == Loader.Ready) { select_loader.item.product.productName = "bar"; } console.log(select_loader.item.product.productName); //that actually shows "bar" } } @
  • [solved] How to change line spacing in Flow?

    7
    0 Votes
    7 Posts
    3k Views
    D
    Also it will be good to add [solved] to title. Manually of course
  • [solved] How to fire off QML-animation from C++

    3
    0 Votes
    3 Posts
    3k Views
    H
    That's a good idea. I went for an even cleaner approach now by binding the "state" of the object which I try to animate to a Q_PROPERTY in the C++ interface. The different states are linked to transitions (in QML) which do the animation I want.
  • QML ListView multiple delegates

    8
    0 Votes
    8 Posts
    15k Views
    B
    Looks like it's working pretty good. I wonder if the Loader has some kind of cache under the hood to maximize performance. Thanks.
  • WebView Clear history

    4
    0 Votes
    4 Posts
    5k Views
    G
    Ups, sorry, missed the forum topic. Just saw WebView :-)
  • Calling QML function from PySide

    7
    0 Votes
    7 Posts
    7k Views
    F
    This question raise a design issue; while is not a very good idea to pollute your root object with tons of functions, is still a good idea to put to root object all the function you need. You should try to think about root object as the interface to your qml gui: the deep you go through your QmlItems the wrost is going to be. You should expose a clear interface on your root object so changes behind the scenes can be kept hidden. In your case you should write a search function on the root object that parametrically finds what you want; that function should be semantc: say what you want and i will give it to you. Once again changing the entire qml and providing the same interface, gives you a new way to present and do stuffs, without change the backend. Doing so, you may see you are going to write too much function on your root object. In this case you can consider to write some interface Item on your Qml code directly behind your root object. So you can broke down interfaces by semantically unrelated groups and provide those interfaces as main gateways through your root object. I hope this can clear your picture.
  • Undefined reference to 'vtable for myClass'

    6
    0 Votes
    6 Posts
    15k Views
    F
    Hi Guys, Thanks for your help, I have moc and I have added @ HEADERS += myclass.h SOURCES += main.cpp myclass.cpp @ in my .pro file. I found my mistake, I must also add @ CONFIG += qt @ It works now, even though I don't know why. =)
  • Any idea when use OAuth with QML?

    5
    0 Votes
    5 Posts
    5k Views
    C
    [quote author="mario" date="1305789703"]Oh, I haven't tried the library myself so I have no clue on how to use it. Try contacting the authors (there's a contact page on the site). I think they will be glad to answer your question. [/quote] Ok, thanks.
  • [solved]QML element scope

    4
    0 Votes
    4 Posts
    4k Views
    Z
    Items in external component files are limited in scope to their own file. If you wish to expose properties of internal items in a component then you need to define alias properties in the top-level item of the component. See this "article":http://developer.qt.nokia.com/wiki/QML_Progress_Spinner for an example.
  • Best way to make a game menu in Qt Quick

    8
    0 Votes
    8 Posts
    5k Views
    C
    Donner: I got your point. The normal way is, you can specify a property to binding with the State. @ State { name: "C" when: menuPage.x == STATE_B_POSITION_X PropertyChanges { target: menuPage x: STATE_C_POSITION_X ... ... } }@ It will have a warning "<Unknown File>: QML StateGroup: Can't apply a state change as part of a state definition.", but you can ignore it.
  • Pl Explain math in Dial qml example

    4
    0 Votes
    4 Posts
    5k Views
    F
    I do not know the example. I just reasoned backwards from the chunk of code you posted.
  • How to pass variables between Rectangles?

    5
    0 Votes
    5 Posts
    3k Views
    Z
    Yeah, I did say "not tested". Thanks for pointing out my (ahem) deliberate mistake ;-)
  • More flashy

    2
    0 Votes
    2 Posts
    2k Views
    ?
    Maybe you could raise brightness & contrast levels... It would be more effective (and impossible, I think) to raise screen's voltage level XD. --