Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to set QQuickPaintedItem content offset?
Forum Updated to NodeBB v4.3 + New Features

How to set QQuickPaintedItem content offset?

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 769 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    ubivaza
    wrote on last edited by
    #1

    QQuickPaintedItem has non virtual contentsBoundingRect method.

    But bounding rect could be extended only in size. Is there the way to modify bounding rect by shifting it?

    For example, item rect is [0, 0, 10, 10]. I want to set bounding rect to [-5, -5, 15, 15]. Is it possible?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dasRicardo
      wrote on last edited by
      #2

      The boundingRect function return an QRectF value. This should be work.
      @
      QRectF temp = boundingRect();
      temp.setX(-5);
      temp.setY(-5);
      @

      **Sorry for my english :)

      PLEASE ADD [SOLVED] TO YOUR THREAD TITLE IF IT'S SOLVED.**

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dasRicardo
        wrote on last edited by
        #3

        Please add [SOLVED] to your thread title if the problem is solved so other forum members can quickly see if this thread helped or not.

        **Sorry for my english :)

        PLEASE ADD [SOLVED] TO YOUR THREAD TITLE IF IT'S SOLVED.**

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved