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

stylesheet problem

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 436 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
    mohamed Qt
    wrote on last edited by
    #1

    i use qt designer and i set mainwindow background...but every element i created after it take the same background even if i change stylesheet ....what can i do?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      Read the docs :)
      http://doc.qt.io/qt-5/stylesheet-reference.html

      My guess is ( since you dont show the stylesheet )
      That you are using a too broad selector so all children of mainwindow
      is also affected. If its ONLY mainwindow u want,
      then use
      QMainwindow {
      background: xxxx
      }
      Stylesheets are cascading. Meaning,
      it also affects children, that is any other widget you put on
      mainwindow.
      But you can use ClassType, and object name and more for saying which one you target.

      1 Reply Last reply
      3
      • M Offline
        M Offline
        mohamed Qt
        wrote on last edited by
        #3

        @mrjj yes ,thats really what happend thanks alot for your time

        1 Reply Last reply
        2

        • Login

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