Results 1 to 9 of 9

Thread: Status bar(widget frame) problem

  1. #1
    Join Date
    Dec 2014
    Posts
    29
    Thanks
    12
    Qt products
    Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Smile Status bar(widget frame) problem

    Hello, I'm having problem removing frame of QLabel widget:

    http://i.imgur.com/TA0hoSR.png ( on far right side of status bar)

    I tried setFrameShape(QtWidgets.QFrame.NoFrame), and with stylesheets (border-width: 0px) or just (border: x), without success.

    Edit: And is there a way to get text cursor current line postion( like this .textCursor().positionInBlock() for column)?
    Last edited by vuletic; 27th March 2015 at 18:59.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Status bar(widget frame) problem

    The frame comes from the status bar and not QLabel. You will not be able to remove it easily.

    As for your second question, QTextCursor::blockNumber() contains the line number of the cursor.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    vuletic (28th March 2015)

  4. #3
    Join Date
    Dec 2014
    Posts
    29
    Thanks
    12
    Qt products
    Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: Status bar(widget frame) problem

    I thought it was something like that, but I still would like to remove it, but I would need to know where to start looking first, if you/anyone else have any ideas where I could start working on that, please tell
    Last edited by vuletic; 28th March 2015 at 11:14.

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Status bar(widget frame) problem

    paintEvent of QStatusBar would be a good place to start looking.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. The following user says thank you to wysota for this useful post:

    vuletic (29th March 2015)

  7. #5
    Join Date
    Dec 2014
    Posts
    29
    Thanks
    12
    Qt products
    Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: Status bar(widget frame) problem

    After better google search than last one , I found easy fix for this:

    adding app.setStyleSheet("QStatusBar::item { border: 0px solid black }; "); after app = QtWidgets.QApplication(sys.argv) fixed my problem, for anyone else wondering how to do this.

    Here is link how it looks now: http://i.imgur.com/yqyFZzU.png

    Edit: or just self.setStyleSheet("QStatusBar::item { border: 0px };") in setupUi
    Last edited by vuletic; 30th March 2015 at 19:42.

  8. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Status bar(widget frame) problem

    You should move the items up a bit. They are not vertically centered.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #7
    Join Date
    Dec 2014
    Posts
    29
    Thanks
    12
    Qt products
    Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: Status bar(widget frame) problem

    'QStatusBar' object has no attribute 'setAlignment', so I tried to align only widgets on it:

    self.statusbarLocationLabel.setAlignment(QtCore.Qt .AlignVCenter) etc, but I don't think it works, look:

    old one:
    http://i.imgur.com/yqyFZzU.png
    new one:
    http://i.imgur.com/QAljYAM.png

  10. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Status bar(widget frame) problem

    If you are using stylesheets then maybe you can use them for that.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #9
    Join Date
    Dec 2014
    Posts
    29
    Thanks
    12
    Qt products
    Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: Status bar(widget frame) problem

    Indeed :P

Similar Threads

  1. Size grip between dock widget and status bar
    By jpalbertini in forum Qt Programming
    Replies: 0
    Last Post: 28th January 2013, 11:50
  2. frame around the tree widget items
    By fulbay in forum Qt Programming
    Replies: 3
    Last Post: 29th December 2010, 14:37
  3. Add a Frame Widget to the main window
    By kamlmish in forum Qt Programming
    Replies: 2
    Last Post: 30th November 2010, 08:51
  4. Replies: 3
    Last Post: 8th July 2010, 07:41
  5. Status Widget
    By user_mail07 in forum Qt Programming
    Replies: 4
    Last Post: 18th June 2008, 07:51

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.