Congratulations to our 2022 Qt Champions!

[Workaround]Background image of one form carried over the next !!!

  • Hey,

    I have about 10 forms in my project.

    For the main form i havnt put any background image. Its a default form with an array of manually created buttons. In the next form , I've put a background image using the designer, jus applying the stylesheet. When i get back to the main form, the background image is carried to the main form, the form as well as all the buttons have the same background image :(.

    I dont want that.
    Could you tell me wat possibly could have gone wrong.

    Thank you

  • Is it possible that you have applied the background image to QWidget instead of a specific widget?

  • Lukas,

    The main window is of QMainWindow and the Settings form is also of QMainWindows.
    I noticed tht whn u jum from dialog form to a mainwindow form, this does not happen.

    thank you.

    P.S I think the quick fix to the problem is to put a background image to the main form also. Cuz its only when there is no background image, the previous image is loaded

  • Looks like you've setted this stylesheet for all QMainWindow's, not for only one.

  • dennis,

    No, only for settings form I've set a stylesheet, that too using designer.Ive put a jpeg image as background.

  • This is not really a solution but ive found out a workaround, put a background image for each form, so that it doesn get carried over.

  • Maybe "this": can help you (especially filtering by object name).

Log in to reply