Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.5k Posts
  • Animating button press

    6
    0 Votes
    6 Posts
    14k Views
    J
    The problem with your examples is that the button is only animated when it is held. Unfortunately this doesn't work on Windows 7 tablet PC at all, because long press is treated like a right mouse click and not registered. The only working solution I found is this: file Button.qml @import Qt 4.7 Item { id: container signal clicked property string text Rectangle { id: buttonRectangle width: container.width height: container.height color: "red" MouseArea { id: mouseArea; anchors.fill: parent onClicked: { buttonRectangle.state = "pressed" stateTimer.start() container.clicked() } } Text { color: "#fff" anchors.centerIn: buttonRectangle font.pixelSize: 12 text: container.text } states: State { name: "pressed" PropertyChanges { target: buttonRectangle; scale: 0.7 } } Timer { id: stateTimer interval: 200; repeat: false onTriggered: buttonRectangle.state = 'State0' } transitions: Transition { NumberAnimation { properties: "scale"; duration: 200; easing.type: Easing.InOutQuad } } } }@ But I do believe there should be an easier way to implement this behavior of the button.
  • Reading local Symbian file using XMLHttpRequest

    7
    0 Votes
    7 Posts
    3k Views
    S
    As per my messages... "I assumed this would map to the private dir because the Qt created pkg file puts them there."...."When I run the app, the XMLHttpRequest can’t see the file" Simon
  • Modifying a ListView content from PySide

    3
    0 Votes
    3 Posts
    5k Views
    J
    I already solved the problem by implementing removeRows and addItem functions of the associated QAbstractListModel following "this tutorial":http://blog.rburchell.com/2010/02/pyside-tutorial-model-view-programming_22.html.
  • Hiding Symbian Soft Keys

    7
    0 Votes
    7 Posts
    4k Views
    K
    [quote author="VCsala" date="1293195123"]As I find the simulator is good tool but its compatibility with real word devices is relatively low. If you have any problem there it is always worth to try it on the device.[/quote] Yes, but fullscreen works fine in simulator.
  • Qml javascript problem

    9
    0 Votes
    9 Posts
    5k Views
    D
    Thanks guys it's working
  • Newbie:Doubt on QML coding.

    10
    0 Votes
    10 Posts
    6k Views
    K
    [quote author="qtrahul" date="1293090092"]There are so many articles available in this web for the new developer, So, you can try it. And also run the code.And start developing. [/quote] Its obvious from his post that he tried to run the code and started development using QML.
  • Any way to smooth Gradients?

    10
    0 Votes
    10 Posts
    7k Views
    A
    [quote author="mbrasser" date="1293060738"]In general, QML will always try to draw things the fastest way. Often this means that we internally cache things to a pixmap (for example, for 4.7.0 all Text is internally cached to a pixmap, though in 4.7.2 we will switch to using a QStaticText-like solution, which retains good performance and uses less memory). In terms of drawing a vertical linear gradient in a plain rectangle, that can be optimized quite well without caching, so we don't cache to a pixmap. (A gradient in a rounded rect, or bordered rect, however, is not well optimized) There are certainly cases when using your own pre-composed image is the best way to go, see for example http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeperformance.html#image-resources-over-composition. [/quote] Thanks for the explanation! Interesting that it seems to contradict the advice given at the Dev Days on this, but perhaps I just misunderstood. Still, I am very glad that there is constant work being done to improve performance. I guess in the end, there is no substitute for just measuring what performs better for your own specific case.
  • QML vs Standard C++ Graphical view

    4
    0 Votes
    4 Posts
    4k Views
    D
    thanks alot for answers, i will wait then :)
  • Qt Mobility Declarative Mapviewer Example

    3
    0 Votes
    3 Posts
    3k Views
    S
    Great, solved thanks Simon
  • Writing and Reading External Files

    10
    0 Votes
    10 Posts
    8k Views
    K
    I will look into it, I am up for whatever leads to simplicity and reliability.
  • SQL Driver

    8
    0 Votes
    8 Posts
    8k Views
    A
    I usually put the SQL plugin in a directory called "sqldrivers", and place that directory in the same directory as the executable. Note that you must use the same version as your Qt libs, including debug or release version. Otherwise, the plugin will not load. It can help to change your Run Settings (from the Projects tab) and add QT_DEBUG_PLUGINS = 1 to your Run Environment. That will generate debug output for the loading of Qt plugins.
  • Using ListModel inside C++ class.

    6
    0 Votes
    6 Posts
    5k Views
    X
    What shape is your pop-up menu by the way? You can achieve any shape using images. Is it that you want a non-rectangular mouseArea for the clicks? If so, yeah only C++ for that. Is there anything wrong with having the qml file define texts and ids? What do you need the C++ to do in this case? I have a log program that reads a text file and generates a list in C++ and passes it as a model in QML. The QML then interacts with the model and passes updated model back to the C++. Not sure if this is what you want.
  • QML Video not working on N900 PR1.3

    3
    0 Votes
    3 Posts
    3k Views
    B
    thanks to codise, who has pointed me to that link, I have installed Qt Mobility 1.1 on N900: http://zwong.de/2010/10/qt-mobility-11-maemo5-nokia-qt-sdk/ qml Video component on my N900 now works ok.
  • Howto make the flickr example's search happen on the key presses?

    2
    0 Votes
    2 Posts
    2k Views
    M
    Hi, You should be able to do this with something like: @ TextInput { ... onTextChanged: container.accept() } @ Regards, Michael
  • BorderImages and transparency in images

    3
    0 Votes
    3 Posts
    4k Views
    M
    Hi, You shouldn't need to do anything special, it should "just work" (testing with a black background on OS X, the above image in a BorderImage worked fine for me -- no white corners). What platform and graphics system (raster, opengl, etc) are you using? Regards, Michael
  • QML module versions

    3
    0 Votes
    3 Posts
    3k Views
    D
    Answering my own post here, but I found that you can have any name for the component qml file if you are using qmldir for an installed module. For example, component Button can be in xyz.qml if qmldir has the line "Button 1.0 xyz.qml". If there is no qmldir file, then the default convention is that component Button is in the file Button.qml.
  • .bin file from qml

    6
    0 Votes
    6 Posts
    4k Views
    S
    You have to add Myfile.qrc @<!DOCTYPE RCC><RCC version="1.0"> <qresource> <file>new/main.qml</file> </qresource> </RCC>@ update .pro file add this line RESOURCES += Myfile.qrc
  • [solved] How can I make something like Qt.createComponent(Rectangle) ?

    4
    0 Votes
    4 Posts
    6k Views
    I
    Alright, thanks for the ideas
  • [Solved] QML Back Button with JavaScript or ListModel?

    18
    0 Votes
    18 Posts
    12k Views
    X
    You must have added something to the list. As count is indexed starting with 1 while the array is indexed starting with 0, you use count-1 to map to the array. Hence, count-1 retrieves the last element in the array. Your version will get the second last element in the array, so something odd there. The one I posted works perfectly though (without adding any additional code) :)
  • QML on N900 help

    10
    0 Votes
    10 Posts
    5k Views
    V
    You need update. See "this":http://tablets-dev.nokia.com/nokia_N900.php link.