本文整理汇总了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();
}
示例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();
}
示例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();
}
}
示例4: commitData
void JavaScriptInterpreter::commitData(QSessionManager &manager)
{
if (manager.allowsInteraction()) {
if (!maybeSave())
manager.cancel();
}
else {
if (TextEdit_input->document()->isModified())
save();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}