summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJyri Tahtela <jyri.tahtela@nokia.com>2011-05-13 11:30:46 (GMT)
committerJyri Tahtela <jyri.tahtela@nokia.com>2011-05-13 11:30:46 (GMT)
commit50ea2454c0ad9b28be6dd5125c74466f0f96d16a (patch)
tree610e8b4852bca7d23ec5c4b9937a119eed96a124 /src/gui
parent0f750aec4507fffc06acea46a513c6d374564d6a (diff)
parenta80130b07c5b8ee4b06eabbceb65eb23d4d4602e (diff)
downloadQt-50ea2454c0ad9b28be6dd5125c74466f0f96d16a.zip
Qt-50ea2454c0ad9b28be6dd5125c74466f0f96d16a.tar.gz
Qt-50ea2454c0ad9b28be6dd5125c74466f0f96d16a.tar.bz2
Merge remote-tracking branch 'qt/4.8'
Conflicts: src/s60installs/eabi/QtOpenGLu.def
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_p.h1
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp10
-rw-r--r--src/gui/kernel/qapplication_s60.cpp35
-rw-r--r--src/gui/kernel/qclipboard.h1
-rw-r--r--src/gui/kernel/qplatformclipboard_qpa.cpp7
-rw-r--r--src/gui/kernel/qplatformclipboard_qpa.h1
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60.cpp40
-rw-r--r--src/gui/kernel/qt_s60_p.h3
-rw-r--r--src/gui/kernel/qwidget_s60.cpp16
-rw-r--r--src/gui/painting/qpainter.cpp2
10 files changed, 85 insertions, 31 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h
index de3577f..57c1e45 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_p.h
+++ b/src/gui/inputmethod/qcoefepinputcontext_p.h
@@ -168,6 +168,7 @@ private:
};
Q_GUI_EXPORT void qt_s60_setPartialScreenInputMode(bool enable);
+Q_GUI_EXPORT void qt_s60_setPartialScreenAutomaticTranslation(bool enable);
QT_END_NAMESPACE
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 06dc25c..a4d53c0 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -88,6 +88,11 @@ Q_GUI_EXPORT void qt_s60_setPartialScreenInputMode(bool enable)
ic->update();
}
+Q_GUI_EXPORT void qt_s60_setPartialScreenAutomaticTranslation(bool enable)
+{
+ S60->partial_keyboardAutoTranslation = enable;
+}
+
QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
: QInputContext(parent),
m_fepState(q_check_ptr(new CAknEdwinState)), // CBase derived object needs check on new
@@ -559,12 +564,13 @@ void QCoeFepInputContext::ensureFocusWidgetVisible(QWidget *widget)
widget->resize(widget->width(), splitViewRect.height() - windowTop);
}
- if (gv->scene()) {
+ if (gv->scene() && S60->partial_keyboardAutoTranslation) {
const QRectF microFocusRect = gv->scene()->inputMethodQuery(Qt::ImMicroFocus).toRectF();
gv->ensureVisible(microFocusRect);
}
} else {
- translateInputWidget();
+ if (S60->partial_keyboardAutoTranslation)
+ translateInputWidget();
}
if (alwaysResize)
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 2221500..68c1ab5 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1360,6 +1360,23 @@ void QSymbianControl::PositionChanged()
}
}
+// Search recursively if there is a child widget that is both visible and focused.
+bool QSymbianControl::hasFocusedAndVisibleChild(QWidget *parentWidget)
+{
+ for (int i = 0; i < parentWidget->children().size(); ++i) {
+ QObject *object = parentWidget->children().at(i);
+ if (object && object->isWidgetType()) {
+ QWidget *w = static_cast<QWidget *>(object);
+ WId winId = w->internalWinId();
+ if (winId && winId->IsFocused() && winId->IsVisible())
+ return true;
+ if (hasFocusedAndVisibleChild(w))
+ return true;
+ }
+ }
+ return false;
+}
+
void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */)
{
if (m_ignoreFocusChanged || (qwidget->windowType() & Qt::WindowType_Mask) == Qt::Desktop)
@@ -1392,17 +1409,9 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */)
if (qwidget->isWindow())
S60->setRecursiveDecorationsVisibility(qwidget, qwidget->windowState());
#endif
- } else if (QApplication::activeWindow() == qwidget->window()) {
- bool focusedControlFound = false;
- WId winId = 0;
- for (QWidget *w = qwidget->parentWidget(); w && (winId = w->internalWinId()); w = w->parentWidget()) {
- if (winId->IsFocused() && winId->IsVisible()) {
- focusedControlFound = true;
- break;
- } else if (w->isWindow())
- break;
- }
- if (!focusedControlFound) {
+ } else {
+ QWidget *parentWindow = qwidget->window();
+ if (QApplication::activeWindow() == parentWindow && !hasFocusedAndVisibleChild(parentWindow)) {
if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog() || S60->menuBeingConstructed) {
QWidget *fw = QApplication::focusWidget();
if (fw) {
@@ -1509,6 +1518,10 @@ void QSymbianControl::HandleResourceChange(int resourceType)
#ifdef Q_WS_S60
case KEikDynamicLayoutVariantSwitch:
{
+#ifdef QT_SOFTKEYS_ENABLED
+ // Update needed just in case softkeys contain icons
+ QSoftKeyManager::updateSoftKeys();
+#endif
handleClientAreaChange();
// Send resize event to trigger desktopwidget workAreaResized signal
if (qt_desktopWidget) {
diff --git a/src/gui/kernel/qclipboard.h b/src/gui/kernel/qclipboard.h
index b55bdc6..019917e 100644
--- a/src/gui/kernel/qclipboard.h
+++ b/src/gui/kernel/qclipboard.h
@@ -112,6 +112,7 @@ protected:
friend class QBaseApplication;
friend class QDragManager;
friend class QMimeSource;
+ friend class QPlatformClipboard;
private:
Q_DISABLE_COPY(QClipboard)
diff --git a/src/gui/kernel/qplatformclipboard_qpa.cpp b/src/gui/kernel/qplatformclipboard_qpa.cpp
index 957a4df..33d2afc 100644
--- a/src/gui/kernel/qplatformclipboard_qpa.cpp
+++ b/src/gui/kernel/qplatformclipboard_qpa.cpp
@@ -42,6 +42,8 @@
#ifndef QT_NO_CLIPBOARD
+#include <QtGui/private/qapplication_p.h>
+
QT_BEGIN_NAMESPACE
class QClipboardData
@@ -100,6 +102,11 @@ bool QPlatformClipboard::supportsMode(QClipboard::Mode mode) const
return mode == QClipboard::Clipboard;
}
+void QPlatformClipboard::emitChanged(QClipboard::Mode mode)
+{
+ QApplication::clipboard()->emitChanged(mode);
+}
+
QT_END_NAMESPACE
#endif //QT_NO_CLIPBOARD
diff --git a/src/gui/kernel/qplatformclipboard_qpa.h b/src/gui/kernel/qplatformclipboard_qpa.h
index 3381c06..5444a1f 100644
--- a/src/gui/kernel/qplatformclipboard_qpa.h
+++ b/src/gui/kernel/qplatformclipboard_qpa.h
@@ -62,6 +62,7 @@ public:
virtual const QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard ) const;
virtual void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard);
virtual bool supportsMode(QClipboard::Mode mode) const;
+ void emitChanged(QClipboard::Mode mode);
};
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp
index 79ed91a..d80cf8a 100644
--- a/src/gui/kernel/qsoftkeymanager_s60.cpp
+++ b/src/gui/kernel/qsoftkeymanager_s60.cpp
@@ -278,12 +278,6 @@ bool QSoftKeyManagerPrivateS60::setSoftkeyImage(CEikButtonGroupContainer *cba,
EikSoftkeyImage::SetImage(cba, *myimage, left); // Takes myimage ownership
cbaHasImage[position] = true;
ret = true;
- } else {
- // Restore softkey to text based
- if (cbaHasImage[position]) {
- EikSoftkeyImage::SetLabel(cba, left);
- cbaHasImage[position] = false;
- }
}
}
return ret;
@@ -294,7 +288,7 @@ bool QSoftKeyManagerPrivateS60::setSoftkey(CEikButtonGroupContainer &cba,
{
QAction *action = highestPrioritySoftkey(role);
if (action) {
- setSoftkeyImage(&cba, *action, position);
+ bool hasImage = setSoftkeyImage(&cba, *action, position);
QString text = softkeyText(*action);
TPtrC nativeText = qt_QString2TPtrC(text);
int command = S60_COMMAND_START + position;
@@ -303,6 +297,11 @@ bool QSoftKeyManagerPrivateS60::setSoftkey(CEikButtonGroupContainer &cba,
command = softKeyCommandActions.value(action);
#endif
setNativeSoftkey(cba, position, command, nativeText);
+ if (!hasImage && cbaHasImage[position]) {
+ EikSoftkeyImage::SetLabel(&cba, (position == LSK_POSITION));
+ cbaHasImage[position] = false;
+ }
+
const bool dimmed = !action->isEnabled() && !QSoftKeyManager::isForceEnabledInSofkeys(action);
cba.DimCommand(command, dimmed);
realSoftKeyActions.insert(command, action);
@@ -313,7 +312,18 @@ bool QSoftKeyManagerPrivateS60::setSoftkey(CEikButtonGroupContainer &cba,
bool QSoftKeyManagerPrivateS60::setLeftSoftkey(CEikButtonGroupContainer &cba)
{
- return setSoftkey(cba, QAction::PositiveSoftKey, LSK_POSITION);
+ if (!setSoftkey(cba, QAction::PositiveSoftKey, LSK_POSITION)) {
+ if (cbaHasImage[LSK_POSITION]) {
+ // Clear any residual icon if LSK has no action. A real softkey
+ // is needed for SetLabel command to work, so do a temporary dummy
+ setNativeSoftkey(cba, LSK_POSITION, EAknSoftkeyExit, KNullDesC);
+ EikSoftkeyImage::SetLabel(&cba, true);
+ setNativeSoftkey(cba, LSK_POSITION, EAknSoftkeyEmpty, KNullDesC);
+ cbaHasImage[LSK_POSITION] = false;
+ }
+ return false;
+ }
+ return true;
}
bool QSoftKeyManagerPrivateS60::setMiddleSoftkey(CEikButtonGroupContainer &cba)
@@ -332,16 +342,26 @@ bool QSoftKeyManagerPrivateS60::setRightSoftkey(CEikButtonGroupContainer &cba)
if (windowType != Qt::Dialog && windowType != Qt::Popup) {
QString text(QSoftKeyManager::tr("Exit"));
TPtrC nativeText = qt_QString2TPtrC(text);
+ setNativeSoftkey(cba, RSK_POSITION, EAknSoftkeyExit, nativeText);
if (cbaHasImage[RSK_POSITION]) {
EikSoftkeyImage::SetLabel(&cba, false);
cbaHasImage[RSK_POSITION] = false;
}
- setNativeSoftkey(cba, RSK_POSITION, EAknSoftkeyExit, nativeText);
cba.DimCommand(EAknSoftkeyExit, false);
return true;
+ } else {
+ if (cbaHasImage[RSK_POSITION]) {
+ // Clear any residual icon if RSK has no action. A real softkey
+ // is needed for SetLabel command to work, so do a temporary dummy
+ setNativeSoftkey(cba, RSK_POSITION, EAknSoftkeyExit, KNullDesC);
+ EikSoftkeyImage::SetLabel(&cba, false);
+ setNativeSoftkey(cba, RSK_POSITION, EAknSoftkeyEmpty, KNullDesC);
+ cbaHasImage[RSK_POSITION] = false;
+ }
+ return false;
}
}
- return false;
+ return true;
}
void QSoftKeyManagerPrivateS60::setSoftkeys(CEikButtonGroupContainer &cba)
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index 02977ce..4640393 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -159,6 +159,7 @@ public:
int menuBeingConstructed : 1;
int orientationSet : 1;
int partial_keyboard : 1;
+ int partial_keyboardAutoTranslation : 1;
QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type
QPointer<QWidget> splitViewLastWidget;
@@ -299,6 +300,7 @@ private:
void translateAdvancedPointerEvent(const TAdvancedPointerEvent *event);
#endif
bool isSplitViewWidget(QWidget *widget);
+ bool hasFocusedAndVisibleChild(QWidget *parentWidget);
public:
void handleClientAreaChange();
@@ -348,6 +350,7 @@ inline QS60Data::QS60Data()
menuBeingConstructed(0),
orientationSet(0),
partial_keyboard(0),
+ partial_keyboardAutoTranslation(1),
s60ApplicationFactory(0)
#ifdef Q_OS_SYMBIAN
,s60InstalledTrapHandler(0)
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 12bcc4b..5e9584b 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -235,19 +235,21 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
QSize oldSize(q->size());
QRect oldGeom(data.crect);
- // Lose maximized status if deliberate resize
- if (w != oldSize.width() || h != oldSize.height())
- data.window_state &= ~Qt::WindowMaximized;
-
bool checkExtra = true;
- if (q->isWindow() && (data.window_state & Qt::WindowFullScreen)) {
- // Do not modity window size for fullscreen windows, if requested
- // size is already equal to clientRect.
+ if (q->isWindow() && (data.window_state & (Qt::WindowFullScreen | Qt::WindowMaximized))) {
+ // Do not allow fullscreen/maximized windows to expand beyond client rect
TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+ w = qMin(w, r.Width());
+ h = qMin(h, r.Height());
+
if (w == r.Width() && h == r.Height())
checkExtra = false;
}
+ // Lose maximized status if deliberate resize
+ if (w != oldSize.width() || h != oldSize.height())
+ data.window_state &= ~Qt::WindowMaximized;
+
if (checkExtra && extra) { // any size restrictions?
w = qMin(w,extra->maxw);
h = qMin(h,extra->maxh);
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 9e28102..3fd4c5b 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -692,7 +692,7 @@ void QPainterPrivate::updateInvMatrix()
invMatrix = state->matrix.inverted();
}
-extern bool qt_isExtendedRadialGradient(const QBrush &brush);
+Q_GUI_EXPORT bool qt_isExtendedRadialGradient(const QBrush &brush);
void QPainterPrivate::updateEmulationSpecifier(QPainterState *s)
{