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 is not working properly
Forum Updated to NodeBB v4.3 + New Features

stylesheet is not working properly

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 2 Posters 6.5k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    saber
    wrote on last edited by aha_1980
    #1

    qt 5.11.1 , linux.
    i applied this stylesheet in the central widget .

    QFrame [accessibleName="windowBar"]{
    background-color: #111111;
    color: #111111;
    border: 1px #111111;
    }
    
    QPushButton  [accessibleName="windowBar"]{
    border: 1px #2A2A2A;
    background-color: #111111; 
    }
    
    QPushButton:hover  [accessibleName="windowBar"]{
    background-color: #1268A4;
    }
    
    

    but is applied in designer fine ,but after build is shows this.

    0_1530413253262_as.png

    but is i use QWidget instead QFrame is works fine.

    what is the problem.

    mrjjM 1 Reply Last reply
    0
    • S saber

      qt 5.11.1 , linux.
      i applied this stylesheet in the central widget .

      QFrame [accessibleName="windowBar"]{
      background-color: #111111;
      color: #111111;
      border: 1px #111111;
      }
      
      QPushButton  [accessibleName="windowBar"]{
      border: 1px #2A2A2A;
      background-color: #111111; 
      }
      
      QPushButton:hover  [accessibleName="windowBar"]{
      background-color: #1268A4;
      }
      
      

      but is applied in designer fine ,but after build is shows this.

      0_1530413253262_as.png

      but is i use QWidget instead QFrame is works fine.

      what is the problem.

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @saber
      Hi
      Works fine here for Frame in central widget
      alt text

      Is your frame actually child of centralwidget ? even at run time?

      S 1 Reply Last reply
      0
      • mrjjM mrjj

        @saber
        Hi
        Works fine here for Frame in central widget
        alt text

        Is your frame actually child of centralwidget ? even at run time?

        S Offline
        S Offline
        saber
        wrote on last edited by
        #3

        @mrjj

        my frame is in the central widget ,always.

        mrjjM 1 Reply Last reply
        0
        • S saber

          @mrjj

          my frame is in the central widget ,always.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @saber
          Do you also have stylesheet on MainWindow ?

          S 1 Reply Last reply
          0
          • mrjjM mrjj

            @saber
            Do you also have stylesheet on MainWindow ?

            S Offline
            S Offline
            saber
            wrote on last edited by
            #5

            @mrjj
            not in mainwindow .
            i put it in central widget.

            mrjjM 1 Reply Last reply
            0
            • S saber

              @mrjj
              not in mainwindow .
              i put it in central widget.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by mrjj
              #6

              @saber
              Aha, i see what you mean now.
              in Designer
              alt text
              But when run its gone.
              Not sure why that happens. seems odd.

              it is most likely related to this
              https://wiki.qt.io/Dynamic_Properties_and_Stylesheets

              S 1 Reply Last reply
              0
              • mrjjM mrjj

                @saber
                Aha, i see what you mean now.
                in Designer
                alt text
                But when run its gone.
                Not sure why that happens. seems odd.

                it is most likely related to this
                https://wiki.qt.io/Dynamic_Properties_and_Stylesheets

                S Offline
                S Offline
                saber
                wrote on last edited by
                #7

                @mrjj

                so it happened on your side !!!??

                mrjjM 1 Reply Last reply
                0
                • S saber

                  @mrjj

                  so it happened on your side !!!??

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by mrjj
                  #8

                  @saber
                  Yep. Didn't get a green frame.
                  Its related to using properties in stylesheet as name works.

                  QFrame#frame {
                  background-color: #111111;
                  color: #111111;
                  border: 1px #111111;
                  }
                  

                  i thought maybe it was due to
                  accessibleName, but not shown using custom prop either.
                  So not sure why this case is not working.

                  update:
                  after clean build folder
                  this started working

                  QFrame[styleit=true]{
                  background-color: #111111;
                  color: #111111;
                  border: 1px #111111;
                  }
                  

                  styleit as a custom property added with the green +
                  (bool as type) and check for widgets.

                  alt text

                  I think the reason is the order in setupUI(). but did not test further.

                  S 1 Reply Last reply
                  3
                  • mrjjM mrjj

                    @saber
                    Yep. Didn't get a green frame.
                    Its related to using properties in stylesheet as name works.

                    QFrame#frame {
                    background-color: #111111;
                    color: #111111;
                    border: 1px #111111;
                    }
                    

                    i thought maybe it was due to
                    accessibleName, but not shown using custom prop either.
                    So not sure why this case is not working.

                    update:
                    after clean build folder
                    this started working

                    QFrame[styleit=true]{
                    background-color: #111111;
                    color: #111111;
                    border: 1px #111111;
                    }
                    

                    styleit as a custom property added with the green +
                    (bool as type) and check for widgets.

                    alt text

                    I think the reason is the order in setupUI(). but did not test further.

                    S Offline
                    S Offline
                    saber
                    wrote on last edited by
                    #9

                    @mrjj
                    sorry for the late reply.

                    i did not understand the need and what is custom property is.

                    you know my app called corebox.
                    it has 14 apps combined .

                    i am trying to add two theme by stylsheet .but i am facing many defecults .
                    it is just a one.

                    so i am giving you invitation to join this project to solve this major problems that we are facing and not able to fix.

                    thanks.

                    mrjjM 1 Reply Last reply
                    0
                    • S saber

                      @mrjj
                      sorry for the late reply.

                      i did not understand the need and what is custom property is.

                      you know my app called corebox.
                      it has 14 apps combined .

                      i am trying to add two theme by stylsheet .but i am facing many defecults .
                      it is just a one.

                      so i am giving you invitation to join this project to solve this major problems that we are facing and not able to fix.

                      thanks.

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @saber
                      A custom property is just one you make yourself.
                      Its the green + over the properties.

                      1 Reply Last reply
                      5

                      • Login

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