Results 1 to 5 of 5

Thread: QMenu indicator style sheet undesired behaviour

  1. #1
    Join Date
    Aug 2019
    Posts
    7
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default QMenu indicator style sheet undesired behaviour

    Hello there,
    In one of my projects, I used to define my own application theme (via style sheets).

    Everything worked fine except when I tried to set an image for the QMenu::indicator:exclusive:checked state.
    In fact, it works fine for the checked item but it generates collateral undesired behaviour over unchecked items.
    Indeed, if I define an image for the checked indicator, the unchecked indicators become sunk and I don't understand why (and nothing worked to remove it: removing borders, changing border-style, setting an empty image, setting a not empty image, ... nothing seems to affect this ugly sunken border).

    You can find the details (context, screenshots, ...) of the problem in the original question here.

    If someone has an idea of how to get rid of it, I would be very grateful.

    Thanks in advance for those who will spend some time to help me.

    EDIT: After performing additional tests, it seems to be a bug. I reported it on the Qt bug tracker, you can find it here.
    Last edited by Fareanor; 6th August 2019 at 15:40.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QMenu indicator style sheet undesired behaviour

    Stylesheets are nice for small and few changes, for anything beyond that it is usually a better idea to invest in a proper QProxyStyle.

    Cheers,
    _

  3. #3
    Join Date
    Aug 2019
    Posts
    7
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QMenu indicator style sheet undesired behaviour

    First of all, thank you for your answer.

    I agree with this for elaborated design, it is better to use something else than stylesheets.
    But, I think even for the style of a whole application, if we stay in the scope of stylesheets capabilities, I don't see a reason why it should be bad to use them.

    The problem here is that I don't have any elaborated effects that exceed the stylesheets capabilities and applying the stylesheet does not behave as it should do.
    So the problem is not about stylesheets capabilities but more about the way they are implemented in Qt (what Qt does when we apply a stylesheet with setStyleSheet()). And this is where I found the bug.

    In the bug report, I have added a minimal and complete example to reproduce the bug.

    Thanks for your advice anyway
    Last edited by Fareanor; 7th August 2019 at 10:53.

  4. #4
    Join Date
    Oct 2019
    Posts
    7
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QMenu indicator style sheet undesired behaviour

    There is some example of QMenu indicator stylesheet here : https://qss-stock.devsecstudio.com

  5. #5
    Join Date
    Nov 2014
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: QMenu indicator style sheet undesired behaviour

    Have you found any workaround for this bug?
    Maybe it is possible to customize checkmark without drawing this frame for unchecked state?

Similar Threads

  1. Strange behaviour of hovering in QMenu
    By CassandraD in forum Qt Programming
    Replies: 0
    Last Post: 12th May 2014, 17:49
  2. QProgress bar - Busy Indicator - Strange behaviour
    By johnnyturbo3 in forum Newbie
    Replies: 4
    Last Post: 27th April 2011, 14:56
  3. Problems with Gradient style used through Style sheet on ARM platform
    By puneet.narsapur in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 25th January 2010, 13:48
  4. QMenu style sheet: works in dev env, breaks in release
    By JimDaniel in forum Qt Programming
    Replies: 1
    Last Post: 6th October 2008, 20:18
  5. [Style Sheet] QMenu::item:hover bug
    By spud in forum Qt Programming
    Replies: 3
    Last Post: 11th May 2007, 15:11

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.