本文整理汇总了C++中removeTab函数的典型用法代码示例。如果您正苦于以下问题:C++ removeTab函数的具体用法?C++ removeTab怎么用?C++ removeTab使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了removeTab函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: setCurrentChild
//-----------------------------------------------------------------------------
bool CTabView::removeAllTabs ()
{
setCurrentChild (0);
CTabChildView* v = lastChild;
while (v)
{
CTabChildView* next = v->previous;
removeTab (v->view);
v = next;
}
firstChild = 0;
lastChild = 0;
numberOfChilds = 0;
currentTab = -1;
return true;
}
开发者ID:EQ4,项目名称:vstgui,代码行数:17,代码来源:ctabview.cpp
示例17: removeTab
void DockingCont::removeToolbar(tTbData TbData)
{
// remove from list
for (size_t iTb = 0; iTb < _vTbData.size(); iTb++)
{
if (_vTbData[iTb]->hClient == TbData.hClient)
{
// remove tab
removeTab(_vTbData[iTb]);
// free resources
delete _vTbData[iTb];
vector<tTbData*>::iterator itr = _vTbData.begin() + iTb;
_vTbData.erase(itr);
}
}
}
开发者ID:noodle1983,项目名称:Notepad---nd,代码行数:17,代码来源:DockingCont.cpp
示例18: Q_ASSERT_X
bool ExtendedTabWidget::closeWindow(QWidget* wnd)
{
Q_ASSERT_X(wnd,
"bool ExtendedTabWidget::close(int index)",
"Can't get window");
if(wnd->close())
{
emit tabBeforeClose(wnd);
removeTab(indexOf(wnd));
delete wnd;
tabsUpdate();
return true;
}
return false;
}
开发者ID:aur1m,项目名称:kbe,代码行数:17,代码来源:extendedtabwidget.cpp
示例19: QDialog
ViewConfigurationDialog::ViewConfigurationDialog(Project *project, QWidget *parent) :
QDialog(parent),
ui(new Ui::ViewConfigurationDialog),
mProject(project)
{
ui->setupUi(this);
mViewModel = new ViewsModel(mProject);
ui->viewView->setModel( mViewModel );
mTabsModel = 0;
mItemsModel = 0;
mPhrasalGlossesModel = 0;
mView = 0;
mTab = 0;
connect(ui->addView, SIGNAL(clicked()), this, SLOT(addView()) );
connect(ui->removeView, SIGNAL(clicked()), this, SLOT(removeView()) );
connect(ui->addTab, SIGNAL(clicked()), this, SLOT(addTab()) );
connect(ui->removeTab, SIGNAL(clicked()), this, SLOT(removeTab()) );
connect(ui->addItem, SIGNAL(clicked()), this, SLOT(addItem()) );
connect(ui->removeItem, SIGNAL(clicked()), this, SLOT(removeItem()) );
connect(ui->itemView, SIGNAL(activated(QModelIndex)), this, SLOT(editItem(QModelIndex)) );
connect(ui->addPhrasalGloss, SIGNAL(clicked()), this, SLOT(addPhrasalGloss()) );
connect(ui->removePhrasalGloss, SIGNAL(clicked()), this, SLOT(removePhrasalGloss()) );
connect(ui->phrasalGlossView, SIGNAL(activated(QModelIndex)), this, SLOT(editPhrasalGloss(QModelIndex)) );
connect(ui->viewView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(viewChanged(QItemSelection,QItemSelection)));
connect(ui->itemWritingSystemsCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(indexLanguageChanged(int)));
connect(ui->viewUp, SIGNAL(clicked()), this, SLOT(viewUp()));
connect(ui->viewDown, SIGNAL(clicked()), this, SLOT(viewDown()));
connect(ui->tabUp, SIGNAL(clicked()), this, SLOT(tabUp()));
connect(ui->tabDown, SIGNAL(clicked()), this, SLOT(tabDown()));
connect(ui->itemUp, SIGNAL(clicked()), this, SLOT(itemUp()));
connect(ui->itemDown, SIGNAL(clicked()), this, SLOT(itemDown()));
connect(ui->phrasalGlossUp, SIGNAL(clicked()), this, SLOT(phrasalGlossUp()));
connect(ui->phrasalGlossDown, SIGNAL(clicked()), this, SLOT(phrasalGlossDown()));
setTabWidgetsEnabled(false);
setItemWidgetsEnabled(false);
}
开发者ID:adamb924,项目名称:Gloss,代码行数:46,代码来源:viewconfigurationdialog.cpp
示例20: qDebug
void DeclarativeTabModel::closeActiveTab()
{
if (m_activeTab.isValid()) {
#ifdef DEBUG_LOGS
qDebug() << &m_activeTab;
#endif
// Clear active tab data and try to active a tab from the first model index.
int activeTabId = m_activeTab.tabId();
// Invalidate
m_activeTab.setTabId(0);
removeTab(activeTabId, m_activeTab.thumbnailPath());
if (!activateTab(0)) {
// Last active tab got closed.
emit activeTabChanged(activeTabId, 0);
}
}
}
开发者ID:Amit-Tomar,项目名称:sailfish-browser,代码行数:17,代码来源:declarativetabmodel.cpp
注:本文中的removeTab函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论