本文整理汇总了C++中cancel函数的典型用法代码示例。如果您正苦于以下问题:C++ cancel函数的具体用法?C++ cancel怎么用?C++ cancel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cancel函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: cancel
timer::~timer()
{
cancel();
}
开发者ID:NoAvailableAlias,项目名称:signal-slot-benchmarks,代码行数:4,代码来源:timer.cpp
示例2: componentPeerChanged
void componentPeerChanged()
{
if (! component->isShowing())
cancel();
}
开发者ID:Amcut,项目名称:pizmidi,代码行数:5,代码来源:juce_ModalComponentManager.cpp
示例3: QWidget
FileSelector::FileSelector(QWidget *parent)
: QWidget(parent),
m_view(new QListView(this)),
m_model(new QFileSystemModel(this)),
m_title(new QLabel(this)),
m_path(new QLabel(this)),
m_bookmarkButton(new QPushButton(this)),
m_bookmarkMenu(new QMenu(this)),
m_bookmarks(),
m_signalMapper(new QSignalMapper(this))
{
QGridLayout *layout = new QGridLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
layout->setRowStretch(5, 1);
layout->setSpacing(0);
m_title->setAlignment(Qt::AlignCenter);
layout->addWidget(m_title, 0, 0, 1, 2);
layout->addWidget(m_path, 1, 0, 1, 2);
m_view->setModel(m_model);
connect(m_view, SIGNAL(activated(QModelIndex)), this, SLOT(enter(QModelIndex)));
layout->addWidget(m_view, 2, 0, 6, 1);
m_view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_view->setSelectionMode(QListView::ExtendedSelection);
QFont font = m_view->font();
font.setPointSize(8);
m_view->setFont(font);
m_model->setNameFilterDisables(false);
m_model->setRootPath("/");
connect(m_signalMapper, SIGNAL(mapped(QString)), this, SLOT(setCurrentDirectory(QString)));
m_bookmarkButton->setIcon(QIcon(":nobookmark.png"));
m_bookmarkButton->setShortcut(QKeySequence(Qt::ALT+Qt::Key_B));
connect(m_bookmarkButton, SIGNAL(clicked()), this, SLOT(toggleBookmark()));
layout->addWidget(m_bookmarkButton, 2, 1);
QPushButton *button = new QPushButton();
button->setIcon(QIcon(":up.png"));
button->setShortcut(QKeySequence(Qt::ALT+Qt::Key_Up));
connect(button, SIGNAL(clicked()), this, SLOT(goUp()));
layout->addWidget(button, 3, 1);
button = new QPushButton();
button->setIcon(QIcon(":ok.png"));
connect(button, SIGNAL(clicked()), this, SLOT(accept()));
layout->addWidget(button, 6, 1);
button = new QPushButton();
button->setIcon(QIcon(":cancel.png"));
button->setShortcut(QKeySequence(Qt::Key_Escape));
connect(button, SIGNAL(clicked()), this, SIGNAL(cancel()));
layout->addWidget(button, 7, 1);
QSettings conf(QDir::homePath()+"Maps/nanomap.conf", QSettings::NativeFormat);
conf.beginGroup("fileselector");
m_bookmarks = conf.value("bookmarks").toStringList();
conf.endGroup();
setCurrentDirectory(m_model->index(QDir::homePath()));
updateBookmarkMenu();
m_view->setFocus(Qt::OtherFocusReason);
resize(320, 240);
}
开发者ID:kyak,项目名称:nanomap,代码行数:67,代码来源:fileselector.cpp
示例4: applyCl
void BlockingDialog::applyCl( CClient *cl )
{
std::string str;
text.toString(str);
if(vstd::contains(cl->playerint,player))
cl->playerint[player]->showBlockingDialog(str,components,queryID,(soundBase::soundID)soundID,selection(),cancel());
else
logNetwork->warnStream() << "We received YesNoDialog for not our player...";
}
开发者ID:vargad,项目名称:vcmi,代码行数:10,代码来源:NetPacksClient.cpp
示例5: on_stop
void on_stop()
{
cancel();
}
开发者ID:mkjaergaard,项目名称:darc_component,代码行数:4,代码来源:periodic_timer.hpp
示例6: cancel
void ResourceLoader::cancel()
{
cancel(ResourceError());
}
开发者ID:emutavchi,项目名称:WebKitForWayland,代码行数:4,代码来源:ResourceLoader.cpp
示例7: QMainWindow
XSettingsWindow::XSettingsWindow(const qutim_sdk_0_3::SettingsItemList& settings, QObject* controller, QWidget *parent) :
QMainWindow(parent),
p(new XSettingsWindowPrivate)
{
setAttribute(Qt::WA_DeleteOnClose);
p->controller = controller;
setWindowModality(controller ? Qt::WindowModal : Qt::NonModal);
//setup ui
QWidget *w = new QWidget(this);
QVBoxLayout *l = new QVBoxLayout(w);
Config cfg;
cfg.beginGroup("xsettings/window");
QByteArray data;
p->parent = qobject_cast<XSettingsWindow*>(qApp->activeWindow());
if(p->parent) {
QRect geom = p->parent->geometry();
int width = geom.width()/15;
int height = geom.height()/15;
geom.adjust(width,height,-width,-height);
setGeometry(geom);
} else {
data = cfg.value("geometry", QByteArray());
if (data.isEmpty() || !restoreGeometry(data)) {
QSize desktopSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size();
resize(desktopSize.width() / 2, desktopSize.height() * 2 / 3);
centerizeWidget(this);
}
}
//init widgets
p->splitter = new QSplitter(Qt::Horizontal,w);
p->listWidget = new QListWidget(w);
p->stackedWidget = new QStackedWidget(w);
//default widget
QWidget *empty = new QWidget(this);
p->stackedWidget->addWidget(empty);
p->splitter->addWidget(p->listWidget);
p->splitter->addWidget(p->stackedWidget);
data = cfg.value("splitterState", QByteArray());
if (data.isEmpty() || !p->splitter->restoreState(data))
p->splitter->setSizes(QList<int>() << 80 << 250);
l->addWidget(p->splitter);
QDialogButtonBox::StandardButtons buttons;
if (controller)
buttons = QDialogButtonBox::Ok;
else
buttons = QDialogButtonBox::Save | QDialogButtonBox::Cancel;
p->buttonBox = new QDialogButtonBox(buttons, Qt::Horizontal, w);
l->addWidget(p->buttonBox);
p->buttonBox->setVisible(controller);
//init actiontoolbar
setCentralWidget(w);
setUnifiedTitleAndToolBarOnMac(true);
p->toolBar = new ActionToolBar(w);
addToolBar(Qt::TopToolBarArea,p->toolBar);
int width = style()->pixelMetric(QStyle::PM_IconViewIconSize);
QSize size = QSize(width, width);
p->toolBar->setIconSize(size);
p->toolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
p->toolBar->setObjectName(QLatin1String("SettingsBar"));
p->toolBar->setMovable(false);
#if defined (Q_WS_WIN32) || defined(Q_WS_MAC)
width = 22;
#else
width = style()->pixelMetric(QStyle::PM_ToolBarIconSize);
#endif
size = QSize(width, width);
p->listWidget->setIconSize(size);
p->group = new QActionGroup(w);
p->group->setExclusive(true);
//connections
connect(p->group,SIGNAL(triggered(QAction*)), SLOT(onGroupActionTriggered(QAction*)));
connect(p->listWidget,
SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
SLOT(onCurrentItemChanged(QListWidgetItem*))
);
connect(p->buttonBox,SIGNAL(accepted()), SLOT(save()));
connect(p->buttonBox,SIGNAL(rejected()), SLOT(cancel()));
loadSettings(settings);
if (p->group->actions().count())
p->group->actions().first()->trigger();
}
开发者ID:dganic,项目名称:qutim,代码行数:91,代码来源:xsettingswindow.cpp
示例8: cancel
void PackerJob::closeAllTabs()
{
cancel();
delete m_tab;
}
开发者ID:tweimer,项目名称:miranda-ng,代码行数:5,代码来源:job_packer.cpp
示例9: cancel
/**
* @brief
*/
Timer::TimerThread::~TimerThread()
{
cancel();
}
开发者ID:SteveGilvarry,项目名称:ozonebase,代码行数:7,代码来源:libgenTimer.cpp
示例10: cancel
Timer::~Timer() {
cancel();
}
开发者ID:kkk669,项目名称:Cloumo,代码行数:3,代码来源:timer.cpp
示例11: cancel
void tracker_connection::close()
{
cancel();
m_man.remove_request(this);
}
开发者ID:milindbenjamin,项目名称:libtorrent-android,代码行数:5,代码来源:tracker_manager.cpp
示例12: cancel
void QgsMapToolOffsetCurve::applyOffset( double offset, Qt::KeyboardModifiers modifiers )
{
if ( !mLayer || offset == 0.0 )
{
cancel();
notifyNotVectorLayer();
return;
}
updateGeometryAndRubberBand( offset );
// no modification
if ( !mGeometryModified )
{
mLayer->destroyEditCommand();
cancel();
return;
}
if ( mModifiedPart >= 0 )
{
QgsGeometry geometry;
int partIndex = 0;
QgsWkbTypes::Type geomType = mOriginalGeometry.wkbType();
if ( QgsWkbTypes::geometryType( geomType ) == QgsWkbTypes::LineGeometry )
{
QgsMultiPolylineXY newMultiLine;
QgsMultiPolylineXY multiLine = mOriginalGeometry.asMultiPolyline();
QgsMultiPolylineXY::const_iterator it = multiLine.constBegin();
for ( ; it != multiLine.constEnd(); ++it )
{
if ( partIndex == mModifiedPart )
{
newMultiLine.append( mModifiedGeometry.asPolyline() );
}
else
{
newMultiLine.append( *it );
}
partIndex++;
}
geometry = QgsGeometry::fromMultiPolylineXY( newMultiLine );
}
else
{
QgsMultiPolygonXY newMultiPoly;
const QgsMultiPolygonXY multiPoly = mOriginalGeometry.asMultiPolygon();
QgsMultiPolygonXY::const_iterator multiPolyIt = multiPoly.constBegin();
for ( ; multiPolyIt != multiPoly.constEnd(); ++multiPolyIt )
{
if ( partIndex == mModifiedPart )
{
if ( mModifiedGeometry.isMultipart() )
{
// not a ring
if ( mModifiedRing <= 0 )
{
// part became mulitpolygon, that means discard original rings from the part
newMultiPoly += mModifiedGeometry.asMultiPolygon();
}
else
{
// ring became multipolygon, oh boy!
QgsPolygonXY newPoly;
int ringIndex = 0;
QgsPolygonXY::const_iterator polyIt = multiPolyIt->constBegin();
for ( ; polyIt != multiPolyIt->constEnd(); ++polyIt )
{
if ( ringIndex == mModifiedRing )
{
const QgsMultiPolygonXY ringParts = mModifiedGeometry.asMultiPolygon();
QgsPolygonXY newRings;
QgsMultiPolygonXY::const_iterator ringIt = ringParts.constBegin();
for ( ; ringIt != ringParts.constEnd(); ++ringIt )
{
// the different parts of the new rings cannot have rings themselves
newRings.append( ringIt->at( 0 ) );
}
newPoly += newRings;
}
else
{
newPoly.append( *polyIt );
}
ringIndex++;
}
newMultiPoly.append( newPoly );
}
}
else
{
// original part had no ring
if ( mModifiedRing == -1 )
{
newMultiPoly.append( mModifiedGeometry.asPolygon() );
}
else
{
QgsPolygonXY newPoly;
int ringIndex = 0;
//.........这里部分代码省略.........
开发者ID:phborba,项目名称:QGIS,代码行数:101,代码来源:qgsmaptooloffsetcurve.cpp
示例13: cancel
RCSDiscoveryManager::DiscoveryTask::~DiscoveryTask()
{
cancel();
}
开发者ID:Lyoncore,项目名称:iotivity-demo-uc15,代码行数:4,代码来源:RCSDiscoveryManager.cpp
示例14: GetMessageDialogStyle
int wxMessageDialog::ShowModal()
{
const long style = GetMessageDialogStyle();
DialogCreateFunction dialogCreateFunction;
if ( style & wxYES_NO )
{
// if we have [Yes], it must be a question
dialogCreateFunction = XmCreateQuestionDialog;
}
else if ( style & wxICON_STOP )
{
// error dialog is the one with error icon...
dialogCreateFunction = XmCreateErrorDialog;
}
else if ( style & wxICON_EXCLAMATION )
{
// ...and the warning dialog too
dialogCreateFunction = XmCreateWarningDialog;
}
else
{
// finally, use the info dialog by default
dialogCreateFunction = XmCreateInformationDialog;
}
Widget wParent = m_parent ? GetWidget(m_parent) : (Widget) 0;
if ( !wParent )
{
wxWindow *window = wxTheApp->GetTopWindow();
if ( !window )
{
wxFAIL_MSG("can't show message box without parent window");
return wxID_CANCEL;
}
wParent = GetWidget(window);
}
// prepare the arg list
Arg args[10];
int ac = 0;
wxXmString text(m_message);
wxXmString title(m_caption);
XtSetArg(args[ac], XmNmessageString, text()); ac++;
XtSetArg(args[ac], XmNdialogTitle, title()); ac++;
Display* dpy = XtDisplay(wParent);
wxComputeColours (dpy, & m_backgroundColour, (wxColour*) NULL);
XtSetArg(args[ac], XmNbackground, g_itemColors[wxBACK_INDEX].pixel); ac++;
XtSetArg(args[ac], XmNtopShadowColor, g_itemColors[wxTOPS_INDEX].pixel); ac++;
XtSetArg(args[ac], XmNbottomShadowColor, g_itemColors[wxBOTS_INDEX].pixel); ac++;
XtSetArg(args[ac], XmNforeground, g_itemColors[wxFORE_INDEX].pixel); ac++;
wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
#if __WXMOTIF20__ && !__WXLESSTIF__
XtSetArg(args[ac], XmNbuttonRenderTable, font.GetFontTypeC(dpy)); ac++;
XtSetArg(args[ac], XmNlabelRenderTable, font.GetFontTypeC(dpy)); ac++;
XtSetArg(args[ac], XmNtextRenderTable, font.GetFontTypeC(dpy)); ac++;
#else
XtSetArg(args[ac], XmNbuttonFontList, font.GetFontTypeC(dpy)); ac++;
XtSetArg(args[ac], XmNlabelFontList, font.GetFontTypeC(dpy)); ac++;
XtSetArg(args[ac], XmNtextFontList, font.GetFontTypeC(dpy)); ac++;
#endif
// do create message box
Widget wMsgBox = (*dialogCreateFunction)(wParent, wxMOTIF_STR(""), args, ac);
wxCHECK_MSG( wMsgBox, wxID_CANCEL, "msg box creation failed" );
// get the buttons which we might either remove or rename
// depending on the requested style
//
Widget wBtnOk = XmMessageBoxGetChild(wMsgBox, XmDIALOG_OK_BUTTON);
Widget wBtnHelp = XmMessageBoxGetChild(wMsgBox, XmDIALOG_HELP_BUTTON);
Widget wBtnCancel = XmMessageBoxGetChild(wMsgBox, XmDIALOG_CANCEL_BUTTON);
if ( style & wxYES_NO )
{
wxXmString yes(_("Yes")), no(_("No")), cancel(_("Cancel"));
if ( style & wxCANCEL )
{
// use the cancel button for No and the help button for
// Cancel Yuk :-) MB
//
XtVaSetValues(wBtnOk, XmNlabelString, yes(), NULL);
XtVaSetValues(wBtnCancel, XmNlabelString, no(), NULL);
XtVaSetValues(wBtnHelp, XmNlabelString, cancel(), NULL);
}
else
{
// no cancel button requested...
// remove the help button and use cancel for no
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:101,代码来源:msgdlg.cpp
示例15: componentVisibilityChanged
void componentVisibilityChanged()
{
if (! component->isShowing())
cancel();
}
开发者ID:Amcut,项目名称:pizmidi,代码行数:5,代码来源:juce_ModalComponentManager.cpp
示例16: main
int main(void)
{
// Menu Variables
int menuActive = 1;
int menuSelect;
int room;
char *p = hotel[0];
char name[NAMESIZE];
int roomsRequested;
// Initializing Hotel Roster
for (room = 0;room < ROOMS;room++,p+=20)
{
*p = '\0';
}
while(menuActive == 1)
{
// Introductory Matters - Menu
printf("***************************************************");
printf("*******\n");
printf("Welcome to the Room Reservation Program!\n");
printf("Select one of the options below.\n");
printf("0 - Reserve a Room\n");
printf("1 - Cancel a Reservation\n");
printf("2 - Show the List of Reservations\n\n");
printf("Type in any other number to exit.\n");
scanf("%d",&menuSelect);
printf("***************************************************");
printf("*******\n");
switch (menuSelect)
{
case 0:
{
// Input - Name
printf("Type in Your Name\n");
scanf("%s",&name);
// Input - Number of Rooms
printf("How many rooms would ");
printf("you like to reserve?\n");
scanf("%d",&roomsRequested);
reserve(name,roomsRequested);
break;
}
case 1:
{
// Input - Name
printf("Type in Your Name\n");
scanf("%s",&name);
cancel(name);
break;
}
case 2:
{
display();
break;
}
default:
{
menuActive = 0;
break;
}
}
}
printf("\nCome again!\n\n");
return 0;
}
开发者ID:scott-m-sarsfield,项目名称:code_archive,代码行数:78,代码来源:roomres4.c
示例17: cancel
Reporter::~Reporter() {
cancel();
}
开发者ID:ahmedfadhil,项目名称:mongo,代码行数:3,代码来源:reporter.cpp
注:本文中的cancel函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论