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


C++ QSessionManager::allowsInteraction方法代码示例

本文整理汇总了C++中QSessionManager::allowsInteraction方法的典型用法代码示例。如果您正苦于以下问题:C++ QSessionManager::allowsInteraction方法的具体用法?C++ QSessionManager::allowsInteraction怎么用?C++ QSessionManager::allowsInteraction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QSessionManager的用法示例。


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

示例1: commitData

 virtual void commitData(QSessionManager &manager) {
     if (!m_mainWindow) return;
     bool mayAskUser = manager.allowsInteraction();
     bool success = m_mainWindow->commitData(mayAskUser);
     manager.release();
     if (!success) manager.cancel();
 }
开发者ID:dafx,项目名称:sonic-visualizer,代码行数:7,代码来源:main.cpp

示例2: commitData

void MainWindow::commitData(QSessionManager &manager)
{
    // Play nice with session management and cancel shutdown process when user
    // requests this
    if (manager.allowsInteraction())
        if (!confirmAllSave())
            manager.cancel();
}
开发者ID:ChicoTeam,项目名称:tiled,代码行数:8,代码来源:mainwindow.cpp

示例3: commitData

/**
	reimplementing QApplication::commitData().
	This function deals with session management. It is invoked when the QSessionManager wants the application to commit all its data.
 */
void MyApplication::commitData(QSessionManager& manager)
{
	debugQt("MyApplication::commitData()");
	if (manager.allowsInteraction())
	{
		manager.release();
		emit quitMyApp();
	}
}
开发者ID:danielrocher,项目名称:qtsmbstatus,代码行数:13,代码来源:mainwindows.cpp

示例4: commitData

void JavaScriptInterpreter::commitData(QSessionManager &manager)
{
	if (manager.allowsInteraction()) {
		if (!maybeSave())
			manager.cancel();
	}
	else {
		if (TextEdit_input->document()->isModified())
			save();
	}
}
开发者ID:nurfet,项目名称:world,代码行数:11,代码来源:javascriptinterpreter.cpp

示例5: commitData

void Application::commitData(QSessionManager &sessionManager)
{
    if (ticTacToe->gameInProgress()
            && sessionManager.allowsInteraction()) {
        int ret = QMessageBox::warning(ticTacToe, tr("Tic-Tac-Toe"),
                     tr("The game hasn't finished.\n"
                        "Do you really want to quit?"),
                     QMessageBox::Yes | QMessageBox::Default,
                     QMessageBox::No | QMessageBox::Escape);
        if (ret == QMessageBox::Yes)
            sessionManager.release();
        else
            sessionManager.cancel();
    }
}
开发者ID:EleVenPerfect,项目名称:OTHERS,代码行数:15,代码来源:application.cpp

示例6: commitData

void GUIApplication::commitData(QSessionManager &manager)
{
    if (manager.allowsInteraction()) {
        if (!Gui::getMainWindow()->close()) {
            // cancel the shutdown
            manager.release();
            manager.cancel();
        }
    }
    else {
        // no user interaction allowed, thus close all documents and
        // the main window
        App::GetApplication().closeAllDocuments();
        Gui::getMainWindow()->close();
    }
}
开发者ID:needtogettomit,项目名称:FreeCAD,代码行数:16,代码来源:GuiApplication.cpp

示例7: onCommitData

void ClipboardServer::onCommitData(QSessionManager &sessionManager)
{
    COPYQ_LOG("Got commit data request from session manager.");

    const bool cancel = sessionManager.allowsInteraction() && !askToQuit();
    sessionManager.release();

    if (cancel) {
        sessionManager.cancel();
        startMonitoring();
    } else {
        m_wnd->saveTabs();

        // WORKAROUND: This is required to exit application from
        //             installer, otherwise main window is only
        //             minimized after this when tray is disabled.
        m_wnd->hide();
        exit();
    }
}
开发者ID:hluk,项目名称:CopyQ,代码行数:20,代码来源:clipboardserver.cpp


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