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. Widget color gradient

Widget color gradient

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 596 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.
  • A Offline
    A Offline
    AndrzejB
    wrote on last edited by
    #1

    Standard Calculator example has nice color gradient, whereas my application using class derived from QWidget and Button derived from QToolButton is flat and has not gradients.
    I don't see any piece code in Calculator sample where is set gradient.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mpergand
      wrote on last edited by
      #2

      Depends of your OS and the Qt Theme used.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        AndrzejB
        wrote on last edited by
        #3

        OS is the same, I don't see theme settings in *.cpp files of Calculator.
        Main difference: Calculator is compiled by Qt Creator, and have .pro my application by CLion a have cmake.

        M 1 Reply Last reply
        0
        • A AndrzejB

          OS is the same, I don't see theme settings in *.cpp files of Calculator.
          Main difference: Calculator is compiled by Qt Creator, and have .pro my application by CLion a have cmake.

          M Offline
          M Offline
          mpergand
          wrote on last edited by mpergand
          #4

          @AndrzejB
          What OS are you talking about ?
          Post a screenshot.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            AndrzejB
            wrote on last edited by AndrzejB
            #5

            I have Mint 21 Cinamon
            Qt sample
            button color change from light to dark
            My trial
            (whole screenshots)

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mpergand
              wrote on last edited by mpergand
              #6

              Looks OK here on KDE with Fusion theme.
              qDebug()<<QStyleFactory::keys();
              qDebug()<<qApp->style()->objectName();

              ("Windows", "Fusion")
              "fusion"

              What's your default theme ?
              Have you applied any style sheet somewhere.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                AndrzejB
                wrote on last edited by
                #7

                @mpergand said in Widget color gradient:

                qDebug()<<QStyleFactory::keys();
                qDebug()<<qApp->style()->objectName();

                Thanks,
                Calculator example :

                ("Windows", "Fusion")
                "fusion"
                

                My application:

                ("cleanlooks", "gtk2", "cde", "motif", "plastique", "qt5ct-style", "Windows", "Fusion")
                "qt5ct-style"
                

                I change style:

                qApp->setStyle("Fusion");
                

                and is OK
                what if style Fusion will not available?

                1 Reply Last reply
                0

                • Login

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