Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.6k Posts
  • QtQuick2 applications steal mouse cursor from the OS

    1
    0 Votes
    1 Posts
    720 Views
    No one has replied
  • Changing Rectangle border color decline performance

    2
    0 Votes
    2 Posts
    1k Views
    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 Votes
    3 Posts
    1k Views
    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 Votes
    1 Posts
    718 Views
    No one has replied
  • QQuick(PaintedItem) inside a flickable

    2
    0 Votes
    2 Posts
    2k Views
    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 Votes
    2 Posts
    2k Views
    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 Votes
    7 Posts
    11k Views
    U
    Did you register the class, i.e. the second step of my example?
  • A bug of Item position in Qt Quick2

    11
    0 Votes
    11 Posts
    3k Views
    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 Votes
    6 Posts
    2k Views
    S
    Thanks for you answer!
  • QtGui.QIcon("filename.png") results in blank button, version PyQt4.4.4

    1
    0 Votes
    1 Posts
    3k Views
    No one has replied
  • Zetcode tutorial vs what works for me. Version difference?

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Drawing a graph in Qt Quick 2.0

    4
    0 Votes
    4 Posts
    3k Views
    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 Votes
    5 Posts
    2k Views
    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 Votes
    2 Posts
    2k Views
    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 Votes
    6 Posts
    4k Views
    U
    Ah, you are using Qt4... it seems there is no such property in QtQuick 1...
  • Get/Set cookies from qml

    6
    0 Votes
    6 Posts
    4k Views
    D
    Exactly. While there is no reason why that shouldn't be possible using pure QML. P.S. Maybe that's possible using webkit but that's different topic.
  • Rectangles & padding

    4
    1 Votes
    4 Posts
    24k Views
    C
    It is the anchors which define how the child rectangle fills the parent rectangle. Remember, in QML, just because an object instance is declared within another one does NOT mean that it is visually located inside that other one. The positioning (either via anchors, or some other positioning method) define where it "appears" and thus the positioning also defines the spacing / padding. So, to implement what you want, just add an "anchors.margins: 10" to your anchors declaration. Note that the margin can also be specified separately for each edge; see http://doc-snapshot.qt-project.org/qt5-stable/qtquick/qtquick-positioning-anchors.html for more information. Cheers, Chris.
  • Updating fontSize via function key call - calling functions in QML

    6
    0 Votes
    6 Posts
    2k Views
    D
    Thank you. That was what I was doing but there was a typo blush
  • QML Drag Outside of Window

    7
    0 Votes
    7 Posts
    3k Views
    R
    Just cloned it. Thanks a lot
  • 0 Votes
    9 Posts
    6k Views
    T
    Done! Thanks:)