void QTabWidgetPrivate::init() { Q_Q(QTabWidget); stack = new QStackedWidget(q); stack->setObjectName(QLatin1String("qt_tabwidget_stackedwidget")); stack->setLineWidth(0); // hack so that QMacStyle::layoutSpacing() can detect tab widget pages stack->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred, QSizePolicy::TabWidget)); QObject::connect(stack, SIGNAL(widgetRemoved(int)), q, SLOT(_q_removeTab(int))); QTabBar *tabBar = new QTabBar(q); tabBar->setObjectName(QLatin1String("qt_tabwidget_tabbar")); tabBar->setDrawBase(false); q->setTabBar(tabBar); q->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding, QSizePolicy::TabWidget)); #ifdef QT_KEYPAD_NAVIGATION if (QApplication::keypadNavigationEnabled()) q->setFocusPolicy(Qt::NoFocus); else #endif q->setFocusPolicy(Qt::TabFocus); q->setFocusProxy(tabs); q->setTabPosition(static_cast<QTabWidget::TabPosition> (q->style()->styleHint( QStyle::SH_TabWidget_DefaultTabPosition, 0, q ))); }
void ENT_GeometryOutln::InitOutline() { InitPropertiesTab(); InitTransformationTab(); // create tabwidget _tabWidget = new QTabWidget; _tabWidget->setObjectName("outlinerTabs"); QTabBar* tabBar = _tabWidget->findChild<QTabBar *>(QLatin1String("qt_tabwidget_tabbar")); tabBar->setObjectName("outlinerTabBar"); _tabWidget->setTabPosition(QTabWidget::North); _tabWidget->addTab(_tabProperties, "Visual"); _tabWidget->addTab(_tabTransformation, "Transform"); QVBoxLayout* layout = new QVBoxLayout; layout->addWidget(_tabWidget); setLayout(layout); }