Search code examples
c++qtuser-interfacebackground-imageqmainwindow

How do I set a background image to mainwindow?


I am trying to set the background image of the mainwindow through setStyleSheet() but this also applies the image to its children including textbrowsers and TextEdit. How can I accomplish this without doing so?


Solution

  • Try to add What you have tried so far,with out that we cant help. Try the below one

    setStyleSheet("MainWindow {background-image:url(:/files/MainPic/Technology-Banner1.jpg)}");