Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. pyside6 setTooltip显示空白,没有正常显示文字(Pyside6 setTooltip displays blank and does not display text properly)

pyside6 setTooltip显示空白,没有正常显示文字(Pyside6 setTooltip displays blank and does not display text properly)

Scheduled Pinned Locked Moved Unsolved Qt for Python
7 Posts 2 Posters 504 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.
  • S Offline
    S Offline
    sky_peng
    wrote on 26 Aug 2024, 03:24 last edited by sky_peng
    #1

    python: 3.12.1
    windows version: windows 10
    02221315-d514-4738-b34a-c92fa0f2780e-1be944f4-d333-4f5e-8f81-5afe28e9e48a.png

    win11系统可以显示,但是win10系统不行
    windows 11 is ok, but windows 10 is not.
    emmm,请告诉我如何解决这个问题。同时感谢你的回复,感恩!
    emmmm, please tell me how to deal this problem. And, thanks you replay.Bless for you!

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 26 Aug 2024, 06:35 last edited by
      #2

      Hi and welcome to devnet,

      Which version of PySide6 are you using ?

      On a side note, there is a Chinese sub-forum if you would like to get help in your mother tongue.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply 30 Aug 2024, 01:43
      0
      • S SGaist
        26 Aug 2024, 06:35

        Hi and welcome to devnet,

        Which version of PySide6 are you using ?

        On a side note, there is a Chinese sub-forum if you would like to get help in your mother tongue.

        S Offline
        S Offline
        sky_peng
        wrote on 30 Aug 2024, 01:43 last edited by
        #3

        Oh!I forget to mention to my pyside6 version. It is 6.7.2. Thank you for informing me that there is a Chinese forum available.

        a8bceb81-be29-4278-9e62-2773d56e2edd-image.png

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 30 Aug 2024, 18:31 last edited by
          #4

          Can you provide a minimal runnable script that shows this behavior ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          S 2 Replies Last reply 6 Sept 2024, 04:43
          0
          • S SGaist
            30 Aug 2024, 18:31

            Can you provide a minimal runnable script that shows this behavior ?

            S Offline
            S Offline
            sky_peng
            wrote on 6 Sept 2024, 04:43 last edited by
            #5

            @SGaist

            import sys
            
            from PySide6.QtCore import Slot
            from PySide6.QtWidgets import QApplication, QWidget, QLabel, QPlainTextEdit
            
            
            class Hello(QWidget):
                def __init__(self):
                    super().__init__()
                    self.setFixedSize(200, 200)
            
                    self.input0 = QPlainTextEdit(self)
                    self.input0.setStyleSheet("color: white;")
                    self.input0.setGeometry(20, 20, 100, 50)
                    self.input0.textChanged.connect(self.labelChange)
            
                @Slot()
                def labelChange(self):
                    self.input0.setToolTip(self.input0.toPlainText())
            
            
            if __name__ == '__main__':
                app = QApplication([])
                s = Hello()
                s.show()
                sys.exit(app.exec())
            

            99bd53d7-9b19-47b3-9fb6-c7c47403bc48-企业微信截图_17255975471298.png !

            import sys
            
            from PySide6.QtCore import Slot
            from PySide6.QtWidgets import QApplication, QWidget, QLabel, QPlainTextEdit
            
            
            class Hello(QWidget):
               def __init__(self):
                   super().__init__()
                   self.setFixedSize(200, 200)
            
                   self.input0 = QPlainTextEdit(self)
                   self.input0.setStyleSheet("color: white;")
                   self.input0.setGeometry(20, 20, 100, 50)
                   self.input0.textChanged.connect(self.labelChange)
            
               @Slot()
               def labelChange(self):
                   self.input0.setToolTip(self.input0.toPlainText())
            
            
            if __name__ == '__main__':
               app = QApplication([])
               s = Hello()
               s.show()
               sys.exit(app.exec())
            
            

            ec6694d1-39f7-4027-9338-5f3609cbca6b-企业微信截图_17255975555415.png !

            emmm,如此看来,好像是因为"setStyleSheet"中background-color: rgb(101, 115, 130)无法改变tooltip的"background-color"。

            emmm, It seems that it is because the background color: rgb (101, 115, 130) in the "setStyleSheet" cannot change the "background color" of the tooltip.

            1 Reply Last reply
            0
            • S SGaist
              30 Aug 2024, 18:31

              Can you provide a minimal runnable script that shows this behavior ?

              S Offline
              S Offline
              sky_peng
              wrote on 9 Oct 2024, 05:45 last edited by
              #6

              @SGaist
              Hey, bro.So how can i solve this problem in the win10?or how can i set tooltip backgroundColor in the win10?

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 9 Oct 2024, 19:47 last edited by
                #7

                Sorry, I just tested it on macOS (I don't have a Win10 machine at hand), and it's working properly.

                Can you test your application using the fusion style ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                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