Results 1 to 2 of 2

Thread: Insert a background image

  1. #1
    Join Date
    Jul 2017
    Posts
    1
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Insert a background image

    Hi people,

    I'm very newe in Qt language and now i'm experimenting with the widgets. Actually I have a problem with a background images, I'm trying to insert a background image to my aplication in fullscreen, but it's replicated inside the buttons.

    Can somebody help me?

    1st Image: I select the QWidget-->StyleSheet-->insert background image
    2nd Image:We can see the button has adquiered the background (1rst error)
    3th Image: In the execution time with extended windowscreen, the button has the background and no background aplication (2nd error)

    1r.jpg
    2n.jpg
    3r.png

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Insert a background image

    Welcome!
    Qt is not a language but a framework.
    You probably are using C++ as a language.

    Have a look at the stylesheet selectors: http://doc.qt.io/qt-5.9/stylesheet-s...selector-types
    You will notice that by using QWidget you are using the Type selector, which matches all widgets.
    Since QPushButton is also a widget, it effects the buttons too.
    One way would be to use the ID selector: QWidget#<your widgets object name>
    This will then select on that specific widget.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Replies: 4
    Last Post: 27th November 2013, 15:15
  2. Replies: 3
    Last Post: 3rd August 2012, 10:35
  3. Replies: 0
    Last Post: 5th April 2011, 13:36
  4. How to insert an image through Qt
    By thanisha in forum Newbie
    Replies: 1
    Last Post: 26th June 2010, 05:55
  5. How to insert an image in background of a Form?
    By awanish_jmi in forum Qt Tools
    Replies: 2
    Last Post: 8th August 2008, 10:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.