summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2009-06-12 08:29:29 (GMT)
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2009-06-12 08:29:29 (GMT)
commitaf26ef4356cf2bf8ccbcb391b488ddf301dbb2fe (patch)
tree0656dec3fdf12abbf37a48d65f0adb01d54bbb59 /src
parentbccd5442f24ce18e08ec5a5e78ccc6566f4e0463 (diff)
parent53cfa304345df1cd7b7686a2ebc1acd74a886886 (diff)
downloadQt-af26ef4356cf2bf8ccbcb391b488ddf301dbb2fe.zip
Qt-af26ef4356cf2bf8ccbcb391b488ddf301dbb2fe.tar.gz
Qt-af26ef4356cf2bf8ccbcb391b488ddf301dbb2fe.tar.bz2
Merge branch 'master' of git@scm.dev.troll.no:qt/qt-s60-public
Conflicts: src/network/ssl/ssl.pri
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qglobal.cpp145
-rw-r--r--src/corelib/global/qglobal.h89
-rw-r--r--src/corelib/tools/qlist.h9
-rw-r--r--src/corelib/tools/qscopedpointer.cpp36
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp13
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp2
-rw-r--r--src/gui/kernel/qaction.cpp3
-rw-r--r--src/gui/kernel/qwidget.cpp30
-rw-r--r--src/gui/kernel/qwidget_s60.cpp2
-rw-r--r--src/gui/styles/qs60style.cpp48
-rw-r--r--src/gui/styles/qs60style_simulated.cpp20
-rw-r--r--src/gui/widgets/qactiontokeyeventmapper.cpp2
-rw-r--r--src/gui/widgets/qactiontokeyeventmapper_p.h13
-rw-r--r--src/gui/widgets/qcombobox.cpp2
-rw-r--r--src/gui/widgets/qmenu.cpp2
15 files changed, 324 insertions, 92 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 484c618..6590ea6 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2207,10 +2207,10 @@ void qt_message_output(QtMsgType msgType, const char *buf)
*/
static void qEmergencyOut(QtMsgType msgType, const char *msg, va_list ap)
{
- char emergency_buf[1024] = { '\0' };
- emergency_buf[1023] = '\0';
+ char emergency_buf[256] = { '\0' };
+ emergency_buf[255] = '\0';
if (msg)
- qvsnprintf(emergency_buf, 1023, msg, ap);
+ qvsnprintf(emergency_buf, 255, msg, ap);
qt_message_output(msgType, emergency_buf);
}
#endif
@@ -3214,14 +3214,127 @@ bool QInternal::callFunction(InternalFunction func, void **args)
#include <typeinfo>
-const char* QSymbianLeaveException::what() const throw()
+/*! \macro QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(function)
+ \relates QSymbianLeaveException
+
+ TRAP leaves from Symbian \a function and throws an appropriate
+ standard C++ exception instead.
+ This must be used when calling Symbian OS leaving functions
+ from inside Qt or standard C++ code, so that the code can respond
+ correctly to the exception.
+
+ \warning This macro is only available on Symbian.
+
+ Example:
+
+ \code
+ // A Symbian leaving function is being called within a Qt function.
+ // Any leave must be converted to an exception
+ CAknTitlePane* titlePane = S60->titlePane();
+ if (titlePane) {
+ TPtrC captionPtr(qt_QString2TPtrC(caption));
+ QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(titlePane->SetTextL(captionPtr));
+ }
+ \endcode
+
+ \sa QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(), QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE()
+*/
+
+/*! \macro QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(error, function)
+ \relates QSymbianLeaveException
+ \ingroup qts60
+
+ Catch standard C++ exceptions from a \a function and convert them to a Symbian OS
+ \a error code, or \c KErrNone if there is no exception.
+ This must be used inside Qt or standard C++ code when using exception throwing
+ code (practically anything) and returning an error code to Symbian OS.
+
+ \warning This macro is only available on Symbian.
+
+ Example:
+
+ \code
+ // An exception might be thrown in this Symbian TInt error returning function.
+ // It is caught and translated to an error code
+ TInt QServerApp::Connect(const QString &serverName)
+ {
+ TPtrC name;
+ TInt err;
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, name.Set(qt_QString2TPtrC(serverName)));
+ if (err != KErrNone)
+ return err;
+ return iServer.Connect(name);
+ }
+ \endcode
+}
+
+ \sa QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(), QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION()
+*/
+
+/*! \macro QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(function)
+ \relates QSymbianLeaveException
+ \ingroup qts60
+
+ Catch standard C++ exceptions from \a function and convert them to Symbian OS
+ leaves. This must be used inside Qt or standard C++ code when using exception
+ throwing code (practically anything) and returning to Symbian OS from a leaving function.
+ For example inside a Symbian active object's \c RunL function implemented with Qt code.
+
+ \warning This macro is only available on Symbian.
+
+ Example:
+
+ \code
+ // This active object signals Qt code
+ // Exceptions from the Qt code must be converted to Symbian OS leaves for the active scheduler
+ void QWakeUpActiveObject::RunL()
+ {
+ iStatus = KRequestPending;
+ SetActive();
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(m_dispatcher->wakeUpWasCalled());
+ }
+ \endcode
+
+ \sa QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(), QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR()
+*/
+
+/*! \class QSymbianLeaveException
+ \ingroup qts60
+ \brief The QSymbianLeaveException class represents a block of Symbian leave code.
+
+ \warning This class is only available on Symbian.
+*/
+
+/*! \fn QSymbianLeaveException::QSymbianLeaveException(int error)
+
+ Constructs a QSymbianLeaveException object that stores the given
+ Symbian \a error code.
+*/
+
+/*! \fn const char *QSymbianLeaveException::what() const
+
+ Returns a C-style character string describing the general
+ cause of the current error.
+
+ The string is not localized.
+*/
+const char *QSymbianLeaveException::what() const throw()
{
- static const char str[] = "Symbian leave exception %d";
- static char msg[sizeof(str)+12];
- sprintf(msg, str, error);
+ static char msg[36];
+ snprintf(msg, sizeof(msg), "Symbian leave exception %d", error);
return msg;
}
+/*! \relates QSymbianLeaveException
+ \ingroup qts60
+
+ Throws a QSymbianLeaveException if the \a error parameter is a symbian error code.
+ This is the exception throwing equivalent of Symbian's User::LeaveIfError.
+
+ \warning This function is only available on Symbian.
+
+ \sa qt_translateExceptionToSymbianErrorL(), qt_translateExceptionToSymbianError()
+*/
void qt_translateSymbianErrorToException(int error)
{
if (error >= KErrNone)
@@ -3234,11 +3347,29 @@ void qt_translateSymbianErrorToException(int error)
}
}
+/*! \relates QSymbianLeaveException
+ \ingroup qts60
+
+ Convert a caught standard C++ exception \a aThrow to a Symbian leave
+
+ \warning This function is only available on Symbian.
+
+ \sa qt_translateSymbianErrorToException(), qt_translateExceptionToSymbianError()
+*/
void qt_translateExceptionToSymbianErrorL(const std::exception& aThrow)
{
User::Leave(qt_translateExceptionToSymbianError(aThrow));
}
+/*! \relates QSymbianLeaveException
+ \ingroup qts60
+
+ Convert a caught standard C++ exception \a aThrow to a Symbian error code
+
+ \warning This function is only available on Symbian.
+
+ \sa qt_translateSymbianErrorToException(), qt_translateExceptionToSymbianErrorL()
+*/
int qt_translateExceptionToSymbianError(const std::exception& aThrow)
{
const std::type_info& atype = typeid(aThrow);
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 030840e..450fd86 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -2310,6 +2310,50 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathTranslations();
QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf();
#endif
+#if defined(Q_OS_SYMBIAN)
+
+#include <stdexcept>
+
+class QSymbianLeaveException : public std::exception
+{
+public:
+ inline QSymbianLeaveException(int err) : error(err) {}
+ const char* what() const throw();
+public:
+ int error;
+};
+
+Q_CORE_EXPORT void qt_translateSymbianErrorToException(int error);
+Q_CORE_EXPORT void qt_translateExceptionToSymbianErrorL(const std::exception& ex);
+Q_CORE_EXPORT int qt_translateExceptionToSymbianError(const std::exception& ex);
+
+#define QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(f) \
+ { \
+ TInt error; \
+ TRAP(error, f); \
+ if (error) \
+ qt_translateSymbianErrorToException(error); \
+ }
+
+#define QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) \
+ { \
+ err = KErrNone; \
+ try { \
+ f; \
+ } catch (const std::exception &ex) { \
+ err = qt_translateExceptionToSymbianError(ex); \
+ } \
+ }
+
+#define QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(f) \
+ { \
+ TInt err; \
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) \
+ User::LeaveIfError(err); \
+ }
+#endif
+
+
/*
This gives us the possibility to check which modules the user can
use. These are purely compile time checks and will generate no code.
@@ -2383,6 +2427,9 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf();
#define QT_LICENSED_MODULE(x) \
enum QtValidLicenseFor##x##Module { Licensed##x = true };
+/* qdoc is really unhappy with the following block of preprocessor checks,
+ making it difficult to document classes properly after this point. */
+
#if (QT_EDITION & QT_MODULE_CORE)
QT_LICENSED_MODULE(Core)
#endif
@@ -2465,48 +2512,6 @@ QT_LICENSED_MODULE(DBus)
# define QT_NO_CONCURRENT_FILTER
#endif
-#if defined(Q_OS_SYMBIAN)
-
-#include <stdexcept>
-class QSymbianLeaveException : public std::exception
-{
-public:
- QSymbianLeaveException(int err) : error(err){ }
- const char* what() const throw();
-public:
- int error;
-};
-
-Q_CORE_EXPORT void qt_translateSymbianErrorToException(int error);
-Q_CORE_EXPORT void qt_translateExceptionToSymbianErrorL(const std::exception& ex);
-Q_CORE_EXPORT int qt_translateExceptionToSymbianError(const std::exception& ex);
-
-#define QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(f) \
- { \
- TInt error; \
- TRAP(error, f); \
- if (error) \
- qt_translateSymbianErrorToException(error); \
- }
-
-#define QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) \
- { \
- err = KErrNone; \
- try { \
- f; \
- } catch (const std::exception &ex) { \
- err = qt_translateExceptionToSymbianError(ex); \
- } \
- }
-
-#define QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(f) \
- { \
- TInt err; \
- QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) \
- User::LeaveIfError(err); \
- }
-#endif
-
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index 89e082b..7540035 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -117,7 +117,14 @@ public:
inline int size() const { return p.size(); }
inline void detach() { if (d->ref != 1) detach_helper(); }
- inline void detachShared() { if (d->ref != 1 && d != &QListData::shared_null) detach_helper(); }
+
+ inline void detachShared()
+ {
+ // The "this->" qualification is needed for GCCE.
+ if (d->ref != 1 && this->d != &QListData::shared_null)
+ detach_helper();
+ }
+
inline bool isDetached() const { return d->ref == 1; }
inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp
index 8150a18..0239575 100644
--- a/src/corelib/tools/qscopedpointer.cpp
+++ b/src/corelib/tools/qscopedpointer.cpp
@@ -3,9 +3,39 @@
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
-** This file is part of the $MODULE$ of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
-** $TROLLTECH_DUAL_LICENSE$
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
**
****************************************************************************/
@@ -112,7 +142,7 @@
/*!
\fn void QScopedPointer::reset(T *other = 0)
- Deletes the existing object its pointing to if any, and sets its pointer to
+ Deletes the existing object it is pointing to if any, and sets its pointer to
\a other. QScopedPointer now owns \a other and will delete it in its
destructor.
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 1dfb012..7d79422 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -43,7 +43,6 @@
#include "qcoefepinputcontext_p.h"
#include <qapplication.h>
-#include <private/qapplication_p.h>
#include <qtextformat.h>
#include <fepitfr.h>
@@ -89,13 +88,9 @@ QCoeFepInputContext::~QCoeFepInputContext()
// This is to make sure that the FEP manager "forgets" about us,
// otherwise we may get callbacks even after we're destroyed.
- // The call is asynchronous though, so we must spin the event loop
- // to make sure it gets detected. However we will not spin eventloop
- // in case that app is closing, since eventDispatcher is already deleted.
- CCoeEnv::Static()->InputCapabilitiesChanged();
- if(!QApplicationPrivate::is_app_closing) {
- QApplication::processEvents();
- }
+ // The call below is essentially equivalent to InputCapabilitiesChanged(),
+ // but is synchronous, rather than asynchronous.
+ CCoeEnv::Static()->SyncNotifyFocusObserversOfChangeInFocus();
if (m_fepState)
delete m_fepState;
@@ -334,6 +329,8 @@ void QCoeFepInputContext::updateHints()
m_lastImHints = hints;
applyHints(hints);
}
+ } else {
+ CCoeEnv::Static()->InputCapabilitiesChanged();
}
}
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index af84ea6..2576724 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -61,7 +61,7 @@
#ifndef QT_NO_ACCESSIBILITY
#include <qaccessible.h>
#endif
-#include <qactiontokeyeventmapper_p.h>
+#include <private/qactiontokeyeventmapper_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp
index 8263cbc..b1db8d6 100644
--- a/src/gui/kernel/qaction.cpp
+++ b/src/gui/kernel/qaction.cpp
@@ -81,7 +81,8 @@ static QString qt_strippedText(QString s)
QActionPrivate::QActionPrivate() : group(0), enabled(1), forceDisabled(0),
visible(1), forceInvisible(0), checkable(0), checked(0), separator(0), fontSet(false),
- menuRole(QAction::TextHeuristicRole), iconVisibleInMenu(-1)
+ menuRole(QAction::TextHeuristicRole), softKeyRole(QAction::OptionsSoftKey),
+ iconVisibleInMenu(-1)
{
#ifdef QT3_SUPPORT
static int qt_static_action_id = -1;
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 103577e..a83a79f 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -885,6 +885,30 @@ void QWidget::setAutoFillBackground(bool enabled)
\endlist
\sa QEvent, QPainter, QGridLayout, QBoxLayout
+
+ \section1 SoftKeys
+ \since 4.6
+ \preliminary
+
+ Softkeys API is a platform independent way of mapping actions to (hardware)keys
+ and toolbars provided by the underlying platform.
+
+ There are three major use cases supported. First one is a mobile device
+ with keypad navigation and no touch ui. Second use case is a mobile
+ device with touch ui. Third use case is desktop. For now the softkey API is
+ only implemented for Series60.
+
+ QActions are set to widget(s) via softkey API. Actions in focused widget are
+ mapped to native toolbar or hardware keys. Even though the API allows to set
+ any amount of widgets there might be physical restrictions to amount of
+ softkeys that can be used by the device.
+
+ \o Series60: For series60 menu button is automatically mapped to left
+ soft key if there is QMainWindow with QMenuBar in widgets parent hierarchy.
+
+ \sa softKeys()
+ \sa setSoftKey()
+
*/
QWidgetMapper *QWidgetPrivate::mapper = 0; // widget with wid
@@ -11555,6 +11579,9 @@ void QWidget::clearMask()
}
/*!
+ \preliminary
+ \since 4.6
+
Returns the (possibly empty) list of this widget's softkeys.
Returned list cannot be changed. Softkeys should be added
and removed via method called setSoftKeys
@@ -11573,6 +11600,9 @@ const QList<QAction*>& QWidget::softKeys() const
}
/*!
+ \preliminary
+ \since 4.6
+
Sets the softkey \a softkey to this widget's list of softkeys,
Setting 0 as softkey will clear all the existing softkeys set
to the widget
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index eb3180f..bc69d6d 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -95,7 +95,7 @@ void QWidgetPrivate::setSoftKeys_sys(const QList<QAction*> &softkeys)
const QAction* softKeyAction = softkeys.at(index);
if (softKeyAction->softKeyRole() != QAction::ContextMenuSoftKey) {
- HBufC* text = qt_QString2HBufCNewL(softKeyAction->text());
+ HBufC* text = qt_QString2HBufC(softKeyAction->text());
CleanupStack::PushL(text);
if (softKeyAction->softKeyRole() == QAction::MenuSoftKey) {
nativeContainer->SetCommandL(placeInScreen, EAknSoftkeyOptions, *text);
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 6ee63e6..83f1698 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -44,8 +44,8 @@
#include "qapplication.h"
#include "qpainter.h"
#include "qstyleoption.h"
-#include "qresizeevent"
-#include "qpixmapcache"
+#include "qevent.h"
+#include "qpixmapcache.h"
#include "qcalendarwidget.h"
#include "qdial.h"
@@ -574,7 +574,7 @@ void QS60StylePrivate::drawRow(QS60StyleEnums::SkinParts start,
if (startRect.topRight().y() > endRect.bottomLeft().y()) {
const int overlap = (startRect.topRight().y() - endRect.bottomLeft().y())>>1;
startRect.setHeight(startRect.height()-overlap);
- endRect.adjust(0,overlap,0,0);
+ endRect.adjust(0,overlap,0,0);
}
}
@@ -1129,7 +1129,7 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
copy.state |= State_Raised;
copy.state &= ~State_Sunken;
}
- pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) ?
+ pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) ?
PE_IndicatorSpinPlus :
PE_IndicatorSpinUp;
@@ -1156,7 +1156,7 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
copy.state |= State_Raised;
copy.state &= ~State_Sunken;
}
- pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) ?
+ pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) ?
PE_IndicatorSpinMinus :
PE_IndicatorSpinDown;
@@ -1586,12 +1586,12 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
QPixmap tabIcon = optionTab.icon.pixmap(iconSize,
(optionTab.state & State_Enabled) ? QIcon::Normal : QIcon::Disabled);
if (tab->text.isEmpty())
- painter->drawPixmap(tr.center().x() - (tabIcon.height() >>1),
- tr.center().y() - (tabIcon.height() >>1),
+ painter->drawPixmap(tr.center().x() - (tabIcon.height() >>1),
+ tr.center().y() - (tabIcon.height() >>1),
tabIcon);
else
- painter->drawPixmap(tr.left() + tabOverlap,
- tr.center().y() - (tabIcon.height() >>1),
+ painter->drawPixmap(tr.left() + tabOverlap,
+ tr.center().y() - (tabIcon.height() >>1),
tabIcon);
tr.setLeft(tr.left() + iconSize.width() + 4);
}
@@ -1822,7 +1822,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
}
}
QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, mtyRect, adjFlags);
-
+
QRegion clipRegion = painter->clipRegion();
painter->setClipRect(option->rect);
drawControl(CE_HeaderSection, header, painter, widget);
@@ -2038,8 +2038,18 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
#endif //QT_NO_SPINBOX
case PE_FrameFocusRect:
// Calendar widget and combox both do not use styled itemDelegate
- if (!(widget && qobject_cast<const QCalendarWidget *>(widget->parent())) ||
- qobject_cast<const QComboBoxListView *>(widget)) {
+ if ( widget && (
+#ifndef QT_NO_CALENDARWIDGET
+ (qobject_cast<const QCalendarWidget *>(widget->parent()))
+#else
+ false
+#endif //QT_NO_CALENDARWIDGET
+#ifndef QT_NO_COMBOBOX
+ || (qobject_cast<const QComboBoxListView *>(widget))
+#else
+ || false
+#endif //QT_NO_COMBOBOX
+ )) {
// no focus selection for touch
if (option->state & State_HasFocus && !QS60StylePrivate::isTouchSupported()) {
painter->save();
@@ -2292,9 +2302,9 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
retValue = true;
break;
case SH_ProgressDialog_TextLabelAlignment:
- retValue = (QApplication::layoutDirection() == Qt::LeftToRight) ?
+ retValue = (QApplication::layoutDirection() == Qt::LeftToRight) ?
Qt::AlignLeft :
- Qt::AlignRight;
+ Qt::AlignRight;
break;
case SH_Menu_SubMenuPopupDelay:
retValue = 300;
@@ -2314,6 +2324,8 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
case SH_BlinkCursorWhenTextSelected:
retValue = true;
break;
+ case SH_UnderlineShortcut:
+ retValue = 0;
default:
break;
}
@@ -2406,7 +2418,7 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
const int y = frameThickness + spinbox->rect.y();
const int x = spinbox->rect.x() + spinbox->rect.width() - frameThickness - 2*buttonSize.width();
-
+
switch (scontrol) {
case SC_SpinBoxUp:
if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons)
@@ -2641,7 +2653,7 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con
// a) highlight border does not cross the rect
// b) in s60 list checkbox is smaller than normal checkbox
//todo; magic three
- ret.setRect(opt->rect.left()+3, opt->rect.top() + heightOffset,
+ ret.setRect(opt->rect.left()+3, opt->rect.top() + heightOffset,
indicatorWidth-3, indicatorHeight-3);
} else {
ret.setRect(opt->rect.right() - indicatorWidth - spacing, opt->rect.top() + heightOffset,
@@ -2780,8 +2792,8 @@ QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon,
QS60StyleEnums::SkinParts part;
QS60StylePrivate::SkinElementFlags adjustedFlags;
if (option)
- adjustedFlags = (option->state & State_Enabled) ?
- QS60StylePrivate::SF_StateEnabled :
+ adjustedFlags = (option->state & State_Enabled) ?
+ QS60StylePrivate::SF_StateEnabled :
QS60StylePrivate::SF_StateDisabled;
switch(standardIcon) {
diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp
index 7667f92..684f232 100644
--- a/src/gui/styles/qs60style_simulated.cpp
+++ b/src/gui/styles/qs60style_simulated.cpp
@@ -53,6 +53,7 @@
#include "qmetaobject.h"
#include "qdebug.h"
#include "qbuffer.h"
+#include "qdesktopwidget.h"
#if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN)
@@ -61,13 +62,20 @@ QT_BEGIN_NAMESPACE
static const quint32 blobVersion = 1;
static const int pictureSize = 256;
+#if defined(Q_CC_GNU)
+#if __GNUC__ >= 2
+#define __FUNCTION__ __func__
+#endif
+#endif
+
+
bool saveThemeToBlob(const QString &themeBlob,
const QHash<QString, QPicture> &partPictures,
const QHash<QPair<QString, int>, QColor> &colors)
{
QFile blob(themeBlob);
if (!blob.open(QIODevice::WriteOnly)) {
- qWarning() << __FUNCTION__": Could not create blob: " << themeBlob;
+ qWarning() << __FUNCTION__ << ": Could not create blob: " << themeBlob;
return false;
}
@@ -106,7 +114,7 @@ bool loadThemeFromBlob(const QString &themeBlob,
{
QFile blob(themeBlob);
if (!blob.open(QIODevice::ReadOnly)) {
- qWarning() << __FUNCTION__": Could not read blob: " << themeBlob;
+ qWarning() << __FUNCTION__ << ": Could not read blob: " << themeBlob;
return false;
}
QDataStream blobIn(&blob);
@@ -115,7 +123,7 @@ bool loadThemeFromBlob(const QString &themeBlob,
blobIn >> version;
if (version != blobVersion) {
- qWarning() << __FUNCTION__": Invalid blob version: " << version << " ...expected: " << blobVersion;
+ qWarning() << __FUNCTION__ << ": Invalid blob version: " << version << " ...expected: " << blobVersion;
return false;
}
@@ -148,7 +156,7 @@ bool loadThemeFromBlob(const QString &themeBlob,
}
if (dataIn.status() != QDataStream::Ok) {
- qWarning() << __FUNCTION__": Invalid data blob: " << themeBlob;
+ qWarning() << __FUNCTION__ << ": Invalid data blob: " << themeBlob;
return false;
}
return true;
@@ -266,7 +274,7 @@ QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size,
const QRect leftRect = rightRect.translated(cornerWidth - rectWidth, 0);
const QRect centerRect = drawOnlyCenter ? rect : rect.adjusted(cornerWidth, cornerWidth, -cornerWidth, -cornerWidth);
- QImage result(size, QImage::Format_ARGB32);
+ QPixmap result(size);
result.fill(Qt::transparent);
QPainter painter(&result);
@@ -295,7 +303,7 @@ QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size,
drawPart(center, &painter, centerRect, flags);
#endif
- return QPixmap::fromImage(result);
+ return result;
}
void QS60StylePrivate::setStyleProperty_specific(const char *name, const QVariant &value)
diff --git a/src/gui/widgets/qactiontokeyeventmapper.cpp b/src/gui/widgets/qactiontokeyeventmapper.cpp
index 5cce415..280b1c6 100644
--- a/src/gui/widgets/qactiontokeyeventmapper.cpp
+++ b/src/gui/widgets/qactiontokeyeventmapper.cpp
@@ -41,7 +41,7 @@
#include "qapplication.h"
#include "qevent.h"
-#include "QActionToKeyEventMapper_p.h"
+#include "qactiontokeyeventmapper_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/gui/widgets/qactiontokeyeventmapper_p.h b/src/gui/widgets/qactiontokeyeventmapper_p.h
index da336e8..c54e612 100644
--- a/src/gui/widgets/qactiontokeyeventmapper_p.h
+++ b/src/gui/widgets/qactiontokeyeventmapper_p.h
@@ -42,6 +42,17 @@
#ifndef QACTIONTOKEYEVENTMAPPER_P_H
#define QACTIONTOKEYEVENTMAPPER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qobject.h>
#include "QtGui/qaction.h"
QT_BEGIN_HEADER
@@ -67,4 +78,4 @@ QT_END_NAMESPACE
QT_END_HEADER
-#endif //QACTIONTOKEYEVENTMAPPER_H
+#endif //QACTIONTOKEYEVENTMAPPER_P_H
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index 2da5cd0..a6a5e08 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -63,7 +63,7 @@
#include <private/qabstractitemmodel_p.h>
#include <private/qabstractscrollarea_p.h>
#include <qdebug.h>
-#include <qactiontokeyeventmapper_p.h>
+#include <private/qactiontokeyeventmapper_p.h>
#ifdef Q_WS_X11
#include <private/qt_x11_p.h>
#endif
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index 3486574..6d4dcf2 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -60,7 +60,7 @@
#ifndef QT_NO_WHATSTHIS
# include <qwhatsthis.h>
#endif
-#include <qactiontokeyeventmapper_p.h>
+#include <private/qactiontokeyeventmapper_p.h>
#include "qmenu_p.h"
#include "qmenubar_p.h"