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


C++ removeTab函数代码示例

本文整理汇总了C++中removeTab函数的典型用法代码示例。如果您正苦于以下问题:C++ removeTab函数的具体用法?C++ removeTab怎么用?C++ removeTab使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: assert

void TabView::close(int index)
{
    assert(index >= 0 && index < count());

    if (index < 0 || index >= count())
        return;

    if (auto pTab = qobject_cast<Tab*>(widget(index))) {
        removeTab(index);
        pTab->deleteLater();
    }

    emit countChanged(count());
}
开发者ID:henrikfroehling,项目名称:snipit-deprecated,代码行数:14,代码来源:tabview.cpp

示例2: get_editor

/**
 * @brief Closes the editor at the specified index without confirmation.
 * @param index An editor index.
 */
void EditorTabs::remove_editor(int index) {

  Editor* editor = get_editor(index);
  QString path = editor->get_file_path();

  undo_group->removeStack(&editor->get_undo_stack());

  // Tell the quest that this file is now closed.
  editor->get_quest().set_path_open(path, false);

  editors.remove(path);
  removeTab(index);

}
开发者ID:Plague78,项目名称:solarus-quest-editor,代码行数:18,代码来源:editor_tabs.cpp

示例3: saveWorkSheet

void Workspace::removeWorkSheet()
{
  WorkSheet *current = (WorkSheet*)currentWidget();

  if ( current ) {
    saveWorkSheet( current );

    removeTab(indexOf( current ));
    mSheetList.removeAll( current );
  } else {
    QString msg = i18n( "There are no tabs that could be deleted." );
    KMessageBox::error( this, msg );
  }
}
开发者ID:fluxer,项目名称:kde-workspace,代码行数:14,代码来源:Workspace.cpp

示例4: removeTab

    void TabbedArea::death(const Event& event)
    {
        Widget* source = event.getSource();
        Tab* tab = dynamic_cast<Tab*>(source);

        if (tab != NULL)
        {
            removeTab(tab);
        }
        else
        {
            BasicContainer::death(event);
        }
    }
开发者ID:olofn,项目名称:db_public,代码行数:14,代码来源:tabbedarea.cpp

示例5: qMin

bool TabWidget::swapTabs(int index1, int index2)
{
    if (index1==index2)
        return false;
    int t1 = qMin(index1,index2);
    int t2 = qMax(index1,index2);

    index1=t1;
    index2=t2;

    QString name1 = tabBar()->tabText(index1);
    QString name2 = tabBar()->tabText(index2);

    QWidget *editor1 = widget(index1);
    QWidget *editor2 = widget(index2);

    removeTab(index2);
    removeTab(index1);

    insertTab(index1,editor2,name2);
    insertTab(index2,editor1,name1);
    return true;
}
开发者ID:heiheshang,项目名称:ananas-labs-qt4,代码行数:23,代码来源:tabwidget.cpp

示例6: IF_FAILED_RET

//----------------------------------------------------------------------------
//
HRESULT CAnchoAddonService::removeTabs(LPDISPATCH aTabs, LPDISPATCH aCallback)
{
  VariantVector tabs;

  IF_FAILED_RET(addJSArrayToVariantVector(aTabs, tabs));
  for(VariantVector::iterator it = tabs.begin(); it != tabs.end(); ++it) {
    if( it->vt == VT_I4 ) {
      removeTab(it->intVal, aCallback);
    } else {
      ATLTRACE(L"Problem with specified tabId - not an integer\n");
    }
  }
  return S_OK;
}
开发者ID:yuriMalakhov,项目名称:ancho,代码行数:16,代码来源:AnchoAddonService.cpp

示例7: removeTab

TabButton * TabBar::addTab( QWidget * _w, const QString & _text, int _id,
				bool _add_stretch, bool _text_is_tooltip )
{
	// already tab with id?
	if( m_tabs.contains( _id ) )
	{
		// then remove it
		removeTab( _id );
	}
	QString caption = ( _text_is_tooltip ) ? QString( "" ) : _text;
	// create tab-button
	TabButton * b = new TabButton( caption, _id, this );
	connect( b, SIGNAL( clicked( int ) ), this, SLOT( tabClicked( int ) ) );
	b->setIconSize( QSize( 48, 48 ) );
	b->setFixedSize( 64, 64 );
	b->show();
	if( _text_is_tooltip )
	{
		ToolTip::add( b, _text );
	}

	// small workaround, because QBoxLayout::addWidget(...) doesn't
	// work properly, so we first have to remove all tabs from the
	// layout and them add them in the correct order
	QMap<int, QPair<TabButton *, QWidget *> >::iterator it;
	for( it = m_tabs.begin(); it != m_tabs.end(); ++it )
	{
		m_layout->removeWidget( it.value().first );
	}
	m_tabs.insert( _id, qMakePair( b, _w ) );
	for( it = m_tabs.begin(); it != m_tabs.end(); ++it )
	{
		m_layout->addWidget( it.value().first );
	}

	if( _add_stretch )
	{
		m_layout->addStretch();
	}


	// we assume, parent-widget is a widget acting as widget-stack so all
	// widgets have the same size and only the one on the top is visible
	_w->setFixedSize( _w->parentWidget()->size() );

	b->setFont( pointSize<8>( b->font() ) );

	return( b );
}
开发者ID:DanielAeolusLaude,项目名称:lmms,代码行数:49,代码来源:TabBar.cpp

