Results 1 to 2 of 2

Thread: Cannot style the background of a QToolBar on Mac OSX

  1. #1
    Join Date
    May 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Cannot style the background of a QToolBar on Mac OSX

    Hi all!

    I have a problem styling the background of a QToolBar on Mac OSX. Im using Qt4.8.1 and Mac OS X 10.7
    I set a global qss stylesheet for my application and everything works just fine. The only thing that does not have any effect is the background part of the QToolBar. I can still set the padding or height or anything but the background...
    Here's the part of my stylesheet responsible for the toolbar:
    Qt Code:
    1. QWidget#toolBarMainView{
    2. padding-top:0px;
    3. min-height:42px;
    4. background-image:url(:/images/recources/img/assets/toolbar/background_img.png);
    5. background-repeat: repeat-xy;
    6. }
    To copy to clipboard, switch view to plain text mode 

    By the way: Im also using the same stylesheet and code for the application in windows. And in windows this problem does not occur.
    I have already googled for this problem and i found a bugreport for this issue (https://bugreports.qt-project.org/browse/QTBUG-12717).
    Does anyone know if this bug has been resolved and the problem is in my code or if the bug is still in qt?

    Thanks in advance for any hints or tips,
    Urchulak
    Last edited by Urchulak; 24th May 2012 at 15:15.

  2. #2
    Join Date
    May 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Cannot style the background of a QToolBar on Mac OSX

    Okay....

    I've made a workaround for this: First I create an empty widget for my toolbar. Then I create a subclass of QToolBar and make the toolbar I want. Afterwards I just add the toolbar to the layout of my empty widget and I can style the background of that toolbar.

    The issue seems to occur when a toolbar is added to a QMainWindow... On any other widget the toolbar is fully stylable.

    Does anyone know if Qt has reloved this issue or is at least working on it?

    Greetings
    Urchulak

Similar Threads

  1. QScrollArea misbehaving background style
    By Cruz in forum Qt Programming
    Replies: 6
    Last Post: 7th March 2021, 21:46
  2. How to style Toolbar background in MainWindow under OSX?
    By maik.stange in forum Qt Programming
    Replies: 0
    Last Post: 27th October 2010, 11:13
  3. Style Sheet with Gradient Background
    By waynew in forum Qt Programming
    Replies: 1
    Last Post: 27th July 2010, 05:23
  4. Style Sheet Syntax background
    By Tondog in forum Qt Programming
    Replies: 5
    Last Post: 28th April 2010, 07:21
  5. Transparent background Style
    By Lele in forum Qt Programming
    Replies: 5
    Last Post: 17th July 2006, 12:02

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.