首先在.h文件中定义void keyPressEvent(QKeyEvent *e); ,然后再.cpp中进行实现
void SlwView::keyPressEvent(QKeyEvent *e)
{
if(e->key() == Qt::Key_F11)
{
if(this->isFullSreen)
this->showNormal();
else
this->showFullSreen();
}
}
首先在.h文件中定义void keyPressEvent(QKeyEvent *e); ,然后再.cpp中进行实现
void SlwView::keyPressEvent(QKeyEvent *e)
{
if(e->key() == Qt::Key_F11)
{
if(this->isFullSreen)
this->showNormal();
else
this->showFullSreen();
}
}
本文标题:用键盘设置全屏和非全屏
本文链接:https://www.haomeiwen.com/subject/jjzesftx.html
网友评论