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. Smooth change of background image / PyQt6
Forum Update on Monday, May 27th 2025

Smooth change of background image / PyQt6

Scheduled Pinned Locked Moved Unsolved Qt for Python
pyqt6pythonbackgroundanimationqmainwindow
1 Posts 1 Posters 1.7k 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.
  • F Offline
    F Offline
    FoxyFox
    wrote on last edited by
    #1

    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
    0

    • Login

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