void ConnectionBox::onCancel() { emit closed(); }
//------------------------------------------------------------------------------ My4Socket::My4Socket(QObject *parent) : QTcpSocket(parent), safeShutDown(false) { connect(this, SIGNAL(readyRead()), this, SLOT(read())); connect(this, SIGNAL(disconnected()), this, SLOT(closed())); }
void DialogSecuritySubscriptions::on_pushButtonCancel_clicked() { emit closed(); close(); }
void BackEnd::genCodeImpl(IRUnit& unit, AsmInfo* asmInfo) { ctr++; auto regs = allocateRegs(unit); assert(checkRegisters(unit, regs)); // calls checkCfg internally. Timer _t(Timer::codeGen); LiveRegs live_regs = computeLiveRegs(unit, regs); CodegenState state(unit, regs, live_regs, asmInfo); CodeBlock& mainCodeIn = mcg->code.main(); CodeBlock& coldCodeIn = mcg->code.cold(); CodeBlock* frozenCode = &mcg->code.frozen(); CodeBlock mainCode; CodeBlock coldCode; bool relocate = false; if (RuntimeOption::EvalJitRelocationSize && supportsRelocation() && coldCodeIn.canEmit(RuntimeOption::EvalJitRelocationSize * 3)) { /* * This is mainly to exercise the relocator, and ensure that its * not broken by new non-relocatable code. Later, it will be * used to do some peephole optimizations, such as reducing branch * sizes. * Allocate enough space that the relocated cold code doesn't * overlap the emitted cold code. */ static unsigned seed = 42; auto off = rand_r(&seed) & (cacheLineSize() - 1); coldCode.init(coldCodeIn.frontier() + RuntimeOption::EvalJitRelocationSize + off, RuntimeOption::EvalJitRelocationSize - off, "cgRelocCold"); mainCode.init(coldCode.frontier() + RuntimeOption::EvalJitRelocationSize + off, RuntimeOption::EvalJitRelocationSize - off, "cgRelocMain"); relocate = true; } else { /* * Use separate code blocks, so that attempts to use the mcg's * code blocks directly will fail (eg by overwriting the same * memory being written through these locals). */ coldCode.init(coldCodeIn.frontier(), coldCodeIn.available(), coldCodeIn.name().c_str()); mainCode.init(mainCodeIn.frontier(), mainCodeIn.available(), mainCodeIn.name().c_str()); } if (frozenCode == &coldCodeIn) { frozenCode = &coldCode; } auto frozenStart = frozenCode->frontier(); auto coldStart DEBUG_ONLY = coldCodeIn.frontier(); auto mainStart DEBUG_ONLY = mainCodeIn.frontier(); size_t hhir_count{0}; { mcg->code.lock(); mcg->cgFixups().setBlocks(&mainCode, &coldCode, frozenCode); SCOPE_EXIT { mcg->cgFixups().setBlocks(nullptr, nullptr, nullptr); mcg->code.unlock(); }; if (RuntimeOption::EvalHHIRGenerateAsserts) { emitTraceCall(mainCode, unit.bcOff()); } auto const linfo = layoutBlocks(unit); auto main_start = mainCode.frontier(); auto cold_start = coldCode.frontier(); auto frozen_start = frozenCode->frontier(); Vasm vasm(&state.meta); auto& vunit = vasm.unit(); // create the initial set of vasm numbered the same as hhir blocks. for (uint32_t i = 0, n = unit.numBlocks(); i < n; ++i) { state.labels[i] = vunit.makeBlock(AreaIndex::Main); } vunit.roots.push_back(state.labels[unit.entry()]); vasm.main(mainCode); vasm.cold(coldCode); vasm.frozen(*frozenCode); for (auto it = linfo.blocks.begin(); it != linfo.blocks.end(); ++it) { auto block = *it; auto v = block->hint() == Block::Hint::Unlikely ? vasm.cold() : block->hint() == Block::Hint::Unused ? vasm.frozen() : vasm.main(); FTRACE(6, "genBlock {} on {}\n", block->id(), area_names[(unsigned)v.area()]); auto b = state.labels[block]; vunit.blocks[b].area = v.area(); v.use(b); hhir_count += genBlock(unit, v, vasm, state, block); assert(v.closed()); assert(vasm.main().empty() || vasm.main().closed()); assert(vasm.cold().empty() || vasm.cold().closed()); assert(vasm.frozen().empty() || vasm.frozen().closed()); } printUnit("after code-gen", vasm.unit()); vasm.finish(vasm_abi); if (state.asmInfo) { auto block = unit.entry(); state.asmInfo->asmRanges[block] = {main_start, mainCode.frontier()}; if (mainCode.base() != coldCode.base() && frozenCode != &coldCode) { state.asmInfo->acoldRanges[block] = {cold_start, coldCode.frontier()}; } if (mainCode.base() != frozenCode->base()) { state.asmInfo->afrozenRanges[block] = {frozen_start, frozenCode->frontier()}; } } } auto bcMap = &mcg->cgFixups().m_bcMap; if (!bcMap->empty()) { TRACE(1, "BCMAPS before relocation\n"); for (UNUSED auto& map : *bcMap) { TRACE(1, "%s %-6d %p %p %p\n", map.md5.toString().c_str(), map.bcStart, map.aStart, map.acoldStart, map.afrozenStart); } } assert(coldCodeIn.frontier() == coldStart); assert(mainCodeIn.frontier() == mainStart); if (relocate) { if (asmInfo) { printUnit(kRelocationLevel, unit, " before relocation ", ®s, asmInfo); } auto& be = mcg->backEnd(); RelocationInfo rel; size_t asm_count{0}; asm_count += be.relocate(rel, mainCodeIn, mainCode.base(), mainCode.frontier(), mcg->cgFixups()); asm_count += be.relocate(rel, coldCodeIn, coldCode.base(), coldCode.frontier(), mcg->cgFixups()); TRACE(1, "hhir-inst-count %ld asm %ld\n", hhir_count, asm_count); if (frozenCode != &coldCode) { rel.recordRange(frozenStart, frozenCode->frontier(), frozenStart, frozenCode->frontier()); } be.adjustForRelocation(rel, mcg->cgFixups()); be.adjustForRelocation(rel, asmInfo, mcg->cgFixups()); if (asmInfo) { static int64_t mainDeltaTot = 0, coldDeltaTot = 0; int64_t mainDelta = (mainCodeIn.frontier() - mainStart) - (mainCode.frontier() - mainCode.base()); int64_t coldDelta = (coldCodeIn.frontier() - coldStart) - (coldCode.frontier() - coldCode.base()); mainDeltaTot += mainDelta; HPHP::Trace::traceRelease("main delta after relocation: %" PRId64 " (%" PRId64 ")\n", mainDelta, mainDeltaTot); coldDeltaTot += coldDelta; HPHP::Trace::traceRelease("cold delta after relocation: %" PRId64 " (%" PRId64 ")\n", coldDelta, coldDeltaTot); } #ifndef NDEBUG auto& ip = mcg->cgFixups().m_inProgressTailJumps; for (size_t i = 0; i < ip.size(); ++i) { const auto& ib = ip[i]; assert(!mainCode.contains(ib.toSmash())); assert(!coldCode.contains(ib.toSmash())); } memset(mainCode.base(), 0xcc, mainCode.frontier() - mainCode.base()); memset(coldCode.base(), 0xcc, coldCode.frontier() - coldCode.base()); #endif } else { coldCodeIn.skip(coldCode.frontier() - coldCodeIn.frontier()); mainCodeIn.skip(mainCode.frontier() - mainCodeIn.frontier()); } if (asmInfo) { printUnit(kCodeGenLevel, unit, " after code gen ", ®s, asmInfo); } }
void DeviceCollectionWND::closeEvent(QCloseEvent *e) { QWidget::closeEvent( e ); emit closed(); }
void TypeTypeForm::applyClicked() { m_type->setNote(m_textNote->toPlainText()); emit closed(m_op, QVarPtr<TypeType>::asQVariant(m_type)); }
void FixtureConsole::closeEvent(QCloseEvent* e) { emit closed(); }
void SynthControl::closeEvent(QCloseEvent* ev) { emit closed(false); QWidget::closeEvent(ev); }
void MainWindowPlugin::onOptionsChanged(const OptionsNode &ANode) { QWidget * widget = FMainWindowBorder ? (QWidget*)FMainWindowBorder : (QWidget*)FMainWindow; if (ANode.path() == OPV_MAINWINDOW_STAYONTOP) { bool show = widget->isVisible(); if (ANode.value().toBool()) widget->setWindowFlags(widget->windowFlags() | Qt::WindowStaysOnTopHint); else widget->setWindowFlags(widget->windowFlags() & ~Qt::WindowStaysOnTopHint); if (show) showMainWindow(); } #ifdef Q_OS_WIN else if (ANode.path() == OPV_MAINWINDOW_MINIMIZETOTRAY_W7) { if (QSysInfo::windowsVersion() == QSysInfo::WV_WINDOWS7) { bool minimize = ANode.value().toBool(); FMainWindowBorder->setMinimizeOnClose(!minimize); FMainWindowBorder->setShowInTaskBar(!minimize); if (minimize) disconnect(FMainWindowBorder ? (QObject*)FMainWindowBorder : (QObject*)FMainWindow, SIGNAL(closed()), this, SLOT(onMainWindowClosed())); else connect(FMainWindowBorder ? (QObject*)FMainWindowBorder : (QObject*)FMainWindow, SIGNAL(closed()), SLOT(onMainWindowClosed())); } else FMainWindowBorder->setShowInTaskBar(false); } #endif }
void AbstractBox::onClose() { closePressed(); emit closed(); }
void PlayPanel::closeEvent(QCloseEvent* ev) { emit closed(false); QWidget::closeEvent(ev); }
void CDialogSettings::on_pushButtonCancel_clicked() { emit closed(); close(); }
void Tuning::prepareRemove() { glView_->destroy(); emit closed(index_); }
void CDialogCreateTorrent::on_pushButtonSave_clicked() { emit closed(); close(); }
void ClientApplication::showMainWindow() { mainWindow = new MainWindow(); connect(mainWindow, SIGNAL(closed()), SLOT(quit())); mainWindow->show(); }
MainWindow::MainWindow() : QMainWindow(0) , ui(new Ui::MainWindow) , m_isKKeyPressed(false) { // Create the UI. ui->setupUi(this); #ifndef Q_WS_X11 ui->mainToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); #endif setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea); setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea); setDockNestingEnabled(true); // These use the icon theme on Linux, with fallbacks to the icons specified in QtDesigner for other platforms. ui->actionOpen->setIcon(QIcon::fromTheme("document-open", ui->actionOpen->icon())); ui->actionSave->setIcon(QIcon::fromTheme("document-save", ui->actionSave->icon())); ui->actionEncode->setIcon(QIcon::fromTheme("media-record", ui->actionEncode->icon())); // Connect UI signals. connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(openVideo())); connect(ui->actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt())); // Accept drag-n-drop of files. this->setAcceptDrops(true); // Add the player widget. QLayout* layout = new QVBoxLayout(ui->playerPage); layout->setObjectName("centralWidgetLayout"); layout->setMargin(0); m_player = new Player(this); layout->addWidget(m_player); connect(this, SIGNAL(producerOpened()), m_player, SLOT(onProducerOpened())); connect(m_player, SIGNAL(showStatusMessage(QString)), this, SLOT(showStatusMessage(QString))); connect(m_player, SIGNAL(inChanged(int)), this, SLOT(onCutModified())); connect(m_player, SIGNAL(outChanged(int)), this, SLOT(onCutModified())); // Add the docks. m_propertiesDock = new QDockWidget(tr("Properties")); m_propertiesDock->hide(); m_propertiesDock->setObjectName("propertiesDock"); m_propertiesDock->setWindowIcon(QIcon((":/icons/icons/view-form.png"))); m_propertiesDock->toggleViewAction()->setIcon(QIcon::fromTheme("view-form", m_propertiesDock->windowIcon())); addDockWidget(Qt::LeftDockWidgetArea, m_propertiesDock); ui->menuView->addAction(m_propertiesDock->toggleViewAction()); ui->mainToolBar->addAction(m_propertiesDock->toggleViewAction()); connect(m_propertiesDock->toggleViewAction(), SIGNAL(triggered(bool)), this, SLOT(onPropertiesDockTriggered(bool))); m_recentDock = new RecentDock(this); m_recentDock->hide(); addDockWidget(Qt::LeftDockWidgetArea, m_recentDock); ui->menuView->addAction(m_recentDock->toggleViewAction()); ui->mainToolBar->addAction(m_recentDock->toggleViewAction()); connect(m_recentDock, SIGNAL(itemActivated(QString)), this, SLOT(open(QString))); connect(m_recentDock->toggleViewAction(), SIGNAL(triggered(bool)), this, SLOT(onRecentDockTriggered(bool))); m_playlistDock = new PlaylistDock(this); m_playlistDock->hide(); addDockWidget(Qt::LeftDockWidgetArea, m_playlistDock); ui->menuView->addAction(m_playlistDock->toggleViewAction()); ui->mainToolBar->addAction(m_playlistDock->toggleViewAction()); connect(m_playlistDock->toggleViewAction(), SIGNAL(triggered(bool)), this, SLOT(onPlaylistDockTriggered(bool))); connect(m_playlistDock, SIGNAL(clipOpened(void*,int,int)), this, SLOT(openCut(void*, int, int))); connect(m_playlistDock, SIGNAL(itemActivated(int)), this, SLOT(seekPlaylist(int))); connect(m_playlistDock, SIGNAL(showStatusMessage(QString)), this, SLOT(showStatusMessage(QString))); connect(m_playlistDock->model(), SIGNAL(created()), this, SLOT(onPlaylistCreated())); connect(m_playlistDock->model(), SIGNAL(cleared()), this, SLOT(onPlaylistCleared())); connect(m_playlistDock->model(), SIGNAL(closed()), this, SLOT(onPlaylistClosed())); connect(m_playlistDock->model(), SIGNAL(modified()), this, SLOT(onPlaylistModified())); connect(m_playlistDock->model(), SIGNAL(loaded()), this, SLOT(updateMarkers())); connect(m_playlistDock->model(), SIGNAL(modified()), this, SLOT(updateMarkers())); tabifyDockWidget(m_recentDock, m_propertiesDock); tabifyDockWidget(m_propertiesDock, m_playlistDock); m_recentDock->raise(); m_encodeDock = new EncodeDock(this); m_encodeDock->hide(); addDockWidget(Qt::RightDockWidgetArea, m_encodeDock); ui->menuView->addAction(m_encodeDock->toggleViewAction()); ui->mainToolBar->addAction(ui->actionEncode); connect(this, SIGNAL(producerOpened()), m_encodeDock, SLOT(onProducerOpened())); connect(m_encodeDock, SIGNAL(visibilityChanged(bool)), ui->actionEncode, SLOT(setChecked(bool))); connect(m_encodeDock, SIGNAL(captureStateChanged(bool)), m_player, SLOT(onCaptureStateChanged(bool))); connect(m_encodeDock, SIGNAL(captureStateChanged(bool)), m_propertiesDock, SLOT(setDisabled(bool))); connect(m_encodeDock, SIGNAL(captureStateChanged(bool)), m_recentDock, SLOT(setDisabled(bool))); connect(m_encodeDock, SIGNAL(captureStateChanged(bool)), ui->actionOpen, SLOT(setDisabled(bool))); connect(m_encodeDock, SIGNAL(captureStateChanged(bool)), ui->actionOpenOther, SLOT(setDisabled(bool))); connect(m_encodeDock, SIGNAL(captureStateChanged(bool)), ui->actionExit, SLOT(setDisabled(bool))); connect(m_encodeDock, SIGNAL(captureStateChanged(bool)), this, SLOT(onCaptureStateChanged(bool))); m_jobsDock = new JobsDock(this); m_jobsDock->hide(); addDockWidget(Qt::RightDockWidgetArea, m_jobsDock); tabifyDockWidget(m_encodeDock, m_jobsDock); ui->menuView->addAction(m_jobsDock->toggleViewAction()); connect(&JOBS, SIGNAL(jobAdded()), m_jobsDock, SLOT(show())); connect(&JOBS, SIGNAL(jobAdded()), m_jobsDock, SLOT(raise())); connect(m_jobsDock, SIGNAL(visibilityChanged(bool)), this, SLOT(onJobsVisibilityChanged(bool))); // Connect signals. connect(this, SIGNAL(producerOpened()), this, SLOT(onProducerOpened())); // connect video widget signals #if defined(Q_WS_MAC) || defined(Q_WS_WIN) Mlt::GLWidget* videoWidget = (Mlt::GLWidget*) &(MLT); connect(videoWidget, SIGNAL(dragStarted()), m_playlistDock, SLOT(onPlayerDragStarted())); connect(videoWidget, SIGNAL(seekTo(int)), m_player, SLOT(seek(int))); #else if (m_settings.value("player/opengl", true).toBool()) { Mlt::GLWidget* videoWidget = (Mlt::GLWidget*) &(MLT); connect(videoWidget, SIGNAL(dragStarted()), m_playlistDock, SLOT(onPlayerDragStarted())); connect(videoWidget, SIGNAL(seekTo(int)), m_player, SLOT(seek(int))); } else { Mlt::SDLWidget* videoWidget = (Mlt::SDLWidget*) &(MLT); connect(videoWidget, SIGNAL(dragStarted()), m_playlistDock, SLOT(onPlayerDragStarted())); connect(videoWidget, SIGNAL(seekTo(int)), m_player, SLOT(seek(int))); } #endif readSettings(); setFocus(); setCurrentFile(""); }
void DebugWindow::closeEvent( QCloseEvent* e ) { Q_UNUSED( e ) emit closed(); }
~frontend_ui() { closed(); // this is here only to make frontend_manager's life harder - it should ignore this signal. }
void TypeTypeForm::editClicked() { int index = m_listView->selected(); if (index < 0) return; switch (m_currentEditMode) { case Type: { ElementTypeForm *typeForm = new ElementTypeForm(m_type->type().at(index), this->mainWindow()); typeForm->setTitle(tr("Type")); QObject::connect(typeForm, SIGNAL(closed(Operation,QVariant)), this, SLOT(typeFormClosed(Operation,QVariant))); this->mainWindow()->pushWidget(typeForm); } break; case Genre: { TypeGroupForm *genreForm = new TypeGroupForm(m_type->genre().at(index), this->mainWindow()); genreForm->setTitle(tr("Genre")); genreForm->setGeneralDoc(tr("A group of attributes to describe the genre.")); genreForm->setDefinitionDoc(tr("Free text for an optional definition.")); genreForm->setLinkDoc(tr("A link to a term or only identify a classification scheme.")); genreForm->setLabelDoc(tr("Free text field. This can be used to repeat the term name of the classification scheme term identified by a typeLink.\nExample: 'non-fiction/information'.")); genreForm->addLinksMap(mainWindow()->getMap("ebu_ContentAlertSchemeCodeCS")); genreForm->addLinksMap(mainWindow()->getMap("ebu_ContentGenreCS")); genreForm->addLinksMap(mainWindow()->getMap("ebu_EditorialFormatCodeCS")); genreForm->addLinksMap(mainWindow()->getMap("ebu_IntentionCodeCS")); genreForm->addLinksMap(mainWindow()->getMap("tva_ContentCommercialCS")); genreForm->addLinksMap(mainWindow()->getMap("tva_ContentAlertCS")); QObject::connect(genreForm, SIGNAL(closed(Operation,QVariant)), this, SLOT(genreFormClosed(Operation,QVariant))); this->mainWindow()->pushWidget(genreForm); } break; case ObjectType: { TypeGroupForm *objectTypeForm = new TypeGroupForm(m_type->objectType().at(index), this->mainWindow()); objectTypeForm->setTitle(tr("Object Type")); objectTypeForm->setGeneralDoc(tr("A group of attributes to describe the objectType.")); objectTypeForm->setDefinitionDoc(tr("Free text for an optional definition.\nExample: 'A short description of the resource'.")); objectTypeForm->setLinkDoc(tr("A link to a term or only identify a classification scheme.")); objectTypeForm->setLabelDoc(tr("Free text field. This can be used to repeat the term name of the classification scheme term identified by a typeLink.")); objectTypeForm->addLinksMap(mainWindow()->getMap("ebu_ObjectTypeCS")); QObject::connect(objectTypeForm, SIGNAL(closed(Operation,QVariant)), this, SLOT(objectTypeFormClosed(Operation,QVariant))); this->mainWindow()->pushWidget(objectTypeForm); } break; case TargetAudience: { TypeGroupForm *targetAudienceForm = new TypeGroupForm(m_type->targetAudience().at(index), this->mainWindow()); targetAudienceForm->setTitle(tr("Target Audience")); targetAudienceForm->setGeneralDoc(tr("A group of attributes to describe the target audience (parental guidance, geographical or occupantional groups, etc.).")); targetAudienceForm->setDefinitionDoc(tr("An optional definition.\nExample: code for MPAA 'general' rating.")); targetAudienceForm->setLinkDoc(tr("A link to a term or only identify a classification scheme.")); targetAudienceForm->setLabelDoc(tr("Free text field. This can be used to repeat the term name of the classification scheme term identified by a typeLink.\nExample: 'General'.")); targetAudienceForm->addLinksMap(mainWindow()->getMap("ebu_IntendedAudienceCodeCS")); targetAudienceForm->addLinksMap(mainWindow()->getMap("ebu_ParentalGuidanceCodeCS")); QObject::connect(targetAudienceForm, SIGNAL(closed(Operation,QVariant)), this, SLOT(targetAudienceFormClosed(Operation,QVariant))); this->mainWindow()->pushWidget(targetAudienceForm); } break; } }
void emulate_close() { closed(); }
void CDialogLibrarySearch::on_pushButtonCancel_clicked() { emit closed(); close(); }
void MasterPalette::closeEvent(QCloseEvent* ev) { emit closed(false); QWidget::closeEvent(ev); }
void PanelTimeLineWidget::closeEvent(QCloseEvent *evt) { emit closed(); evt->accept(); }
void Protocol::prepareStateMachine(){ qDebug() << "Protocol: Initialising Protocol State"; QStateMachine *machine = new QStateMachine(this); /** * Main states are connected, disconnected and done, we start disconnected * and turn to connected when the socket is operational. * All the other states are part of the connected state */ QState *disconnected = new QState(); QState *connected = new QState(); QFinalState *done = new QFinalState(); /** * When first connected, we need to know the protocol version, * then request authentication. We then either turn to the authenticated * state or flee to *done */ QState *waitingproto = new QState(connected); QState *waitingauthrequest = new QState(connected); QState *waitingauthstatus = new QState(connected); QState *authenticated = new QState(connected); connected->setInitialState(waitingproto); /** * When authenticated, the user must provide some information about himself * (nickname, status, planet picture, user picture, attack picture) * Then the user can request to join the chat room, get the list of games and users * join a game or create a game * In the chat room, the user sends and receives messages, and can eventually exit */ QState *waitinguserdetails = new QState(authenticated); QState *waitingcommand = new QState(authenticated); QState *inchat = new QState(authenticated); QState *waitinggamecreation = new QState(authenticated); QState *waitinggamelist = new QState(authenticated); QState *waitinguserlist = new QState(authenticated); QState *joinedgame = new QState(authenticated); authenticated->setInitialState(waitinguserdetails); /** * When entering the game, we wait for the users to show up * then receive the game map * we then wait for the game to unpause, and the game progresses till * there's a winner or cancellation */ QState *waitinguser = new QState(joinedgame); QState *waitingmap = new QState(joinedgame); QState *paused = new QState(joinedgame); QState *ingame = new QState(joinedgame); joinedgame->setInitialState(waitinguser); qDebug() << "Protocol: Connecting Protocol Signals"; disconnected->addTransition(this, SIGNAL(connected()), connected); connected->addTransition(this, SIGNAL(closed()), done); waitingproto->addTransition(this, SIGNAL(protocol(QString)), waitingauthrequest); waitingauthrequest->addTransition(this, SIGNAL(authrequest(QString,QString)), waitingauthstatus); waitingauthstatus->addTransition(this, SIGNAL(authenticated()), authenticated); waitingauthstatus->addTransition(this, SIGNAL(protocolError(QString)), done); machine->addState(disconnected); machine->addState(connected); machine->setInitialState(disconnected); qDebug() << "Protocol: Starting State Machine"; machine->start(); }
void EmojiBox::onClose() { emit closed(); }
void LodToolsDialog::closeEvent(QCloseEvent* event) { this->QDialog::closeEvent(event); emit closed(); }
void DialogProfile::on_pushButtonCancel_clicked() { emit closed(); close(); }
QT_BEGIN_NAMESPACE /*! \class QNetworkSession \brief The QNetworkSession class provides control over the system's access points and enables session management for cases when multiple clients access the same access point. \since 4.7 \inmodule QtNetwork \ingroup network A QNetworkSession enables control over the system's network interfaces. The session's configuration parameter are determined via the QNetworkConfiguration object to which it is bound. Depending on the type of the session (single access point or service network) a session may be linked to one or more network interfaces. By means of \l{open()}{opening} and \l{close()}{closing} of network sessions a developer can start and stop the systems network interfaces. If the configuration represents multiple access points (see \l QNetworkConfiguration::ServiceNetwork) more advanced features such as roaming may be supported. QNetworkSession supports session management within the same process and depending on the platform's capabilities may support out-of-process sessions. If the same network configuration is used by multiple open sessions the underlying network interface is only terminated once the last session has been closed. \section1 Roaming Applications may connect to the preferredConfigurationChanged() signal in order to receive notifications when a more suitable access point becomes available. In response to this signal the application must either initiate the roaming via migrate() or ignore() the new access point. Once the session has roamed the newConfigurationActivated() signal is emitted. The application may now test the carrier and must either accept() or reject() it. The session will return to the previous access point if the roaming was rejected. The subsequent state diagram depicts the required state transitions. \image roaming-states.png Some platforms may distinguish forced roaming and application level roaming (ALR). ALR implies that the application controls (via migrate(), ignore(), accept() and reject()) whether a network session can roam from one access point to the next. Such control is useful if the application maintains stateful socket connections and wants to control the transition from one interface to the next. Forced roaming implies that the system automatically roams to the next network without consulting the application. This has the advantage that the application can make use of roaming features without actually being aware of it. It is expected that the application detects that the underlying socket is broken and automatically reconnects via the new network link. If the platform supports both modes of roaming, an application indicates its preference by connecting to the preferredConfigurationChanged() signal. Connecting to this signal means that the application wants to take control over the roaming behavior and therefore implies application level roaming. If the client does not connect to the preferredConfigurationChanged(), forced roaming is used. If forced roaming is not supported the network session will not roam by default. Some applications may want to suppress any form of roaming altogether. Possible use cases may be high priority downloads or remote services which cannot handle a roaming enabled client. Clients can suppress roaming by connecting to the preferredConfigurationChanged() signal and answer each signal emission with ignore(). \sa QNetworkConfiguration, QNetworkConfigurationManager */ /*! \enum QNetworkSession::State This enum describes the connectivity state of the session. If the session is based on a single access point configuration the state of the session is the same as the state of the associated network interface. \value Invalid The session is invalid due to an invalid configuration. This may happen due to a removed access point or a configuration that was invalid to begin with. \value NotAvailable The session is based on a defined but not yet discovered QNetworkConfiguration (see \l QNetworkConfiguration::StateFlag). \value Connecting The network session is being established. \value Connected The network session is connected. If the current process wishes to use this session it has to register its interest by calling open(). A network session is considered to be ready for socket operations if it isOpen() and connected. \value Closing The network session is in the process of being shut down. \value Disconnected The network session is not connected. The associated QNetworkConfiguration has the state QNetworkConfiguration::Discovered. \value Roaming The network session is roaming from one access point to another access point. */ /*! \enum QNetworkSession::SessionError This enum describes the session errors that can occur. \value UnknownSessionError An unidentified error occurred. \value SessionAbortedError The session was aborted by the user or system. \value RoamingError The session cannot roam to a new configuration. \value OperationNotSupportedError The operation is not supported for current configuration. \value InvalidConfigurationError The operation cannot currently be performed for the current configuration. */ /*! \fn void QNetworkSession::stateChanged(QNetworkSession::State state) This signal is emitted whenever the state of the network session changes. The \a state parameter is the new state. \sa state() */ /*! \fn void QNetworkSession::error(QNetworkSession::SessionError error) This signal is emitted after an error occurred. The \a error parameter describes the error that occurred. \sa error(), errorString() */ /*! \fn void QNetworkSession::preferredConfigurationChanged(const QNetworkConfiguration& config, bool isSeamless) This signal is emitted when the preferred configuration/access point for the session changes. Only sessions which are based on service network configurations may emit this signal. \a config can be used to determine access point specific details such as proxy settings and \a isSeamless indicates whether roaming will break the sessions IP address. As a consequence to this signal the application must either start the roaming process by calling migrate() or choose to ignore() the new access point. If the roaming process is non-seamless the IP address will change which means that a socket becomes invalid. However seamless mobility can ensure that the local IP address does not change. This is achieved by using a virtual IP address which is bound to the actual link address. During the roaming process the virtual address is attached to the new link address. Some platforms may support the concept of Forced Roaming and Application Level Roaming (ALR). Forced roaming implies that the platform may simply roam to a new configuration without consulting applications. It is up to the application to detect the link layer loss and reestablish its sockets. In contrast ALR provides the opportunity to prevent the system from roaming. If this session is based on a configuration that supports roaming the application can choose whether it wants to be consulted (ALR use case) by connecting to this signal. For as long as this signal connection remains the session remains registered as a roaming stakeholder; otherwise roaming will be enforced by the platform. \sa migrate(), ignore(), QNetworkConfiguration::isRoamingAvailable() */ /*! \fn void QNetworkSession::newConfigurationActivated() This signal is emitted once the session has roamed to the new access point. The application may reopen its socket and test the suitability of the new network link. Subsequently it must either accept() or reject() the new access point. \sa accept(), reject() */ /*! \fn void QNetworkSession::opened() This signal is emitted when the network session has been opened. The underlying network interface will not be shut down as long as the session remains open. Note that this feature is dependent on \l{QNetworkConfigurationManager::SystemSessionSupport}{system wide session support}. */ /*! \fn void QNetworkSession::closed() This signal is emitted when the network session has been closed. */ /*! Constructs a session based on \a connectionConfig with the given \a parent. \sa QNetworkConfiguration */ QNetworkSession::QNetworkSession(const QNetworkConfiguration& connectionConfig, QObject* parent) : QObject(parent), d(0) { foreach (QBearerEngine *engine, qNetworkConfigurationManagerPrivate()->engines()) { if (engine->hasIdentifier(connectionConfig.identifier())) { d = engine->createSessionBackend(); d->q = this; d->publicConfig = connectionConfig; d->syncStateWithInterface(); connect(d, SIGNAL(quitPendingWaitsForOpened()), this, SIGNAL(opened())); connect(d, SIGNAL(error(QNetworkSession::SessionError)), this, SIGNAL(error(QNetworkSession::SessionError))); connect(d, SIGNAL(stateChanged(QNetworkSession::State)), this, SIGNAL(stateChanged(QNetworkSession::State))); connect(d, SIGNAL(closed()), this, SIGNAL(closed())); connect(d, SIGNAL(preferredConfigurationChanged(QNetworkConfiguration,bool)), this, SIGNAL(preferredConfigurationChanged(QNetworkConfiguration,bool))); connect(d, SIGNAL(newConfigurationActivated()), this, SIGNAL(newConfigurationActivated())); break; } }
void qBicWin::goClose() { this->close(); emit closed(); }
void ItemEditor::onError() { emitError( m_editor->errorString() ); emit closed(this); }