Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Can't find how to delete / hide QGraphicsScene borders
Qt 6.11 is out! See what's new in the release blog

Can't find how to delete / hide QGraphicsScene borders

Scheduled Pinned Locked Moved Solved Qt for Python
4 Posts 2 Posters 821 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.
  • L Offline
    L Offline
    LucasB
    wrote on last edited by
    #1

    Hi,

    I'm trying to hide QGraphicsScene borders but i can't find how to do it on the internet.

    It appears like a widget but I can't apply the setStyleSheet function like that:

    my_scene = QtWidgets.QGRaphicsScene(0, 0, 200, 200, self)
    my_scene.setStyleSheet("border-style: None")
    

    It returns me an error QGraphicsScene object has no attribute 'setStyleSheet'

    Do you have any ideas how i can reach my goal to hide the borders ?

    Thank you in advance for your help.

    JonBJ 1 Reply Last reply
    0
    • L LucasB

      Hi,

      I'm trying to hide QGraphicsScene borders but i can't find how to do it on the internet.

      It appears like a widget but I can't apply the setStyleSheet function like that:

      my_scene = QtWidgets.QGRaphicsScene(0, 0, 200, 200, self)
      my_scene.setStyleSheet("border-style: None")
      

      It returns me an error QGraphicsScene object has no attribute 'setStyleSheet'

      Do you have any ideas how i can reach my goal to hide the borders ?

      Thank you in advance for your help.

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @LucasB
      QGraphicsScene is not a QWidget, so there won't be any stylesheet.

      QGraphicsView, however, is a QWidget. Is that what you intended?

      L 1 Reply Last reply
      0
      • L Offline
        L Offline
        LucasB
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • JonBJ JonB

          @LucasB
          QGraphicsScene is not a QWidget, so there won't be any stylesheet.

          QGraphicsView, however, is a QWidget. Is that what you intended?

          L Offline
          L Offline
          LucasB
          wrote on last edited by
          #4

          @JonB Thank you for your answer !

          Exactly i can't set style sheet on QGraphicsScene but in QGraphicsView it works.
          In that way, i can hide the borders that exist by default in this widget.

          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