summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-09-20 12:23:53 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-09-20 12:23:53 (GMT)
commitb81201a29a9794ed490098c8eb136464afa12b8a (patch)
tree7d7ad331c8c5316924bd5ff3fd7e6ccb21e7cc48 /src/gui
parent5243b9eaf3deb201f23b2710c274e3108a4eb23b (diff)
parentfde1488aa7476eba915fbac958c56664df8ecf82 (diff)
downloadQt-b81201a29a9794ed490098c8eb136464afa12b8a.zip
Qt-b81201a29a9794ed490098c8eb136464afa12b8a.tar.gz
Qt-b81201a29a9794ed490098c8eb136464afa12b8a.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-symbian-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-symbian-staging: (31 commits) runonphone: Include USB serial ports on OS X for CODA, too runonphone: Implement traceswitch support for coda Fix missing clean up stack panic for a new thread in Symbian Regression in QS60Style when drawing webview scrollbars Cleanup qwidget_s60.cpp Fix panic when global QSettings instance needs flusing at app exit Fix uninitialised variable in temporary files More accurately determine bearer type for symbian GPRS/3G Add documentation for Symbian QSettings locations and security Update QDesktopServices openUrl() documentation on Symbian OS Mark binaries as SMPSAFE in Symbian Fix "sbs -c tools2 --what" output for Qt. Update environment.prf QS60Style: Make spinboxes and lineedits slightly taller runonphone: Add a missing space between a message and the file name runonphone: Allow overriding the temporary sis file name Fix QIcon auto-tests for Symbian Add a cast to moc cpp generator to remove armcc warnings Fix qt.conf for Symbian to use $${EPOCROOT} Remove few unused variables. ...
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qwidget_s60.cpp22
-rw-r--r--src/gui/styles/qs60style.cpp66
-rw-r--r--src/gui/styles/qs60style_s60.cpp28
-rw-r--r--src/gui/util/qdesktopservices.cpp3
4 files changed, 65 insertions, 54 deletions
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 2b51aaa..e06b625 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -84,21 +84,6 @@ CEikButtonGroupContainer *QS60Data::cba = 0;
int qt_symbian_create_desktop_on_screen = -1;
-static bool isEqual(const QList<QAction*>& a, const QList<QAction*>& b)
-{
- if ( a.count() != b.count())
- return false;
- int index=0;
- while (index<a.count()) {
- if (a.at(index)->softKeyRole() != b.at(index)->softKeyRole())
- return false;
- if (a.at(index)->text().compare(b.at(index)->text())!=0)
- return false;
- index++;
- }
- return true;
-}
-
void QWidgetPrivate::setWSGeometry(bool dontShow, const QRect &)
{
// Note: based on x11 implementation
@@ -231,7 +216,6 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
QPoint oldPos(q->pos());
QSize oldSize(q->size());
- QRect oldGeom(data.crect);
bool checkExtra = true;
if (q->isWindow() && (data.window_state & (Qt::WindowFullScreen | Qt::WindowMaximized))) {
@@ -348,11 +332,7 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
bool topLevel = (flags & Qt::Window);
bool popup = (type == Qt::Popup);
- bool dialog = (type == Qt::Dialog
- || type == Qt::Sheet
- || (flags & Qt::MSWindowsFixedSizeDialogHint));
bool desktop = (type == Qt::Desktop);
- //bool tool = (type == Qt::Tool || type == Qt::Drawer);
if (popup)
flags |= Qt::WindowStaysOnTopHint; // a popup stays on top
@@ -1075,7 +1055,7 @@ void QWidgetPrivate::registerTouchWindow()
int QWidget::metric(PaintDeviceMetric m) const
{
Q_D(const QWidget);
- int val;
+ int val = 0;
if (m == PdmWidth) {
val = data->crect.width();
} else if (m == PdmHeight) {
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index e9f7a86..eec2d15 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -101,12 +101,9 @@ const int QS60StylePrivate::m_numberOfLayouts =
const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = {
// *** generated pixel metrics ***
-{5,0,-909,0,0,2,0,2,-1,7,12,22,15,15,7,198,-909,-909,-909,20,13,2,0,0,21,7,18,30,3,3,1,-909,-909,0,1,0,0,12,20,15,15,18,18,1,115,18,0,-909,-909,-909,-909,0,0,16,2,-909,0,0,-909,16,-909,-909,-909,-909,32,18,55,24,55,4,4,4,9,13,-909,5,51,11,5,0,3,3,6,8,3,3,-909,2,-909,-909,-909,-909,5,5,3,1,106,30,30},
-{5,0,-909,0,0,1,0,2,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,28,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,3,3,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1,106,30,30},
-{7,0,-909,0,0,2,0,5,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,11,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,3,3,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135,30,30},
-{7,0,-909,0,0,2,0,5,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,13,0,0,32,25,60,52,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,3,3,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135,30,30},
-{7,0,-909,0,0,2,0,2,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,30,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1,106,30,30},
-{9,0,-909,0,0,2,0,5,-1,30,99,76,51,51,25,352,-909,-909,-909,29,25,7,0,0,43,34,42,76,7,7,2,-909,-909,0,9,14,0,23,39,30,30,37,37,9,391,40,0,-909,-909,-909,-909,0,0,29,2,-909,0,0,-909,29,-909,-909,-909,-909,115,37,96,48,96,2,2,9,1,25,-909,9,101,24,9,0,7,7,7,16,7,7,-909,3,-909,-909,-909,-909,9,9,3,1,184,30,30}
+{7,0,-909,0,0,2,5,5,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,11,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,3,3,6,8,19,-909,7,74,19,7,0,5,5,8,5,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135,30,30},
+{7,0,-909,0,0,2,5,5,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,13,0,0,32,25,60,52,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,3,3,6,8,19,-909,7,74,22,7,0,5,5,8,5,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135,30,30},
+{9,0,-909,0,0,2,5,5,-1,30,99,76,51,51,25,352,-909,-909,-909,29,25,7,0,0,43,34,42,76,7,7,2,-909,-909,0,9,14,0,23,39,30,30,37,37,9,391,40,0,-909,-909,-909,-909,0,0,29,2,-909,0,0,-909,29,-909,-909,-909,-909,115,37,96,48,96,2,2,9,1,25,-909,9,101,24,9,0,7,7,7,7,7,7,-909,3,-909,-909,-909,-909,9,9,3,1,184,30,30}
// *** End of generated data ***
};
@@ -845,6 +842,7 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette)
webPalette.setColor(QPalette::WindowText, Qt::black);
webPalette.setColor(QPalette::Text, Qt::black);
webPalette.setBrush(QPalette::Base, Qt::white);
+ webPalette.setBrush(QPalette::Window, Qt::white);
QApplication::setPalette(webPalette, "QWebView");
QApplication::setPalette(webPalette, "QGraphicsWebView");
@@ -1520,9 +1518,9 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
if (tabOverlap > borderThickness)
tabOverlap -= borderThickness;
- const bool usesScrollButtons =
+ const bool usesScrollButtons =
(widget) ? (qobject_cast<const QTabBar*>(widget))->usesScrollButtons() : false;
- const int roomForScrollButton =
+ const int roomForScrollButton =
usesScrollButtons ? QS60StylePrivate::pixelMetric(PM_TabBarScrollButtonWidth) : 0;
// adjust for overlapping tabs and scrollbuttons, if necessary
@@ -1563,9 +1561,9 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
int tabOverlap = pixelMetric(PM_TabBarTabOverlap);
if (tabOverlap > borderThickness)
tabOverlap -= borderThickness;
- const bool usesScrollButtons =
+ const bool usesScrollButtons =
(widget) ? (qobject_cast<const QTabBar*>(widget))->usesScrollButtons() : false;
- const int roomForScrollButton =
+ const int roomForScrollButton =
usesScrollButtons ? QS60StylePrivate::pixelMetric(PM_TabBarScrollButtonWidth) : 0;
switch (tab->shape) {
@@ -1771,7 +1769,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
//highlight and then it needs one to separate it whatever is shown after it (text/icon/both).
const int moveByX = optionCheckBox.rect.width() + 2 * vSpacing;
optionCheckBox.rect.moveCenter(QPoint(
- optionCheckBox.rect.center().x() + moveByX >> 1,
+ optionCheckBox.rect.center().x() + moveByX >> 1,
menuItem->rect.center().y()));
if (optionMenuItem.direction != Qt::LeftToRight)
@@ -1785,11 +1783,11 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
const int end = optionMenuItem.rect.right() - spacing;
//-1 adjustment to avoid highlight being on top of possible separator item
const QRect highlightRect = QRect(
- QPoint(start, option->rect.top()),
+ QPoint(start, option->rect.top()),
QPoint(end, option->rect.bottom() - 1));
QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, highlightRect, flags);
}
-
+
if (checkable && !ignoreCheckMark)
drawPrimitive(PE_IndicatorMenuCheckMark, &optionCheckBox, painter, widget);
@@ -2072,8 +2070,8 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
if ((qstyleoption_cast<const QStyleOptionFocusRect *>(option) &&
(qobject_cast<const QRadioButton *>(widget) || qobject_cast<const QCheckBox *>(widget))))
QS60StylePrivate::drawSkinElement(
- QS60StylePrivate::isWidgetPressed(widget) ?
- QS60StylePrivate::SE_ListItemPressed :
+ QS60StylePrivate::isWidgetPressed(widget) ?
+ QS60StylePrivate::SE_ListItemPressed :
QS60StylePrivate::SE_ListHighlight, painter, option->rect, flags);
} else {
commonStyleDraws = true;
@@ -2506,11 +2504,13 @@ int QS60Style::pixelMetric(PixelMetric metric, const QStyleOption *option, const
metricValue = QS60StylePrivate::pixelMetric(PM_LayoutLeftMargin);
}
- if (widget && (metric == PM_LayoutTopMargin || metric == PM_LayoutLeftMargin || metric == PM_LayoutRightMargin))
- if (widget->windowType() == Qt::Dialog)
- //double the layout margins (except bottom) for dialogs, it is very close to real value
+ if (widget && (metric == PM_LayoutTopMargin || metric == PM_LayoutBottomMargin
+ || metric == PM_LayoutRightMargin || metric == PM_LayoutLeftMargin))
+ if (widget->windowType() == Qt::Dialog) {
+ //double the layout margins for dialogs, it is very close to real value
//without having to define custom pixel metric
metricValue *= 2;
+ }
#if defined(Q_WS_S60)
if (metric == PM_TabBarTabOverlap && (QSysInfo::s60Version() > QSysInfo::SV_S60_5_2))
@@ -2537,13 +2537,17 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
//Make toolbuttons in toolbar stretch the whole screen area
if (widget && qobject_cast<const QToolBar *>(widget->parentWidget())) {
const QToolBar *tb = qobject_cast<const QToolBar *>(widget->parentWidget());
- const bool parentCanGrowHorizontally = !(tb->sizePolicy().horizontalPolicy() == QSizePolicy::Fixed ||
- tb->sizePolicy().horizontalPolicy() == QSizePolicy::Maximum) && tb->orientation() == Qt::Horizontal;
+ bool parentCanGrowHorizontally = false;
+ if (tb) {
+ parentCanGrowHorizontally = !(tb->sizePolicy().horizontalPolicy() == QSizePolicy::Fixed
+ || tb->sizePolicy().horizontalPolicy() == QSizePolicy::Maximum)
+ && tb->orientation() == Qt::Horizontal;
+ }
if (parentCanGrowHorizontally) {
int buttons = 0;
//Make the auto-stretch to happen only for horizontal orientation
- if (tb && tb->orientation() == Qt::Horizontal) {
+ if (tb->orientation() == Qt::Horizontal) {
QList<QAction*> actionList = tb->actions();
for (int i = 0; i < actionList.count(); i++) {
buttons++;
@@ -2603,7 +2607,7 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
break;
case CT_LineEdit:
if (const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(opt))
- sz += QSize(2 * f->lineWidth, 4 * f->lineWidth);
+ sz += QSize(2 * f->lineWidth, 4 * f->lineWidth + 2 * pixelMetric(PM_FocusFrameHMargin));
break;
case CT_TabBarTab: {
sz = QCommonStyle::sizeFromContents(ct, opt, csz, widget);
@@ -2648,6 +2652,12 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
}
break;
#endif
+#ifndef QT_NO_SPINBOX
+ case CT_SpinBox:
+ // Add margin to the spinbox height
+ sz.setHeight(sz.height() + 2 * pixelMetric(PM_SpinBoxFrameWidth));
+ break;
+#endif
default:
sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
break;
@@ -2821,7 +2831,7 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
// Thus, side-by-side buttons would take half of the total width.
const int maxSize = qMax(spinbox->rect.width() / 4, buttonContentWidth);
QSize buttonSize;
- buttonSize.setHeight(qMin(maxSize, qMax(8, spinbox->rect.height() - frameThickness)));
+ buttonSize.setHeight(qMin(maxSize, qMax(8, spinbox->rect.height() - 2 * frameThickness)));
//width should at least be equal to height
buttonSize.setWidth(qMax(buttonSize.height(), buttonContentWidth));
buttonSize = buttonSize.expandedTo(QApplication::globalStrut());
@@ -2829,9 +2839,9 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
// Normally spinbuttons should be side-by-side, but if spinbox grows very big
// and spinbuttons reach their maximum size, they can be deployed one top of the other.
const bool sideBySide = (buttonSize.height() * 2 < spinbox->rect.height()) ? false : true;
- const int y = frameThickness + spinbox->rect.y() +
+ const int y = spinbox->rect.y() +
(spinbox->rect.height() - (sideBySide ? 1 : 2) * buttonSize.height()) / 2;
- const int x = spinbox->rect.x() +
+ const int x = spinbox->rect.x() +
spinbox->rect.width() - frameThickness - (sideBySide ? 2 : 1) * buttonSize.width();
switch (scontrol) {
@@ -2843,8 +2853,8 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
case SC_SpinBoxDown:
if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons)
return QRect();
- ret = QRect(x + (sideBySide ? buttonSize.width() : 0),
- y + (sideBySide ? 0 : buttonSize.height()),
+ ret = QRect(x + (sideBySide ? buttonSize.width() : 0),
+ y + (sideBySide ? 0 : buttonSize.height()),
buttonSize.width(), buttonSize.height());
break;
case SC_SpinBoxEditField:
@@ -3778,7 +3788,7 @@ QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon,
const QS60StylePrivate::SkinElementFlags flags = adjustedFlags;
const int iconDimension = QS60StylePrivate::pixelMetric(metric);
- const QRect iconSize = (!option) ?
+ const QRect iconSize = (!option) ?
QRect(0, 0, iconDimension * iconWidthMultiplier, iconDimension * iconHeightMultiplier) : option->rect;
const QPixmap cachedPixMap(QS60StylePrivate::cachedPart(part, iconSize.size(), 0, flags));
return cachedPixMap.isNull() ?
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 33619d6..cfb10fa 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -110,7 +110,7 @@ typedef struct {
TDrawType drawType; // Determines which native drawing routine is used to draw this item.
int supportInfo; // Defines the S60 versions that use the default graphics.
// These two, define new graphics that are used in releases other than partMapEntry.supportInfo defined releases.
- // In general, these are given in numeric form to allow style compilation in earlier
+ // In general, these are given in numeric form to allow style compilation in earlier
// native releases that do not contain the new graphics.
int newMajorSkinId;
int newMinorSkinId;
@@ -929,6 +929,16 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX(
fallbackGraphicID ,
fallbackGraphicsMaskID);
+ // If drawing fails, re-try without a mask.
+ if (!icon) {
+ AknsUtils::CreateIconL(
+ skinInstance,
+ skinId,
+ icon,
+ (fallbackGraphicID != KErrNotFound ? AknIconUtils::AvkonIconFileName() : KNullDesC),
+ fallbackGraphicID);
+ }
+
result = fromFbsBitmap(icon, iconMask, flags, targetSize);
delete icon;
delete iconMask;
@@ -961,17 +971,22 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX(
targetSize,
drawParam);
- if (drawn)
+ if (drawn) {
result = fromFbsBitmap(background, NULL, flags, targetSize);
- // if drawing fails in skin server, just ignore the background (probably OOM case)
+ } else {
+ // if drawing fails in skin server, draw background as white
+ QPixmap defaultBg = QPixmap(targetSize.iWidth, targetSize.iHeight);
+ defaultBg.fill(Qt::white);
+ result = defaultBg;
+ }
CleanupStack::PopAndDestroy(4, background); //background, dev, gc, bgContext
// QS60WindowSurface::lockBitmapHeap();
break;
}
case EDrawAnimation: {
- CFbsBitmap* animationFrame;
- CFbsBitmap* frameMask;
+ CFbsBitmap* animationFrame = 0;
+ CFbsBitmap* frameMask = 0;
CAknBitmapAnimation* aknAnimation = 0;
TBool constructedFromTheme = ETrue;
@@ -1225,6 +1240,9 @@ TRect QS60StyleModeSpecifics::innerRectFromElement(QS60StylePrivate::SkinFrameEl
bool QS60StyleModeSpecifics::checkSupport(const int supportedRelease)
{
+ if (supportedRelease == ES60_All)
+ return true;
+
const QSysInfo::S60Version currentRelease = QSysInfo::s60Version();
return ( (currentRelease == QSysInfo::SV_S60_3_1 && supportedRelease & ES60_3_1) ||
(currentRelease == QSysInfo::SV_S60_3_2 && supportedRelease & ES60_3_2) ||
diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp
index e79819e..05a1292 100644
--- a/src/gui/util/qdesktopservices.cpp
+++ b/src/gui/util/qdesktopservices.cpp
@@ -177,6 +177,9 @@ void QOpenUrlHandlerRegistry::handlerDestroyed(QObject *handler)
Unicode-aware, the user may have configured their client without these features.
Also, certain e-mail clients (e.g., Lotus Notes) have problems with long URLs.
+ \note On Symbian OS, \c SwEvent capability is required to open the given \a url
+ if the Web browser is already running.
+
\sa setUrlHandler()
*/
bool QDesktopServices::openUrl(const QUrl &url)