2017-11-16 12:44:13 +08:00
|
|
|
#include "mainwindow.h"
|
|
|
|
#include "ui_mainwindow.h"
|
|
|
|
#include <qqtslideeffecttabbar.h>
|
|
|
|
#include <qqtpictureeffecttabwidget.h>
|
|
|
|
|
2017-12-09 19:07:21 +08:00
|
|
|
MainWindow::MainWindow ( QWidget* parent ) :
|
|
|
|
QMainWindow ( parent ),
|
|
|
|
ui ( new Ui::MainWindow )
|
2017-11-16 12:44:13 +08:00
|
|
|
{
|
2017-12-09 19:07:21 +08:00
|
|
|
ui->setupUi ( this );
|
2017-11-16 12:44:13 +08:00
|
|
|
/*
|
|
|
|
ui->w60->setFixedHeight(30);
|
2018-05-05 15:17:18 +08:00
|
|
|
QQtSlideTabBar* bar = new QQtSlideTabBar(ui->tab_6);
|
|
|
|
QQtSlideTabBar* bar2 = new QQtSlideTabBar(ui->tab_6);
|
2017-11-16 12:44:13 +08:00
|
|
|
bar->addTab("xxx");
|
|
|
|
bar->addTab("ccc");
|
2018-05-05 15:17:18 +08:00
|
|
|
bar2->setShape(QQtSlideTabBar::RoundedEast);
|
2017-11-16 12:44:13 +08:00
|
|
|
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);
|
|
|
|
*/
|
|
|
|
/*
|
2018-05-05 15:17:18 +08:00
|
|
|
QQtSlideTabBar* bar2 = new QQtSlideTabBar(ui->tab_6);
|
2017-11-16 12:44:13 +08:00
|
|
|
ui->tb1->setTabBar(bar2);
|
|
|
|
*/
|
2018-05-05 15:17:18 +08:00
|
|
|
//QQtSlideTabBar* bar = new QQtSlideTabBar(ui->tb0);
|
2017-11-16 12:44:13 +08:00
|
|
|
//ui->tb0->setTabBar(bar);
|
|
|
|
//ui->tb0->setObjectName("tb0");
|
|
|
|
|
2017-12-09 19:07:21 +08:00
|
|
|
ui->w77->addTab ( "ddd" );
|
|
|
|
ui->w77->addTab ( "xxxx" );
|
|
|
|
ui->w77->setFixedHeight ( 28 );
|
2017-11-16 12:44:13 +08:00
|
|
|
|
|
|
|
|
2017-12-10 09:26:01 +08:00
|
|
|
ui->tw0->setStyleSheet ( "QTabWidget#tw0 QTabBar::tab { width:72px; height:90px; }" );
|
2018-05-05 15:17:18 +08:00
|
|
|
QQtPictureTabBar* tab = ( QQtPictureTabBar* ) ui->tw0->localTabBar();
|
|
|
|
tab->setIconStyle ( QQtPictureTabBar::IconStyle_Top_And_BottomText );
|
2017-12-09 19:07:21 +08:00
|
|
|
tab->setTabPixmap ( 0, "./skin/default/bt_setting.png", "./skin/default/bt_setting_press.png" );
|
2017-12-10 09:26:01 +08:00
|
|
|
tab->setTabPixmap ( 1, "./skin/default/bt_dispel.png", "./skin/default/bt_dispel_press.png" );
|
|
|
|
tab->setContentsMargins ( 2, 2, 2, 2 );
|
2017-11-16 13:07:23 +08:00
|
|
|
|
2017-12-09 19:07:21 +08:00
|
|
|
ui->tw1->setStyleSheet ( "QTabWidget#tw1 QTabBar::tab { width:90px; height:30px; }" );
|
2018-05-05 15:17:18 +08:00
|
|
|
QQtPictureTabBar* tab1 = ( QQtPictureTabBar* ) ui->tw1->localTabBar();
|
|
|
|
tab1->setIconStyle ( QQtPictureTabBar::IconStyle_Left_And_RightText );
|
2017-12-09 19:07:21 +08:00
|
|
|
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();
|
2017-12-09 19:18:02 +08:00
|
|
|
tab1->setContentsMargins ( 2, 2, 8, 2 );
|
|
|
|
pline() << tab1->contentsMargins();
|
2017-11-18 18:12:53 +08:00
|
|
|
|
2017-12-09 19:07:21 +08:00
|
|
|
ui->tb0->setStyleSheet ( "QTabWidget#tb0 QTabBar::tab { width:90px; height:30px; }" );
|
2017-11-16 12:44:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
MainWindow::~MainWindow()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|