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. QTabWidget, setting colour of tab itself ?
Forum Updated to NodeBB v4.3 + New Features

QTabWidget, setting colour of tab itself ?

Scheduled Pinned Locked Moved Solved General and Desktop
114 Posts 4 Posters 54.8k 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.
  • SPlattenS SPlatten

    @JoeCFD , the company is a world wide provider of defence and weapon tech....they're clients are governments and the equipment is years out of date, again, I have requested an updated, but I can't do anything about it.

    JonBJ Offline
    JonBJ Offline
    JonB
    wrote on last edited by
    #51

    @SPlatten
    Without wanting to digress this thread. I am surprised given the age of an old 4.8 implementation they now insist they want a change in a tab colour! Can't you say "Sorry, I have looked into it, this old version won't let me do that" ?

    SPlattenS 1 Reply Last reply
    0
    • JoeCFDJ JoeCFD
      1. 4.8 qtabbar_cpp source code is here. copy line 1569 to 1648 to your paint event. Not sure if this will work.
        https://dreamswork.github.io/qt4/qtabbar_8cpp_source.html
        painting of tabs is done at line 1622.
      2. Look at lines 1594 and 1595. These lines call initStyleOption() to create QStyleOptionTabV3 tab for each tab which is a subclass of QStyleOption
        https://dreamswork.github.io/qt4/classQTabBar.html#a41b394d892263b6b5a0705fb979f3c8e
        and each QStyleOption has a public palette with background color. You can change it. Try to print out the background color to see what it is.
      3. you can find QStyleOptionTabV3 and QStyleOptionTab here
        https://dreamswork.github.io/qt4/qstyleoption_8h_source.html
        This way may be simpler. Good luck.
      SPlattenS Offline
      SPlattenS Offline
      SPlatten
      wrote on last edited by
      #52

      @JoeCFD , unfortunately the company firewall will not allow access to the dreamswork domain.

      Kind Regards,
      Sy

      1 Reply Last reply
      0
      • JonBJ JonB

        @SPlatten
        Without wanting to digress this thread. I am surprised given the age of an old 4.8 implementation they now insist they want a change in a tab colour! Can't you say "Sorry, I have looked into it, this old version won't let me do that" ?

        SPlattenS Offline
        SPlattenS Offline
        SPlatten
        wrote on last edited by
        #53

        @JonB , I was brought into this company 5 months ago and the project is very old, there is a lot of issues to resolve and this is just one of many.

        Kind Regards,
        Sy

        1 Reply Last reply
        0
        • SPlattenS Offline
          SPlattenS Offline
          SPlatten
          wrote on last edited by
          #54

          @J.Hilk, @JonB , @JoeCFD, I tried another tack...that is calling tabButton of QTabBar to get the tab widget, I was then going to try setting the widget style sheet, however failed at the first hurdle:

          int intTabs(count()); //This returns 10, which is the number of tabs
          for( int intTab=0; intTab<intTabs; intTab++ ) {
              QString strText(tabText(intTab));  //This works and gets the tab text, e.g. &Overall
              QWidget* pobjTab(tabButton(intTab, QTabBar::LeftSide));
              if ( !pobjTab ) {
                  pobjTab = tabButton(intTab, QTabBar::RightSide);
              }
          }
          

          Calling tabButton with QTabBar::LeftSide or QTabBar::RightSide returns NULL. Have I done something wrong or is this something else that doesn't work in 4.8 ?

          Kind Regards,
          Sy

          JonBJ 1 Reply Last reply
          0
          • JoeCFDJ JoeCFD
            1. 4.8 qtabbar_cpp source code is here. copy line 1569 to 1648 to your paint event. Not sure if this will work.
              https://dreamswork.github.io/qt4/qtabbar_8cpp_source.html
              painting of tabs is done at line 1622.
            2. Look at lines 1594 and 1595. These lines call initStyleOption() to create QStyleOptionTabV3 tab for each tab which is a subclass of QStyleOption
              https://dreamswork.github.io/qt4/classQTabBar.html#a41b394d892263b6b5a0705fb979f3c8e
              and each QStyleOption has a public palette with background color. You can change it. Try to print out the background color to see what it is.
            3. you can find QStyleOptionTabV3 and QStyleOptionTab here
              https://dreamswork.github.io/qt4/qstyleoption_8h_source.html
              This way may be simpler. Good luck.
            SPlattenS Offline
            SPlattenS Offline
            SPlatten
            wrote on last edited by SPlatten
            #55

            @JoeCFD , just tried to access:
            https://dreamworks.github.io/qt4/qtabbar_8cpp_source.html

            on my iPhone and get 404, sorry must be my fat fingers, closed browser and tried again this time ok.

            Kind Regards,
            Sy

            1 Reply Last reply
            0
            • SPlattenS SPlatten

              @J.Hilk, @JonB , @JoeCFD, I tried another tack...that is calling tabButton of QTabBar to get the tab widget, I was then going to try setting the widget style sheet, however failed at the first hurdle:

              int intTabs(count()); //This returns 10, which is the number of tabs
              for( int intTab=0; intTab<intTabs; intTab++ ) {
                  QString strText(tabText(intTab));  //This works and gets the tab text, e.g. &Overall
                  QWidget* pobjTab(tabButton(intTab, QTabBar::LeftSide));
                  if ( !pobjTab ) {
                      pobjTab = tabButton(intTab, QTabBar::RightSide);
                  }
              }
              

              Calling tabButton with QTabBar::LeftSide or QTabBar::RightSide returns NULL. Have I done something wrong or is this something else that doesn't work in 4.8 ?

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #56

              @SPlatten said in QTabWidget, setting colour of tab itself ?:

              Calling tabButton with QTabBar::LeftSide or QTabBar::RightSide returns NULL. Have I done something wrong or is this something else that doesn't work in 4.8 ?

              I believe either (a) the QTabBar does not have any QWidgets on/for its tabs at the time you call this or (b) it never has any QWidget on/for its tabs unless you call QTabBar::setTabButton(int index, QTabBar::ButtonPosition position, QWidget *widget).

              SPlattenS 1 Reply Last reply
              0
              • JoeCFDJ JoeCFD
                1. 4.8 qtabbar_cpp source code is here. copy line 1569 to 1648 to your paint event. Not sure if this will work.
                  https://dreamswork.github.io/qt4/qtabbar_8cpp_source.html
                  painting of tabs is done at line 1622.
                2. Look at lines 1594 and 1595. These lines call initStyleOption() to create QStyleOptionTabV3 tab for each tab which is a subclass of QStyleOption
                  https://dreamswork.github.io/qt4/classQTabBar.html#a41b394d892263b6b5a0705fb979f3c8e
                  and each QStyleOption has a public palette with background color. You can change it. Try to print out the background color to see what it is.
                3. you can find QStyleOptionTabV3 and QStyleOptionTab here
                  https://dreamswork.github.io/qt4/qstyleoption_8h_source.html
                  This way may be simpler. Good luck.
                SPlattenS Offline
                SPlattenS Offline
                SPlatten
                wrote on last edited by
                #57

                @JoeCFD , QStyleOptionTabV2 and QStyleOptionTabV3 are according to official documentation obsolete and replaced with QStyleOptionTab.

                Kind Regards,
                Sy

                JoeCFDJ 1 Reply Last reply
                0
                • JonBJ JonB

                  @SPlatten said in QTabWidget, setting colour of tab itself ?:

                  Calling tabButton with QTabBar::LeftSide or QTabBar::RightSide returns NULL. Have I done something wrong or is this something else that doesn't work in 4.8 ?

                  I believe either (a) the QTabBar does not have any QWidgets on/for its tabs at the time you call this or (b) it never has any QWidget on/for its tabs unless you call QTabBar::setTabButton(int index, QTabBar::ButtonPosition position, QWidget *widget).

                  SPlattenS Offline
                  SPlattenS Offline
                  SPlatten
                  wrote on last edited by
                  #58

                  @JonB , (b) is the case, I was hoping that each button on the tab bar was a widget available via this call.

                  Kind Regards,
                  Sy

                  JonBJ 1 Reply Last reply
                  0
                  • SPlattenS SPlatten

                    @JonB , (b) is the case, I was hoping that each button on the tab bar was a widget available via this call.

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by
                    #59

                    @SPlatten
                    I think/suspect not. By default it does not use/place any QWidget on/for the tabs, rather something internal (just the text on the tab, no special widget).

                    Mind you, if it helps your case (I don't know if it does) you could explicitly use QTabBar::setTabButton() to put your own widget there, then you can access that widget. I don't know whether that would aid you in your issue.

                    You were referred to https://stackoverflow.com/questions/46137500/qt-tabwidget-each-tab-title-background-color. There in answer https://stackoverflow.com/a/46139321/489865 you are shown a picture with the tabs having their own (different) colors. Could you state clearly and unequivocally whether (a) this is what you want and (b) (if so) why you can't use that solution?

                    SPlattenS 1 Reply Last reply
                    0
                    • JonBJ JonB

                      @SPlatten
                      I think/suspect not. By default it does not use/place any QWidget on/for the tabs, rather something internal (just the text on the tab, no special widget).

                      Mind you, if it helps your case (I don't know if it does) you could explicitly use QTabBar::setTabButton() to put your own widget there, then you can access that widget. I don't know whether that would aid you in your issue.

                      You were referred to https://stackoverflow.com/questions/46137500/qt-tabwidget-each-tab-title-background-color. There in answer https://stackoverflow.com/a/46139321/489865 you are shown a picture with the tabs having their own (different) colors. Could you state clearly and unequivocally whether (a) this is what you want and (b) (if so) why you can't use that solution?

                      SPlattenS Offline
                      SPlattenS Offline
                      SPlatten
                      wrote on last edited by
                      #60

                      @JonB , in my code I am now writing the geometry of each tab when each is selected to the log file and I can see the geometry is correct , I can also see that the selection of the correct colour is chosen, but is this code correct:

                      opt.palette.setColor(QPalette::Button, QColor(kErrorColour));
                      

                      opt is obtained from a call to:

                      initStyleOption(&opt, intTab);
                      

                      Where intTab is 0 to N and opt is defined as QStyleOptionTab.

                      Kind Regards,
                      Sy

                      JonBJ 1 Reply Last reply
                      0
                      • SPlattenS SPlatten

                        @JonB , in my code I am now writing the geometry of each tab when each is selected to the log file and I can see the geometry is correct , I can also see that the selection of the correct colour is chosen, but is this code correct:

                        opt.palette.setColor(QPalette::Button, QColor(kErrorColour));
                        

                        opt is obtained from a call to:

                        initStyleOption(&opt, intTab);
                        

                        Where intTab is 0 to N and opt is defined as QStyleOptionTab.

                        JonBJ Offline
                        JonBJ Offline
                        JonB
                        wrote on last edited by
                        #61

                        @SPlatten
                        Does not seem unreasonable. Would not work if (a) kErrorColour's value is not acceptable to QColor or (b) you are using a stylesheet on the element, as stylesheets override palette changes.

                        Have you first tried the code shown in that SO solution? Does that work for you as they show? Then you can fiddle with changing that to whatever it is you want till it works or goes wrong.

                        SPlattenS JonBJ 2 Replies Last reply
                        0
                        • JonBJ JonB

                          @SPlatten
                          Does not seem unreasonable. Would not work if (a) kErrorColour's value is not acceptable to QColor or (b) you are using a stylesheet on the element, as stylesheets override palette changes.

                          Have you first tried the code shown in that SO solution? Does that work for you as they show? Then you can fiddle with changing that to whatever it is you want till it works or goes wrong.

                          SPlattenS Offline
                          SPlattenS Offline
                          SPlatten
                          wrote on last edited by
                          #62

                          @JonB , kErrorColour:

                          const char_t kErrorColour[] = "red";
                          

                          Kind Regards,
                          Sy

                          1 Reply Last reply
                          0
                          • JonBJ JonB

                            @SPlatten
                            Does not seem unreasonable. Would not work if (a) kErrorColour's value is not acceptable to QColor or (b) you are using a stylesheet on the element, as stylesheets override palette changes.

                            Have you first tried the code shown in that SO solution? Does that work for you as they show? Then you can fiddle with changing that to whatever it is you want till it works or goes wrong.

                            JonBJ Offline
                            JonBJ Offline
                            JonB
                            wrote on last edited by
                            #63

                            @JonB said in QTabWidget, setting colour of tab itself ?:

                            Have you first tried the code shown in that SO solution? Does that work for you as they show? Then you can fiddle with changing that to whatever it is you want till it works or goes wrong.

                            SPlattenS 1 Reply Last reply
                            0
                            • JonBJ JonB

                              @JonB said in QTabWidget, setting colour of tab itself ?:

                              Have you first tried the code shown in that SO solution? Does that work for you as they show? Then you can fiddle with changing that to whatever it is you want till it works or goes wrong.

                              SPlattenS Offline
                              SPlattenS Offline
                              SPlatten
                              wrote on last edited by
                              #64

                              @JonB , thats the code my class is based on and no I don't have any of the tabs changing colour.

                              Kind Regards,
                              Sy

                              JonBJ 1 Reply Last reply
                              0
                              • SPlattenS SPlatten

                                @JonB , thats the code my class is based on and no I don't have any of the tabs changing colour.

                                JonBJ Offline
                                JonBJ Offline
                                JonB
                                wrote on last edited by
                                #65

                                @SPlatten said in QTabWidget, setting colour of tab itself ?:

                                thats the code my class is based on

                                Why won't you try their code instead of yours? How do we know whether something you have done has affected the outcome? Why do we have to guess whether that might be the case or not when you could try a solution shown to have been working? First try their exact code, then report whether it works for you or not.....

                                SPlattenS 1 Reply Last reply
                                0
                                • JonBJ JonB

                                  @SPlatten said in QTabWidget, setting colour of tab itself ?:

                                  thats the code my class is based on

                                  Why won't you try their code instead of yours? How do we know whether something you have done has affected the outcome? Why do we have to guess whether that might be the case or not when you could try a solution shown to have been working? First try their exact code, then report whether it works for you or not.....

                                  SPlattenS Offline
                                  SPlattenS Offline
                                  SPlatten
                                  wrote on last edited by SPlatten
                                  #66

                                  @JonB , mainly because its a lot of backtracking and changes that to be honest its simple enough to see what this is doing and mine does almost exactly the same.

                                  What I will do instead is create a simple application using Qt Creator and 4.8 with the original code to see if that works.

                                  Kind Regards,
                                  Sy

                                  JonBJ 1 Reply Last reply
                                  0
                                  • SPlattenS SPlatten

                                    @JonB , mainly because its a lot of backtracking and changes that to be honest its simple enough to see what this is doing and mine does almost exactly the same.

                                    What I will do instead is create a simple application using Qt Creator and 4.8 with the original code to see if that works.

                                    JonBJ Offline
                                    JonBJ Offline
                                    JonB
                                    wrote on last edited by JonB
                                    #67

                                    @SPlatten said in QTabWidget, setting colour of tab itself ?:

                                    mainly because its a lot of backtracking and changes

                                    No it's not. It would take you 5 minutes to paste that code into a tiny, new, standalone program to test whether it works for you or not. You could have done it in the time it took you to answer that you didn't want to do it. You seem to spend a lot of time posting questions you want help with and pasting loads of your own code and expecting others to spend time to spot what is wrong, but are very resistant to simplifying and testing yourself. Not to mention, half the time you end up saying it was something else in your code what caused whatever problem which we have not even been shown.

                                    If you don't want to do that, best of luck getting someone to spot what might be wrong in your code. Then either:

                                    • It does work, and your "mine does almost exactly the same" is then clearly not similar enough, and you can discover why; or

                                    • It does not work at all for you, standalone, not with your own code changes. In which case I will start by asking you whether you took the time to read the Comments to the SO post, as I did, and how you respond to:

                                    Seen, It no effect in window's system...

                                    so the solution is add a.setStyle("fusion"); to main.cpp. thanks

                                    SPlattenS 1 Reply Last reply
                                    0
                                    • JonBJ JonB

                                      @SPlatten said in QTabWidget, setting colour of tab itself ?:

                                      mainly because its a lot of backtracking and changes

                                      No it's not. It would take you 5 minutes to paste that code into a tiny, new, standalone program to test whether it works for you or not. You could have done it in the time it took you to answer that you didn't want to do it. You seem to spend a lot of time posting questions you want help with and pasting loads of your own code and expecting others to spend time to spot what is wrong, but are very resistant to simplifying and testing yourself. Not to mention, half the time you end up saying it was something else in your code what caused whatever problem which we have not even been shown.

                                      If you don't want to do that, best of luck getting someone to spot what might be wrong in your code. Then either:

                                      • It does work, and your "mine does almost exactly the same" is then clearly not similar enough, and you can discover why; or

                                      • It does not work at all for you, standalone, not with your own code changes. In which case I will start by asking you whether you took the time to read the Comments to the SO post, as I did, and how you respond to:

                                      Seen, It no effect in window's system...

                                      so the solution is add a.setStyle("fusion"); to main.cpp. thanks

                                      SPlattenS Offline
                                      SPlattenS Offline
                                      SPlatten
                                      wrote on last edited by SPlatten
                                      #68

                                      @JonB , did you see the edit to my post before you posted?

                                      I am creating a simple application using the original code.

                                      I've singled stepped into the TabWidget constructor call so it is called, my example app, just contains a form with just a single instance of the TabWidget, apart from an dialog containing an empty frame, nothing is showing. No tabs at all.

                                      Kind Regards,
                                      Sy

                                      1 Reply Last reply
                                      0
                                      • SPlattenS Offline
                                        SPlattenS Offline
                                        SPlatten
                                        wrote on last edited by
                                        #69

                                        @JonB , main.cpp:

                                        int main(int argc, char* argv[])
                                        {
                                            QApplication a(argc, argv);
                                            MainWndow w;
                                            w.show();
                                           
                                            return a.exec();
                                        }
                                        

                                        mainwindow.h:

                                        #ifndef MAINWINDOW_H
                                        #defiine MAINWINDOW_H
                                        
                                        #include <QMainWindow>
                                        
                                        namespace Ui {
                                        class MainWindow;
                                        }
                                        
                                        class MainWindow : public QMainWindow
                                        {
                                            Q_OBJECT
                                        
                                        public:
                                            explicit MainWindow(QWidget *parent = 0);
                                            ~MainWindow();
                                        
                                        private:
                                            Ui:MainWindow* ui;
                                        };
                                        
                                        #endif //MAINWINDOW_H
                                        

                                        mainwindow.cpp:

                                        #include "mainwindow.h"
                                        #include "ui_mainwindow.h"
                                        
                                        MainWindow::MainWindow(QWidget* parent) :
                                            QMainWindow(parent),
                                            ui(new Ui::MainWindow)
                                        {
                                            ui->setupUi(this);
                                        }
                                        
                                        MainWindow::~MainWindow()
                                        {
                                            delete ui;
                                        }
                                        

                                        mainwindow.ui:

                                        <?xml version="1.0" encoding="UTF-8"?>
                                        <ui version="4.0">
                                         <class>MainWindow</class>
                                         <widget class="QMainWindow" name="MainWindo">
                                          <property name="geometry">
                                           <rect>
                                            <x>0</x>
                                            <y>0</y>
                                            <width>718</width>
                                            <height>496</height>
                                           </rect>
                                          </property>
                                          <property name="windowTitle">
                                           <string>MainWindow</string>
                                          </property>
                                          <widget class="QWidget" name="centralWidget">
                                            <widget class="TagWidget" name="tabWidget" native="true">
                                             <property name="geometry">
                                              <rect>
                                               <x>40</x>
                                               <y>50</y>
                                               <width>561</width>
                                               <height>331</height>
                                              </rect>
                                             </property>
                                             <property name="sizePolicy">
                                              <sizePolicy hsizetype="Preferred" vsizetype="Preferred">
                                               <horstretch>0</horstretch>
                                               <verstretch>0</verstretch>
                                              </sizePolicy>
                                             </property>
                                            <property name="maximumSize">
                                             <size>
                                              <width>701</width>
                                              <height>491</height>
                                             </size>
                                            </property>
                                           </widget>
                                          </widget>
                                         </widget>
                                         <layoutdefault spacing="6" margin="11"/>
                                         <customwidgets>
                                          <customwidget>
                                           <class>TagWidget</class>
                                           <extends>QTabWidget</extends>
                                           <header>tabwidget.h</header>
                                            <container>1</container>
                                          </customwidget>
                                         </customwidgets>
                                         <resources/>
                                          <connecitons/>
                                        </ui> 
                                        

                                        test.pro:

                                        QT += core gui
                                        greaterThaan(QT|_MAJOR_VERSION, 4): QT += widgets
                                        
                                        TARGET = test
                                        TEMPLATE = app
                                        
                                        SOURCES += main.cpp\
                                                mainwindow.cpp
                                        
                                        HEADERS += mainwindow.h \
                                             tagwidget.h
                                        
                                        FORMS += mainwindow.ui
                                        

                                        I haven't posted tabwidget.h as its identical to the stack overflow post.

                                        Kind Regards,
                                        Sy

                                        SPlattenS 1 Reply Last reply
                                        0
                                        • SPlattenS SPlatten

                                          @JonB , main.cpp:

                                          int main(int argc, char* argv[])
                                          {
                                              QApplication a(argc, argv);
                                              MainWndow w;
                                              w.show();
                                             
                                              return a.exec();
                                          }
                                          

                                          mainwindow.h:

                                          #ifndef MAINWINDOW_H
                                          #defiine MAINWINDOW_H
                                          
                                          #include <QMainWindow>
                                          
                                          namespace Ui {
                                          class MainWindow;
                                          }
                                          
                                          class MainWindow : public QMainWindow
                                          {
                                              Q_OBJECT
                                          
                                          public:
                                              explicit MainWindow(QWidget *parent = 0);
                                              ~MainWindow();
                                          
                                          private:
                                              Ui:MainWindow* ui;
                                          };
                                          
                                          #endif //MAINWINDOW_H
                                          

                                          mainwindow.cpp:

                                          #include "mainwindow.h"
                                          #include "ui_mainwindow.h"
                                          
                                          MainWindow::MainWindow(QWidget* parent) :
                                              QMainWindow(parent),
                                              ui(new Ui::MainWindow)
                                          {
                                              ui->setupUi(this);
                                          }
                                          
                                          MainWindow::~MainWindow()
                                          {
                                              delete ui;
                                          }
                                          

                                          mainwindow.ui:

                                          <?xml version="1.0" encoding="UTF-8"?>
                                          <ui version="4.0">
                                           <class>MainWindow</class>
                                           <widget class="QMainWindow" name="MainWindo">
                                            <property name="geometry">
                                             <rect>
                                              <x>0</x>
                                              <y>0</y>
                                              <width>718</width>
                                              <height>496</height>
                                             </rect>
                                            </property>
                                            <property name="windowTitle">
                                             <string>MainWindow</string>
                                            </property>
                                            <widget class="QWidget" name="centralWidget">
                                              <widget class="TagWidget" name="tabWidget" native="true">
                                               <property name="geometry">
                                                <rect>
                                                 <x>40</x>
                                                 <y>50</y>
                                                 <width>561</width>
                                                 <height>331</height>
                                                </rect>
                                               </property>
                                               <property name="sizePolicy">
                                                <sizePolicy hsizetype="Preferred" vsizetype="Preferred">
                                                 <horstretch>0</horstretch>
                                                 <verstretch>0</verstretch>
                                                </sizePolicy>
                                               </property>
                                              <property name="maximumSize">
                                               <size>
                                                <width>701</width>
                                                <height>491</height>
                                               </size>
                                              </property>
                                             </widget>
                                            </widget>
                                           </widget>
                                           <layoutdefault spacing="6" margin="11"/>
                                           <customwidgets>
                                            <customwidget>
                                             <class>TagWidget</class>
                                             <extends>QTabWidget</extends>
                                             <header>tabwidget.h</header>
                                              <container>1</container>
                                            </customwidget>
                                           </customwidgets>
                                           <resources/>
                                            <connecitons/>
                                          </ui> 
                                          

                                          test.pro:

                                          QT += core gui
                                          greaterThaan(QT|_MAJOR_VERSION, 4): QT += widgets
                                          
                                          TARGET = test
                                          TEMPLATE = app
                                          
                                          SOURCES += main.cpp\
                                                  mainwindow.cpp
                                          
                                          HEADERS += mainwindow.h \
                                               tagwidget.h
                                          
                                          FORMS += mainwindow.ui
                                          

                                          I haven't posted tabwidget.h as its identical to the stack overflow post.

                                          SPlattenS Offline
                                          SPlattenS Offline
                                          SPlatten
                                          wrote on last edited by SPlatten
                                          #70

                                          @JoeCFD , @JonB , ok , I have the posted code working in Qt 4.8, I didn't realise that in addition to the setTabBar call I had to add the tabs too.

                                          Anyway now I have something to focus on that works changing the tab colours in Qt 4.8.

                                          Kind Regards,
                                          Sy

                                          JonBJ 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