summaryrefslogtreecommitdiff
path: root/src/dialogs/qquickabstractdialog.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2015-03-18 17:41:07 +0100
committerShawn Rutledge <shawn.rutledge@digia.com>2015-03-30 14:00:36 +0000
commit5061d101310bd110e86831249b94d137a831d3be (patch)
tree6f051f732557a3df70969dc601bd5ea9567d766d /src/dialogs/qquickabstractdialog.cpp
parent4606c04a689cbc73bc5150f36ad22ce2d6d405ae (diff)
downloadqtquickcontrols-5061d101310bd110e86831249b94d137a831d3be.tar.gz
Dialogs: redo calculations depending on __maximumDimension before show
Once again the old problem recurs that on Android the primaryScreen has invalid geometry at the time the dialog's QML implementation is loaded. So if the loading occurs before the main window is shown, the dialog was resized to 0x0 and stayed that way. The fix is to make __maximumDimension a notifying property and artificially emit a change signal each time before the dialog is shown. Task-number: QTBUG-45092 Change-Id: Ie86eb7f7bd3cbe8401ccc98c9cc8829c788a71dd Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'src/dialogs/qquickabstractdialog.cpp')
-rw-r--r--src/dialogs/qquickabstractdialog.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dialogs/qquickabstractdialog.cpp b/src/dialogs/qquickabstractdialog.cpp
index ffc995c8..ba65bd8b 100644
--- a/src/dialogs/qquickabstractdialog.cpp
+++ b/src/dialogs/qquickabstractdialog.cpp
@@ -107,6 +107,8 @@ void QQuickAbstractDialog::setVisible(bool v)
// Pure QML implementation: wrap the contentItem in a window, or fake it
if (!m_dialogWindow && m_contentItem) {
+ if (v)
+ emit __maximumDimensionChanged();
if (m_hasNativeWindows)
m_dialogWindow = m_contentItem->window();
// An Item-based dialog implementation doesn't come with a window, so
@@ -220,7 +222,7 @@ void QQuickAbstractDialog::decorationLoaded()
m_windowDecoration->setProperty("content", contentVariant);
connect(m_windowDecoration, SIGNAL(dismissed()), this, SLOT(reject()));
ok = true;
- qCDebug(lcWindow) << "using synthetic window decoration" << m_windowDecoration;
+ qCDebug(lcWindow) << "using synthetic window decoration" << m_windowDecoration << "from" << m_decorationComponent->url();
} else {
qWarning() << m_decorationComponent->url() <<
"cannot be used as a window decoration because it's not an Item";
@@ -360,6 +362,7 @@ int QQuickAbstractDialog::height() const
int QQuickAbstractDialog::__maximumDimension() const
{
QScreen *screen = QGuiApplication::primaryScreen();
+ qCDebug(lcWindow) << "__maximumDimension checking screen" << screen << "geometry" << screen->availableVirtualGeometry();
return (screen ?
qMin(screen->availableVirtualGeometry().width(), screen->availableVirtualGeometry().height()) :
480) * 9 / 10;