Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Stylesheet problem with background (very basic)
Forum Updated to NodeBB v4.3 + New Features

Stylesheet problem with background (very basic)

Scheduled Pinned Locked Moved Unsolved General and Desktop
stylesheetbackgroundqt 5.4
4 Posts 3 Posters 1.8k 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.
  • M Offline
    M Offline
    MarceloGomez
    wrote on 3 Aug 2016, 00:21 last edited by
    #1

    Hi

    My name is Marcelo. I am new to Qt and I have a very basic problem.

    I when I add a background image to the window, all objects take on that image. How do I get just the background image has the window?

    I do not want the background image on the buttons. I just want the background image in the window.

    http://img254.imagevenue.com/img.php?image=183552445_screenshot_122_347lo.jpg

    Tanks!!!

    1 Reply Last reply
    0
    • R Offline
      R Offline
      ray4qt
      wrote on 3 Aug 2016, 01:04 last edited by
      #2

      You need to tell it to only apply itself to the main window:

      QMainWindow { background-image: url(:Escritorio/back.jpg); }

      If you wanted to limit it to the push buttons you would use QPushButton, or to a particular
      push button QPushButton#pushButton_2.

      Hope this helps.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MarceloGomez
        wrote on 3 Aug 2016, 02:24 last edited by
        #3

        Tanks for your reply!

        I use QPushButton. I had tried its code and does not work. Please see image:

        http://oi63.tinypic.com/t5h9js.jpg

        R 1 Reply Last reply 3 Aug 2016, 05:15
        0
        • M MarceloGomez
          3 Aug 2016, 02:24

          Tanks for your reply!

          I use QPushButton. I had tried its code and does not work. Please see image:

          http://oi63.tinypic.com/t5h9js.jpg

          R Offline
          R Offline
          Ratzz
          wrote on 3 Aug 2016, 05:15 last edited by Ratzz 8 Mar 2016, 05:44
          #4

          @MarceloGomez

          The About code works for me using setStyleSheet .

          setStyleSheet("QMainWindow { background-image: url(:/icon/Icon.jpg); }");
          

          alternate text

          --Alles ist gut.

          1 Reply Last reply
          1

          3/4

          3 Aug 2016, 02:24

          • Login

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