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.
  • MarceloGomezM Offline
    MarceloGomezM Offline
    MarceloGomez
    wrote on 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 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
      • MarceloGomezM Offline
        MarceloGomezM Offline
        MarceloGomez
        wrote on 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

        RatzzR 1 Reply Last reply
        0
        • MarceloGomezM MarceloGomez

          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

          RatzzR Offline
          RatzzR Offline
          Ratzz
          wrote on last edited by Ratzz
          #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

          • Login

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