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. QToolTip opacity
Forum Updated to NodeBB v4.3 + New Features

QToolTip opacity

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 5 Posters 2.1k Views 2 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.
  • M Offline
    M Offline
    minjunkim
    wrote on 1 Nov 2018, 02:45 last edited by minjunkim 11 Jan 2018, 04:04
    #1

    hi,

    i want to use QToolTip transparently

    i found few solutions in doc.qt

    QToolTip { opacity: 100;} is the solution

    i try it but does not work..

    What is the correct way?

    i think that i have to apply some code like this(setAttribute(Qt::WA_TranslucentBackground, true);)

    What am I doing wrong?

    my code is

    mybutton->setToolTip("this test");

    setStyleSheet("QToolTip { border: 2px solid darkkhaki; padding: 5px; border-radius: 3px; opacity: 100; }");

    J 1 Reply Last reply 1 Nov 2018, 06:15
    0
    • M minjunkim
      1 Nov 2018, 02:45

      hi,

      i want to use QToolTip transparently

      i found few solutions in doc.qt

      QToolTip { opacity: 100;} is the solution

      i try it but does not work..

      What is the correct way?

      i think that i have to apply some code like this(setAttribute(Qt::WA_TranslucentBackground, true);)

      What am I doing wrong?

      my code is

      mybutton->setToolTip("this test");

      setStyleSheet("QToolTip { border: 2px solid darkkhaki; padding: 5px; border-radius: 3px; opacity: 100; }");

      J Offline
      J Offline
      J.Hilk
      Moderators
      wrote on 1 Nov 2018, 06:15 last edited by
      #2

      @minjunkim said in QToolTip opacity:

      setStyleSheet("QToolTip { border: 2px solid darkkhaki; padding: 5px; border-radius: 3px; opacity: 100; }");

      setStyleSheet("QToolTip { border: 2px solid darkkhaki; padding: 5px; border-radius: 3px; background-color: rgba(255,255,0,0); }");


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      M 1 Reply Last reply 1 Nov 2018, 06:23
      2
      • J J.Hilk
        1 Nov 2018, 06:15

        @minjunkim said in QToolTip opacity:

        setStyleSheet("QToolTip { border: 2px solid darkkhaki; padding: 5px; border-radius: 3px; opacity: 100; }");

        setStyleSheet("QToolTip { border: 2px solid darkkhaki; padding: 5px; border-radius: 3px; background-color: rgba(255,255,0,0); }");

        M Offline
        M Offline
        minjunkim
        wrote on 1 Nov 2018, 06:23 last edited by
        #3

        @J.Hilk

        thank you for reply

        I applied your suggestion.

        result is

        0_1541053314911_result.png

        i think that something remains

        M 1 Reply Last reply 1 Nov 2018, 06:43
        0
        • M minjunkim
          1 Nov 2018, 06:23

          @J.Hilk

          thank you for reply

          I applied your suggestion.

          result is

          0_1541053314911_result.png

          i think that something remains

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 1 Nov 2018, 06:43 last edited by
          #4

          @minjunkim

          Hi what platform are you on ?
          I had issue on windows 8/10 to make it transparent.

          M J 2 Replies Last reply 1 Nov 2018, 06:51
          3
          • M mrjj
            1 Nov 2018, 06:43

            @minjunkim

            Hi what platform are you on ?
            I had issue on windows 8/10 to make it transparent.

            M Offline
            M Offline
            minjunkim
            wrote on 1 Nov 2018, 06:51 last edited by
            #5

            @mrjj

            Hi,

            I 'm using the window10 platform.

            Is this a platform-specific issue?

            Is there any solution?

            M 1 Reply Last reply 1 Nov 2018, 06:55
            0
            • M mrjj
              1 Nov 2018, 06:43

              @minjunkim

              Hi what platform are you on ?
              I had issue on windows 8/10 to make it transparent.

              J Offline
              J Offline
              J.Hilk
              Moderators
              wrote on 1 Nov 2018, 06:53 last edited by
              #6

              @mrjj jep that's the issue.

              on windows I have the same issues as the op with the stylesheet and on macOS It works as intended:
              0_1541055180234_Bildschirmfoto 2018-11-01 um 07.52.10.png


              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              1 Reply Last reply
              2
              • M minjunkim
                1 Nov 2018, 06:51

                @mrjj

                Hi,

                I 'm using the window10 platform.

                Is this a platform-specific issue?

                Is there any solution?

                M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 1 Nov 2018, 06:55 last edited by
                #7

                @minjunkim

                I never got it to work on win 10. ( worked fine in linux, win 7)
                I didn't find any solutions back then but maybe
                other have found way now.

                M 1 Reply Last reply 1 Nov 2018, 07:10
                1
                • M mrjj
                  1 Nov 2018, 06:55

                  @minjunkim

                  I never got it to work on win 10. ( worked fine in linux, win 7)
                  I didn't find any solutions back then but maybe
                  other have found way now.

                  M Offline
                  M Offline
                  minjunkim
                  wrote on 1 Nov 2018, 07:10 last edited by
                  #8

                  @mrjj , @J-Hilk

                  thank you!

                  The information has helped a lot.

                  Let me try to solve it.

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    minjunkim
                    wrote on 1 Nov 2018, 09:36 last edited by
                    #9

                    I gave up. I would be create custom class and use it.

                    1 Reply Last reply
                    1
                    • D Offline
                      D Offline
                      Dominikanetz
                      wrote on 10 Mar 2020, 06:42 last edited by
                      #10

                      I know this topic is too old but think it help anyone else.
                      If set stylesheet right after initialisatioin of QApplication like that

                      QApplication a(argc, argv);
                      qApp->setStyleSheet("QToolTip {opacity: 150;}"); 
                      

                      it's take effect.

                      Then you can just change background or font colors in widgets

                      mybutton->setToolTip("this test");
                      mybutton->setStyleSheet("QToolTip {background-color: rgb(0, 0, 0); color: rgb(200, 200, 200);}");
                      
                      C 1 Reply Last reply 23 Jan 2021, 02:37
                      2
                      • D Dominikanetz
                        10 Mar 2020, 06:42

                        I know this topic is too old but think it help anyone else.
                        If set stylesheet right after initialisatioin of QApplication like that

                        QApplication a(argc, argv);
                        qApp->setStyleSheet("QToolTip {opacity: 150;}"); 
                        

                        it's take effect.

                        Then you can just change background or font colors in widgets

                        mybutton->setToolTip("this test");
                        mybutton->setStyleSheet("QToolTip {background-color: rgb(0, 0, 0); color: rgb(200, 200, 200);}");
                        
                        C Offline
                        C Offline
                        cawell
                        wrote on 23 Jan 2021, 02:37 last edited by
                        #11

                        @Dominikanetz it doesn't work on linux

                        D 1 Reply Last reply 9 Mar 2021, 10:34
                        0
                        • C cawell
                          23 Jan 2021, 02:37

                          @Dominikanetz it doesn't work on linux

                          D Offline
                          D Offline
                          Dominikanetz
                          wrote on 9 Mar 2021, 10:34 last edited by
                          #12

                          @cawell which version of Qt? Unfortunately this has a direct relationship. On version 5.9, everything worked fine everywhere. At 5.12 it was broken and it worked as I mentioned above. I didn't look further

                          1 Reply Last reply
                          1

                          • Login

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