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. [solved] QStatusBar add a widget without a frame/border
Forum Updated to NodeBB v4.3 + New Features

[solved] QStatusBar add a widget without a frame/border

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 5.0k 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.
  • idlefrogI Offline
    idlefrogI Offline
    idlefrog
    wrote on last edited by
    #1

    When adding a widget to QStatusBar such as a QLabel, it is shown with a frame.

    Is there a way to add a widget to the status bar without the border / frame?

    Or is inheriting QStatusBar and overriding render() the only possibility?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You could try using a stylesheet like described "here":http://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qstatusbar

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • idlefrogI Offline
        idlefrogI Offline
        idlefrog
        wrote on last edited by
        #3

        Yes, that's just what I needed :)
        Thanks for the tip!

        Adding:
        @ qApp->setStyleSheet( "QStatusBar::item { border: 0px}" ) ;@

        Removed the border from the widgets in the status bar.
        Thanks again :)

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          zeljko
          wrote on last edited by
          #4

          You can insert QLabel without frame afaik, there's no need for using stylesheet. Just set Shape to QFrame::NoFrame. See http://qt-project.org/doc/qt-4.8/qframe.html#Shadow-enum

          1 Reply Last reply
          0
          • idlefrogI Offline
            idlefrogI Offline
            idlefrog
            wrote on last edited by
            #5

            Yes, I see, of course if you insert a custom QWidget you automatically get a frame, even if the custom widget does not inherit from QFrame.

            But I'll keep that in mind for other standard widgets that I might add to the status bar.
            :) Thanks for your help.

            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