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. How to avoid style change when I morph groupBox into QTabWidget?
Forum Updated to NodeBB v4.3 + New Features

How to avoid style change when I morph groupBox into QTabWidget?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 266 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.
  • E Offline
    E Offline
    eximus
    wrote on 3 Dec 2019, 09:31 last edited by eximus 12 Mar 2019, 12:11
    #1

    Greetings!
    So, I had a groupBox and once I need to have more controls than groupBox could contain. Then I used "Morph into..." function to morph groupBox into QTabWidget.

    BUT: there are irritate things: all my controls (especially ToolButtons) stylesheet changed!!!
    When I open "Change styleSheet ..." for a morphed groupBox (now QTabWidget), it is empty! That means one thing only, Qt treats this changes as normal or does not track style sheet change!

    Please, help! How to fix such things, except applying newly created stylesheet for each element in new QTabWidget.
    GbToQtwStyleChange.jpg

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 3 Dec 2019, 09:35 last edited by mrjj 12 Mar 2019, 09:37
      #2

      Hi
      StyleSheets are cascading. Meaning it will affect child also. So why not just use
      1 stylesheet with all settings in and apply it to MainWindow.

      That way "Morph into..." do not remove anything AND
      its wont become such a mess over time to keep track of all the stylesheets.

      1 Reply Last reply
      1
      • E Offline
        E Offline
        eximus
        wrote on 3 Dec 2019, 11:46 last edited by
        #3

        Thank you for reply, but it doesn't help due to MainWindow doesn't have any style applied with styleSheet at all.

        M 1 Reply Last reply 3 Dec 2019, 14:11
        0
        • E eximus
          3 Dec 2019, 11:46

          Thank you for reply, but it doesn't help due to MainWindow doesn't have any style applied with styleSheet at all.

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 3 Dec 2019, 14:11 last edited by mrjj 12 Apr 2019, 08:06
          #4

          @eximus
          Hi
          Just so we are clear. :)
          You can have a stylesheet on MainWindow that affects all its children but not itself.
          So one place/sheet that will change all widgets inside main window.

          Then you are free to morph widgets since the stylesheet is controlled top widget.

          1 Reply Last reply
          1

          1/4

          3 Dec 2019, 09:31

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved