本文整理汇总了C++中TabWidget类的典型用法代码示例。如果您正苦于以下问题:C++ TabWidget类的具体用法?C++ TabWidget怎么用?C++ TabWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TabWidget类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: moveTab
void TabWidget::moveTab(QWidget* what,TabWidget *where){
TabWidget* from = dynamic_cast<TabWidget*>(what->parentWidget());
if(!from){
return;
}
if(from == where){
/*We check that even if it is the same TabWidget, it really exists.*/
bool found = false;
for (int i =0; i < from->count(); ++i) {
if (what == from->tabAt(i)) {
found = true;
break;
}
}
if (found) {
return;
}
//it wasn't found somehow
}
from->removeTab(what);
assert(where);
where->appendTab(what);
what->setParent(where);
where->getGui()->getApp()->triggerAutoSave();
}
开发者ID:ndeebook,项目名称:Natron,代码行数:27,代码来源:TabWidget.cpp
示例2: synced
/*!
* Обработка успешной синхронизации настроек с сервером.
*
* Открываются и закрепляются все ранее закреплённые разговоры.
*/
void StateCache::synced()
{
m_tabs = m_settings->value(m_key).toStringList();
const int policy = ChatClient::channels()->policy();
if (policy & ServerFeed::MainChannelPolicy && m_tabs.isEmpty() && m_settings->value(SETTINGS_AUTO_JOIN).toBool())
m_tabs.append(SimpleID::encode(ChatClient::channels()->mainId()));
TabWidget *tabs = TabWidget::i();
if (!tabs)
return;
foreach (const QString &text, m_tabs) {
const QByteArray id = decode(text);
if (Channel::isCompatibleId(id))
join(id);
}
if (!m_tabs.isEmpty() && restoreLastTalk())
return;
if (policy & ServerFeed::ForcedJoinPolicy)
return;
if (!tabs->channelsCount())
tabs->tab("list");
tabs->closePage("progress");
tabs->closePage("welcome");
}
开发者ID:Artanomell,项目名称:schat,代码行数:35,代码来源:StateCache.cpp
示例3: if
WebView *TabWidget::webView(int index) const
{
QWidget *widget = this->widget(index);
if (WebViewWithSearch *webViewWithSearch = qobject_cast<WebViewWithSearch*>(widget)) {
return webViewWithSearch->m_webView;
} else if (widget) {
// optimization to delay creating the first webview
if (count() == 1) {
TabWidget *that = const_cast<TabWidget*>(this);
that->setUpdatesEnabled(false);
LocationBar *currentLocationBar = qobject_cast<LocationBar*>(m_locationBars->widget(0));
bool giveBackFocus = currentLocationBar->hasFocus();
m_locationBars->removeWidget(currentLocationBar);
m_locationBars->addWidget(new QWidget());
that->newTab();
that->closeTab(0);
QWidget *newEmptyLineEdit = m_locationBars->widget(0);
m_locationBars->removeWidget(newEmptyLineEdit);
newEmptyLineEdit->deleteLater();
m_locationBars->addWidget(currentLocationBar);
currentLocationBar->setWebView(currentWebView());
if (giveBackFocus)
currentLocationBar->setFocus();
that->setUpdatesEnabled(true);
that->m_swappedDelayedWidget = true;
return currentWebView();
}
}
return 0;
}
开发者ID:8jack,项目名称:arora,代码行数:30,代码来源:tabwidget.cpp
示例4:
void
GuiPrivate::notifyGuiClosing()
{
///This is to workaround an issue that when destroying a widget it calls the focusOut() handler hence can
///cause bad pointer dereference to the Gui object since we're destroying it.
std::list<TabWidgetI*> tabs = _gui->getApp()->getTabWidgetsSerialization();
for (std::list<TabWidgetI*>::iterator it = tabs.begin(); it != tabs.end(); ++it) {
TabWidget* tab = dynamic_cast<TabWidget*>(*it);
if (!tab) {
continue;
}
tab->discardGuiPointer();
for (int i = 0; i < tab->count(); ++i) {
tab->tabAt(i)->notifyGuiClosingPublic();
}
}
const NodesGuiList allNodes = _nodeGraphArea->getAllActiveNodes();
// we do not need this list anymore, avoid using it
_gui->getApp()->clearSettingsPanels();
for (NodesGuiList::const_iterator it = allNodes.begin(); it != allNodes.end(); ++it) {
DockablePanel* panel = (*it)->getSettingPanel();
if (panel) {
panel->onGuiClosing();
}
}
_lastFocusedGraph = 0;
}
开发者ID:kcotugno,项目名称:Natron,代码行数:34,代码来源:GuiPrivate.cpp
示例5: assert
void
Gui::createGroupGui(const NodePtr & group,
CreateNodeReason reason)
{
boost::shared_ptr<NodeGroup> isGrp = boost::dynamic_pointer_cast<NodeGroup>( group->getEffectInstance()->shared_from_this() );
assert(isGrp);
boost::shared_ptr<NodeCollection> collection = boost::dynamic_pointer_cast<NodeCollection>(isGrp);
assert(collection);
TabWidget* where = 0;
if (_imp->_lastFocusedGraph) {
TabWidget* isTab = dynamic_cast<TabWidget*>( _imp->_lastFocusedGraph->parentWidget() );
if (isTab) {
where = isTab;
} else {
QMutexLocker k(&_imp->_panesMutex);
assert( !_imp->_panes.empty() );
where = _imp->_panes.front();
}
}
QGraphicsScene* scene = new QGraphicsScene(this);
scene->setItemIndexMethod(QGraphicsScene::NoIndex);
NodeGraph* nodeGraph = new NodeGraph(this, collection, scene, this);
nodeGraph->setObjectName( QString::fromUtf8(group->getLabel().c_str()) );
_imp->_groups.push_back(nodeGraph);
if ( where && reason == eCreateNodeReasonUserCreate && !getApp()->isCreatingPythonGroup() ) {
where->appendTab(nodeGraph, nodeGraph);
QTimer::singleShot( 25, nodeGraph, SLOT(centerOnAllNodes()) );
} else {
nodeGraph->setVisible(false);
}
}
开发者ID:JamesLinus,项目名称:Natron,代码行数:34,代码来源:Gui05.cpp
示例6: assert
TabWidget*
GuiPrivate::getOnly1NonFloatingPane(int & count) const
{
count = 0;
std::list<TabWidgetI*> tabs = _gui->getApp()->getTabWidgetsSerialization();
if ( tabs.empty() ) {
return NULL;
}
TabWidget* firstNonFloating = 0;
for (std::list<TabWidgetI*>::const_iterator it = tabs.begin(); it != tabs.end(); ++it) {
TabWidget* isWidget = dynamic_cast<TabWidget*>(*it);
assert(isWidget);
if (!isWidget) {
continue;
}
if ( !isWidget->isFloatingWindowChild() ) {
if (!firstNonFloating) {
firstNonFloating = isWidget;
}
++count;
}
}
///there should always be at least 1 non floating window
assert(firstNonFloating);
return firstNonFloating;
}
开发者ID:kcotugno,项目名称:Natron,代码行数:27,代码来源:GuiPrivate.cpp
示例7: k
void
Gui::ensureScriptEditorVisible()
{
// Ensure that the script editor is visible
TabWidget* pane = _imp->_scriptEditor->getParentPane();
if (pane != 0) {
pane->setCurrentWidget(_imp->_scriptEditor);
} else {
pane = _imp->_nodeGraphArea->getParentPane();
if (!pane) {
std::list<TabWidget*> tabs;
{
QMutexLocker k(&_imp->_panesMutex);
tabs = _imp->_panes;
}
if ( tabs.empty() ) {
return;
}
pane = tabs.front();
}
assert(pane);
pane->moveScriptEditorHere();
}
}
开发者ID:ChristianHeckl,项目名称:Natron,代码行数:25,代码来源:Gui40.cpp
示例8: closeFloatingPane
void TabWidget::stopDragTab(const QPoint& globalPos) {
if (_isFloating && count() == 0) {
closeFloatingPane();
}
QWidget* draggedPanel = _gui->stopDragPanel();
const std::list<TabWidget*> panes = _gui->getPanes();
bool foundTabWidgetUnderneath = false;
for (std::list<TabWidget*>::const_iterator it = panes.begin(); it!=panes.end(); ++it) {
if ((*it)->isWithinWidget(globalPos)) {
(*it)->appendTab(draggedPanel);
foundTabWidgetUnderneath = true;
break;
}
}
if (!foundTabWidgetUnderneath) {
///if we reach here that means the mouse is not over any tab widget, then float the panel
TabWidget* newTab = new TabWidget(_gui,TabWidget::CLOSABLE);
newTab->appendTab(draggedPanel);
QPoint windowPos = globalPos;
newTab->floatPane(&windowPos);
}
}
开发者ID:ndeebook,项目名称:Natron,代码行数:28,代码来源:TabWidget.cpp
示例9: closed
void FloatingWidget::closeEvent(QCloseEvent* e) {
emit closed();
TabWidget* w = dynamic_cast<TabWidget*>(_embeddedWidget);
if (w) {
w->closePane();
}
QWidget::closeEvent(e);
}
开发者ID:bonalex01,项目名称:Natron,代码行数:8,代码来源:TabWidget.cpp
示例10: closeEvent
void FloatingWidget::closeEvent(QCloseEvent* e) {
TabWidget* embedded = dynamic_cast<TabWidget*>(_embeddedWidget);
emit closed();
if (embedded) {
embedded->destroyTabs();
}
QWidget::closeEvent(e);
}
开发者ID:ndeebook,项目名称:Natron,代码行数:8,代码来源:TabWidget.cpp
示例11: getParentPane
void
PanelWidget::leaveEventBase()
{
TabWidget* parentPane = getParentPane();
if (parentPane) {
parentPane->setWidgetMouseOverFocus(this, false);
}
}
开发者ID:ebrayton,项目名称:Natron,代码行数:9,代码来源:PanelWidget.cpp
示例12: setLabel
void
PyPanel::setPanelLabel(const QString& label)
{
setLabel( label.toStdString() );
TabWidget* parent = dynamic_cast<TabWidget*>( parentWidget() );
if (parent) {
parent->setTabLabel(this, label);
}
}
开发者ID:azerupi,项目名称:Natron,代码行数:9,代码来源:PythonPanels.cpp
示例13: removeTab
void TabWidget::floatCurrentWidget(){
if(!_currentWidget)
return;
QWidget* w = _currentWidget;
removeTab(w);
TabWidget* newTab = new TabWidget(_gui,TabWidget::CLOSABLE);
newTab->appendTab(w);
newTab->floatTab(w);
}
开发者ID:ndeebook,项目名称:Natron,代码行数:9,代码来源:TabWidget.cpp
示例14: getAnchor
void
Gui::appendTabToDefaultViewerPane(PanelWidget* tab,
ScriptObject* obj)
{
TabWidget* viewerAnchor = getAnchor();
assert(viewerAnchor);
viewerAnchor->appendTab(tab, obj);
}
开发者ID:ChristianHeckl,项目名称:Natron,代码行数:9,代码来源:Gui40.cpp
示例15: getTabWidgetWithTab
void WorkTabMgr::addChildTab(ChildTab *child, const QString &name, quint32 workTabId)
{
TabWidget *tabW = getTabWidgetWithTab(workTabId);
if(!tabW)
return;
child->setParentId(workTabId);
tabW->addChildTab(child, name);
m_children[workTabId].insert(child);
}
开发者ID:Tasssadar,项目名称:Lorris,代码行数:10,代码来源:WorkTabMgr.cpp
示例16: start
void StateCache::start()
{
TabWidget *tabs = TabWidget::i();
if (tabs) {
connect(tabs, SIGNAL(pinned(AbstractTab*)), SLOT(pinned(AbstractTab*)));
connect(tabs, SIGNAL(unpinned(AbstractTab*)), SLOT(unpinned(AbstractTab*)));
connect(tabs, SIGNAL(currentChanged(int)), SLOT(tabIndexChanged(int)));
connect(tabs->tabBar(), SIGNAL(tabMoved(int,int)), SLOT(save()));
}
}
开发者ID:Artanomell,项目名称:schat,代码行数:10,代码来源:StateCache.cpp
示例17: main
int main(int argc, char *argv[])
{
Application app(argc, argv);
app.setOrganizationName("XTab");
app.setApplicationName("XTab");
app.setOrganizationDomain("https://github.com/Andersbakken/xtab");
app.setWindowIcon(QIcon(":/terminal.png"));
TabWidget window;
window.show();
return app.exec();
}
开发者ID:Andersbakken,项目名称:xtab,代码行数:11,代码来源:main.cpp
示例18: TabWidget
void TabWidget::floatTab(QWidget* tab) {
std::vector<QWidget*>::iterator it = std::find(_tabs.begin(),_tabs.end(),tab);
if (it != _tabs.end()) {
TabWidget* newTab = new TabWidget(_gui,TabWidget::CLOSABLE);
removeTab(*it);
newTab->appendTab(*it);
newTab->floatPane();
if(_tabBar->count() == 0){
_floatButton->setEnabled(false);
}
}
}
开发者ID:ndeebook,项目名称:Natron,代码行数:12,代码来源:TabWidget.cpp
示例19: loadHistoryItemInNewTab
void NavigationBar::loadHistoryItemInNewTab(const QWebHistoryItem &item)
{
TabWidget* tabWidget = m_window->tabWidget();
int tabIndex = tabWidget->duplicateTab(tabWidget->currentIndex());
QWebHistory* history = m_window->weView(tabIndex)->page()->history();
history->goToItem(item);
if (qzSettings->newTabPosition == Qz::NT_SelectedTab) {
tabWidget->setCurrentIndex(tabIndex);
}
}
开发者ID:AlexTalker,项目名称:qupzilla,代码行数:13,代码来源:navigationbar.cpp
示例20: toNodeGroup
void
Gui::createGroupGui(const NodePtr & group,
const CreateNodeArgs& args)
{
NodeGroupPtr isGrp = toNodeGroup( group->getEffectInstance()->shared_from_this() );
assert(isGrp);
NodeCollectionPtr collection = boost::dynamic_pointer_cast<NodeCollection>(isGrp);
assert(collection);
TabWidget* where = 0;
if (_imp->_lastFocusedGraph) {
TabWidget* isTab = dynamic_cast<TabWidget*>( _imp->_lastFocusedGraph->parentWidget() );
if (isTab) {
where = isTab;
} else {
std::list<TabWidgetI*> panes = getApp()->getTabWidgetsSerialization();
assert( !panes.empty() );
where = dynamic_cast<TabWidget*>(panes.front());
}
}
QGraphicsScene* scene = new QGraphicsScene(this);
scene->setItemIndexMethod(QGraphicsScene::NoIndex);
std::string newName = isGrp->getNode()->getFullyQualifiedName();
for (std::size_t i = 0; i < newName.size(); ++i) {
if (newName[i] == '.') {
newName[i] = '_';
}
}
newName += "_NodeGraph";
std::string label = tr(" Node Graph").toStdString();
NodeGraph::makeFullyQualifiedLabel(group, &label);
NodeGraph* nodeGraph = new NodeGraph(this, collection, newName, scene, this);
nodeGraph->setLabel(label);
nodeGraph->setObjectName( QString::fromUtf8( group->getLabel().c_str() ) );
_imp->_groups.push_back(nodeGraph);
SERIALIZATION_NAMESPACE::NodeSerializationPtr serialization = args.getPropertyUnsafe<SERIALIZATION_NAMESPACE::NodeSerializationPtr>(kCreateNodeArgsPropNodeSerialization);
bool showSubGraph = args.getPropertyUnsafe<bool>(kCreateNodeArgsPropSubGraphOpened);
if ( showSubGraph && where && !serialization ) {
where->appendTab(nodeGraph, nodeGraph);
QTimer::singleShot( 25, nodeGraph, SLOT(centerOnAllNodes()) );
} else {
nodeGraph->setVisible(false);
}
}
开发者ID:ebrayton,项目名称:Natron,代码行数:51,代码来源:Gui05.cpp
注:本文中的TabWidget类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论