Results 1 to 7 of 7

Thread: How to create a QToolBar without a border?

  1. #1
    Join Date
    Jan 2006
    Posts
    52
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to create a QToolBar without a border?

    Hi all

    Is it possible to create a QToolBar without a border and without using styles?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to create a QToolBar without a border?

    What border do you mean? Generally, you can subclass QToolBar and do the background painting yourself.

  3. #3
    Join Date
    Jan 2006
    Posts
    52
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to create a QToolBar without a border?

    Quote Originally Posted by Lykurg View Post
    What border do you mean?
    like this:


    Quote Originally Posted by Lykurg View Post
    Generally, you can subclass QToolBar and do the background painting yourself.
    Well, yes. I was looking for an easier way .

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to create a QToolBar without a border?

    What style do you use? You also can modify your style which is maybe easier by reacting on QStyle::PE_PanelToolBar. See also QProxyStyle.

  5. #5
    Join Date
    Jan 2006
    Posts
    52
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to create a QToolBar without a border?

    I'm dumb. Forgot all about stylesheets. So I finally went and used this:
    Qt Code:
    1. tb->setStyleSheet("QToolBar { border: 0px }");
    To copy to clipboard, switch view to plain text mode 
    . Works great.

  6. #6
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to create a QToolBar without a border?

    Ok, I misunderstand your fist question, because I thought you don't want to use style sheets.

  7. #7
    Join Date
    Jan 2006
    Posts
    52
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to create a QToolBar without a border?

    Yes, I was pretty confused myself. I thought you could only change the look of a widget by subclassing QStyle.

Similar Threads

  1. Replies: 2
    Last Post: 21st March 2012, 14:30
  2. Replies: 1
    Last Post: 26th July 2009, 15:08
  3. Replies: 4
    Last Post: 13th July 2009, 18:18
  4. Replies: 4
    Last Post: 1st May 2009, 11:00
  5. How to create a movable border between two widgets?
    By Teuniz in forum Qt Programming
    Replies: 2
    Last Post: 16th March 2007, 08:45

Tags for this Thread

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.