Hi,

I have implemented my custom dialog inherited from QDialog:

mydialog.h
Code:
#ifndef MYDIALOG_H
#define MYDIALOG_H

#include <QDialog>

class QPushButton;

class MyDialog : public QDialog
{
public:
    MyDialog();
    MyDialog(QWidget* parent);

private:
    void init();

private:
    QPushButton* okButton;

};

#endif // MYDIALOG_H
mydialog.cpp
Code:
#include <QPushButton>
#include <QGridLayout>
#include "mydialog.h"

MyDialog::MyDialog()
{
    this->okButton = new QPushButton();
    this->init();
}

MyDialog::MyDialog(QWidget* parent) : QDialog(parent)
{
    this->okButton = new QPushButton(this);
    this->init();
}

void MyDialog::init()
{
    this->okButton->setText("OK");

    connect(this->okButton, SIGNAL(pressed()), this, SLOT(close()));

    QGridLayout* layout = new QGridLayout();

    layout->addWidget(this->okButton, 0, 0);

    this->setLayout(layout);
    this->resize(50, 50);
}
I am using it in this way:
Code:
...
MainWindow::MainWindow(QWidget *parent, Qt::WFlags flags)
    : QMainWindow(parent, flags)
{
    ui.setupUi(this);

    connect(ui.pushButton_1, SIGNAL(pressed()), this, SLOT(close()));
    connect(ui.pushButton_2, SIGNAL(pressed()), this, SLOT(showNonModalDialog()));
    connect(ui.pushButton_3, SIGNAL(pressed()), this, SLOT(showModalDialog()));
    connect(ui.pushButton_4, SIGNAL(pressed()), this, SLOT(showMessage()));
}
...
void MainWindow::showNonModalDialog()
{
    MyDialog* dialog = new MyDialog(this);
    dialog->show();
}

void MainWindow::showModalDialog()
{
    MyDialog* dialog = new MyDialog(this);
    dialog->exec();
}
...
There are some buttons on MainWindow. In emulator I can change their focus e.g. pressing arrows or by LSK. Pressing pushButton_2 or pushButton_3 opens the custom dialog (show() or exec()).

PROBLEM: After dialog is closed (no matter if show() or exec() was used), nor MainWindow neither buttons have focus, so pressing arrows or LSK has no effect.
Only way how to recover from this is by pointer events (which is obviously impossible on device without touch support) or sending app to background first and to foreground then.

MainWindow and buttons have StrongFocus policy.
Setting focus to window directly (setFocus()) doesn't help.

Please help. Thanks in advance.