Qt界面美化4
来源:互联网 发布:淘宝查号网址 编辑:程序博客网 时间:2024/06/18 00:03
代码:
![](http://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif)
#include <QApplication>#include <QStyle>#include <QToolButton>#include <QTabWidget>#include <QTabBar> class TabWidget : public QTabWidget{public: QTabBar* tabBar() { return QTabWidget::tabBar(); }}; #define Count(arr) ((unsigned int) (sizeof(arr) / sizeof(arr[0]))) int main( int argc, char** argv ){ QApplication app( argc, argv ); TabWidget tw; QWidget w; QStyle::StandardPixmap tab_icons[] = { QStyle::SP_MediaSkipBackward, QStyle::SP_MediaPlay, QStyle::SP_MediaStop, QStyle::SP_MediaSkipForward }; QString tab_names[] = { "Rewind", "Play", "Stop", "Fast Forward" }; tw.setTabPosition( QTabWidget::West ); for( int i = 0; i < Count( tab_icons ); i++ ) { tw.addTab( new QWidget(), QString() ); QToolButton* tb = new QToolButton; tb->setStyleSheet( "background-color: none; border: 0px;" ); tb->setAttribute( Qt::WA_TransparentForMouseEvents ); tb->setIcon( app.style()->standardIcon( tab_icons[i] ) ); tb->setText( tab_names[i] ); tb->setToolButtonStyle( Qt::ToolButtonTextUnderIcon ); tw.tabBar()->setTabButton( i, QTabBar::LeftSide, tb ); } tw.show(); return app.exec();}
界面效果:
阅读全文
0 0
- Qt界面美化4
- QT界面美化
- Qt 界面美化
- Qt 界面美化
- Qt界面美化 QSS
- Qt界面美化 QSS
- QT界面美化
- QT界面美化
- QT界面美化
- Qt界面美化
- Qt] 界面美化
- QT界面美化
- Qt-界面美化
- Qt 界面美化
- qt界面美化
- QT 界面美化
- QT 界面美化
- Qt 界面美化
- Qt界面美化2
- 大整数加法
- 编程,更多?更好?更快?
- hadoop起动后没有datanode的问题
- Qt界面美化3
- Qt界面美化4
- 结构型设计模式之代理模式
- 强烈推荐的机器学习,深度学习课程以及python库
- simple traditional layout in html(use table)
- 2款风格QPushButton
- FTPrep, 100 Same Tree
- 【Codeforces 868 B. Race Against Time】& 模拟
- mybatis-generator 代码自动生成工具(maven方式)
- web前端动态添加进度条