TabBar::TabBar(QupZilla* mainClass, TabWidget* tabWidget) : QTabBar() , p_QupZilla(mainClass) , m_tabWidget(tabWidget) , m_tabPreview(new TabPreview(mainClass, tabWidget)) , m_showTabPreviews(false) , m_clickedTab(0) , m_pinnedTabsCount(0) , m_normalTabWidth(0) , m_activeTabWidth(0) { setObjectName("tabbar"); setContextMenuPolicy(Qt::CustomContextMenu); setElideMode(Qt::ElideRight); setDocumentMode(true); setFocusPolicy(Qt::NoFocus); setTabsClosable(true); setMouseTracking(true); setMovable(true); setAcceptDrops(true); connect(this, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int))); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(contextMenuRequested(const QPoint &))); connect(m_tabWidget, SIGNAL(pinnedTabClosed()), this, SLOT(pinnedTabClosed())); connect(m_tabWidget, SIGNAL(pinnedTabAdded()), this, SLOT(pinnedTabAdded())); m_tabPreviewTimer = new QTimer(this); m_tabPreviewTimer->setInterval(200); m_tabPreviewTimer->setSingleShot(true); connect(m_tabPreviewTimer, SIGNAL(timeout()), m_tabPreview, SLOT(hideAnimated())); }
WBTabBar::WBTabBar(QWidget *parent) : QTabBar(parent) { setObjectName("ubWebBrowserTabBar"); setContextMenuPolicy(Qt::CustomContextMenu); setAcceptDrops(true); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(contextMenuRequested(const QPoint &))); QString alt = QLatin1String("Alt+%1"); for (int i = 1; i <= 10; ++i) { int key = i; if (key == 10) key = 0; QShortcut *shortCut = new QShortcut(alt.arg(key), this); mTabShortcuts.append(shortCut); connect(shortCut, SIGNAL(activated()), this, SLOT(selectTabAction())); } setTabsClosable(true); connect(this, SIGNAL(tabCloseRequested(int)), this, SIGNAL(closeTab(int))); setSelectionBehaviorOnRemove(QTabBar::SelectPreviousTab); setMovable(true); setDocumentMode(false); #ifdef Q_OS_OSX QFont baseFont = font(); baseFont.setPointSize(baseFont.pointSize() - 2); setFont(baseFont); #endif }
int QTabBar::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 8) qt_static_metacall(this, _c, _id, _a); _id -= 8; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< Shape*>(_v) = shape(); break; case 1: *reinterpret_cast< int*>(_v) = currentIndex(); break; case 2: *reinterpret_cast< int*>(_v) = count(); break; case 3: *reinterpret_cast< bool*>(_v) = drawBase(); break; case 4: *reinterpret_cast< QSize*>(_v) = iconSize(); break; case 5: *reinterpret_cast< Qt::TextElideMode*>(_v) = elideMode(); break; case 6: *reinterpret_cast< bool*>(_v) = usesScrollButtons(); break; case 7: *reinterpret_cast< bool*>(_v) = tabsClosable(); break; case 8: *reinterpret_cast< SelectionBehavior*>(_v) = selectionBehaviorOnRemove(); break; case 9: *reinterpret_cast< bool*>(_v) = expanding(); break; case 10: *reinterpret_cast< bool*>(_v) = isMovable(); break; case 11: *reinterpret_cast< bool*>(_v) = documentMode(); break; } _id -= 12; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setShape(*reinterpret_cast< Shape*>(_v)); break; case 1: setCurrentIndex(*reinterpret_cast< int*>(_v)); break; case 3: setDrawBase(*reinterpret_cast< bool*>(_v)); break; case 4: setIconSize(*reinterpret_cast< QSize*>(_v)); break; case 5: setElideMode(*reinterpret_cast< Qt::TextElideMode*>(_v)); break; case 6: setUsesScrollButtons(*reinterpret_cast< bool*>(_v)); break; case 7: setTabsClosable(*reinterpret_cast< bool*>(_v)); break; case 8: setSelectionBehaviorOnRemove(*reinterpret_cast< SelectionBehavior*>(_v)); break; case 9: setExpanding(*reinterpret_cast< bool*>(_v)); break; case 10: setMovable(*reinterpret_cast< bool*>(_v)); break; case 11: setDocumentMode(*reinterpret_cast< bool*>(_v)); break; } _id -= 12; } else if (_c == QMetaObject::ResetProperty) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 12; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 12; } #endif // QT_NO_PROPERTIES return _id; }
PlaylistTabBar::PlaylistTabBar(QWidget* parent) : QTabBar(parent), manager_(nullptr), menu_(new QMenu(this)), menu_index_(-1), suppress_current_changed_(false), initialized_(false), rename_editor_(new RenameTabLineEdit(this)) { setAcceptDrops(true); setElideMode(Qt::ElideRight); setUsesScrollButtons(true); setTabsClosable(true); close_ = menu_->addAction(IconLoader::Load("list-remove", IconLoader::Base), tr("Close playlist"), this, SLOT(Close())); rename_ = menu_->addAction(IconLoader::Load("edit-rename", IconLoader::Base), tr("Rename playlist..."), this, SLOT(Rename())); save_ = menu_->addAction(IconLoader::Load("document-save", IconLoader::Base), tr("Save playlist..."), this, SLOT(Save())); menu_->addSeparator(); rename_editor_->setVisible(false); connect(rename_editor_, SIGNAL(editingFinished()), SLOT(RenameInline())); connect(rename_editor_, SIGNAL(EditingCanceled()), SLOT(HideEditor())); connect(this, SIGNAL(currentChanged(int)), SLOT(CurrentIndexChanged(int))); connect(this, SIGNAL(tabMoved(int, int)), SLOT(TabMoved())); // We can't just emit Close signal, we need to extract the playlist id first connect(this, SIGNAL(tabCloseRequested(int)), SLOT(CloseFromTabIndex(int))); }
MsaEditorTreeTab::MsaEditorTreeTab(MSAEditor* msa, QWidget* parent) : QTabWidget(parent), msa(msa), addTabButton(NULL){ setObjectName("MsaEditorTreeTab"); addTabButton = new QPushButton(QIcon(":/core/images/add_tree.png"), "", this); addTabButton->setToolTip(tr("Add existing tree")); setCornerWidget(addTabButton); connect(addTabButton, SIGNAL(clicked(bool)), this, SLOT(sl_addTabTriggered())); connect(this, SIGNAL(si_tabsCountChanged(int)), SLOT(sl_onCountChanged(int))); setTabsClosable(true); connect(this, SIGNAL(tabCloseRequested(int)), SLOT(sl_onTabCloseRequested(int))); tabBar()->setContextMenuPolicy(Qt::CustomContextMenu); connect(tabBar(), SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(sl_onContextMenuRequested(const QPoint&))); closeOtherTabs = new QAction(tr("Close other tabs"), this); closeOtherTabs->setObjectName("Close other tabs"); connect(closeOtherTabs, SIGNAL(triggered()), SLOT(sl_onCloseOtherTabs())); closeAllTabs = new QAction(tr("Close all tabs"), this); closeAllTabs->setObjectName("Close all tabs"); connect(closeAllTabs, SIGNAL(triggered()), SLOT(sl_onCloseAllTabs())); closeTab = new QAction(tr("Close tab"), this); closeTab->setObjectName("Close tab"); connect(closeTab, SIGNAL(triggered()), SLOT(sl_onCloseTab())); }
ViewManager::ViewManager(DwarfModel *dm, DwarfModelProxy *proxy, QWidget *parent) : QTabWidget(parent) , m_model(dm) , m_proxy(proxy) , m_add_tab_button(new QToolButton(this)) { m_proxy->setSourceModel(m_model); setTabsClosable(true); setMovable(true); //reload_views(); m_add_tab_button->setText(tr("Add ")); m_add_tab_button->setIcon(QIcon(":img/ui-tab--plus.png")); m_add_tab_button->setPopupMode(QToolButton::InstantPopup); m_add_tab_button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); m_add_tab_button->setToolTip(tr("Add an existing view. New views can be copied or created from the [Windows->Docks->Grid Views] dock.")); draw_add_tab_button(); setCornerWidget(m_add_tab_button, Qt::TopLeftCorner); connect(tabBar(), SIGNAL(tabMoved(int, int)), SLOT(write_views())); connect(tabBar(), SIGNAL(currentChanged(int)), SLOT(setCurrentIndex(int)), Qt::UniqueConnection); connect(this, SIGNAL(tabCloseRequested(int)), SLOT(remove_tab_for_gridview(int))); connect(m_model, SIGNAL(need_redraw()), SLOT(redraw_current_tab())); //draw_views(); m_squad_warning = new QErrorMessage(this); }
TabBar::TabBar(QWidget *parent) : KTabBar(parent) , m_actualIndex(-1) , m_currentTabPreviewIndex(-1) , m_isFirstTimeOnTab(true) , m_tabHighlightEffect(new TabHighlightEffect(this)) , m_animationMapper(new QSignalMapper(this)) { setElideMode(Qt::ElideRight); setDocumentMode(true); setTabsClosable(true); setMovable(true); setContextMenuPolicy(Qt::CustomContextMenu); // avoid ambiguos shortcuts. See BUG:275858 KAcceleratorManager::setNoAccel(this); connect(this, SIGNAL(contextMenu(int, QPoint)), this, SLOT(contextMenu(int, QPoint))); connect(this, SIGNAL(emptyAreaContextMenu(QPoint)), this, SLOT(emptyAreaContextMenu(QPoint))); connect(m_animationMapper, SIGNAL(mapped(int)), this, SLOT(removeAnimation(int))); setGraphicsEffect(m_tabHighlightEffect); setAnimatedTabHighlighting(ReKonfig::animatedTabHighlighting()); setAcceptDrops(true); }
SC_SimulateTab::SC_SimulateTab( QWidget* parent, SC_RecentlyClosedTabItemModel* modelToUse ): SC_RecentlyClosedTab( parent, modelToUse ), addTabWidget( new QWidget( this ) ), lastSimulateTabIndexOffset( -2 ) { setTabsClosable( true ); setCloseAllTabsTitleText( tr( "Close ALL Simulate Tabs?" ) ); setCloseAllTabsBodyText( tr( "Do you really want to close ALL simulation profiles?" ) ); QIcon addTabIcon( ":/icon/addtab.png" ); int i = addTab( addTabWidget, addTabIcon, addTabIcon.pixmap( QSize( 64, 64 ) ).isNull() ? "+" : "" ); tabBar() -> setTabButton( i, QTabBar::LeftSide, 0 ); tabBar() -> setTabButton( i, QTabBar::RightSide, 0 ); addCloseAllExclude( addTabWidget ); enableDragHoveredOverTabSignal( true ); connect( this, SIGNAL( mouseDragHoveredOverTab( int ) ), this, SLOT( mouseDragSwitchTab( int ) ) ); connect( this, SIGNAL( currentChanged( int ) ), this, SLOT( addNewTab( int ) ) ); connect( this, SIGNAL( tabCloseRequested( int ) ), this, SLOT( TabCloseRequest( int ) ) ); // Using QTabBar::tabMoved(int,int) signal turns out to be very wonky // It is emitted WHILE tabs are still being dragged and looks very funny // This is the best way I could find to enable this setMovable( true ); // Would need to disallow moving the + tab, or to the right of it. That would require subclassing tabbar connect( this, SIGNAL( tabBarLayoutRequestEvent() ), this, SLOT( enforceAddTabWidgetLocationInvariant() ) ); }
int TabWidget::addTab(Tab *widget, const QString &name, quint32 tabId) { if(!widget->isHometab()) emit closeHomeTab(); int idx = QTabWidget::addTab(widget, name); installEventFilterToChildren(widget); std::vector<quint32>::iterator itr = m_tab_ids.begin() + idx; m_tab_ids.insert(itr, tabId); setCurrentIndex(idx); changeMenu(idx); if(count() >= 2) m_tab_bar->enableSplit(true); if(widget->isWorkTab()) { connect(widget, SIGNAL(statusBarMsg(QString,int)), SIGNAL(statusBarMsg(QString,int))); connect(widget, SIGNAL(setConnId(QString,bool)), SLOT(setConnString(QString,bool))); } else if(widget->isChild()) connect((ChildTab*)widget, SIGNAL(tabText(QString)), SLOT(setTabNameAndTooltip(QString))); connect(widget, SIGNAL(activateMe()), SLOT(activateTab())); connect(widget, SIGNAL(destroyed()), SLOT(checkEmpty()), Qt::QueuedConnection); setTabNameAndTooltip(idx, name); setTabsClosable(true); return idx; }
int TabBar::addNewTab(const QString &title) { TRACE_OBJ const int index = addTab(title); setTabsClosable(count() > 1); return index; }
QueuePool::QueuePool(QWidget* parent) : KTabWidget(parent) { setTabBarHidden(false); #if KDE_IS_VERSION(4,3,0) setTabsClosable(false); #else setCloseButtonEnabled(false); #endif slotAddQueue(); connect(this, SIGNAL(currentChanged(int)), this, SLOT(slotQueueSelected(int))); connect(this, SIGNAL(closeRequest(QWidget*)), this, SLOT(slotCloseQueueRequest(QWidget*))); connect(this, SIGNAL(testCanDecode(const QDragMoveEvent*, bool&)), this, SLOT(slotTestCanDecode(const QDragMoveEvent*, bool&))); // -- FileWatch connections ------------------------------ LoadingCacheInterface::connectToSignalFileChanged(this, SLOT(slotFileChanged(const QString&))); }
void TabBarWidget::optionChanged(const QString &option, const QVariant &value) { if (option == QLatin1String("TabBar/ShowCloseButton")) { setTabsClosable(value.toBool()); } }
AS_NAMESPACE_START EditorTabs::EditorTabs(QWidget *parent) : QTabWidget(parent), _finder(nullptr) { _connections << connect(parent, SIGNAL(editCopy()), this, SLOT(onEditCopy())); _connections << connect(parent, SIGNAL(editCut()), this, SLOT(onEditCut())); _connections << connect(parent, SIGNAL(editFind()), this, SLOT(onEditFind())); _connections << connect(parent, SIGNAL(editGoto()), this, SLOT(onEditGoto())); _connections << connect(parent, SIGNAL(editPaste()), this, SLOT(onEditPaste())); _connections << connect(parent, SIGNAL(editRedo()), this, SLOT(onEditRedo())); _connections << connect(parent, SIGNAL(editReplace()), this, SLOT(onEditReplace())); _connections << connect(parent, SIGNAL(editUndo()), this, SLOT(onEditUndo())); _connections << connect(parent, SIGNAL(fileClose()), this, SLOT(onFileClose())); _connections << connect(parent, SIGNAL(fileCloseAll()), this, SLOT(onFileCloseAll())); _connections << connect(parent, SIGNAL(fileOpen(QString)), this, SLOT(onFileOpen(QString))); _connections << connect(parent, SIGNAL(fileSave()), this, SLOT(onFileSave())); _connections << connect(parent, SIGNAL(fileSaveAll()), this, SLOT(onFileSaveAll())); _connections << connect(this, &QTabWidget::tabCloseRequested, this, &EditorTabs::onTabCloseRequested); _connections << connect(tabBar(), &QTabBar::tabMoved, this, &EditorTabs::onTabMoved); _connections << connect(this, &EditorTabs::currentChanged, this, &EditorTabs::onCurrentChanged); _connections << connect(this, SIGNAL(fileChanged(QString)), parent, SLOT(onFileChanged(QString))); _connections << connect(this, SIGNAL(fileSaved(QString)), parent, SLOT(onFileSaved(QString))); setMovable(true); setTabsClosable(true); }
OutputWidget::OutputWidget(QWidget *parent) : QTabWidget(parent) { setTabsClosable(true); setMovable(true); connect(this, SIGNAL(tabCloseRequested(int)), this, SLOT(closePage(int))); }
QTabDrawer::QTabDrawer(QTabContainer* tabContainer) : QTabBar(tabContainer), tabContainer(tabContainer), pressedIndex(-1) { //setMovable(true); setTabsClosable(true); setUsesScrollButtons(true); setElideMode(Qt::ElideRight); connect(this, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int))); }
MyCentralWidget::MyCentralWidget(QWidget *parent) : QMdiArea(parent) { setViewMode(QMdiArea::TabbedView); setTabsMovable(true); setTabsClosable(true); setDocumentMode(true); }
RealTabWidget::RealTabWidget(QWidget *parent) : QTabWidget(parent) { setObjectName("realtabwidget"); connect(this, SIGNAL(destroyed()), twutil, SLOT(dumpDestroyed())); setTabBar(new TabBar(this)); setTabsClosable(true); tabBar()->setExpanding(true); }
void TabBar::overflowChanged(bool overflowed) { // Make sure close buttons on inactive tabs are hidden // This is needed for when leaving fullscreen from non-overflowed to overflowed state if (overflowed && m_showCloseOnInactive != 1) { setTabsClosable(false); showCloseButton(currentIndex()); } }
DiagramsView::DiagramsView(QWidget *parent) : QTabWidget(parent), m_diagramsManager(0) { setTabsClosable(true); setMovable(true); setDocumentMode(false); connect(this, SIGNAL(currentChanged(int)), this, SLOT(onCurrentChanged(int))); connect(this, SIGNAL(tabCloseRequested(int)), this, SLOT(onTabCloseRequested(int))); }
MdiArea::MdiArea(MainWindow* mw, QWidget *parent) : QMdiArea(parent), mainWin(mw) { #if QT_VERSION >= 0x040800 setTabsClosable(true); #endif useLogo = false; useTexture = false; useColor = false; }
SqlResulTab::SqlResulTab(QWidget *parent) : QTabWidget(parent) { errors=NULL; output=NULL; setMovable(true); setTabsClosable(true); //queryModel=new QSqlQueryModel; connect(this, SIGNAL(tabCloseRequested(int)), this, SLOT(closeRequestedTab(int))); }
TerminalView::TerminalView(QWidget *parent) : QTabWidget(parent) { termId = 1; icon.addFile(QString::fromUtf8(":/images/terminal.png"), QSize(), QIcon::Normal, QIcon::On); setMovable(true); setTabsClosable(true); connect(this, SIGNAL(tabCloseRequested(int)), this, SLOT(closePage(int))); }
TabWidget::TabWidget(QWidget *parent) : QTabWidget(parent) { setDocumentMode(true); setElideMode(Qt::ElideRight); setMovable(true); setTabsClosable(true); setTabShape(QTabWidget::Rounded); setTabPosition(QTabWidget::North); setUsesScrollButtons(true); }
DockableTabWidget::DockableTabWidget( QWidget* parentWidget, QMainWindow* mainWindow ) : QTabWidget( parentWidget ) , m_mainWindow( mainWindow ) { // add the tabs manager setContextMenuPolicy( Qt::CustomContextMenu ); setTabsClosable( true ); setMovable( true ); connect( this, SIGNAL( tabCloseRequested ( int ) ), this, SLOT( closeTab( int ) ) ); connect( this, SIGNAL( customContextMenuRequested( const QPoint& ) ), this, SLOT( showPopupMenu( const QPoint& ) ) ); }
TabBar::TabBar(QWidget *parent) : QTabBar(parent) { setTabsClosable(true); connect(this, SIGNAL(currentChanged(int)), this, SLOT(handleChanged(int))); v_activeIcons = QVector<QIcon>(10); v_normalIcons = QVector<QIcon>(10); v_actions = QVector<QAction*>(10); #ifndef Q_OS_MAC for (int i=0; i<10; i++) { const QString text = i>0? QString::number(i) : "~"; QFont f(font()); f.setPixelSize(10); f.setBold(true); int w = QFontMetrics(f).width(text); QImage numberImageActive(16,16,QImage::Format_ARGB32); numberImageActive.fill(0); QPainter p(&numberImageActive); p.setPen(palette().brush(QPalette::HighlightedText).color()); p.setBrush(palette().brush(QPalette::Highlight)); p.drawRect(2,2,12,12); p.setFont(f); p.drawText(3+(12-w)/2, 12, text); p.end(); QImage numberImage(16,16,QImage::Format_ARGB32); numberImage.fill(0); QPainter pp(&numberImage); pp.setPen(palette().brush(QPalette::WindowText).color()); pp.setBrush(Qt::NoBrush); pp.drawRect(2,2,12,12); pp.setFont(f); pp.drawText(3+(12-w)/2, 12, text); pp.end(); v_normalIcons[i] = QIcon(QPixmap::fromImage(numberImage)); v_activeIcons[i] = v_normalIcons[i]; QAction * toggleView = new QAction(this); if (i==0) { toggleView->setShortcut(QKeySequence("Ctrl+`")); } else { toggleView->setShortcut(QKeySequence(QString("Ctrl+%1").arg(i))); } toggleView->setShortcutContext(Qt::ApplicationShortcut); toggleView->setProperty("tabIndex", i); connect(toggleView, SIGNAL(triggered()), this, SLOT(switchToTab())); addAction(toggleView); v_actions[i] = toggleView; } #endif setIconSize(QSize(16,16)); }
DateTabWidget::DateTabWidget(QWidget *parent) : QTabWidget(parent) { setMinimumSize(QSize(0, 19)); setMaximumSize(QSize(16777215, 19)); setTabPosition(QTabWidget::South); setTabShape(QTabWidget::Triangular); setTabsClosable(true); connect( this, SIGNAL( currentChanged(int) ), this, SLOT( selectPage(int) ) ); connect( this, SIGNAL( tabCloseRequested(int) ), this, SLOT( closePageRequest(int) ) ); }
MdiArea::MdiArea(QWidget *pParent) : QMdiArea(pParent) { mpMainWindow = qobject_cast<MainWindow*>(pParent); setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); setActivationOrder(QMdiArea::ActivationHistoryOrder); setDocumentMode(true); #if QT_VERSION >= 0x040800 setTabsClosable(true); #endif }
TabManager::TabManager(QWidget *parent) : QTabWidget(parent) { clear(); setDocumentMode(true); setMovable(true); setTabsClosable(true); setElideMode(Qt::ElideRight); setTabPosition(QTabWidget::East); tab_count=1; new_file_count=1; }
int QMdiArea::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QAbstractScrollArea::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 14) qt_static_metacall(this, _c, _id, _a); _id -= 14; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QBrush*>(_v) = background(); break; case 1: *reinterpret_cast< WindowOrder*>(_v) = activationOrder(); break; case 2: *reinterpret_cast< ViewMode*>(_v) = viewMode(); break; case 3: *reinterpret_cast< bool*>(_v) = documentMode(); break; case 4: *reinterpret_cast< bool*>(_v) = tabsClosable(); break; case 5: *reinterpret_cast< bool*>(_v) = tabsMovable(); break; case 6: *reinterpret_cast< QTabWidget::TabShape*>(_v) = tabShape(); break; case 7: *reinterpret_cast< QTabWidget::TabPosition*>(_v) = tabPosition(); break; } _id -= 8; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setBackground(*reinterpret_cast< QBrush*>(_v)); break; case 1: setActivationOrder(*reinterpret_cast< WindowOrder*>(_v)); break; case 2: setViewMode(*reinterpret_cast< ViewMode*>(_v)); break; case 3: setDocumentMode(*reinterpret_cast< bool*>(_v)); break; case 4: setTabsClosable(*reinterpret_cast< bool*>(_v)); break; case 5: setTabsMovable(*reinterpret_cast< bool*>(_v)); break; case 6: setTabShape(*reinterpret_cast< QTabWidget::TabShape*>(_v)); break; case 7: setTabPosition(*reinterpret_cast< QTabWidget::TabPosition*>(_v)); break; } _id -= 8; } else if (_c == QMetaObject::ResetProperty) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 8; } #endif // QT_NO_PROPERTIES return _id; }
TabWindow::TabWindow(QWidget *parent) : QTabWidget(parent) { setParent(parent); setTabsClosable(false); setElideMode(Qt::ElideRight); // Get the system colours we need QPalette palette = QApplication::palette("QPushButton"); QColor activebg = palette.color(QPalette::Button); QColor activefg = palette.color(QPalette::ButtonText); QColor inactivebg = palette.color(QPalette::Dark); QColor inactivefg = palette.color(QPalette::ButtonText); QColor border = palette.color(QPalette::Mid); setStyleSheet( "QTabBar::tab { " "background-color: " + inactivebg.name() + "; " "color: " + inactivefg.name() + "; " "border: 1px solid " + border.name() + "; " "padding: 1px 0px; " "margin-left: 0px; " "margin-top: 1px; " #ifndef __APPLE__ "width: 15em; " #ifdef _WIN32 "height: 1.5em; " #else "height: 1em; " #endif #endif "} " "QTabBar::tab:selected { " "background-color: " + activebg.name() + "; " "color: " + activefg.name() + "; " "border-bottom-style: none; " "} " "QTabWidget::pane { " "border: 0; " "} " "QTabWidget::tab-bar {" "alignment: left; " "}" ); #ifdef __APPLE__ m_testTabBar = new TabBar(); setTabBar(m_testTabBar); #endif // Hide the default tab tabBar()->setVisible(false); }