Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <QtGui>
- int main(int argc, char * argv[])
- {
- QApplication app(argc, argv);
- QString css = ".QFrame { padding-top: -30px; } QTabWidget::pane {border: 0; border-top: 30px solid qlineargradient(x1:0, y1:0, x2:0, y2:1, stop: 0 red, stop: 1 yellow); background: yellow; } QTabWidget::tab-bar { top: 30px; } ";
- app.setStyleSheet(css);
- QFrame frame;
- QVBoxLayout * lay = new QVBoxLayout(&frame);
- QTabWidget * wgt = new QTabWidget;
- wgt->addTab(new QPushButton, "Tab1");
- wgt->addTab(new QPushButton, "Tab2");
- lay->addWidget(wgt);
- lay->setContentsMargins(0, 0, 0, 0);
- frame.show();
- return app.exec();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement