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 toggle visibility of a QRect

How to toggle visibility of a QRect

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 2 Posters 313 Views
  • 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.
  • R Offline
    R Offline
    RobM
    wrote on last edited by RobM
    #1

    Is there a way to toggle the visibility of a QRect from QML? I created one in C++:

    QRect                    miniMapRect;
    ...
    miniMapRect = QRect(20, int(pThis->height() - 130 - hPart),
                                int(pThis->width() / miniDivisor), hPart);
    

    but I am not sure how to go about toggling it's visibility from QML.

    I suppose I can just use the setHeight and setWidth functions for this.

    1 Reply Last reply
    0
    • GrecKoG Offline
      GrecKoG Offline
      GrecKo
      Qt Champions 2018
      wrote on last edited by
      #2

      a QRect is not a visual element.

      Can you give us more detail about your code? Especially the UI part.

      1 Reply Last reply
      1

      • Login

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