focus bug fix

This commit is contained in:
Rafael 2016-04-14 03:51:48 +02:00
parent a57948f77e
commit c4b42beae4
2 changed files with 5 additions and 3 deletions

View file

@ -67,6 +67,8 @@ PictureDialog::PictureDialog(ProfileDatabase *profileDB, QWidget *parent) :
ui->cmdExport->setMenu(exportMenu); ui->cmdExport->setMenu(exportMenu);
installEventFilter(this); installEventFilter(this);
installEventFilter(ui->labPicture);
ui->labPicture->setFocusPolicy(Qt::StrongFocus);
} }
PictureDialog::~PictureDialog() PictureDialog::~PictureDialog()
@ -78,7 +80,7 @@ PictureDialog::~PictureDialog()
bool PictureDialog::eventFilter(QObject *obj, QEvent *ev) bool PictureDialog::eventFilter(QObject *obj, QEvent *ev)
{ {
bool returnValue = false; bool returnValue = false;
if (obj == this) if (obj == this || obj == ui->labPicture)
{ {
if (ev->type() == QEvent::KeyPress) if (ev->type() == QEvent::KeyPress)
{ {

View file

@ -120,7 +120,7 @@
<item> <item>
<widget class="QPushButton" name="cmdExport"> <widget class="QPushButton" name="cmdExport">
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::ClickFocus</enum> <enum>Qt::NoFocus</enum>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Export picture</string> <string>Export picture</string>
@ -136,7 +136,7 @@
<item> <item>
<widget class="QPushButton" name="cmdClose"> <widget class="QPushButton" name="cmdClose">
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::ClickFocus</enum> <enum>Qt::NoFocus</enum>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Close</string> <string>Close</string>