当前位置: 首页>>代码示例>>C++>>正文


C++ TabWidget::appendTab方法代码示例

本文整理汇总了C++中TabWidget::appendTab方法的典型用法代码示例。如果您正苦于以下问题:C++ TabWidget::appendTab方法的具体用法?C++ TabWidget::appendTab怎么用?C++ TabWidget::appendTab使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TabWidget的用法示例。


在下文中一共展示了TabWidget::appendTab方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: stopDragTab

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

示例2: k

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

示例3: getAnchor

void
Gui::appendTabToDefaultViewerPane(PanelWidget* tab,
                                  ScriptObject* obj)
{
    TabWidget* viewerAnchor = getAnchor();

    assert(viewerAnchor);
    viewerAnchor->appendTab(tab, obj);
}
开发者ID:ChristianHeckl,项目名称:Natron,代码行数:9,代码来源:Gui40.cpp

示例4: floatCurrentWidget

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

示例5: floatTab

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

示例6: 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

示例7: l

void
Gui::activateViewerTab(ViewerInstance* viewer)
{
    OpenGLViewerI* viewport = viewer->getUiContext();

    {
        QMutexLocker l(&_imp->_viewerTabsMutex);
        for (std::list<ViewerTab*>::iterator it = _imp->_viewerTabs.begin(); it != _imp->_viewerTabs.end(); ++it) {
            if ( (*it)->getViewer() == viewport ) {
                TabWidget* viewerAnchor = getAnchor();
                assert(viewerAnchor);
                viewerAnchor->appendTab(*it, *it);
                (*it)->show();
            }
        }
    }
    Q_EMIT viewersChanged();
}
开发者ID:ChristianHeckl,项目名称:Natron,代码行数:18,代码来源:Gui40.cpp


注:本文中的TabWidget::appendTab方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。