1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/newbeats-pastes

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
mainframe.cpp 714
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
Jackie Liu Отправлено 16.12.2020 08:32 b3eb527
#include <QEvent>
#include <QKeyEvent>
#include "mainframe.h"
MainFrame::MainFrame(QWidget *parent) : QWidget(parent)
{
this->setObjectName("MainFrame");
this->setAttribute(Qt::WA_StyledBackground);
}
bool MainFrame::event(QEvent *event)
{
if (event->type() == QEvent::KeyPress) {
QKeyEvent *ke = static_cast<QKeyEvent *>(event);
switch (ke->key()) {
case Qt::Key_Return:
case Qt::Key_Enter:
emit this->selectItem();
return true;
case Qt::Key_Escape:
emit this->hideWindow();
return true;
case Qt::Key_Tab:
emit this->moveFocusPrevNext(false);
return true;
case Qt::Key_Backtab:
emit this->moveFocusPrevNext(true);
return true;
}
}
return QWidget::event(event);
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/newbeats-pastes.git
git@api.gitlife.ru:oschina-mirror/newbeats-pastes.git
oschina-mirror
newbeats-pastes
newbeats-pastes
master