QSoftKeyManager::QSoftKeyManager() :
#ifdef Q_WS_S60
    QObject(*(new QSoftKeyManagerPrivateS60), 0)
#else
    QObject(*(new QSoftKeyManagerPrivate), 0)
#endif
{
}

QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *actionWidget)
{
    const char* text = standardSoftKeyText(standardKey);
    QAction *action = new QAction(QSoftKeyManager::tr(text), actionWidget);
    QAction::SoftKeyRole softKeyRole = QAction::NoSoftKey;
    switch (standardKey) {
    case MenuSoftKey: // FALL-THROUGH
        action->setProperty(MENU_ACTION_PROPERTY, QVariant(true)); // TODO: can be refactored away to use _q_action_menubar
    case OkSoftKey:
    case SelectSoftKey:
    case DoneSoftKey:
        softKeyRole = QAction::PositiveSoftKey;
        break;
    case CancelSoftKey:
        softKeyRole = QAction::NegativeSoftKey;
        break;
    }
    action->setSoftKeyRole(softKeyRole);
    return action;
}

/*! \internal

  Creates a QAction and registers the 'triggered' signal to send the given key event to
  \a actionWidget as a convenience.

*/
QAction *QSoftKeyManager::createKeyedAction(StandardSoftKey standardKey, Qt::Key key, QWidget *actionWidget)
{
#ifndef QT_NO_ACTION
    QScopedPointer<QAction> action(createAction(standardKey, actionWidget));

    connect(action.data(), SIGNAL(triggered()), QSoftKeyManager::instance(), SLOT(sendKeyEvent()));
    connect(action.data(), SIGNAL(destroyed(QObject*)), QSoftKeyManager::instance(), SLOT(cleanupHash(QObject*)));
    QSoftKeyManager::instance()->d_func()->keyedActions.insert(action.data(), key);
    return action.take();
#endif //QT_NO_ACTION
}
示例#2
0
void XProcess::slotCleanup(){
  Backend::log("Session Finished\n - Return Code: "+ QString::number(this->exitCode()) );
  pam_shutdown(); //make sure that PAM shuts down properly
  this->closeWriteChannel();
  this->closeReadChannel(QProcess::StandardOutput);
  this->closeReadChannel(QProcess::StandardError);
  //Now remove this user's access to the Xserver
  QString xhostcmd = "xhost -si:localuser:"******" - Removing Stealth session"; }
    QProcess::execute("personacrypt temprem"); //remove the temporary home-dir
  }else if( !xdevpass.isEmpty() ){
    if(DEBUG){ Backend::log(" - Unmounting PersonaCrypt User: "******" WARNING: Could not unmount user device (attempt "+QString::number(tries)+"/10)");
      tries++;
      QObject().thread()->usleep(500000); //wait 1/2 second before trying again (max 5 seconds)
    }
    if(tries>10){ Backend::log(" ERROR: Could not unmount user device"); }
    else{ Backend::log(" SUCCESS: User device unmounted"); }
  }
}
示例#3
0
QPlane::QPlane(const QVector& _point, const QVector& _normal){
	QObject();
	point = _point;
	normal = _normal;
	normal.normalize();
}