#include "mainwindow.h" #include "ui_mainwindow.h" #include #include MainWindow::MainWindow ( QWidget* parent ) : QMainWindow ( parent ), ui ( new Ui::MainWindow ) { ui->setupUi ( this ); /* ui->w60->setFixedHeight(30); QQtSlideEffectTabBar* bar = new QQtSlideEffectTabBar(ui->tab_6); QQtSlideEffectTabBar* bar2 = new QQtSlideEffectTabBar(ui->tab_6); bar->addTab("xxx"); bar->addTab("ccc"); bar2->setShape(QQtSlideEffectTabBar::RoundedEast); bar2->addTab("yyy"); bar2->addTab("ddd"); QSpacerItem* space = new QSpacerItem(800, 30, QSizePolicy::Maximum); QGridLayout* lay = new QGridLayout(ui->tab_6); lay->addWidget(ui->w60, 1, 1, 1, 2); lay->addWidget(bar, 2, 1, 1, 2); lay->addWidget(bar2, 3, 1, 1, 1); lay->addItem(space, 3, 2, 1, 1); ui->tab_6->setLayout(lay); */ /* QQtSlideEffectTabBar* bar2 = new QQtSlideEffectTabBar(ui->tab_6); ui->tb1->setTabBar(bar2); */ //QQtSlideEffectTabBar* bar = new QQtSlideEffectTabBar(ui->tb0); //ui->tb0->setTabBar(bar); //ui->tb0->setObjectName("tb0"); ui->w77->addTab ( "ddd" ); ui->w77->addTab ( "xxxx" ); ui->w77->setFixedHeight ( 28 ); ui->tw0->setStyleSheet ( "QTabWidget#tw0 QTabBar::tab { width:72px; height:90px; }" ); QQtPictureEffectTabBar* tab = ( QQtPictureEffectTabBar* ) ui->tw0->localTabBar(); tab->setIconStyle ( QQtPictureEffectTabBar::IconStyle_Top_And_BottomText ); tab->setTabPixmap ( 0, "./skin/default/bt_setting.png", "./skin/default/bt_setting_press.png" ); tab->setTabPixmap ( 1, "./skin/default/bt_dispel.png", "./skin/default/bt_dispel_press.png" ); tab->setContentsMargins ( 2, 2, 2, 2 ); ui->tw1->setStyleSheet ( "QTabWidget#tw1 QTabBar::tab { width:90px; height:30px; }" ); QQtPictureEffectTabBar* tab1 = ( QQtPictureEffectTabBar* ) ui->tw1->localTabBar(); tab1->setIconStyle ( QQtPictureEffectTabBar::IconStyle_Left_And_RightText ); tab1->setTabPixmap ( 0, "./skin/default/bt_bt_hover.png", "./skin/default/bt_bt_press.png" ); tab1->setTabIcon ( 0, "./skin/default/bk_user_normal.png", "./skin/default/bk_user_press.png" ); tab1->setTabPixmap ( 1, "./skin/default/bt_bt_hover.png", "./skin/default/bt_bt_press.png" ); pline() << tab1->contentsMargins(); tab1->setContentsMargins ( 2, 2, 8, 2 ); pline() << tab1->contentsMargins(); ui->tb0->setStyleSheet ( "QTabWidget#tb0 QTabBar::tab { width:90px; height:30px; }" ); } MainWindow::~MainWindow() { delete ui; }