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


C++ releaseKeyboard函数代码示例

本文整理汇总了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 ???" );
    }
  }
}
开发者ID:BackupTheBerlios,项目名称:ttcut-svn,代码行数:29,代码来源:ttcutpreview.cpp

示例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);
    }
}
开发者ID:ResearchDaniel,项目名称:inviwo,代码行数:14,代码来源:eventpropertywidgetqt.cpp

示例3: releaseMouse

void ColorPickerWidget::closeEventFilter()
{
    m_filterActive = false;
    releaseMouse();
    releaseKeyboard();
    removeEventFilter(this);
}
开发者ID:dreamsxin,项目名称:kdenlive,代码行数:7,代码来源:colorpickerwidget.cpp

示例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);
    }
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:26,代码来源:quickbutton.cpp

示例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;
    }
}
开发者ID:BayTekGames,项目名称:apitrace,代码行数:33,代码来源:pixelwidget.cpp

示例6: releaseKeyboard

		void EditSingleShortcut::stopRecording_()
		{
			if(is_recording_) {
				releaseKeyboard();
				is_recording_ = false;
			}
		}
开发者ID:HeyJJ,项目名称:ball,代码行数:7,代码来源:editSingleShortcut.C

示例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);
}
开发者ID:focusn1k,项目名称:Lightscreen,代码行数:32,代码来源:hotkeywidget.cpp

示例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();
}
开发者ID:areyeslo,项目名称:marsyas,代码行数:25,代码来源:MainWindow.cpp

示例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);
        }
    }
}
开发者ID:cbreak-black,项目名称:ExaminationRoom,代码行数:28,代码来源:mainwindow.cpp

示例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;
}
开发者ID:testcocoon,项目名称:testcocoon,代码行数:29,代码来源:WProcess.cpp

示例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();
}
开发者ID:Mystro256,项目名称:dolphin,代码行数:32,代码来源:IOWindow.cpp

示例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();
	}
}
开发者ID:xufooo,项目名称:fbreader-e2-test,代码行数:30,代码来源:QOptionView.cpp

示例13: releaseKeyboard

void ShutdownManager::hideEvent(QHideEvent *e)
{
    releaseKeyboard();
    m_hotZoneInterface->EnableZoneDetected(true);

    QWidget::hideEvent(e);
}
开发者ID:oberon2007,项目名称:deepin-session-ui-manjaro,代码行数:7,代码来源:shutdownmanager.cpp

示例14: QPoint

void Calibrate::reset()
{
    penPos = QPoint();
    location = QWSPointerCalibrationData::TopLeft;
    crossPos = fromDevice( cd.screenPoints[location] );
    releaseMouse();
    releaseKeyboard();
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:8,代码来源:calibrate.cpp

示例15: releaseKeyboard

void ColorSelector::keyReleaseEvent ( QKeyEvent * e )
{
  if (e->key() == mHotKey) {
    mCtrlPressed = false;
    releaseKeyboard();
  }
  emit (keyRelease(e));
}
开发者ID:imod-mirror,项目名称:IMOD,代码行数:8,代码来源:colorselector.cpp


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