BlackBerry: Fix QFileDialog show()/hide()
QFileDialog::show() no longer worked after the dialog had already been shown and hidden before. Task-number: QTBUG-34983 Change-Id: I7300374b74805308e0966db7b3545e5fd8470465 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
This commit is contained in:
parent
2a76ef7e99
commit
0312cb3ffe
@ -87,6 +87,9 @@ public:
|
||||
Q_SIGNALS:
|
||||
void dialogClosed();
|
||||
|
||||
private Q_SLOTS:
|
||||
void emitSignals();
|
||||
|
||||
private:
|
||||
void setNameFilter(const QString &filter);
|
||||
void setNameFilters(const QStringList &filters);
|
||||
|
@ -68,6 +68,7 @@ QQnxFileDialogHelper::QQnxFileDialogHelper(const QQnxIntegration *integration)
|
||||
m_selectedFilter(),
|
||||
m_result(QPlatformDialogHelper::Rejected)
|
||||
{
|
||||
connect(m_dialog, &QQnxFilePicker::closed, this, &QQnxFileDialogHelper::emitSignals);
|
||||
}
|
||||
|
||||
QQnxFileDialogHelper::~QQnxFileDialogHelper()
|
||||
@ -85,11 +86,6 @@ void QQnxFileDialogHelper::exec()
|
||||
QEventLoop loop;
|
||||
connect(m_dialog, SIGNAL(closed()), &loop, SLOT(quit()));
|
||||
loop.exec();
|
||||
|
||||
if (m_dialog->selectedFiles().isEmpty())
|
||||
Q_EMIT reject();
|
||||
else
|
||||
Q_EMIT accept();
|
||||
}
|
||||
|
||||
bool QQnxFileDialogHelper::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent)
|
||||
@ -197,6 +193,14 @@ QString QQnxFileDialogHelper::selectedNameFilter() const
|
||||
return m_selectedFilter;
|
||||
}
|
||||
|
||||
void QQnxFileDialogHelper::emitSignals()
|
||||
{
|
||||
if (m_dialog->selectedFiles().isEmpty())
|
||||
Q_EMIT reject();
|
||||
else
|
||||
Q_EMIT accept();
|
||||
}
|
||||
|
||||
void QQnxFileDialogHelper::setNameFilter(const QString &filter)
|
||||
{
|
||||
qFileDialogHelperDebug() << Q_FUNC_INFO << "filter =" << filter;
|
||||
|
Loading…
x
Reference in New Issue
Block a user