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. Newb stylesheet question: How to remove gradients on qt5 apps.
QtWS25 Last Chance

Newb stylesheet question: How to remove gradients on qt5 apps.

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 1.5k Views
  • 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.
  • X Offline
    X Offline
    xaxazak
    wrote on 5 Aug 2016, 23:30 last edited by xaxazak 8 May 2016, 23:32
    #1

    Not really a development question sorry, and definately a newb one, but I don't know of a better place to ask. (perhaps there should be a Qt User forum category?)

    I want to disable the gradient on the background of qt5 windows (mainly for KDE kate & dolphin). (Or better yet, disable all gradients everywhere).
    I do this via a stylesheet, right?
    Since use XFCE (Mint 18) I have installed qt5ct, which is working - changes affect kate & dolphin when applied.
    I have tried copying and pasting some stylesheet examples into an enabled "sheet.qss" on qt5ct's stylesheet editor, but nothing seems to have any effect except occasionally making widgets disappear.

    Should this work? If so, can someone tell me what I need to enter into the stylesheet?

    (I'm using Oxygen as the qt5 style)

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 5 Aug 2016, 23:42 last edited by
      #2

      @xaxazak said:
      Hi and welcome
      I cant say if qt5ct works with XFCE but you say some changes work?

      Well the hard part is finding out for the applications
      how they use the gradient. Meaning what tag/element they assign it to.
      You can try with

      QWidget {background-color: rgb(0, 85, 255)}

      and see if it does anything.

      X 1 Reply Last reply 6 Aug 2016, 00:19
      1
      • M mrjj
        5 Aug 2016, 23:42

        @xaxazak said:
        Hi and welcome
        I cant say if qt5ct works with XFCE but you say some changes work?

        Well the hard part is finding out for the applications
        how they use the gradient. Meaning what tag/element they assign it to.
        You can try with

        QWidget {background-color: rgb(0, 85, 255)}

        and see if it does anything.

        X Offline
        X Offline
        xaxazak
        wrote on 6 Aug 2016, 00:19 last edited by xaxazak 8 Jun 2016, 00:40
        #3

        @mrjj

        Yes that worked, thanks. Lots of blue.
        I guess there's no "widget picker" type tool (like a color picker), or something that will produce a snapshot of all the widgets of a tree.

        Edit: Still here:

        Ok, replacing QWidget with QMainWindow did work - must've messed up before.
        So I can now manually set a solid main-window color, thanks - although if there's a way to just disable the gradient it might be a better solution.

        Unfortunately, the pretty (and useful) tree structure lines in dolphin's tree view disappear when I do.
        I had to install "kde-style-oxygen-qt5" mainly so I could get those lines - could it be partially reverting back to the old style somehow when it's affected by stylesheets?
        If I use a blank stylesheet, the lines are still there, so it's not just switching the style because custom stylesheets are used (unless it ignores blank ones).

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 6 Aug 2016, 01:19 last edited by
          #4

          Hi
          You might need to tweak additional style sheet settings to make it look right.
          Applying a stylesheet is sort of a all-or-nothing so it might alter look.
          Also they are cascading so might have side effects if u apply to parent.

          Unless qt5ct offer way to disable all gradients, im not sure there any global way to do it.

          X 1 Reply Last reply 6 Aug 2016, 03:24
          0
          • M mrjj
            6 Aug 2016, 01:19

            Hi
            You might need to tweak additional style sheet settings to make it look right.
            Applying a stylesheet is sort of a all-or-nothing so it might alter look.
            Also they are cascading so might have side effects if u apply to parent.

            Unless qt5ct offer way to disable all gradients, im not sure there any global way to do it.

            X Offline
            X Offline
            xaxazak
            wrote on 6 Aug 2016, 03:24 last edited by
            #5

            @mrjj

            Well, I just stumbled on something very useful (and quite surprising) - it seems there's an Oxygen Settings app, and it has a "draw background gradient" tickbox.
            Never heard of an app dedicated to altering a specific style before, but it's a very nice idea.

            Thanks for the help, I did learn some stuff.

            1 Reply Last reply
            1

            3/5

            6 Aug 2016, 00:19

            • Login

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