CSSQTabWidget::pane{ border-image: url(:/border.png); border-width: 14px 14px 14px 14px;}
CSSQTabWidget::pane{ border-image: url(:/border.png); border-width: 14px 14px 14px 14px; min-height: 32px;}
C++ (Qt)#include <QtGui> int main(int argc, char *argv[]){ QApplication app(argc, argv); QTabWidget *w = new QTabWidget; QWidget *p = new QWidget; QGridLayout *g = new QGridLayout; p->setLayout(g); QLineEdit *l; l = new QLineEdit; l->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); g->addWidget(l, 0, 0); l = new QLineEdit; l->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); g->addWidget(l, 1, 0); g->addWidget(new QLineEdit, 1, 0); g->addItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::Expanding), 2, 0); w->addTab(p, "page1"); w->show(); return app.exec();}
C++ (Qt)#include <QtGui> int main(int argc, char *argv[]){ QApplication app(argc, argv); QWidget *mainWidget = new QWidget; QVBoxLayout *mainLayout = new QVBoxLayout; mainWidget->setLayout( mainLayout ); QTabWidget *w = new QTabWidget( mainWidget ); mainLayout->addWidget( w ); QWidget *p = new QWidget; QGridLayout *g = new QGridLayout; p->setLayout(g); QLineEdit *l; l = new QLineEdit;// l->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); g->addWidget(l, 0, 0); l = new QLineEdit;// l->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); g->addWidget(l, 1, 0); // g->addWidget(new QLineEdit, 1, 0); g->addItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::Expanding), 2, 0); w->addTab(p, "page1"); mainWidget->show(); return app.exec();}
C++ (Qt)#include <QtGui> int main(int argc, char *argv[]){ QApplication app(argc, argv); QWidget *mainWidget = new QWidget; QVBoxLayout *mainLayout = new QVBoxLayout; mainWidget->setLayout( mainLayout ); QTabWidget *w = new QTabWidget( mainWidget ); w->setStyleSheet("""QTabWidget::pane""{"" border-image: url(border.png);"" border-width: 14px 14px 14px 14px;""} "); mainLayout->addWidget( w ); QWidget *p = new QWidget; QGridLayout *g = new QGridLayout; p->setLayout(g); QLineEdit *l; l = new QLineEdit; g->addWidget(l, 0, 0); l = new QLineEdit; g->addWidget(l, 1, 0); g->addItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::Expanding), 2, 0); w->addTab(p, "page1"); mainWidget->show(); return app.exec();}