本文整理汇总了C++中removeWidget函数的典型用法代码示例。如果您正苦于以下问题:C++ removeWidget函数的具体用法?C++ removeWidget怎么用?C++ removeWidget使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了removeWidget函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: error
void RemapDialog::reflowLayout() {
Dialog::reflowLayout();
int buttonHeight = g_gui.xmlEval()->getVar("Globals.Button.Height", 0);
int scrollbarWidth = g_gui.xmlEval()->getVar("Globals.Scrollbar.Width", 0);
int16 areaX, areaY;
uint16 areaW, areaH;
int spacing = g_gui.xmlEval()->getVar("Globals.KeyMapper.Spacing");
int labelWidth = g_gui.xmlEval()->getVar("Globals.KeyMapper.LabelWidth");
int buttonWidth = g_gui.xmlEval()->getVar("Globals.KeyMapper.ButtonWidth");
int colWidth = labelWidth + buttonWidth + spacing;
g_gui.xmlEval()->getWidgetData((const String&)String("KeyMapper.KeymapArea"), areaX, areaY, areaW, areaH);
_colCount = (areaW - scrollbarWidth) / colWidth;
_rowCount = (areaH + spacing) / (buttonHeight + spacing);
if (_colCount <= 0 || _rowCount <= 0)
error("Remap dialog too small to display any keymaps");
_scrollBar->resize(areaX + areaW - scrollbarWidth, areaY, scrollbarWidth, areaH);
_scrollBar->_entriesPerPage = _rowCount;
_scrollBar->_numEntries = 1;
_scrollBar->recalc();
uint textYOff = (buttonHeight - kLineHeight) / 2;
uint oldSize = _keymapWidgets.size();
uint newSize = _rowCount * _colCount;
_keymapWidgets.reserve(newSize);
for (uint i = 0; i < newSize; i++) {
ActionWidgets widg;
if (i >= _keymapWidgets.size()) {
widg.actionText =
new GUI::StaticTextWidget(this, 0, 0, 0, 0, "", Graphics::kTextAlignRight);
widg.keyButton =
new GUI::ButtonWidget(this, 0, 0, 0, 0, "", 0, kRemapCmd + i);
_keymapWidgets.push_back(widg);
} else {
widg = _keymapWidgets[i];
}
uint x = areaX + (i % _colCount) * colWidth;
uint y = areaY + (i / _colCount) * (buttonHeight + spacing);
widg.actionText->resize(x, y + textYOff, labelWidth, kLineHeight);
widg.keyButton->resize(x + labelWidth, y, buttonWidth, buttonHeight);
}
while (oldSize > newSize) {
ActionWidgets widg = _keymapWidgets.remove_at(--oldSize);
removeWidget(widg.actionText);
delete widg.actionText;
removeWidget(widg.keyButton);
delete widg.keyButton;
}
}
开发者ID:St0rmcrow,项目名称:scummvm,代码行数:60,代码来源:remap-dialog.cpp
示例2: switch
void CellmlAnnotationViewMetadataViewDetailsWidget::updateGui(iface::cellml_api::CellMLElement *pElement)
{
if (pElement == nullptr) {
return;
}
// Decide on which view to use and update it, if needed
switch (mCellmlFile->rdfTriples(pElement).type()) {
case CellMLSupport::CellmlFileRdfTriple::Type::Unknown:
removeWidget(mNormalView);
addWidget(mRawView);
mRawView->updateGui(pElement);
break;
case CellMLSupport::CellmlFileRdfTriple::Type::BioModelsDotNetQualifier:
case CellMLSupport::CellmlFileRdfTriple::Type::Empty:
removeWidget(mRawView);
addWidget(mNormalView);
mNormalView->updateGui(pElement);
break;
}
}
开发者ID:dbrnz,项目名称:opencor,代码行数:26,代码来源:cellmlannotationviewmetadataviewdetailswidget.cpp
示例3: removeWidget
void kClipHolder::removeSubView(){
if(subView) {
view->addDelete(subView);
removeWidget(subView);
subView.reset();
}
}
开发者ID:furenku,项目名称:kinho,代码行数:7,代码来源:guiVideoObjects.cpp
示例4: removeWidget
void WalletStack::removeAllWallets()
{
QMap<QString, WalletView*>::const_iterator i;
for (i = mapWalletViews.constBegin(); i != mapWalletViews.constEnd(); ++i)
removeWidget(i.value());
mapWalletViews.clear();
}
开发者ID:BlakeBitcoin,项目名称:BlakeBitcoin,代码行数:7,代码来源:walletstack.cpp
示例5: removeWidget
bool SdlManager::removeWidget(WidgetReference widget)
{
for(int layer = 0; layer < WL_COUNT; layer++)
if(removeWidget(widget, layer))
return true;
return false;
}
开发者ID:barrett1733,项目名称:CSCI152-Spring-14-God-Game,代码行数:7,代码来源:sdl-manager.cpp
示例6: removeWidget
void WContainerWidget::removeFromLayout(WWidget *widget)
{
#ifndef WT_NO_LAYOUT
if (layout_)
removeWidget(widget);
#endif // WT_NO_LAYOUT
}
开发者ID:StevenFarley,项目名称:wt,代码行数:7,代码来源:WContainerWidget.C
示例7: QTodoChangeDelete
void QTodoList::removeTodo(QTodoItem* item)
{
QTUM::get()->addChange(new QTodoChangeDelete(this,findWidget(item),new QTodoItem(*item)));
removeWidget(item);
delete item;
setModified();
}
开发者ID:tobimensch,项目名称:qtodo,代码行数:7,代码来源:qtodo_list.cpp
示例8: PTRACE
void PluginFactory::unload( const PluginInfoPair& pair )
{
PTRACE( 6, "PluginFactory::unload" );
PluginInfo *pluginInfo = pair.first;
if( !pluginInfo ) return;
int id = pluginInfo->id;
onStartupMap[id] = NotLoad;
if( !loaded(pair) ) return;
//do not unload the plugin if P_CAN_UNLOAD flag is not set and
//forceUnload is false
if( !(pluginInfo->flags & P_CAN_UNLOAD) && !d->forceUnload ) {
PTRACE(3, "Plugin " << pluginInfo->name << " can't be unloaded.");
return;
}
PTRACE(6, "Unloading plugin " << pluginInfo->name );
if( pluginInfo->flags & P_HAS_GUI ) {
emit removeWidget( insertedWidgets[id] );
insertedWidgets.remove(id);
}
destroyPlugin(pair);
}
开发者ID:nightfly19,项目名称:renyang-learn,代码行数:27,代码来源:pluginfactory.cpp
示例9: widget
void PagesWidget::removePage(const QString& userId)
{
ChatPageWidget* chatPage = widget(userId);
removeWidget(chatPage);
delete chatPage;
qDebug() << "page" << userId << "removed" << count();
}
开发者ID:hexwaffle,项目名称:ProjectTox-Qt-GUI,代码行数:7,代码来源:pageswidget.cpp
示例10: removeWidget
void DMainWindow::removeAll()
{
for (QValueList<QWidget*>::iterator it = m_widgets.begin(); it != m_widgets.end(); ++it)
{
removeWidget(*it);
}
}
开发者ID:BackupTheBerlios,项目名称:kludoteca-svn,代码行数:7,代码来源:dmainwindow.cpp
示例11: QFrame
CustomToolbarCreator::CustomToolbarCreator(QWidget* parent,
QMap<QString, QAction*>& action_map)
: QFrame(parent)
, ui(new Ui::CustomToolbarCreator)
, a_map(action_map)
{
ui->setupUi(this);
ui->chosen_actions->setDragDropMode(QAbstractItemView::InternalMove);
ui->offered_actions->setSortingEnabled(true);
ui->offered_actions->fromActionMap(a_map);
connect(ui->add_button, SIGNAL(released()), this, SLOT(addChosenAction()));
connect(ui->remove_button, SIGNAL(released()), this, SLOT(removeChosenAction()));
connect(ui->offered_actions, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
this, SLOT(addChosenAction(QListWidgetItem*)));
connect(ui->chosen_actions, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
this, SLOT(removeChosenAction(QListWidgetItem*)));
connect(ui->add_widget_button, SIGNAL(released()), this, SLOT(addWidget()));
connect(ui->remove_widget_button, SIGNAL(released()), this, SLOT(removeWidget()));
connect(ui->combo, SIGNAL(activated(QString)), this, SLOT(setLists(QString)));
connect(ui->save_button, SIGNAL(released()), parent, SLOT(accept()));
}
开发者ID:DINKIN,项目名称:LibreCAD,代码行数:29,代码来源:customtoolbarcreator.cpp
示例12: widget
void PagesWidget::removePage(int friendId)
{
ChatPageWidget* chatPage = widget(friendId);
removeWidget(chatPage);
delete chatPage;
qDebug() << "page" << friendId << "removed" << count();
}
开发者ID:chriskonstad,项目名称:ProjectTox-Qt-GUI,代码行数:7,代码来源:pageswidget.cpp
示例13: height
void DnDWidget::moveVerticalToNewPos(const QPoint &pos)
{
int dest = pos.y();
int y = oldPos.y();
int sign = (dest > y)?1:-1;
int h = height();
auto vl = qobject_cast<QVBoxLayout*>(getParentLayout());
if (vl)
{
if (std::abs(dest - y ) > h)
{
int index = vl->indexOf(this);
while (true)
{
if (y >= dest && y <= dest + h)
break;
index += sign;
y += sign * h;
if (index < 0 || index >= vl->count())
break;
vl->removeWidget(this);
vl->insertWidget(index , this);
}
}
vl->update();
}
}
开发者ID:alexzk1,项目名称:qtcampp,代码行数:31,代码来源:dndwidget.cpp
示例14: removeWidget
Decorator::~Decorator()
{
if (container) {
removeWidget(container);
delete container;
}
}
开发者ID:mustafagonul,项目名称:dnw,代码行数:7,代码来源:decorator.cpp
示例15: removeWidget
void MainMenuDialog::reflowLayout() {
if (_engine->hasFeature(Engine::kSupportsLoadingDuringRuntime))
_loadButton->setEnabled(_engine->canLoadGameStateCurrently());
if (_engine->hasFeature(Engine::kSupportsSavingDuringRuntime))
_saveButton->setEnabled(_engine->canSaveGameStateCurrently());
// Overlay size might have changed since the construction of the dialog.
// Update labels when it might be needed
// FIXME: it might be better to declare GUI::StaticTextWidget::setLabel() virtual
// and to reimplement it in GUI::ButtonWidget to handle the hotkey.
if (g_system->getOverlayWidth() > 320)
_rtlButton->setLabel(_rtlButton->cleanupHotkey(_("~R~eturn to Launcher")));
else
_rtlButton->setLabel(_rtlButton->cleanupHotkey(_c("~R~eturn to Launcher", "lowres")));
#ifndef DISABLE_FANCY_THEMES
if (g_gui.xmlEval()->getVar("Globals.ShowGlobalMenuLogo", 0) == 1 && g_gui.theme()->supportsImages()) {
if (!_logo)
_logo = new GUI::GraphicsWidget(this, "GlobalMenu.Logo");
_logo->useThemeTransparency(true);
_logo->setGfx(g_gui.theme()->getImageSurface(GUI::ThemeEngine::kImageLogoSmall));
GUI::StaticTextWidget *title = (GUI::StaticTextWidget *)findWidget("GlobalMenu.Title");
if (title) {
removeWidget(title);
title->setNext(0);
delete title;
}
} else {
GUI::StaticTextWidget *title = (GUI::StaticTextWidget *)findWidget("GlobalMenu.Title");
if (!title) {
title = new GUI::StaticTextWidget(this, "GlobalMenu.Title", "ScummVM");
title->setAlign(Graphics::kTextAlignCenter);
}
if (_logo) {
removeWidget(_logo);
_logo->setNext(0);
delete _logo;
_logo = 0;
}
}
#endif
Dialog::reflowLayout();
}
开发者ID:chrisws,项目名称:scummvm,代码行数:46,代码来源:dialogs.cpp
示例16: cancelButtonClicked
void BakeWidget::cancelButtonClicked() {
// the user wants to go back to the mode selection screen
// remove ourselves from the stacked widget and call delete later so we'll be cleaned up
auto stackedWidget = qobject_cast<QStackedWidget*>(parentWidget());
stackedWidget->removeWidget(this);
deleteLater();
}
开发者ID:Atlante45,项目名称:hifi,代码行数:8,代码来源:BakeWidget.cpp
示例17: removeWidget
void container_widget_t::clear_contents()
{
if( contents_)
{
removeWidget( contents_);
contents_ = 0;
}
}
开发者ID:JohanAberg,项目名称:Ramen,代码行数:8,代码来源:container_widget.cpp
示例18: onNetwork
void onNetwork() override {
// If the app is shutting down, don't service network connections
if (isNull(m_server)) {
return;
}
// See if there are any new clients
for (NetConnectionIterator& client = m_server->newConnectionIterator(); client.isValid(); ++client) {
m_conversationArray.append(shared_ptr<Conversation>(new Conversation(this, client.connection())));
// Tell this client who I am
sendMyName(client.connection());
}
for (int c = 0; c < m_conversationArray.size(); ++c) {
shared_ptr<Conversation> conversation = m_conversationArray[c];
switch (conversation->connection->status()) {
case NetConnection::WAITING_TO_CONNECT:
// Still waiting for the server to accept us.
break;
case NetConnection::JUST_CONNECTED:
// We've just connected to the server but never invoked send() or incomingMessageIterator().
// Tell the server our name.
sendMyName(conversation->connection);
// Intentionally fall through
case NetConnection::CONNECTED:
// Read all incoming messages from all connections, regardless of who created them
for (NetMessageIterator& msg = conversation->connection->incomingMessageIterator(); msg.isValid(); ++msg) {
BinaryInput& bi = msg.binaryInput();
switch (msg.type()) {
case TEXT:
conversation->lastTextReceived->setCaption(bi.readString32());
break;
case CHANGE_NAME:
conversation->name = bi.readString32();
conversation->window->setCaption(conversation->name);
break;
} // Dispatch on message type
} // For each message
break;
case NetConnection::DISCONNECTED:
// Remove this conversation from my list
removeWidget(m_conversationArray[c]->window);
m_conversationArray.fastRemove(c);
--c;
break;
} // Switch status
} // For each conversation
}
开发者ID:jackpoz,项目名称:G3D-backup,代码行数:58,代码来源:ChatApp.cpp
示例19: OstTraceFunctionEntry0
/*!
Displays the to-do viewer and populates the to-do entry attributes.
\param entry Agenda entry from which attributes have to be read.
*/
void AgendaEventView::execute(AgendaEntry entry,
AgendaEventViewer::Actions action)
{
OstTraceFunctionEntry0( AGENDAEVENTVIEW_EXECUTE_ENTRY );
mOriginalAgendaEntry = entry;
mAgendaEntry = entry;
// For later reference
mParentId = mOwner->mAgendaUtil->parentEntry(mAgendaEntry).id();
// Add the viewer data reading from the agenda entry.
addViewerData();
// Remove unnecessary widget from event viewer.
removeWidget();
// Add the menu items to event viewer.
addMenuItem();
// Add the toolbar items to event viewer
addToolBarItem(action);
// Connect for the entry updation and addtion signal to refresh the view
// when the same is edited in editor.
connect(mOwner->mAgendaUtil, SIGNAL(entryUpdated(ulong)),
this, SLOT(handleEntryUpdation(ulong)));
connect(mOwner->mAgendaUtil, SIGNAL(entryAdded(ulong)),
this, SLOT(handleEntryUpdation(ulong)));
// Connect for entry deletion signal to close the event viewer.
connect(mOwner->mAgendaUtil, SIGNAL(entryDeleted(ulong)), this,
SLOT(handleEntryDeletion(ulong)));
// Add the view to the main window.
HbMainWindow *window = hbInstance->allMainWindows().first();
if (!window) {
// Might be some non-ui based app called us
// so create mainwindow now
mMainWindow = new HbMainWindow();
mMainWindow->addView(mViewer);
mMainWindow->setCurrentView(mViewer);
connect(mMainWindow,SIGNAL(orientationChanged(Qt::Orientation)),this,SLOT(changedOrientation(Qt::Orientation)));
} else {
window->addView(mViewer);
window->setCurrentView(mViewer);
connect(window,SIGNAL(orientationChanged(Qt::Orientation)),this,SLOT(changedOrientation(Qt::Orientation)));
}
// Add softkey after adding view on window
mBackAction = new HbAction(Hb::BackNaviAction);
mViewer->setNavigationAction(mBackAction);
connect(mBackAction, SIGNAL(triggered()), this, SLOT(close()));
OstTraceFunctionExit0( AGENDAEVENTVIEW_EXECUTE_EXIT );
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:63,代码来源:agendaeventview.cpp
示例20: S_LOG_WARNING
void GUIManager::destroyWidget(Widget* widget)
{
if (!widget) {
S_LOG_WARNING("Trying to destroy null widget.");
return;
}
removeWidget(widget);
delete widget;
}
开发者ID:Chimangoo,项目名称:ember,代码行数:9,代码来源:GUIManager.cpp
注:本文中的removeWidget函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论