Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • [SOLVED] QML states not updating image rotation property

    3
    0 Votes
    3 Posts
    3k Views
    S
    Good explanation, thanks. So I just deleted the 'property string' bit so that I'm using the default 'state' property and now everything works correctly.
  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • QML Application Window size lock

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Phonon and queue

    2
    0 Votes
    2 Posts
    2k Views
    A
    Ok, i've better read documentation...is not so clear, but I've got an intuition...so I've tried and now it's work! So, when I put several clips and then I start playing, it works as aspected: play sounds one after other one until queue is not empty; when it ends with all sounds, calling the same code doesn't work as espected because the queue is elaborated only if the media is currently playing. So the solution is this: @ void RadioVoicePhononControl::play(QString sound) { if (this->media->state() == Phonon::PlayingState || this->media->state() == Phonon::LoadingState) this->media->enqueue(sound); else this->media->setCurrentSource(sound); } void RadioVoicePhononControl::stateChanged(Phonon::State newstate, Phonon::State) { if (newstate == Phonon::StoppedState) // this state will be set when media has loaded clip this->media->play(); } @ That works because of setCurrentSource(...) that reactivates playing and eventually use the queue.
  • Optimization: Simplified ListView

    10
    0 Votes
    10 Posts
    4k Views
    G
    You may want to experiment creating a filter for event loop and do gesture detection that way.
  • [SOLVED] i18n - chinese fonts

    3
    0 Votes
    3 Posts
    2k Views
    P
    Thanks for offer, but in the end i have found out that it was my fault:-) I was reading chinese text from DB and I didn't noticed that I have put it in DB with new line char in the end. So after removing new line - problem solved. Sorry.
  • Array length

    5
    0 Votes
    5 Posts
    5k Views
    W
    Ok. I get it done already.. Thank You so much for your help..
  • 0 Votes
    3 Posts
    1k Views
    H
    [quote author="leafaku" date="1343277513"]Hey hong, I spent half hour and found a solution maybe can solved your problem. Just add the two line to Text component: @horizontalAlignment : Text.AlignHCenter verticalAlignment : Text.AlignVCenter@ BR, Leaf[/quote] Hey, I tried it and yeah, it worked! Took me half a day and I couldn't figure it out. Thank you so much for taking the time to help me. :)
  • Passing touch coordinates to qml

    2
    0 Votes
    2 Posts
    1k Views
    C
    If you expose the parser class to QML (ie, make it a QObject and expose the touchX and touchY coordinates as Q_PROPERTY ints) then you can simply bind the rectangle's x/y properties to the parser's touchX and touchY coordinates. If you don't want to expose the parser class, you could update context properties, but that will cause all bindings (not just the ones involving those properties) to be re-evaluated on every update, and so will most likely cause a prohibitive performance penalty. The final thing you could do is create a mouse click event from the touch coordinates, and send the event to a MouseArea defined in QML - its onClicked signal-handler could manually position the rectangle according to the mouse.x and mouse.y values available in the handler. But this is something I haven't ever tried, so YMMV. Cheers, Chris.
  • Unable to import QtMultimediaKit 1.1 in a Qt Quick application

    15
    0 Votes
    15 Posts
    13k Views
    B
    mgvali can you post more detailed instructions?
  • ToolbarMenuLayout and programmatcally add or remove buttons

    6
    0 Votes
    6 Posts
    2k Views
    P
    So the only one reason is, I think do it in C++...
  • [Solved] TextInput select problem

    3
    0 Votes
    3 Posts
    2k Views
    E
    thank you very much for your reply! stupid me... now I call select when the activeFocus changes and is true, and everything is working fine!
  • [SOLVED] Error launching my App after PR 1.3

    6
    0 Votes
    6 Posts
    3k Views
    EddyE
    [quote author="AlterX" date="1342690647"] Sorry, but you are speaking about "import QtQuick 1.0" or "import com.nokia.meego 1.0" ?? [/quote] Sorry to be late, but to answer your question: I changed it for both
  • Register QList<QDate> with QML

    3
    0 Votes
    3 Posts
    2k Views
    T
    Thanks! QVariantList works great.
  • [SOLVED] How do I retrieve image from XmlListModel for Splash Screen?

    7
    0 Votes
    7 Posts
    3k Views
    H
    It worked! It managed to load the image correctly and the splash screen appeared as well. Thank you very much for your help. You just made my day! :D For future reference, here is my final code. @ import QtQuick 1.1 import com.nokia.symbian 1.1 Page { id:root orientationLock: PageOrientation.LockPortrait //---------------------------------------XML---------------------------- XmlListModel { id: splash1 property string feedUrl: "" property bool loading: status == XmlListModel.Loading source: "http://appsfactory.my/client/canonmsia2/android/startup.php" query: "/plist/dict" XmlRole { name: "splashImage"; query: "string[2]/string()" } onStatusChanged: { if(status == XmlListModel.Ready) { splashImage2.source = splash1.get(0).splashImage; } } } //---------------------------------------splash---------------------------- Item { id: splashScreenContainer2 signal splashScreenCompleted() Image { id: splashImage2 anchors{top:parent.top} } SequentialAnimation { id:splashanimation2 PauseAnimation { duration: 8200 } PropertyAnimation { target: splashImage2 duration: 700 properties: "opacity" to:0 } onCompleted: { splashScreenContainer2.splashScreenCompleted() root.pageStack.push(window.homePage) } } //starts the splashScreen Component.onCompleted: splashanimation2.start() } } @
  • States does not respond

    4
    0 Votes
    4 Posts
    1k Views
    S
    It must not be because of the states' names (they are the same)
  • Is Qt-components 1.1.3 available right now?

    2
    0 Votes
    2 Posts
    1k Views
    L
    Thers is some configures in my *.pro: @symbian { TARGET.UID3 = 0x20067137 DEPLOYMENT.installer_header=0x2002CCCF DEPLOYMENT.display_name = Good of food VERSION = 1.0.0 vendorinfo = "%{"Freeman"}" ":"Freeman"" my_deployment.pkg_prerules = vendorinfo my_deployment.pkg_prerules += \ "; Dependency to Symbian Qt Quick components" \ "(0x200346DE), 1, 1, 0, {\"Qt Quick components\"}" DEPLOYMENT += my_deployment } CONFIG += qt-components@
  • [Solved] Forward key event

    6
    0 Votes
    6 Posts
    2k Views
    R
    well, you could connect textInput.text to a custom curText property using onTextChanged and then bind that to the C++... P.S. - I don't get how validator and input mask are a problem
  • [Solved] TextInput overwriteMode

    6
    0 Votes
    6 Posts
    3k Views
    E
    I would also like the cursor to be different, depending on which mode is set. So I was thinking about selecting the characters to overwrite them: @ TextInput { id: input text: "ciao" font.pixelSize: 20 onTextChanged: { select(cursorPosition, cursorPosition+1); } } @ This is working quite nice. But I don't know how to select the first character. I tried this: @ Component.onCompleted: select(0, 1) @ The character was selected, but I couldn't enter anything anymore. Also the left/right keys were not working. The other problem are the left/right buttons. I would need to set the selection when they are pressed, too. I tried this: @ Keys.onPressed: { if(event.key == Qt.Key_Right) { select(cursorPosition, cursorPosition+1); } } @ When the cursorPosition is 0 and I press the right arrow key, the cursor is on the second position (before the 'a'). When I press the right arrow key again, the cursor is behind the 'o' but nothing is selected I also tried to set the cursorDelegate, but the Rectangle is shown on top of the text.
  • GetElementsByTagName("") - is not supported by XmlHttpRequest??

    3
    0 Votes
    3 Posts
    4k Views
    I
    You can implement your own getElementByTag name, something like: @function getElementsByTagName(rootElement, tagName) { var childNodes = rootElement.childNodes; var elements = []; for(var i = 0; i < childNodes.length; i++) { if(childNodes[i].nodeName === tagName) { elements.push(childNodes[i]); } } return elements; }@ :)