本文整理汇总了C++中releaseKeyboard函数的典型用法代码示例。如果您正苦于以下问题:C++ releaseKeyboard函数的具体用法?C++ releaseKeyboard怎么用?C++ releaseKeyboard使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了releaseKeyboard函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QDir
// -----------------------------------------------------------------------------
// Exit the preview window
// -----------------------------------------------------------------------------
void TTCutPreview::exitPreview()
{
QString rm_command = "rm ";
QString file_name = "preview*";
QFileInfo file_info;
if ( !isPlaying ) {
// clean up preview* files in temp directory
file_info.setFile( QDir(TTCut::tempDirPath), file_name );
rm_command += file_info.absoluteFilePath();
rm_command += " 2>/dev/null";
system( rm_command.toAscii().data());
releaseKeyboard();
done( 0 );
} else {
if(stopMPlayer()) {
releaseKeyboard();
done(0);
} else {
qDebug( "Cant't exit, mplayer still running ???" );
}
}
}
示例2: releaseKeyboard
void EventPropertyWidgetQt::keyReleaseEvent(QKeyEvent* event) {
if (keyMatcher_ && (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return)) {
releaseKeyboard();
eventproperty_->setEventMatcher(std::unique_ptr<EventMatcher>(keyMatcher_->clone()));
setButtonText();
button_->setEnabled(true);
} else if (keyMatcher_ && event->key() == Qt::Key_Escape) {
releaseKeyboard();
setButtonText();
button_->setEnabled(true);
} else {
QWidget::keyReleaseEvent(event);
}
}
示例3: releaseMouse
void ColorPickerWidget::closeEventFilter()
{
m_filterActive = false;
releaseMouse();
releaseKeyboard();
removeEventFilter(this);
}
示例4: p
void QuickButton::mouseMoveEvent(QMouseEvent *e)
{
if((e->state() & LeftButton) == 0)
return;
QPoint p(e->pos() - _dragPos);
if(p.manhattanLength() <= KGlobalSettings::dndEventDelay())
return;
DEBUGSTR << "dragstart" << endl << flush;
setDown(false);
if(_dragEnabled)
{
KURL::List uris;
uris.append(_qurl->kurl());
DEBUGSTR << "creating KURLDrag" << endl << flush;
KURLDrag *dd = new KURLDrag(uris, this);
dd->setPixmap(_icon); // PIX
DEBUGSTR << "ready to drag" << endl << flush;
grabKeyboard();
dd->drag();
releaseKeyboard();
}
else
{
setCursor(Qt::ForbiddenCursor);
}
}
示例5: switch
void PixelWidget::keyPressEvent(QKeyEvent *e)
{
switch (e->key()) {
case Qt::Key_Plus:
increaseZoom();
break;
case Qt::Key_Minus:
decreaseZoom();
break;
case Qt::Key_PageUp:
setGridSize(m_gridSize + 1);
break;
case Qt::Key_PageDown:
setGridSize(m_gridSize - 1);
break;
case Qt::Key_G:
toggleGrid();
break;
case Qt::Key_C:
if (e->modifiers() & Qt::ControlModifier)
copyToClipboard();
break;
case Qt::Key_S:
if (e->modifiers() & Qt::ControlModifier) {
releaseKeyboard();
saveToFile();
}
break;
case Qt::Key_Control:
grabKeyboard();
break;
}
}
示例6: releaseKeyboard
void EditSingleShortcut::stopRecording_()
{
if(is_recording_) {
releaseKeyboard();
is_recording_ = false;
}
}
示例7: setHotkeyText
bool HotkeyWidget::event(QEvent *event)
{
if (event->type() == QEvent::LanguageChange) {
setHotkeyText();
} else if (event->type() == QEvent::KeyPress) {
keyPressEvent(static_cast<QKeyEvent *>(event));
return true;
} else if (event->type() == QEvent::FocusIn) {
QFocusEvent *focusEvent = static_cast<QFocusEvent *>(event);
if (focusEvent->reason() != Qt::TabFocusReason) {
setText(tr("Type your hotkey"));
mKeyboardFocus = false;
grabKeyboard();
} else {
mKeyboardFocus = true;
}
} else if (event->type() == QEvent::FocusOut) {
if (text() == tr("Invalid hotkey")) {
emit invalidHotkeyError();
showError();
}
releaseKeyboard();
setHotkeyText(); // Reset the text
} else if ((event->type() == QEvent::KeyPress || event->type() == QEvent::ShortcutOverride || event->type() == QEvent::Shortcut) && hasFocus()) {
event->accept();
return true;
}
return QPushButton::event(event);
}
示例8: menuBar
void MainWindow::fullScreenMode(bool mode)
{
isFullScreenMouse = mode;
if(mode)
{
_toolbar->hide();
menuBar()->hide();
//setWindowFlags(Qt::FramelessWindowHint);
//showMaximized();
showFullScreen();
grabKeyboard();
}
else
{
_toolbar->show();
menuBar()->show();
// setWindowFlags((Qt::WindowFlags)(~Qt::FramelessWindowHint));
showNormal();
releaseKeyboard();
}
show();
}
示例9: releaseKeyboard
void MainWindow::toggleFullscreen()
{
if (fullScreen_)
{
fullScreen_ = false;
fsGlWidget_->showNormal();
fsGlWidget_->hide();
releaseKeyboard();
mainGlWidget_->makeCurrent();
// mainGlWidget_->show();
}
else
{
fullScreen_ = true;
grabKeyboard();
// mainGlWidget_->hide();
fsGlWidget_->makeCurrent();
fsGlWidget_->showFullScreen();
int numScreens = QApplication::desktop()->numScreens();
if (numScreens >= 2)
{
// Two Screens used by output widget
QRect s2 = QApplication::desktop()->screenGeometry(0);
s2 = s2.united(QApplication::desktop()->screenGeometry(1));
fsGlWidget_->setGeometry(s2);
}
}
}
示例10: grabKeyboard
int WProcess::execute(const QString &command,
const QStringList &arguments,
const QString &title,
bool close_when_finished)
{
grabKeyboard();
setWindowTitle(title);
connect(cmd_p,SIGNAL(readyReadStandardOutput()),this,SLOT(readyReadStandardOutput()));
connect(cmd_p,SIGNAL(readyReadStandardError()),this,SLOT(readyReadStandardError()));
connect(cmd_p,SIGNAL(error(QProcess::ProcessError )),this,SLOT(error(QProcess::ProcessError )));
connect(cmd_p,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(finished(int,QProcess::ExitStatus)));
close_p->setText(tr("Cancel"));
text_p->clear();
status_p->setText(tr("Executing %1 ...").arg(command));
cmd_p->start(command,arguments);
returned_code=-1;
if (cmd_p->waitForStarted())
{
status_p->setText(tr("%1 is running").arg(command));
this->close_when_finished=close_when_finished;
if (! exec() )
returned_code=-1;
}
releaseKeyboard();
stdout_p=NULL;
return returned_code;
}
示例11: installEventFilter
void IOWindow::OnDetectButtonPressed()
{
installEventFilter(BlockUserInputFilter::Instance());
grabKeyboard();
grabMouse();
std::thread([this] {
auto* btn = m_type == IOWindow::Type::Input ? m_detect_button : m_test_button;
const auto old_label = btn->text();
btn->setText(QStringLiteral("..."));
const auto expr = MappingCommon::DetectExpression(
m_reference, g_controller_interface.FindDevice(m_devq).get(), m_devq,
MappingCommon::Quote::Off);
btn->setText(old_label);
if (!expr.isEmpty())
{
const auto list = m_option_list->findItems(expr, Qt::MatchFixedString);
if (list.size() > 0)
m_option_list->setCurrentItem(list[0]);
}
releaseMouse();
releaseKeyboard();
removeEventFilter(BlockUserInputFilter::Instance());
})
.detach();
}
示例12: grabKeyboard
void KeyButton::keyPressEvent(QKeyEvent *keyEvent) {
std::string keyText = QKeyUtil::keyName(keyEvent);
if (keyEvent->key() == Key_Return) {
grabKeyboard();
return;
}
if (keyEvent->key() == Key_Up ||
keyEvent->key() == Key_Down) {
clearFocus();
releaseKeyboard();
return;
}
if (!keyText.empty()) {
myKeyView.myCurrentKey = keyText;
myKeyView.myLabel->setText("Action For " + QString::fromUtf8(keyText.c_str()));
myKeyView.myLabel->show();
#if 0
QSizePolicy pol = myKeyView.myLabel->sizePolicy();
pol.setHorData(QSizePolicy::Fixed);
myKeyView.myLabel->setSizePolicy(pol);
myKeyView.myLabel->setLineWidth(80);
pol = myKeyView.myComboBox->sizePolicy();
pol.setHorData(QSizePolicy::Fixed);
myKeyView.myComboBox->setSizePolicy(pol);
#endif
myKeyView.myComboBox->setCurrentItem(((ZLKeyOptionEntry*)myKeyView.myOption)->actionIndex(keyText));
myKeyView.myComboBox->show();
}
}
示例13: releaseKeyboard
void ShutdownManager::hideEvent(QHideEvent *e)
{
releaseKeyboard();
m_hotZoneInterface->EnableZoneDetected(true);
QWidget::hideEvent(e);
}
示例14: QPoint
void Calibrate::reset()
{
penPos = QPoint();
location = QWSPointerCalibrationData::TopLeft;
crossPos = fromDevice( cd.screenPoints[location] );
releaseMouse();
releaseKeyboard();
}
示例15: releaseKeyboard
void ColorSelector::keyReleaseEvent ( QKeyEvent * e )
{
if (e->key() == mHotKey) {
mCtrlPressed = false;
releaseKeyboard();
}
emit (keyRelease(e));
}