Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Is it possible to place a QRect on the ui without using a QGraphicsScene?
Forum Updated to NodeBB v4.3 + New Features

Is it possible to place a QRect on the ui without using a QGraphicsScene?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 308 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.
  • Dummie1138D Offline
    Dummie1138D Offline
    Dummie1138
    wrote on last edited by
    #1

    As aforementioned. Looking through the QRect documentation, I haven't been able to find any documentation discussing whether QRect can be placed on the ui without using a QGraphics scene. Please let me know if more information is required.

    jsulmJ 1 Reply Last reply
    0
    • Dummie1138D Dummie1138

      As aforementioned. Looking through the QRect documentation, I haven't been able to find any documentation discussing whether QRect can be placed on the ui without using a QGraphics scene. Please let me know if more information is required.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Dummie1138 QRect is not a widget, so cannot be visible. What you can use instead is QFrame.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      Dummie1138D 1 Reply Last reply
      2
      • jsulmJ jsulm

        @Dummie1138 QRect is not a widget, so cannot be visible. What you can use instead is QFrame.

        Dummie1138D Offline
        Dummie1138D Offline
        Dummie1138
        wrote on last edited by
        #3

        @jsulm By that, do you specifically mean placing a QFrame around the QRect, or just building a QFrame in the shape of a QRect? I think I've seen both as viable options according to the documentation.

        jsulmJ 1 Reply Last reply
        0
        • Dummie1138D Dummie1138

          @jsulm By that, do you specifically mean placing a QFrame around the QRect, or just building a QFrame in the shape of a QRect? I think I've seen both as viable options according to the documentation.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Dummie1138 said in Is it possible to place a QRect on the ui without using a QGraphicsScene?:

          QFrame around the QRect

          Again: QRect is NOT a widget, so you cannot place anything "around" it.
          Just call https://doc.qt.io/qt-6/qwidget.html#geometry-prop on your QFrame and pass it your QRect.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          2

          • Login

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