跳到內容

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k 主題 77.7k 貼文
  • List View Zooming

    2
    0 評價
    2 貼文
    1k 瀏覽
    D
    Hmm, i think as main container is "StackView":http://qt-project.org/doc/qt-5/qml-qtquick-controls-stackview.html a good element. For the pages use a "flickable container":http://qt-project.org/doc/qt-5/qml-qtquick-flickable.html with a child item to render the content. Change the size of the child item for zooming should have a direct effect to the flickable element for scrolling.
  • Button Click Signal to make a pop- up window

    3
    0 評價
    3 貼文
    5k 瀏覽
    H
    Yes now I understand, thank you.
  • How to simulate Home Key pressing in Android

    1
    0 評價
    1 貼文
    942 瀏覽
    尚無回覆
  • Camera preview image is always the same

    4
    0 評價
    4 貼文
    2k 瀏覽
    M
    any help on this issue ? I've submitted a bug, but no news as well on that site : https://bugreports.qt-project.org/browse/QTBUG-41442
  • Using rainyday.js in QtQuick app

    2
    0 評價
    2 貼文
    676 瀏覽
    p3c0P
    Hi, I don't think so it could be used. The first major obstruction here would be use of window object which is used in that js. Check "this":http://qt-project.org/doc/qt-5/qtqml-javascript-hostenvironment.html for more details.
  • [SOLVED] Object rotating twice on Transition

    7
    0 評價
    7 貼文
    2k 瀏覽
    V
    That's exactly it, works perfectly now. Thank you. I added the code below in case someone has the same problem: @import QtQuick 2.2 import QtQuick.Window 2.1 Window { visible: true width: 360 height: 360 MouseArea { id: mouseArea anchors.fill: parent onClicked: { rect.state = rect.state === "clicked" ? "" : "clicked"; } } Rectangle { id: rect width: 50 height: 50 color: "blue" anchors.centerIn: parent function getRandom() { var rand = Math.floor(Math.random() * 360) + 1; console.log("Random: " + rand); return rand; } states: [ State { name: "clicked" PropertyChanges { target: rect explicit: true rotation: getRandom() } } ] transitions: Transition { to: "clicked" RotationAnimation { target: rect duration: 500 } } } } @
  • Delete Images from Stored Path in qml

    4
    0 評價
    4 貼文
    1k 瀏覽
    p3c0P
    Well, atleast from what all i have explored i found no way.
  • Message Dialog error on SetGeometry.

    4
    0 評價
    4 貼文
    2k 瀏覽
    T
    Hi, any luck on this? I'm facing the same issue using Qt 5.3.2. The same code had no problem in Qt 5.2.1, but now the dialog window seems to hang on Windows. If I move the window a bit, then it suddenly refreshes, and I may click the buttons. On 5.2.1, the window looked much nicer as well. I have searched, but could not find a bugreport mentioning this.
  • [solved]QtQuick need something to work?

    12
    0 評價
    12 貼文
    6k 瀏覽
    C
    @harshit_smart could you fix it? I have the same problem...!
  • [SOLVED] Qt Quick Application: empty window

    8
    0 評價
    8 貼文
    7k 瀏覽
    R
    The latest versions of Qt Creator take care of the original problem stated here because the main.qml file is put inside a qml.qrc resource file by default. Did yours do this? If not you might not be on the latest (right now 5.2.3 - but its been doing this for a while). Other than that I would suggest taking a look at the Projects mode and switch to the Run tab and see if possibly something got mucked up on the Working Directory line. It should point to that same folder where you are manually double-clicking.
  • [solved] script in property

    5
    0 評價
    5 貼文
    1k 瀏覽
    R
    I think it would be cleaner (just an opinion) to use a couple of functions to populate the ListModel. You would of course need to add a line to fillScreenListModel() for every additional item you added in your case statement. @ function makeObject(roleName, value) { return {"name": roleName, "info": value} } function fillScreenListModel() { var dataArray = [], i=0 dataArray[i++] = makeObject("Screen width",Screen.width) dataArray[i++] = makeObject("Screen height",Screen.height) dataArray[i] = makeObject("Pixel density",Math.floor(Screen.logicalPixelDensity*100)/100) //Now move each object into the ListModel dataArray.forEach(function(element){infoModel.append(element)}) }@ Then your ListModel could look like this: @ ListModel { id: infoModel Component.onCompleted: fillScreenListModel() }@ If you want to format pixelDensity as a string using toFixed(2), then add toString() to the other numbers so that all the info roles are strings.
  • [SOLVED]How to control refreshing qml view?

    12
    0 評價
    12 貼文
    2k 瀏覽
    p3c0P
    Ok. You're Welcome :) Please mark the post as solved.
  • How to delete qml object from Qt slot?

    2
    0 評價
    2 貼文
    887 瀏覽
    p3c0P
    Hi Pass the parent object to QQuickView and it will be deleted on quit.
  • [SOLVED] Load new View

    8
    0 評價
    8 貼文
    3k 瀏覽
    M
    Thanks, it works ;-) the z values did the trick! @ ApplicationWindow { id: applicationWindow1 visible: true width: 1200 height: 1920 title: qsTr("whatsOn") Loader { id: pageLoader anchors.fill: parent z: 1 } // signal qmlSignal(string msg) menuBar: MenuBar { Menu { title: qsTr("File") MenuItem { text: qsTr("Verbindung"); onTriggered: pageLoader.source = "MyItem.qml"; } MenuSeparator {} MenuItem { text: qsTr("Exit") onTriggered: Qt.quit(); } } } Timeline{z: 0} } @
  • [SOLVED]Does XMLHttpRequest read local files, that are not declared in resources?

    3
    0 評價
    3 貼文
    10k 瀏覽
    G
    I see. That's not exactly what I wanted, as it is not going to work starting program with @Component.onCompleted:@ Apparently XMLHttpRequest can read local files directly when they are included in resources and since I'm updating that file with QFile, then I have to read it with QFile as well. The question was raised, because "http://qmlbook.org/ch11/index.html#local-files":http://qmlbook.org/ch11/index.html#local-files and other examples doesn't mention this restriction regarding location of these files.
  • Load qml-files inside a folder as tabs in a TabView

    5
    0 評價
    5 貼文
    1k 瀏覽
    D
    Please add [SOLVED] to all your solved threads because for other users it's a nice help to see if a thread is solved.
  • [SOLVED] clearing FrameBuffer

    2
    0 評價
    2 貼文
    2k 瀏覽
    D
    OK, i solved the problem. The magical part is this: @ this->_fbo->bind(); glClear(GL_COLOR_BUFFER_BIT); this->_fbo->release(); @
  • QQuickView not active before being clicked once

    8
    0 評價
    8 貼文
    2k 瀏覽
    P
    No, raise() does not help. I´ve tried lots of things on QQuickItem , setFocus, forceActiveFocus, setAcceptedMouseButtons...and even sending MouseButtonPress/Release events. But nothing works... Thans for your help.
  • Unable to change parent and child window Z order after calling loader

    3
    0 評價
    3 貼文
    3k 瀏覽
    R
    I think what happens is once you reload, the main window becomes active. Then calling raise and lower is raising and lower the main window (and its child) relative to the other windows in the OS. I just experimented and found that changing your onTopChildChanged handler as follows results in the desired behavior (at least under windows 7): @ onChildOnTopChanged: { if (childOnTop) { winNew.requestActivate() winNew.raise(); } else { winNew.requestActivate() winNew.lower(); } }@
  • [SOLVED] QML: QListView / QListModel force repainting listview / delegates

    6
    0 評價
    6 貼文
    11k 瀏覽
    D
    Please add solved to your thread title