-   
-     Q_OBJECT 
-   
-   public: 
-     explicit-  ExpandTabBar  ( QWidget *- parent  = 0 )- ; 
 
-   
-   public slots: 
-     void hideTabPageArea ( int index ); 
-   
-   private: 
-     bool tabCollapse; 
- }; 
        class ExpandTabBar : public QTabWidget {
    Q_OBJECT
  public:
    explicit ExpandTabBar ( QWidget *parent = 0 );
  public slots:
    void hideTabPageArea ( int index );
  private:
    bool tabCollapse;
};
To copy to clipboard, switch view to plain text mode 
  
	
	- void ExpandTabBar::hideTabPageArea ( int index ) { 
-   
-   qDebug () << "El valor de tabCollapse es: " << this->tabCollapse; 
-   if ( this->tabCollapse ) { 
-   
-     switch ( this->tabPosition () ) { 
-   
-   
-         //this->resize ( this->tabBar ()->width () * 3, this->height () ); 
-         //this->setFixedWidth ( this->tabBar ()->width () * 3 ); 
-         this->setMinimumWidth ( this->tabBar ()->width () * 3 ); 
-         break; 
-   
-   
-         //this->resize ( this->tabBar ()->width () * 3, this->height () ); 
-         //this->setFixedWidth ( this->tabBar ()->width () * 3 ); 
-         this->setMinimumWidth ( this->tabBar ()->width () * 3 ); 
-         break; 
-   
-   
-         //this->resize ( this->width (), this->tabBar ()->height () * 3 ); 
-         //this->setFixedHeight ( this->tabBar ()->height () * 3 ); 
-         this->setMinimumHeight ( this->tabBar ()->height () * 3 ); 
-         break; 
-   
-       default: 
-   
-         //this->resize ( this->width (), this->tabBar ()->height () * 3 ); 
-         //this->setFixedHeight ( this->tabBar ()->height () * 3 ); 
-         this->setMinimumHeight ( this->tabBar ()->height () * 3 ); 
-         break; 
-     } 
-     this->tabCollapse = false; 
-   
-   } else { 
-   
-     switch ( this->tabPosition () ) { 
-   
-   
-         //this->resize ( this->tabBar ()->width (), this->height () ); 
-         //this->setFixedWidth ( this->tabBar ()->width () ); 
-         this->setMaximumWidth ( this->tabBar ()->width () ); 
-         break; 
-   
-   
-         //this->resize ( this->tabBar ()->width (), this->height () ); 
-         //this->setFixedWidth ( this->tabBar ()->width () ); 
-         this->setMaximumWidth ( this->tabBar ()->width () ); 
-         break; 
-   
-   
-         //this->resize ( this->width (), this->tabBar ()->height () ); 
-         //this->setFixedHeight ( this->tabBar ()->height () ); 
-         this->setMaximumHeight ( this->tabBar ()->height () ); 
-         break; 
-   
-       default: 
-   
-         //this->resize ( this->width (), this->tabBar ()->height () ); 
-         //this->setFixedHeight ( this->tabBar ()->height () ); 
-         this->setMaximumHeight ( this->tabBar ()->height () ); 
-         break; 
-     } 
-     this->tabCollapse = true; 
-   } 
-   qDebug () << "sizeHint is: " << sizeHint (); 
-   qDebug () << "sizePolicy is: " << sizePolicy (); 
-   qDebug () << "size is: " << size (); 
- } 
        void ExpandTabBar::hideTabPageArea ( int index ) {
  qDebug () << "El valor de tabCollapse es: " << this->tabCollapse;
  if ( this->tabCollapse ) {
    switch ( this->tabPosition () ) {
      case QTabWidget::West:
        //this->resize ( this->tabBar ()->width () * 3, this->height () );
        //this->setFixedWidth ( this->tabBar ()->width () * 3 );
        this->setMinimumWidth ( this->tabBar ()->width () * 3 );
        this->setSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding );
        break;
      case QTabWidget::East:
        //this->resize ( this->tabBar ()->width () * 3, this->height () );
        //this->setFixedWidth ( this->tabBar ()->width () * 3 );
        this->setMinimumWidth ( this->tabBar ()->width () * 3 );
        this->setSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding );
        break;
      case QTabWidget::South:
        //this->resize ( this->width (), this->tabBar ()->height () * 3 );
        //this->setFixedHeight ( this->tabBar ()->height () * 3 );
        this->setMinimumHeight ( this->tabBar ()->height () * 3 );
        this->setSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding );
        break;
      default:
        //this->resize ( this->width (), this->tabBar ()->height () * 3 );
        //this->setFixedHeight ( this->tabBar ()->height () * 3 );
        this->setMinimumHeight ( this->tabBar ()->height () * 3 );
        this->setSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding );
        break;
    }
    this->tabCollapse = false;
  } else {
    switch ( this->tabPosition () ) {
      case QTabWidget::West:
        //this->resize ( this->tabBar ()->width (), this->height () );
        //this->setFixedWidth ( this->tabBar ()->width () );
        this->setMaximumWidth ( this->tabBar ()->width () );
        this->setSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Expanding );
        break;
      case QTabWidget::East:
        //this->resize ( this->tabBar ()->width (), this->height () );
        //this->setFixedWidth ( this->tabBar ()->width () );
        this->setMaximumWidth ( this->tabBar ()->width () );
        this->setSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Expanding );
        break;
      case QTabWidget::South:
        //this->resize ( this->width (), this->tabBar ()->height () );
        //this->setFixedHeight ( this->tabBar ()->height () );
        this->setMaximumHeight ( this->tabBar ()->height () );
        this->setSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Minimum );
        break;
      default:
        //this->resize ( this->width (), this->tabBar ()->height () );
        //this->setFixedHeight ( this->tabBar ()->height () );
        this->setMaximumHeight ( this->tabBar ()->height () );
        this->setSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Minimum );
        break;
    }
    this->tabCollapse = true;
  }
  qDebug () << "sizeHint is: " << sizeHint ();
  qDebug () << "sizePolicy is: " << sizePolicy ();
  qDebug () << "size is: " << size ();
}
To copy to clipboard, switch view to plain text mode 
  
Bookmarks