From 58b92a951899f74b63048a36c451d3355c0c5a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 18 Sep 2009 19:06:46 +0300 Subject: S60 native looking dialog support. Related to QTSSIXTY-63 "Make Qt dialogs look native" S60 dialog support: * Positioning according S60 rules: - in portrait dialogs at the bottom of the screen, - in landscape positioned in the center of the screen [unless device supports bottom softkeys], so that softkeys are not covered by the dialog * If dialog shows extension, then dialog is re-positioned * Dialog size: - in portrait screen wide dialog, height can change - in landscape width is the same size as width in portrait (some dialogs are maximized) * No push buttons or DialogButtonBoxes in internal qt dialogs (QWizard, QInputDialog, QFileDialog, QFontDialog, QColorDialog, QProgressDialog, QErrorMessage, QMessageBox), instead signals are remapped to softkeys. * Globally, dialogbuttonboxes are converted automatically to softkeys. OPEN: * Needs to be re-factored slightly after softkey API refactoring is finished. BUGS: QWizard layout switch is wonky - dialog is not re-sized correctly. QFontDialog will not fit into device screen (too much widgets in it). Some effort needed to be make it smaller. Cannot set one softkey at the time softkeys => Options menu and right softkey cannot be set separately [SoftKey re-factoring will help] Dialogs cannot get touch events to softkeys [SoftKey re-factoring will help] Reviewed-by: Alessandro Portale Reviewed-by: Jason Barron Reviewed-by: mread Reviewed-by: Shane Kearns --- src/gui/dialogs/qdialog.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/gui/dialogs/qdialog.h') diff --git a/src/gui/dialogs/qdialog.h b/src/gui/dialogs/qdialog.h index 65aba0601c..694bff79cb 100644 --- a/src/gui/dialogs/qdialog.h +++ b/src/gui/dialogs/qdialog.h @@ -107,7 +107,7 @@ public Q_SLOTS: protected: QDialog(QDialogPrivate &, QWidget *parent, Qt::WindowFlags f = 0); -#ifdef Q_WS_WINCE +#if defined(Q_WS_WINCE) || defined(Q_WS_S60) bool event(QEvent *e); #endif void keyPressEvent(QKeyEvent *); @@ -119,11 +119,15 @@ protected: #endif bool eventFilter(QObject *, QEvent *); void adjustPosition(QWidget*); - private: Q_DECLARE_PRIVATE(QDialog) Q_DISABLE_COPY(QDialog) +#if defined(Q_WS_S60) + bool s60AdjustedPosition(); +#endif + + #ifdef Q_WS_WINCE_WM Q_PRIVATE_SLOT(d_func(), void _q_doneAction()) #endif -- cgit v1.2.1