跳到內容

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k 主題 77.4k 貼文
  • How to load bunch of images to the Image in QML?

    4
    0 評價
    4 貼文
    2k 瀏覽
    sierdzioS
    If they are big, then you should probably go into converting them into a movie and then playing it back in your app. Video codecs are optimised to handle those situations well, timely and with small CPU/ RAM footprint. QML Image is really meant for displaying static images. My solution above will work, of course, but I would only consider using this approach for some small, corner use cases.
  • 0 評價
    7 貼文
    4k 瀏覽
    M
    It turns our that Qt 5.0.1 was not calling SetProcessDPIAware function before the initialization. More details are "here":https://bugreports.qt-project.org/browse/QTBUG-30063?focusedCommentId=198569&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-198569 and "here":http://qt-project.org/forums/viewthread/25605/#118658
  • Basic language types implementation

    8
    0 評價
    8 貼文
    3k 瀏覽
    C
    I doubt it will happen for 5.2 now, unless someone puts in the work. The limitation is that the custom basic types will work, but they will be "backed" by a variant - which means that type safety won't be enforced at the parser level for them (I think - my memory is fuzzy, but that's my recollection). QtLocation does expose eg GeoCoordinate as a valuetype, so it can be done (and it "works"), but it's certainly not supported to the extent that would be "good". We ran out of time :-( Cheers, Chris.
  • How to rotate an image

    2
    0 評價
    2 貼文
    1k 瀏覽
    L
    I think that this tutorial might be useful: "Implementing a Rotary Dialer with QML":http://www.developer.nokia.com/Community/Wiki/Implementing_a_Rotary_Dialer_with_QML
  • How do I use the QML?

    4
    0 評價
    4 貼文
    1k 瀏覽
    U
    There is no need to post the same question all over the place, chose a thread and stick to it.
  • QtQuick2 applications steal mouse cursor from the OS

    1
    0 評價
    1 貼文
    718 瀏覽
    尚無回覆
  • Changing Rectangle border color decline performance

    2
    0 評價
    2 貼文
    1k 瀏覽
    J
    Are you on a very resource constrained system? Without having looked much at the code, I would guess that it spends the extra CPU simply because the entire rectangle is filled even if you only modify the border color. When borders are translucent, rounded or antialiased it often requires repainting the whole thing, so it generally just calls update() on the whole Item rect. It might be possible to special case this, but for now I think your fix sounds reasonable as it sounds like your bottle neck is simply the amount of pixels you can push and it might require managing each rect at a lower level.
  • Set onClicked function based upon state

    3
    0 評價
    3 貼文
    1k 瀏覽
    R
    You should be able to modify the signal handler from JS like this: @ State { name: "one" StateChangeScript { script: { area.clicked.disconnect( handleOne ); area.clicked.connect( handleTwo ); } } @ But note: if you add a handler to clicked while this event is currently handled, the newly added handler will be called immediatly.
  • Using/installing (old) Desktop Components with Qt 4.8 on OS X 32 bit

    1
    0 評價
    1 貼文
    718 瀏覽
    尚無回覆
  • QQuick(PaintedItem) inside a flickable

    2
    0 評價
    2 貼文
    2k 瀏覽
    U
    I am also curious if there is a way to "borrow" the geometry QPainter generates when used on a OpenGL paint device, that could prove useful and save math headaches.
  • ListView in QtQuick 1.1 vs QtQuick 2.0

    2
    0 評價
    2 貼文
    2k 瀏覽
    D
    And now I will answer first problem myself: blog I'm pointing to has mistype "n" is missing in isAtYBeginning. ListView still inherits from Flickable (can be seen while reading code). Second problem is more complicated however.
  • Save and load txt file

    7
    0 評價
    7 貼文
    11k 瀏覽
    U
    Did you register the class, i.e. the second step of my example?
  • A bug of Item position in Qt Quick2

    11
    0 評價
    11 貼文
    3k 瀏覽
    U
    Just use a placeholder to center your rotating item into. Here is an example - the rotating item will move with the mouse cursor as it rotates around its center and changes width: @Rectangle { id: root width: 800 height: 800 color: "yellow" MouseArea { id: cursorLocation hoverEnabled: true anchors.fill: parent } Item { // placeholder width: 50 height: 50 x: cursorLocation.mouseX - width/2 y: cursorLocation.mouseY - height/2 Rectangle { id: tester anchors.centerIn: parent width: 50 height: 50 color: "black" NumberAnimation on rotation { loops: Animation.Infinite from: 0 to: 360 duration: 1000 } NumberAnimation on width { loops: Animation.Infinite from: 50 to: 300 duration: 1000 } } } }@
  • Create new Element on demand

    6
    0 評價
    6 貼文
    2k 瀏覽
    S
    Thanks for you answer!
  • QtGui.QIcon("filename.png") results in blank button, version PyQt4.4.4

    1
    0 評價
    1 貼文
    3k 瀏覽
    尚無回覆
  • Zetcode tutorial vs what works for me. Version difference?

    1
    0 評價
    1 貼文
    1k 瀏覽
    尚無回覆
  • Drawing a graph in Qt Quick 2.0

    4
    0 評價
    4 貼文
    3k 瀏覽
    Q
    Hello, thanks for the answers. chrisadams , I didn't know about beginCreateObject, I'll try it! Maybe I could use the C++ side of the animation engine, or maybe use a QtObject for each line just to handle state and position, and do the drawing in a shared item... Jens, this was "option three": using an QSGItem directly. Unfortunately this approach works, but requires to generate a low level tessellation of the geometry. This means that you cannot use all the QPainter goods, and you need to generate the vertexs, color coordinates, textures (line caps, joins,effects,gradients, etc...). This will be much faster but requires a good amout of work. And even in this case I "suspect" that I'll have to share vertex buffers, I don't think creating a number of small nodes/buffers will be so good in terms of performance...
  • Dynamic QML object question

    5
    0 評價
    5 貼文
    2k 瀏覽
    cmessineoC
    I'm using 4.8.4. I don't think it can be done. There doesn't seem to be a way I can trap that event when I create the keyboard dynamically.
  • Confused about keypress event

    2
    0 評價
    2 貼文
    2k 瀏覽
    L
    Perhaps you can upload your files somewhere so other people can try it on their local machine.
  • Smoothly rotate a Rectangle in QML

    6
    0 評價
    6 貼文
    4k 瀏覽
    U
    Ah, you are using Qt4... it seems there is no such property in QtQuick 1...