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. Weird grey backgrounds and other issues when I recreated my virtual environment
QtWS25 Last Chance

Weird grey backgrounds and other issues when I recreated my virtual environment

Scheduled Pinned Locked Moved Unsolved Qt for Python
7 Posts 2 Posters 420 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.
  • M Offline
    M Offline
    Mizmas
    wrote on last edited by Mizmas
    #1

    Hi, I'm using QT Designer with PyCharm. I had to recreate my virtual environment and now the app I'm making has random grey backgrounds for QFrames and QMovies, QCombobox drop down menu style glitches and some borders on QPushbuttons.

    I haven't changed any code or the .ui file, it only started happening after I created the new virtual environment, any help?

    How it looks in PyCharm:
    Screenshot_3.png

    How it looks in QT Designer's preview:
    Screenshot_4.png

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

      I've tried using PyInstaller and it seems to work correctly, so I assume this is an IDE problem?

      PyInstaller onefile:
      Screenshot_5.png

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        They might be using different style plugins.
        One thing you can try is to set the QT_DEBUG_PLUGINS environment variable to 1 and see what is used by each IDE what launching your application.

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

        M 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          They might be using different style plugins.
          One thing you can try is to set the QT_DEBUG_PLUGINS environment variable to 1 and see what is used by each IDE what launching your application.

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

          @SGaist You mean like this? Is it supposed to print something in the console if there's something wrong? It's not printing anything for me.

          if __name__ == '__main__':
          
              os.environ['QT_DEBUG_PLUGINS'] = '1'
          
              app = QApplication([])
          
              window = MyWindow()
              window.show()    
          
              sys.exit(app.exec())
          
          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            I would do that outside of the script or at least before anything Qt related is loaded.

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

            M 1 Reply Last reply
            0
            • SGaistS SGaist

              I would do that outside of the script or at least before anything Qt related is loaded.

              M Offline
              M Offline
              Mizmas
              wrote on last edited by
              #6

              @SGaist adding this line solved it for me. Don't know why it randomly requires to do so app.setStyle(QStyleFactory.create('windowsvista'))

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                You're likely on Windows 11 and the new windows11 style has some issues.

                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