示例8: insertTab

void TabWidget::showSubownerTab( bool b )
{
    if ( b && !mSubVisible )
    {
        insertTab( 1, mSubownerTab, QIcon( ":/icons/conf/targets.png" ), "Subowned SRs" );
        mSubVisible = true;
    }
    else if ( !b && mSubVisible )
    {
        removeTab( indexOf( mSubownerTab ) );
        mSubVisible = false;
    }

    rebuildMaps();
}
开发者ID:bochi,项目名称:kueue,代码行数:15,代码来源:tabwidget.cpp

示例9: tabAboutToRemove

bool TaskbarPreviews::WasTabRemoved(HWND hwnd)
{
	QWidget *internal = m_tabs.internal(hwnd);
	if (internal) {
		QWidget *owner = m_tabs.owner(hwnd);
		bool ignore = false;
		emit tabAboutToRemove(m_tabs.user(hwnd), &ignore);
		if (!ignore) {
			SetNoTabActive((HWND)owner->winId());
			removeTab(m_tabs.user(hwnd));
		}
		return true;
	} else
		return false;
}
开发者ID:CyberSys,项目名称:qutim,代码行数:15,代码来源:TaskbarPreviews.cpp

示例10: widget

void TabWidget::removeTextEdit(QString title)
{
	for(int i = 0; i < count(); i++)
	{
		if(title.compare(tabText(i)) == 0)
		{
			QWidget *tabwidget = widget(i);
			if(tabwidget)
			{
				removeTab(i);
				delete tabwidget;
			}
		}
	}
}
开发者ID:swaechter,项目名称:project-collection,代码行数:15,代码来源:TabWidget.cpp

示例11: removeTab

void CChartTable::slotCloseTab( int _iTabIndex )
{
  QMutex* __pqMutexDataChange = QVCTRuntime::useMutexDataChange();
  __pqMutexDataChange->lock();
  CChart* __poChart = (CChart*)widget( _iTabIndex );
  removeTab( _iTabIndex );
  delete __poChart;
  if( QTabWidget::currentIndex() < 0 )
  {
    oGeoPositionReference = CDataPosition::UNDEFINED;
    fdScaleReference = -1.0;
  }
  __pqMutexDataChange->unlock();
  bProjectModified = true;
}
开发者ID:cedric-dufour,项目名称:qvct,代码行数:15,代码来源:CChartTable.cpp

示例12: QModelIndex

//! [3]
void AddressWidget::addEntry(QString name, QString address)
{
    if (!table->getContacts().contains({ name, address })) {
        table->insertRows(0, 1, QModelIndex());

        QModelIndex index = table->index(0, 0, QModelIndex());
        table->setData(index, name, Qt::EditRole);
        index = table->index(0, 1, QModelIndex());
        table->setData(index, address, Qt::EditRole);
        removeTab(indexOf(newAddressTab));
    } else {
        QMessageBox::information(this, tr("Duplicate Name"),
            tr("The name \"%1\" already exists.").arg(name));
    }
}
开发者ID:RSATom,项目名称:Qt,代码行数:16,代码来源:addresswidget.cpp

示例13: beginResetModel

void DeclarativeTabModel::clear()
{
    if (count() == 0)
        return;

    beginResetModel();
    for (int i = m_tabs.count() - 1; i >= 0; --i) {
        removeTab(m_tabs.at(i), i);
    }
    emit countChanged();
    closeActiveTab();
    endResetModel();
    // No need guard anything as all tabs got closed.
    m_activeTabClosed = false;
}
开发者ID:siteshwar,项目名称:sailfish-browser,代码行数:15,代码来源:declarativetabmodel.cpp

示例14: Q_ASSERT

/*!
   \brief TabWidget::closeTab
   \param index
 */
void TabWidget::closeTab(int index)
{
    Q_ASSERT(index < count());

    if(index < 0) {
        index = currentIndex();
    }

    QWidget *widget = this->widget(index);
    if(widget && widget->close()) {
        removeTab(index);
        widget->deleteLater();
    }

    emit tabClosed(index);
}
开发者ID:PTGF,项目名称:PTGF,代码行数:20,代码来源:TabWidget.cpp

示例15: removeTab

GUI::Widget::TabManager::TabContainerPtrType GUI::Widget::TabManager::addTab(const TabKeyType& key, TabContainerPtrType container) {
	removeTab(key);

	if (!container) {
		//Create container if one was not given.
		container.reset(new GUI::Widget::Container());
	}

	tabs[key] = container;

	if (tabs.size() == 1) {
		selectedTabKey = tabs.begin()->first;
	}

	return container;
}
开发者ID:projectskillz,项目名称:PutkaRTS,代码行数:16,代码来源:TabManager.cpp


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