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. Qt 4.8 qss QHeaderViiew::section
Forum Updated to NodeBB v4.3 + New Features

Qt 4.8 qss QHeaderViiew::section

Scheduled Pinned Locked Moved Solved General and Desktop
12 Posts 2 Posters 3.2k 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
    SU_Shadow
    wrote on last edited by
    #1

    Hi. Can anybody help me. When i using in style sheet of QTableWidget some like this
    QHeaderView::section
    {
    background-color: rgb(85, 0, 0);
    }
    I get all row headers are red (no meter what color i set in styles heet)

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

      Hi and welcome
      if you change to
      background-color: rgb(0, 0,255);
      And select menu
      Build->clean all
      and
      Build->rebuild all

      It must be a blue color. else u set style sheet somewhere else or have something that
      overrules this one.
      like
      Qwidget
      {
      background-color: rgb(85, 0, 0);
      }

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SU_Shadow
        wrote on last edited by
        #3

        No changes. A get red row headers (in editor i see blue row headers, but in runtime its red)

        mrjjM 1 Reply Last reply
        0
        • S SU_Shadow

          No changes. A get red row headers (in editor i see blue row headers, but in runtime its red)

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

          @SU_Shadow
          If it changes when u run program,
          it must mean u also set StyleSheet in code.
          Or set stylesheet on a parent where it also affects
          the childs.
          They are cascading

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SU_Shadow
            wrote on last edited by
            #5

            I create empty QWidget project and add QTableWidget on main widget. Then i add button. On button i connected slot which excute :
            ui->tableWidget->setStyleSheet("QHeaderView::section { background-color: rgb(0, 0,255);}");
            After form loads i get normal (default) background of rows headers, but when i press button i get row headers red (not blue)

            mrjjM 1 Reply Last reply
            0
            • S SU_Shadow

              I create empty QWidget project and add QTableWidget on main widget. Then i add button. On button i connected slot which excute :
              ui->tableWidget->setStyleSheet("QHeaderView::section { background-color: rgb(0, 0,255);}");
              After form loads i get normal (default) background of rows headers, but when i press button i get row headers red (not blue)

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

              @SU_Shadow said:
              ok ?!?! ( strange :)
              I tried the same and I do get blue.

              you want to try the test project ?
              https://www.dropbox.com/s/syt1xipmx6171co/notblue.zip?dl=0

              1 Reply Last reply
              1
              • S Offline
                S Offline
                SU_Shadow
                wrote on last edited by SU_Shadow
                #7

                I download project and when i run it i get the same result (rows header are red)
                Link to screen

                mrjjM 1 Reply Last reply
                0
                • S SU_Shadow

                  I download project and when i run it i get the same result (rows header are red)
                  Link to screen

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

                  @SU_Shadow
                  Also you get no text?? (!)

                  It seems stylesheets are somehow broken in your Qt.

                  Did you compile Qt yourself?

                  What version of Qt ?
                  Looks like a linux platform?

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SU_Shadow
                    wrote on last edited by
                    #9

                    Platform fedora 22. Qt 4.8. When i greate qt5 qwdiget application ( or when i change kit from qt4 to qt5 and make clean all and rebuild all) all look's fine. But on qt4 i get this error.

                    mrjjM 1 Reply Last reply
                    0
                    • S SU_Shadow

                      Platform fedora 22. Qt 4.8. When i greate qt5 qwdiget application ( or when i change kit from qt4 to qt5 and make clean all and rebuild all) all look's fine. But on qt4 i get this error.

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

                      @SU_Shadow
                      ok. must be a bug in 4.8 then. ?
                      Maybe to that platform.
                      Not heard about it before.
                      I have 5.6 only so cant test.

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SU_Shadow
                        wrote on last edited by
                        #11

                        Found some solution. Think problem in QStyle of application on qt 4.8 under fedora (plasma DE). When i write in main some like

                            QApplication a(argc, argv);
                            a.setStyle(new QWindowsStyle);
                            MainWindow w;
                            w.show();
                        

                        All works fine.

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

                          ok !?
                          good found :)

                          1 Reply Last reply
                          0

                          • Login

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