summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2009-06-23 16:03:33 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2009-06-23 16:03:33 (GMT)
commitbf6ba4cecb565514d4d9a531b473e91940b1a547 (patch)
tree68ebee7b7c132eeea71e5fc076a38c2ab358102c /src
parentfb09f0f3851efb30c3387a0724c0519245e29f33 (diff)
parent8aafaa65a1d16f8b982279f5aceedf1e281ddb5a (diff)
downloadQt-bf6ba4cecb565514d4d9a531b473e91940b1a547.zip
Qt-bf6ba4cecb565514d4d9a531b473e91940b1a547.tar.gz
Qt-bf6ba4cecb565514d4d9a531b473e91940b1a547.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-public
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qglobal.h6
-rw-r--r--src/corelib/io/qprocess_symbian.cpp3
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp57
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian_p.h10
-rw-r--r--src/corelib/tools/qlocale_symbian.cpp5
-rw-r--r--src/corelib/tools/qringbuffer_p.h8
-rw-r--r--src/gui/dialogs/qfscompleter_p.h5
-rw-r--r--src/gui/image/qpixmap.h9
-rw-r--r--src/gui/kernel/qaction.h9
-rw-r--r--src/gui/kernel/qapplication_s60.cpp14
-rw-r--r--src/gui/kernel/qlayout.cpp14
-rw-r--r--src/gui/kernel/qwidget_s60.cpp65
-rw-r--r--src/gui/styles/qs60style.cpp67
-rw-r--r--src/gui/styles/qs60style_s60.cpp18
-rw-r--r--src/gui/widgets/qmainwindow.cpp4
-rw-r--r--src/network/kernel/qhostinfo_unix.cpp3
-rw-r--r--src/s60installs/qt.iby1
17 files changed, 192 insertions, 106 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 361c038..14b6895 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -2314,10 +2314,12 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf();
#endif
#if defined(Q_OS_SYMBIAN)
-
+QT_END_NAMESPACE
// forward declare std::exception
+#ifdef __cplusplus
namespace std { class exception; }
-
+#endif
+QT_BEGIN_NAMESPACE
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);
diff --git a/src/corelib/io/qprocess_symbian.cpp b/src/corelib/io/qprocess_symbian.cpp
index 26e7cdc..7da6a1d 100644
--- a/src/corelib/io/qprocess_symbian.cpp
+++ b/src/corelib/io/qprocess_symbian.cpp
@@ -65,6 +65,7 @@
#include "qstring.h"
#include "qprocess.h"
#include "qprocess_p.h"
+#include "qeventdispatcher_symbian_p.h"
#include <private/qthread_p.h>
#include <qmutex.h>
@@ -594,7 +595,7 @@ TInt processManagerThreadFunction(TAny* param)
QProcessManager* manager = reinterpret_cast<QProcessManager*>(param);
- CActiveScheduler* scheduler = new CActiveScheduler();
+ CActiveScheduler* scheduler = new CQtActiveScheduler();
QPROCESS_ASSERT(scheduler,
EProcessManagerSchedulerCreationFail,
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index 423fbaa..88e2a88 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -231,6 +231,9 @@ void QTimerActiveObject::RunL()
void QTimerActiveObject::Run()
{
+ if (!okToRun())
+ return;
+
if (m_timerInfo->interval > 0) {
// Start a new timer immediately so that we don't lose time.
iStatus = KRequestPending;
@@ -246,7 +249,7 @@ void QTimerActiveObject::Run()
SymbianTimerInfoPtr timerInfoPtr(m_timerInfo);
m_timerInfo->dispatcher->timerFired(m_timerInfo->timerId);
-
+
iStatus = KRequestPending;
SetActive();
TRequestStatus *status = &iStatus;
@@ -615,7 +618,7 @@ QEventDispatcherSymbian::~QEventDispatcherSymbian()
void QEventDispatcherSymbian::startingUp()
{
if( !CActiveScheduler::Current() ) {
- m_activeScheduler = new(ELeave)CActiveScheduler();
+ m_activeScheduler = new(ELeave)CQtActiveScheduler();
CActiveScheduler::Install(m_activeScheduler);
}
m_wakeUpAO = new(ELeave) QWakeUpActiveObject(this);
@@ -644,12 +647,12 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
QT_TRY {
Q_D(QAbstractEventDispatcher);
- // It is safe if this counter overflows. The main importance is that each
- // iteration count is different from the last.
- m_iterationCount++;
+ // It is safe if this counter overflows. The main importance is that each
+ // iteration count is different from the last.
+ m_iterationCount++;
RThread &thread = d->threadData->symbian_thread_handle;
-
+
bool block;
if (flags & QEventLoop::WaitForMoreEvents) {
block = true;
@@ -657,7 +660,7 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
} else {
block = false;
}
-
+
bool oldNoSocketEventsValue = m_noSocketEvents;
if (flags & QEventLoop::ExcludeSocketNotifiers) {
m_noSocketEvents = true;
@@ -665,10 +668,10 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
m_noSocketEvents = false;
handledAnyEvent = sendDeferredSocketEvents();
}
-
+
bool handledSymbianEvent = false;
m_interrupt = false;
-
+
/*
* This QTime variable is used to measure the time it takes to finish
* the event loop. If we take too long in the loop, other processes
@@ -684,9 +687,9 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
SubsequentRun,
TimeStarted
} timeState = FirstRun;
-
+
TProcessPriority priority;
-
+
while (1) {
if (block) {
// This is where Qt will spend most of its time.
@@ -698,19 +701,19 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
// This one should return without delay.
CActiveScheduler::Current()->WaitForAnyRequest();
}
-
+
if (timeState == SubsequentRun) {
time.start();
timeState = TimeStarted;
}
-
+
TInt error;
handledSymbianEvent = CActiveScheduler::RunIfReady(error, CActive::EPriorityIdle);
if (error) {
qWarning("CActiveScheduler::RunIfReady() returned error: %i\n", error);
CActiveScheduler::Current()->Error(error);
}
-
+
if (!handledSymbianEvent) {
qFatal("QEventDispatcherSymbian::processEvents(): Caught Symbian stray signal");
}
@@ -719,7 +722,7 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
break;
}
block = false;
- if (timeState == TimeStarted && time.elapsed() > 100) {
+ if (timeState == TimeStarted && time.elapsed() > 100) {
priority = m_processHandle.Priority();
m_processHandle.SetPriority(EPriorityLow);
time.start();
@@ -732,14 +735,14 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
if (timeState == FirstRun)
timeState = SubsequentRun;
};
-
+
emit awake();
-
+
m_noSocketEvents = oldNoSocketEventsValue;
} QT_CATCH (const std::exception& ex) {
-#ifndef QT_NO_EXCEPTIONS
+#ifndef QT_NO_EXCEPTIONS
CActiveScheduler::Current()->Error(qt_translateExceptionToSymbianError(ex));
-#endif
+#endif
}
return handledAnyEvent;
@@ -969,5 +972,21 @@ QList<QEventDispatcherSymbian::TimerInfo> QEventDispatcherSymbian::registeredTim
return list;
}
+/*
+ * This active scheduler class implements a simple report and continue policy, for Symbian OS leaves
+ * or exceptions from Qt that fall back to the scheduler.
+ * It will be used in cases where there is no existing active scheduler installed.
+ * Apps which link to qts60main.lib will have the UI active scheduler installed in the main thread
+ * instead of this one. But this would be used in other threads in the UI.
+ * An app could replace this behaviour by installing an alternative active scheduler.
+ */
+void CQtActiveScheduler::Error(TInt aError) const
+{
+ QT_TRY {
+ qWarning("Error from active scheduler %d", aError);
+ }
+ QT_CATCH (const std::bad_alloc&) {} // ignore alloc fails, nothing more can be done
+}
+
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h
index 3593055..b39d6df 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian_p.h
+++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h
@@ -136,7 +136,7 @@ public:
protected:
void DoCancel();
void RunL();
-
+
private:
void Run();
@@ -209,6 +209,12 @@ private:
bool m_quit;
};
+class Q_CORE_EXPORT CQtActiveScheduler : public CActiveScheduler
+{
+public: // from CActiveScheduler
+ virtual void Error(TInt aError) const;
+};
+
class Q_CORE_EXPORT QEventDispatcherSymbian : public QAbstractEventDispatcher
{
Q_DECLARE_PRIVATE(QAbstractEventDispatcher)
@@ -253,7 +259,7 @@ private:
private:
QSelectThread m_selectThread;
- CActiveScheduler *m_activeScheduler;
+ CQtActiveScheduler *m_activeScheduler;
QHash<int, SymbianTimerInfoPtr> m_timerList;
QHash<QSocketNotifier *, QSocketActiveObject *> m_notifiers;
diff --git a/src/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp
index c11a7b9..976227d 100644
--- a/src/corelib/tools/qlocale_symbian.cpp
+++ b/src/corelib/tools/qlocale_symbian.cpp
@@ -47,11 +47,12 @@
#include <e32std.h>
#include "private/qcore_symbian_p.h"
-// Located in qlocale.cpp
-extern void getLangAndCountry(const QString &name, QLocale::Language &lang, QLocale::Country &cntry);
QT_BEGIN_NAMESPACE
+// Located in qlocale.cpp
+extern void getLangAndCountry(const QString &name, QLocale::Language &lang, QLocale::Country &cntry);
+
static TExtendedLocale _s60Locale;
// Type definitions for runtime resolved function pointers
diff --git a/src/corelib/tools/qringbuffer_p.h b/src/corelib/tools/qringbuffer_p.h
index ac33353..a1bfab0 100644
--- a/src/corelib/tools/qringbuffer_p.h
+++ b/src/corelib/tools/qringbuffer_p.h
@@ -199,8 +199,12 @@ public:
inline void clear() {
if(!buffers.isEmpty()) {
- // remove all but the first
- buffers.erase(buffers.begin() + 1, buffers.end());
+ QByteArray tmp = buffers[0];
+ buffers.clear();
+ buffers << tmp;
+ //TODO merge this optimization ?
+ //buffers.erase(buffers.begin() + 1, buffers.end());
+ //>>>>>>> 08ae7ee1fb930e7d4b4039e2294cba69f9380964:src/corelib/tools/qringbuffer_p.h
if (buffers.at(0).size() != basicBlockSize)
buffers[0].resize(basicBlockSize);
}
diff --git a/src/gui/dialogs/qfscompleter_p.h b/src/gui/dialogs/qfscompleter_p.h
index 37d9c74..c65eeea 100644
--- a/src/gui/dialogs/qfscompleter_p.h
+++ b/src/gui/dialogs/qfscompleter_p.h
@@ -55,8 +55,9 @@
#include "qcompleter.h"
#include <QtGui/qfilesystemmodel.h>
-
+QT_BEGIN_NAMESPACE
#ifndef QT_NO_COMPLETER
+
/*!
QCompleter that can deal with QFileSystemModel
*/
@@ -76,6 +77,6 @@ public:
QFileSystemModel *sourceModel;
};
#endif // QT_NO_COMPLETER
-
+QT_END_NAMESPACE
#endif // QCOMPLETOR_P_H
diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h
index 9ef5347..6c24055 100644
--- a/src/gui/image/qpixmap.h
+++ b/src/gui/image/qpixmap.h
@@ -51,6 +51,10 @@
QT_BEGIN_HEADER
+#if defined(Q_OS_SYMBIAN)
+class CFbsBitmap;
+#endif
+
QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
@@ -59,13 +63,8 @@ class QImageWriter;
class QColor;
class QVariant;
class QX11Info;
-
class QPixmapData;
-#if defined(Q_OS_SYMBIAN)
-class CFbsBitmap;
-#endif
-
class Q_GUI_EXPORT QPixmap : public QPaintDevice
{
public:
diff --git a/src/gui/kernel/qaction.h b/src/gui/kernel/qaction.h
index dfa4933..3449acf 100644
--- a/src/gui/kernel/qaction.h
+++ b/src/gui/kernel/qaction.h
@@ -91,11 +91,10 @@ class Q_GUI_EXPORT QAction : public QObject
public:
enum MenuRole { NoRole, TextHeuristicRole, ApplicationSpecificRole, AboutQtRole,
AboutRole, PreferencesRole, QuitRole };
- enum SoftKeyRole { OptionsSoftKey, SelectSoftKey, BackSoftKey, NextSoftKey, PreviousSoftKey,
- OkSoftKey, CancelSoftKey, EditSoftKey, ViewSoftKey, BackSpaceSoftKey,
- EndEditSoftKey, RevertEditSoftKey, DeselectSoftKey, FinishSoftKey,
- MenuSoftKey, ContextMenuSoftKey, ExitSoftKey, Key1SoftKey, Key2SoftKey,
- Key3SoftKey, Key4SoftKey, CustomSoftKey };
+ enum SoftKeyRole { OptionsSoftKey, SelectSoftKey, BackSoftKey, NextSoftKey, PreviousSoftKey,
+ OkSoftKey, CancelSoftKey, EditSoftKey, ViewSoftKey, BackSpaceSoftKey,
+ EndEditSoftKey, RevertEditSoftKey, DeselectSoftKey, FinishSoftKey,
+ MenuSoftKey, ContextMenuSoftKey, ExitSoftKey };
explicit QAction(QObject* parent);
QAction(const QString &text, QObject* parent);
QAction(const QIcon &icon, const QString &text, QObject* parent);
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 42faf98..b7561e4 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -343,7 +343,7 @@ void QSymbianControl::HandleLongTapEventL( const TPoint& aPenEventLocation, cons
QMouseEvent mEvent(QEvent::MouseButtonPress, alienWidget->mapFrom(qwidget, widgetPos), globalPos,
Qt::RightButton, QApplicationPrivate::mouse_buttons, Qt::NoModifier);
sendMouseEvent(alienWidget, &mEvent);
- m_previousEventLongTap = false;
+ m_previousEventLongTap = true;
}
void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent)
@@ -821,18 +821,20 @@ void QApplicationPrivate::openPopup(QWidget *popup)
WId id = popup->effectiveWinId();
id->SetPointerCapture(true);
id->SetGloballyCapturing(true);
-
autoGrabWindow = id;
}
// popups are not focus-handled by the window system (the first
// popup grabbed the keyboard), so we have to do that manually: A
// new popup gets the focus
- if (popup->focusWidget()) {
- popup->focusWidget()->setFocus(Qt::PopupFocusReason);
+ if (QApplication::focusWidget())
+ static_cast<QSymbianControl*>(QApplication::focusWidget()->effectiveWinId())->CancelLongTapTimer();
+ QWidget *fw = popup->focusWidget();
+ if (fw) {
+ fw->setFocus(Qt::PopupFocusReason);
} else if (QApplicationPrivate::popupWidgets->count() == 1) { // this was the first popup
- if (QWidget *fw = QApplication::focusWidget()) {
- static_cast<QSymbianControl*>(fw->effectiveWinId())->CancelLongTapTimer();
+ fw = QApplication::focusWidget();
+ if (fw) {
QFocusEvent e(QEvent::FocusOut, Qt::PopupFocusReason);
q_func()->sendEvent(fw, &e);
}
diff --git a/src/gui/kernel/qlayout.cpp b/src/gui/kernel/qlayout.cpp
index 4463aab..d8d8234 100644
--- a/src/gui/kernel/qlayout.cpp
+++ b/src/gui/kernel/qlayout.cpp
@@ -145,7 +145,12 @@ QLayout::QLayout(QLayoutPrivate &dd, QLayout *lay, QWidget *w)
} else {
d->topLevel = true;
w->d_func()->layout = this;
- invalidate();
+ QT_TRY {
+ invalidate();
+ } QT_CATCH(...) {
+ w->d_func()->layout = 0;
+ QT_RETHROW;
+ }
}
}
}
@@ -230,7 +235,12 @@ QLayout::QLayout(QWidget *parent, int margin, int spacing, const char *name)
} else {
d->topLevel = true;
parent->d_func()->layout = this;
- invalidate();
+ QT_TRY {
+ invalidate();
+ } QT_CATCH(...) {
+ parent->d_func()->layout = 0;
+ QT_RETHROW;
+ }
}
}
}
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index bc69d6d..6109f17 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -85,29 +85,62 @@ void QWidgetPrivate::setSoftKeys_sys(const QList<QAction*> &softkeys)
if (isEqual(old, softkeys ))
return;
}
- CCoeAppUi* appui = CEikonEnv::Static()->AppUi();
- CAknAppUi* aknAppUi = static_cast <CAknAppUi*>(appui);
- CEikButtonGroupContainer* nativeContainer = aknAppUi->Cba();
+ CEikButtonGroupContainer* nativeContainer = S60->buttonGroupContainer();
nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS);
- int placeInScreen=0;
+ int position = -1;
+ int command;
+ bool needsExitButton = true;
+
for (int index = 0; index < softkeys.count(); index++) {
const QAction* softKeyAction = softkeys.at(index);
- if (softKeyAction->softKeyRole() != QAction::ContextMenuSoftKey) {
+ switch (softKeyAction->softKeyRole()) {
+ // Positive Actions go on LSK
+ case QAction::OptionsSoftKey:
+ case QAction::MenuSoftKey:
+ case QAction::ContextMenuSoftKey:
+ command = EAknSoftkeyOptions; //Calls DynInitMenuPane in AppUI
+ position = 0;
+ break;
+ case QAction::SelectSoftKey:
+ case QAction::PreviousSoftKey:
+ case QAction::OkSoftKey:
+ case QAction::EditSoftKey:
+ case QAction::ViewSoftKey:
+ case QAction::EndEditSoftKey:
+ case QAction::FinishSoftKey:
+ command = SOFTKEYSTART + index;
+ position = 0;
+ break;
+ // Negative Actions on the RSK
+ case QAction::BackSoftKey:
+ case QAction::NextSoftKey:
+ case QAction::CancelSoftKey:
+ case QAction::BackSpaceSoftKey:
+ case QAction::RevertEditSoftKey:
+ case QAction::DeselectSoftKey:
+ needsExitButton = false;
+ command = SOFTKEYSTART + index;
+ position = 2;
+ break;
+ case QAction::ExitSoftKey:
+ needsExitButton = false;
+ command = EAknSoftkeyExit; //Calls HandleCommand in AppUI
+ position = 2;
+ break;
+ default:
+ break;
+ }
- HBufC* text = qt_QString2HBufC(softKeyAction->text());
- CleanupStack::PushL(text);
- if (softKeyAction->softKeyRole() == QAction::MenuSoftKey) {
- nativeContainer->SetCommandL(placeInScreen, EAknSoftkeyOptions, *text);
- } else {
- nativeContainer->SetCommandL(placeInScreen, SOFTKEYSTART + index, *text);
- }
- CleanupStack::PopAndDestroy();
- placeInScreen++;
+ if (position != -1) {
+ TPtrC text = qt_QString2TPtrC(softKeyAction->text());
+ nativeContainer->SetCommandL(position, command, text);
}
- if (placeInScreen==1)
- placeInScreen=2;
}
+
+ if (needsExitButton)
+ nativeContainer->SetCommandL(2, EAknSoftkeyExit, qt_QString2TPtrC(QObject::tr("Exit")));
+
nativeContainer->DrawDeferred(); // 3.1 needs an extra invitation
}
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index d2bd679..794e19f 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -478,7 +478,9 @@ void QS60StylePrivate::setThemePalette(QApplication *app) const
Q_UNUSED(app)
QPalette widgetPalette = QPalette(Qt::white);
setThemePalette(&widgetPalette);
- QApplication::setPalette(widgetPalette);
+ QApplication::setPalette(widgetPalette); //calling QApplication::setPalette clears palette hash
+ setThemePaletteHash(&widgetPalette);
+ storeThemePalette(&widgetPalette);
}
void QS60StylePrivate::setThemePalette(QStyleOption *option) const
@@ -664,7 +666,7 @@ void QS60StylePrivate::setThemePalette(QWidget *widget) const
{
if(!widget)
return;
- QPalette widgetPalette = widget->palette();
+ QPalette widgetPalette = QApplication::palette(widget);
//header view and its viewport need to be set 100% transparent button color, since drawing code will
//draw transparent theme graphics to table column and row headers.
@@ -716,9 +718,6 @@ void QS60StylePrivate::setThemePalette(QPalette *palette) const
palette->setColor(QPalette::Midlight, palette->color(QPalette::Button).lighter(125));
palette->setColor(QPalette::Mid, palette->color(QPalette::Button).darker(150));
palette->setColor(QPalette::Shadow, Qt::black);
-
- setThemePaletteHash(palette);
- storeThemePalette(palette);
}
void QS60StylePrivate::deleteThemePalette()
@@ -791,6 +790,18 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const
QApplication::setPalette(widgetPalette, "QLineEdit");
widgetPalette = *palette;
+ widgetPalette.setColor(QPalette::All, QPalette::Text,
+ s60Color(QS60StyleEnums::CL_QsnTextColors, 34, 0));
+ widgetPalette.setColor(QPalette::All, QPalette::HighlightedText,
+ s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0));
+ QApplication::setPalette(widgetPalette, "QTextEdit");
+ widgetPalette = *palette;
+
+ widgetPalette.setColor(QPalette::All, QPalette::HighlightedText,
+ s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0));
+ QApplication::setPalette(widgetPalette, "QComboBox");
+ widgetPalette = *palette;
+
widgetPalette.setColor(QPalette::WindowText, mainAreaTextColor);
widgetPalette.setColor(QPalette::Button, QApplication::palette().color(QPalette::Button));
widgetPalette.setColor(QPalette::Dark, mainAreaTextColor.darker());
@@ -1383,8 +1394,10 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
} else { QCommonStyle::drawPrimitive(PE_PanelItemViewItem, option, painter, widget);}
// draw the focus rect
- if (isSelected)
- QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, option->rect, flags);
+ if (isSelected) {
+ const QRect highlightRect = option->rect.adjusted(1,1,-1,-1);
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, highlightRect, flags);
+ }
// draw the icon
const QIcon::Mode mode = (voptAdj.state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled;
@@ -1662,7 +1675,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
case CE_MenuItem:
if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) {
QStyleOptionMenuItem optionMenuItem = *menuItem;
-
+
bool drawSubMenuIndicator = false;
switch(menuItem->menuItemType) {
case QStyleOptionMenuItem::Scroller:
@@ -1785,39 +1798,24 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
painter->restore();
}
break;
- case CE_HeaderEmptyArea:
- {
- QS60StylePrivate::SkinElementFlags adjFlags = flags;
- QRect emptyAreaRect = option->rect;
- const int frameWidth = QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth);
- if (option->state & QStyle::State_Horizontal) {
- emptyAreaRect.adjust(-frameWidth,-frameWidth,frameWidth,-frameWidth);
- } else {
- if ( option->direction == Qt::LeftToRight ) {
- emptyAreaRect.adjust(-frameWidth,-frameWidth,0,frameWidth);
- adjFlags |= QS60StylePrivate::SF_PointWest;
- } else {
- emptyAreaRect.adjust(frameWidth,frameWidth,0,-frameWidth);
- adjFlags |= QS60StylePrivate::SF_PointEast;
- }
- }
- QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, emptyAreaRect, adjFlags);
- }
+ case CE_HeaderEmptyArea: // no need to draw this
break;
case CE_Header:
if ( const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
QS60StylePrivate::SkinElementFlags adjFlags = flags;
QRect mtyRect = header->rect;
- QRect parentRect = widget->parentWidget()->rect();
const int frameWidth = QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth);
if (header->orientation == Qt::Horizontal) {
- mtyRect.adjust(-frameWidth,-frameWidth,frameWidth,-frameWidth);
+ if (header->position == QStyleOptionHeader::OnlyOneSection)
+ mtyRect.adjust(frameWidth,1,frameWidth,-frameWidth);
+ else
+ mtyRect.adjust(-frameWidth,1,frameWidth,-frameWidth);
} else {
if ( header->direction == Qt::LeftToRight ) {
- mtyRect.adjust(-frameWidth,-frameWidth,0,frameWidth);
+ mtyRect.adjust(1,-frameWidth,0,frameWidth);
adjFlags |= QS60StylePrivate::SF_PointWest;
} else {
- mtyRect.adjust(frameWidth,frameWidth,0,-frameWidth);
+ mtyRect.adjust(-1,frameWidth,0,-frameWidth);
adjFlags |= QS60StylePrivate::SF_PointEast;
}
}
@@ -1881,11 +1879,16 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
break;
#endif //QT_NO_TOOLBAR
case CE_ShapedFrame:
- if (qobject_cast<const QTextEdit *>(widget))
+ if (qobject_cast<const QTextEdit *>(widget)) {
QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_Editor, painter, option->rect, flags);
+ } else if (qobject_cast<const QAbstractScrollArea *>(widget) && qobject_cast<const QTableView *>(widget)) {
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableItem, painter, option->rect, flags);
+ }
if (option->state & State_HasFocus)
drawPrimitive(PE_FrameFocusRect, option, painter, widget);
break;
+ case CE_MenuScroller:
+ break;
default:
QCommonStyle::drawControl(element, option, painter, widget);
}
@@ -2123,8 +2126,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
#ifndef QT_NO_ITEMVIEWS
case PE_PanelItemViewItem:
case PE_PanelItemViewRow: // ### Qt 5: remove
- if (qobject_cast<const QTableView *>(widget) && qstyleoption_cast<const QStyleOptionViewItemV4 *>(option))
- QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableItem, painter, option->rect, flags);
break;
#endif //QT_NO_ITEMVIEWS
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 1f02efa..63346da 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -318,16 +318,16 @@ const partMapEntry QS60StyleModeSpecifics::m_partMap[] = {
/* SP_QsnFrButtonSideLInactive */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b7},
/* SP_QsnFrButtonSideRInactive */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b8},
/* SP_QsnFrButtonCenterInactive */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b9},
-
- /*SP_QsnFrNotepadCornerTl */ {KAknsIIDQsnFrNotepadCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrNotepadCornerTr */ {KAknsIIDQsnFrNotepadCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
+
+ /* SP_QsnFrNotepadCornerTl */ {KAknsIIDQsnFrNotepadContCornerTl, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrNotepadCornerTr */ {KAknsIIDQsnFrNotepadContCornerTr, ENoDraw, ES60_AllReleases, -1,-1},
/* SP_QsnFrNotepadCornerBl */ {KAknsIIDQsnFrNotepadCornerBl, ENoDraw, ES60_AllReleases, -1,-1},
/* SP_QsnFrNotepadCornerBr */ {KAknsIIDQsnFrNotepadCornerBr, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrNotepadSideT */ {KAknsIIDQsnFrNotepadSideT, ENoDraw, ES60_AllReleases, -1,-1},
+ /* SP_QsnFrNotepadSideT */ {KAknsIIDQsnFrNotepadContSideT, ENoDraw, ES60_AllReleases, -1,-1},
/* SP_QsnFrNotepadSideB */ {KAknsIIDQsnFrNotepadSideB, ENoDraw, ES60_AllReleases, -1,-1},
/* SP_QsnFrNotepadSideL */ {KAknsIIDQsnFrNotepadSideL, ENoDraw, ES60_AllReleases, -1,-1},
/* SP_QsnFrNotepadSideR */ {KAknsIIDQsnFrNotepadSideR, ENoDraw, ES60_AllReleases, -1,-1},
- /* SP_QsnFrNotepadCenter */ {KAknsIIDQsnFrNotepadCenter, EDrawIcon, ES60_AllReleases, -1,-1}
+ /* SP_QsnFrNotepadCenter */ {KAknsIIDQsnFrNotepadCenter, EDrawIcon, ES60_AllReleases, -1,-1},
};
@@ -828,6 +828,10 @@ void QS60StyleModeSpecifics::frameIdAndCenterId(QS60StylePrivate::SkinFrameEleme
centerId.Set(KAknsIIDNone);
frameId.Set(KAknsIIDQsnFrSetOpt);
break;
+ case QS60StylePrivate::SF_Editor:
+ centerId.Set(KAknsIIDQsnFrNotepadCenter);
+ frameId.Set(KAknsIIDQsnFrNotepadCont);
+ break;
default:
// center should be correct here
frameId.iMinor = centerId.iMinor - 9;
@@ -849,6 +853,10 @@ TRect QS60StyleModeSpecifics::innerRectFromElement(QS60StylePrivate::SkinFrameEl
widthShrink = widthShrink>>1;
heightShrink = heightShrink>>1;
break;
+ case QS60StylePrivate::SF_ListHighlight:
+ widthShrink = widthShrink-2;
+ heightShrink = heightShrink-2;
+ break;
default:
break;
}
diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp
index 5f8371c..394523a 100644
--- a/src/gui/widgets/qmainwindow.cpp
+++ b/src/gui/widgets/qmainwindow.cpp
@@ -482,7 +482,7 @@ void QMainWindow::setMenuBar(QMenuBar *menuBar)
}
d->layout->setMenuBar(menuBar);
if (menuBar) {
- QAction* menu = new QAction(QString::fromLatin1("Menu"), this);
+ QAction* menu = new QAction(QString::fromLatin1("Options"), this);
menu->setSoftKeyRole(QAction::MenuSoftKey);
setSoftKey(menu);
}
@@ -1400,7 +1400,7 @@ bool QMainWindow::event(QEvent *event)
case QEvent::WindowActivate:
if (d->layout->menuBar()) {
// ### TODO: This is evil, there is no need to create a new action every time
- QAction* menu = new QAction(QString::fromLatin1("Menu"), this);
+ QAction* menu = new QAction(QString::fromLatin1("Options"), this);
menu->setSoftKeyRole(QAction::MenuSoftKey);
setSoftKey(menu);
}
diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
index f5d7166..bdbf986 100644
--- a/src/network/kernel/qhostinfo_unix.cpp
+++ b/src/network/kernel/qhostinfo_unix.cpp
@@ -320,8 +320,7 @@ QString QHostInfo::localDomainName()
if (local_res_ninit) {
// using thread-safe version
res_state_ptr state = res_state_ptr(qMalloc(sizeof(*state)));
- if (!state)
- qBadAlloc();
+ Q_CHECK_PTR(state);
memset(state, 0, sizeof(*state));
local_res_ninit(state);
QString domainName = QUrl::fromAce(state->defdname);
diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby
index dc702f9..79edc56 100644
--- a/src/s60installs/qt.iby
+++ b/src/s60installs/qt.iby
@@ -7,6 +7,7 @@
#include <base.iby>
#include <openenv.iby> // QtCore, QtGui, QtNetwork, QtOpenGL, QSvgIconEngine,
#include <cone.iby> // QtGui, QtOpenGL
+#include <stdcpp.iby> // for std C++ support
// QtGui dependancies
#include <bafl.iby>