Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Unsolved Smooth change of background image / PyQt6

    Qt for Python
    pyqt6 python background animation qmainwindow
    1
    1
    441
    Loading More Posts
    • 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.
    • F
      FoxyFox last edited by

      Hello everyone!
      This is the part of my code that sets the background, an image taken from the root folder of the project. Yes, everything works. But... I've probably tried all the ways, and I can not make a function for example, which will smoothly change the background to white when I click on it. Help me please!

      window = QMainWindow()
      window.setStyleSheet("""
      QMainWindow {
      background-image:url(Images/default_image.png);
      background-repeat: no-repeat;
      background-position: center;
      }
      """)

      1 Reply Last reply Reply Quote 0
      • First post
        Last post