summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/dialogs/qdialog.cpp41
-rw-r--r--src/gui/graphicsview/qgraphicsproxywidget.cpp33
-rw-r--r--src/gui/graphicsview/qgraphicsproxywidget_p.h2
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp6
-rw-r--r--src/gui/image/qimage.cpp4
-rw-r--r--src/gui/image/qpaintengine_pic.cpp2
-rw-r--r--src/gui/image/qpicture.cpp4
-rw-r--r--src/gui/image/qpixmap_raster.cpp4
-rw-r--r--src/gui/image/qpixmapfilter.cpp2
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp1
-rw-r--r--src/gui/kernel/qapplication.cpp2
-rw-r--r--src/gui/kernel/qtooltip.cpp4
-rw-r--r--src/gui/kernel/qwhatsthis.cpp2
-rw-r--r--src/gui/painting/qbrush.cpp3
-rw-r--r--src/gui/painting/qpaintbuffer.cpp4
-rw-r--r--src/gui/painting/qpaintengine_alpha.cpp4
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp4
-rw-r--r--src/gui/painting/qpaintengineex.cpp2
-rw-r--r--src/gui/painting/qpdf.cpp2
-rw-r--r--src/gui/painting/qstroker.cpp2
-rw-r--r--src/gui/styles/qs60style.cpp46
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp16
-rw-r--r--src/gui/text/qfontdatabase.cpp2
-rw-r--r--src/gui/text/qfontmetrics.cpp2
-rw-r--r--src/gui/text/qtextdocument.cpp2
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp2
-rw-r--r--src/gui/text/qtextengine.cpp4
-rw-r--r--src/gui/text/qtextimagehandler.cpp2
-rw-r--r--src/gui/widgets/qabstractbutton.cpp2
-rw-r--r--src/gui/widgets/qabstractscrollarea.cpp2
-rw-r--r--src/gui/widgets/qcombobox.cpp28
31 files changed, 155 insertions, 81 deletions
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp
index c9129c1..a6bd78a 100644
--- a/src/gui/dialogs/qdialog.cpp
+++ b/src/gui/dialogs/qdialog.cpp
@@ -905,26 +905,33 @@ bool QDialog::s60AdjustedPosition()
} else {
cbaHeight = qt_TSize2QSize(bgContainer->Size()).height();
}
- p.setY(S60->screenHeightInPixels-height()-cbaHeight);
+ p.setY(S60->screenHeightInPixels - height() - cbaHeight);
p.setX(0);
} else {
const int scrollbarWidth = style()->pixelMetric(QStyle::PM_ScrollBarExtent);
- TRect cbaRect = TRect();
- AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, cbaRect);
- AknLayoutUtils::TAknCbaLocation cbaLocation = AknLayoutUtils::CbaLocation();
- switch (cbaLocation) {
- case AknLayoutUtils::EAknCbaLocationBottom:
- p.setY(S60->screenHeightInPixels - height()-cbaRect.Height());
- p.setX((S60->screenWidthInPixels - width())>>1);
- break;
- case AknLayoutUtils::EAknCbaLocationRight:
- p.setY((S60->screenHeightInPixels - height())>>1);
- p.setX(qMax(0,S60->screenWidthInPixels-width()-scrollbarWidth-cbaRect.Width()));
- break;
- case AknLayoutUtils::EAknCbaLocationLeft:
- p.setY((S60->screenHeightInPixels - height())>>1);
- p.setX(qMax(0,scrollbarWidth+cbaRect.Width()));
- break;
+ TRect staConTopRect = TRect();
+ AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStaconTop, staConTopRect);
+ if (staConTopRect.IsEmpty()) {
+ TRect cbaRect = TRect();
+ AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, cbaRect);
+ AknLayoutUtils::TAknCbaLocation cbaLocation = AknLayoutUtils::CbaLocation();
+ switch (cbaLocation) {
+ case AknLayoutUtils::EAknCbaLocationBottom:
+ p.setY(S60->screenHeightInPixels - height() - cbaRect.Height());
+ p.setX((S60->screenWidthInPixels - width()) >> 1);
+ break;
+ case AknLayoutUtils::EAknCbaLocationRight:
+ p.setY((S60->screenHeightInPixels - height()) >> 1);
+ p.setX(qMax(0,S60->screenWidthInPixels - width() - scrollbarWidth - cbaRect.Width()));
+ break;
+ case AknLayoutUtils::EAknCbaLocationLeft:
+ p.setY((S60->screenHeightInPixels - height()) >> 1);
+ p.setX(qMax(0,scrollbarWidth + cbaRect.Width()));
+ break;
+ }
+ } else {
+ p.setY((S60->screenHeightInPixels - height()) >> 1);
+ p.setX(qMax(0,S60->screenWidthInPixels - width()));
}
}
move(p);
diff --git a/src/gui/graphicsview/qgraphicsproxywidget.cpp b/src/gui/graphicsview/qgraphicsproxywidget.cpp
index 2132526..ad7cf5d 100644
--- a/src/gui/graphicsview/qgraphicsproxywidget.cpp
+++ b/src/gui/graphicsview/qgraphicsproxywidget.cpp
@@ -189,7 +189,7 @@ QT_BEGIN_NAMESPACE
*/
extern bool qt_sendSpontaneousEvent(QObject *, QEvent *);
-extern bool qt_tab_all_widgets;
+Q_GUI_EXPORT extern bool qt_tab_all_widgets;
/*!
\internal
@@ -897,6 +897,29 @@ bool QGraphicsProxyWidget::event(QEvent *event)
}
break;
}
+#ifndef QT_NO_TOOLTIP
+ case QEvent::GraphicsSceneHelp: {
+ // Propagate the help event (for tooltip) to the widget under mouse
+ if (d->lastWidgetUnderMouse) {
+ QGraphicsSceneHelpEvent *he = static_cast<QGraphicsSceneHelpEvent *>(event);
+ QPoint pos = d->mapToReceiver(mapFromScene(he->scenePos()), d->lastWidgetUnderMouse).toPoint();
+ QHelpEvent e(QEvent::ToolTip, pos, he->screenPos());
+ QApplication::sendEvent(d->lastWidgetUnderMouse, &e);
+ event->setAccepted(e.isAccepted());
+ return e.isAccepted();
+ }
+ break;
+ }
+ case QEvent::ToolTipChange: {
+ // Propagate tooltip change to the widget
+ if (!d->tooltipChangeMode) {
+ d->tooltipChangeMode = QGraphicsProxyWidgetPrivate::ProxyToWidgetMode;
+ d->widget->setToolTip(toolTip());
+ d->tooltipChangeMode = QGraphicsProxyWidgetPrivate::NoMode;
+ }
+ break;
+ }
+#endif
default:
break;
}
@@ -952,6 +975,14 @@ bool QGraphicsProxyWidget::eventFilter(QObject *object, QEvent *event)
d->styleChangeMode = QGraphicsProxyWidgetPrivate::NoMode;
}
break;
+ case QEvent::ToolTipChange:
+ // Propagate tooltip change to the proxy.
+ if (!d->tooltipChangeMode) {
+ d->tooltipChangeMode = QGraphicsProxyWidgetPrivate::WidgetToProxyMode;
+ setToolTip(d->widget->toolTip());
+ d->tooltipChangeMode = QGraphicsProxyWidgetPrivate::NoMode;
+ }
+ break;
default:
break;
}
diff --git a/src/gui/graphicsview/qgraphicsproxywidget_p.h b/src/gui/graphicsview/qgraphicsproxywidget_p.h
index 8aed363..0e29a7e 100644
--- a/src/gui/graphicsview/qgraphicsproxywidget_p.h
+++ b/src/gui/graphicsview/qgraphicsproxywidget_p.h
@@ -72,6 +72,7 @@ public:
enabledChangeMode(NoMode),
styleChangeMode(NoMode),
paletteChangeMode(NoMode),
+ tooltipChangeMode(NoMode),
focusFromWidgetToProxy(0)
{ }
void init();
@@ -117,6 +118,7 @@ public:
quint32 enabledChangeMode : 2;
quint32 styleChangeMode : 2;
quint32 paletteChangeMode : 2;
+ quint32 tooltipChangeMode : 2;
quint32 focusFromWidgetToProxy : 1;
quint32 proxyIsGivingFocus : 1;
};
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 4b612f4..bd0f0d8 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -3786,6 +3786,12 @@ void QGraphicsScene::helpEvent(QGraphicsSceneHelpEvent *helpEvent)
QGraphicsItem *toolTipItem = 0;
for (int i = 0; i < itemsAtPos.size(); ++i) {
QGraphicsItem *tmp = itemsAtPos.at(i);
+ if (tmp->d_func()->isProxyWidget()) {
+ // if the item is a proxy widget, the event is forwarded to it
+ sendEvent(tmp, helpEvent);
+ if (helpEvent->isAccepted())
+ return;
+ }
if (!tmp->toolTip().isEmpty()) {
toolTipItem = tmp;
break;
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index d226baf..85be5b1 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -118,8 +118,8 @@ const QVector<QRgb> *qt_image_colortable(const QImage &image)
return &image.d->colortable;
}
-extern int qt_defaultDpiX();
-extern int qt_defaultDpiY();
+Q_GUI_EXPORT extern int qt_defaultDpiX();
+Q_GUI_EXPORT extern int qt_defaultDpiY();
QBasicAtomicInt qimage_serial_number = Q_BASIC_ATOMIC_INITIALIZER(1);
diff --git a/src/gui/image/qpaintengine_pic.cpp b/src/gui/image/qpaintengine_pic.cpp
index 029154b..fd1ee6a 100644
--- a/src/gui/image/qpaintengine_pic.cpp
+++ b/src/gui/image/qpaintengine_pic.cpp
@@ -477,7 +477,7 @@ void QPicturePaintEngine::drawImage(const QRectF &r, const QImage &image, const
writeCmdLength(pos, r, false);
}
-extern int qt_defaultDpi();
+Q_GUI_EXPORT extern int qt_defaultDpi();
void QPicturePaintEngine::drawTextItem(const QPointF &p , const QTextItem &ti)
{
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index 45b3ed0..20a1dce 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -108,8 +108,8 @@ void qt_format_text(const QFont &fnt, const QRectF &_r,
const char *qt_mfhdr_tag = "QPIC"; // header tag
static const quint16 mfhdr_maj = 11; // major version #
static const quint16 mfhdr_min = 0; // minor version #
-extern int qt_defaultDpiX();
-extern int qt_defaultDpiY();
+Q_GUI_EXPORT extern int qt_defaultDpiX();
+Q_GUI_EXPORT extern int qt_defaultDpiY();
/*!
Constructs an empty picture.
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp
index b183d0d..9dc15fc 100644
--- a/src/gui/image/qpixmap_raster.cpp
+++ b/src/gui/image/qpixmap_raster.cpp
@@ -361,8 +361,8 @@ QPaintEngine* QRasterPixmapData::paintEngine() const
return image.paintEngine();
}
-extern int qt_defaultDpiX();
-extern int qt_defaultDpiY();
+Q_GUI_EXPORT extern int qt_defaultDpiX();
+Q_GUI_EXPORT extern int qt_defaultDpiY();
int QRasterPixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const
{
diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp
index 5355ad3..70770c4 100644
--- a/src/gui/image/qpixmapfilter.cpp
+++ b/src/gui/image/qpixmapfilter.cpp
@@ -898,7 +898,7 @@ Q_GUI_EXPORT void qt_blurImage(QImage &blurImage, qreal radius, bool quality, in
expblur<12, 10, false>(blurImage, radius, quality, transposed);
}
-bool qt_scaleForTransform(const QTransform &transform, qreal *scale);
+Q_GUI_EXPORT bool qt_scaleForTransform(const QTransform &transform, qreal *scale);
/*!
\internal
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 94036d0..b42e0ab 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -782,7 +782,6 @@ void QCoeFepInputContext::commitCurrentString(bool cancelFepTransaction)
if (w->inputMethodQuery(Qt::ImCursorPosition).toInt() != m_cursorPos)
longPress = 1;
}
- return;
}
QList<QInputMethodEvent::Attribute> attributes;
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 62e99e9..ec635d4 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -142,7 +142,7 @@ static void initResources()
QT_BEGIN_NAMESPACE
-extern void qt_call_post_routines();
+Q_DECL_IMPORT extern void qt_call_post_routines();
int QApplicationPrivate::app_compile_version = 0x040000; //we don't know exactly, but it's at least 4.0.0
diff --git a/src/gui/kernel/qtooltip.cpp b/src/gui/kernel/qtooltip.cpp
index 1343959..c8fcf45 100644
--- a/src/gui/kernel/qtooltip.cpp
+++ b/src/gui/kernel/qtooltip.cpp
@@ -168,9 +168,9 @@ QTipLabel *QTipLabel::instance = 0;
QTipLabel::QTipLabel(const QString &text, QWidget *w)
#ifndef QT_NO_STYLE_STYLESHEET
- : QLabel(w, Qt::ToolTip), styleSheetParent(0), widget(0)
+ : QLabel(w, Qt::ToolTip | Qt::BypassGraphicsProxyWidget), styleSheetParent(0), widget(0)
#else
- : QLabel(w, Qt::ToolTip), widget(0)
+ : QLabel(w, Qt::ToolTip | Qt::BypassGraphicsProxyWidget), widget(0)
#endif
{
delete instance;
diff --git a/src/gui/kernel/qwhatsthis.cpp b/src/gui/kernel/qwhatsthis.cpp
index b877784..6181b62 100644
--- a/src/gui/kernel/qwhatsthis.cpp
+++ b/src/gui/kernel/qwhatsthis.cpp
@@ -143,7 +143,7 @@ QT_BEGIN_NAMESPACE
\sa QToolTip
*/
-extern void qDeleteInEventHandler(QObject *o);
+Q_DECL_IMPORT extern void qDeleteInEventHandler(QObject *o);
class QWhatsThat : public QWidget
{
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index 182cce9..96d547b 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -160,8 +160,7 @@ static void qt_cleanup_brush_pattern_image_cache()
qt_brushPatternImageCache()->cleanup();
}
-Q_GUI_EXPORT
-QImage qt_imageForBrush(int brushStyle, bool invert)
+Q_GUI_EXPORT QImage qt_imageForBrush(int brushStyle, bool invert)
{
return qt_brushPatternImageCache()->getImage(brushStyle, invert);
}
diff --git a/src/gui/painting/qpaintbuffer.cpp b/src/gui/painting/qpaintbuffer.cpp
index e1156dc..cd6718d 100644
--- a/src/gui/painting/qpaintbuffer.cpp
+++ b/src/gui/painting/qpaintbuffer.cpp
@@ -54,8 +54,8 @@
QT_BEGIN_NAMESPACE
-extern int qt_defaultDpiX();
-extern int qt_defaultDpiY();
+Q_GUI_EXPORT extern int qt_defaultDpiX();
+Q_GUI_EXPORT extern int qt_defaultDpiY();
extern void qt_format_text(const QFont &font,
const QRectF &_r, int tf, const QTextOption *option, const QString& str, QRectF *brect,
int tabstops, int* tabarray, int tabarraylen,
diff --git a/src/gui/painting/qpaintengine_alpha.cpp b/src/gui/painting/qpaintengine_alpha.cpp
index 5a3c0cf..4b1c58d 100644
--- a/src/gui/painting/qpaintengine_alpha.cpp
+++ b/src/gui/painting/qpaintengine_alpha.cpp
@@ -93,8 +93,8 @@ bool QAlphaPaintEngine::begin(QPaintDevice *pdev)
return true;
}
-extern int qt_defaultDpiX();
-extern int qt_defaultDpiY();
+Q_GUI_EXPORT extern int qt_defaultDpiX();
+Q_GUI_EXPORT extern int qt_defaultDpiY();
bool QAlphaPaintEngine::end()
{
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 03d0825..8f14583 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -103,7 +103,7 @@
QT_BEGIN_NAMESPACE
-extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); // qtransform.cpp
+Q_GUI_EXPORT extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); // qtransform.cpp
#define qreal_to_fixed_26_6(f) (int(f * 64))
#define qt_swap_int(x, y) { int tmp = (x); (x) = (y); (y) = tmp; }
@@ -4996,7 +4996,7 @@ void QSpanData::init(QRasterBuffer *rb, const QRasterPaintEngine *pe)
clip = pe ? pe->d_func()->clip() : 0;
}
-extern QImage qt_imageForBrush(int brushStyle, bool invert);
+Q_GUI_EXPORT extern QImage qt_imageForBrush(int brushStyle, bool invert);
void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode compositionMode)
{
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index 990e3c4..9366513 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -380,7 +380,7 @@ QPainterState *QPaintEngineEx::createState(QPainterState *orig) const
return new QPainterState(orig);
}
-extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); // qtransform.cpp
+Q_GUI_EXPORT extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); // qtransform.cpp
void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
{
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index dcf745f..44049c0 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -54,7 +54,7 @@
QT_BEGIN_NAMESPACE
-extern int qt_defaultDpi();
+Q_GUI_EXPORT extern int qt_defaultDpi();
#ifndef QT_NO_PRINTER
diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp
index 9740fce..e43544c 100644
--- a/src/gui/painting/qstroker.cpp
+++ b/src/gui/painting/qstroker.cpp
@@ -825,7 +825,7 @@ qreal qt_t_for_arc_angle(qreal angle)
return t;
}
-void qt_find_ellipse_coords(const QRectF &r, qreal angle, qreal length,
+Q_GUI_EXPORT void qt_find_ellipse_coords(const QRectF &r, qreal angle, qreal length,
QPointF* startPoint, QPointF *endPoint);
/*!
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 28cbc45..7587343 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -552,6 +552,7 @@ void QS60StylePrivate::drawRow(QS60StyleEnums::SkinParts start,
QRect endRect;
if (orientation == Qt::Horizontal) {
+ startRect.setHeight(rect.height());
startRect.setWidth(qMin((rect.width() >> 1) - 1, startRect.width()));
endRect = startRect.translated(rect.width() - startRect.width(), 0);
middleRect.adjust(startRect.width(), 0, -startRect.width(), 0);
@@ -561,6 +562,7 @@ void QS60StylePrivate::drawRow(QS60StyleEnums::SkinParts start,
endRect.adjust(overlap, 0, 0, 0);
}
} else {
+ startRect.setWidth(rect.width());
startRect.setHeight(qMin((rect.height() >> 1) - 1, startRect.height()));
endRect = startRect.translated(0, rect.height() - startRect.height());
middleRect.adjust(0, startRect.height(), 0, -startRect.height());
@@ -1372,14 +1374,13 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
optionComboBox.palette.setColor(QPalette::Inactive, QPalette::WindowText,
optionComboBox.palette.text().color() );
QRect editRect = subControlRect(CC_ComboBox, comboBox, SC_ComboBoxEditField, widget);
- painter->save();
- painter->setClipRect(editRect);
+ const int frameW = proxy()->pixelMetric(PM_DefaultFrameWidth, option, widget);
if (!comboBox->currentIcon.isNull()) {
- QIcon::Mode mode = comboBox->state & State_Enabled ? QIcon::Normal : QIcon::Disabled;
- QPixmap pixmap = comboBox->currentIcon.pixmap(comboBox->iconSize, mode);
+ const QIcon::Mode mode = comboBox->state & State_Enabled ? QIcon::Normal : QIcon::Disabled;
+ const QPixmap pixmap = comboBox->currentIcon.pixmap(comboBox->iconSize, mode);
QRect iconRect(editRect);
- iconRect.setWidth(comboBox->iconSize.width() + 4);
+ iconRect.setWidth(comboBox->iconSize.width() + frameW);
iconRect = alignedRect(comboBox->direction,
Qt::AlignLeft | Qt::AlignVCenter,
iconRect.size(), editRect);
@@ -1388,17 +1389,19 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
drawItemPixmap(painter, iconRect, Qt::AlignCenter, pixmap);
if (comboBox->direction == Qt::RightToLeft)
- editRect.translate(-4 - comboBox->iconSize.width(), 0);
+ editRect.setRight(editRect.right() - frameW - comboBox->iconSize.width());
else
- editRect.translate(comboBox->iconSize.width() + 4, 0);
+ editRect.setLeft(comboBox->iconSize.width() + frameW);
}
if (!comboBox->currentText.isEmpty() && !comboBox->editable) {
+ const Qt::TextElideMode elideMode = (comboBox->direction == Qt::LeftToRight) ? Qt::ElideRight : Qt::ElideLeft;
+ const QString text = comboBox->fontMetrics.elidedText(comboBox->currentText, elideMode, editRect.width());
+
QCommonStyle::drawItemText(painter,
editRect.adjusted(QS60StylePrivate::pixelMetric(PM_FrameCornerWidth), 0, -1, 0),
visualAlignment(comboBox->direction, Qt::AlignLeft | Qt::AlignVCenter),
- comboBox->palette, comboBox->state & State_Enabled, comboBox->currentText);
+ comboBox->palette, comboBox->state & State_Enabled, text);
}
- painter->restore();
}
break;
#endif //QT_NO_COMBOBOX
@@ -1541,7 +1544,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth);
const int tabOverlap =
QS60StylePrivate::pixelMetric(PM_TabBarTabOverlap) - borderThickness;
- //todo: draw navi wipe behind tabbar - must be drawn with first draw
if (skinElement==QS60StylePrivate::SE_TabBarTabEastInactive||
skinElement==QS60StylePrivate::SE_TabBarTabEastActive||
@@ -1645,7 +1647,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
painter->drawPixmap(tr.left() + tabOverlap,
tr.center().y() - (tabIcon.height() >> 1),
tabIcon);
- tr.setLeft(tr.left() + iconSize.width() + 4);
+ tr.setLeft(tr.left() + iconSize.width() + 4); //todo: magic four
}
QCommonStyle::drawItemText(painter, tr, alignment, optionTab.palette, tab->state & State_Enabled, tab->text, QPalette::WindowText);
@@ -1964,14 +1966,14 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
// We need to reduce the focus frame size if LayoutSpacing is smaller than FocusFrameMargin
// Otherwise, we would overlay adjacent widgets.
const int frameHeightReduction =
- qMin(0, pixelMetric(QStyle::PM_LayoutVerticalSpacing)
- - pixelMetric(QStyle::PM_FocusFrameVMargin));
+ qMin(0, pixelMetric(PM_LayoutVerticalSpacing)
+ - pixelMetric(PM_FocusFrameVMargin));
const int frameWidthReduction =
- qMin(0, pixelMetric(QStyle::PM_LayoutHorizontalSpacing)
- - pixelMetric(QStyle::PM_FocusFrameHMargin));
+ qMin(0, pixelMetric(PM_LayoutHorizontalSpacing)
+ - pixelMetric(PM_FocusFrameHMargin));
const int rounding =
- qMin(pixelMetric(QStyle::PM_FocusFrameVMargin),
- pixelMetric(QStyle::PM_LayoutVerticalSpacing));
+ qMin(pixelMetric(PM_FocusFrameVMargin),
+ pixelMetric(PM_LayoutVerticalSpacing));
const QRect frameRect =
option->rect.adjusted(-frameWidthReduction, -frameHeightReduction,
frameWidthReduction, frameHeightReduction);
@@ -2847,7 +2849,7 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con
const int tabOverlapNoBorder =
QS60StylePrivate::pixelMetric(PM_TabBarTabOverlap);
const int tabOverlap =
- tabOverlapNoBorder-QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth);
+ tabOverlapNoBorder - QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth);
const QTabWidget *tab = qobject_cast<const QTabWidget *>(widget);
int gain = (tab) ? tabOverlap * tab->count() : 0;
switch (twf->shape) {
@@ -2913,7 +2915,7 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con
ret = QRect();
} else {
if (menuItem->direction == Qt::RightToLeft)
- ret.translate(ret.width()-indicatorWidth, 0);
+ ret.translate(ret.width() - indicatorWidth, 0);
ret.setWidth(indicatorWidth);
}
} else {
@@ -3313,8 +3315,10 @@ bool QS60Style::eventFilter(QObject *object, QEvent *event)
break;
case QEvent::Destroy:
case QEvent::Hide:
- d->stopAnimation(QS60StyleEnums::SP_QgnGrafBarWaitAnim);
- d->m_bars.removeAll(reinterpret_cast<QProgressBar *>(object));
+ if (QProgressBar *bar = reinterpret_cast<QProgressBar *>(object)) {
+ d->stopAnimation(QS60StyleEnums::SP_QgnGrafBarWaitAnim);
+ d->m_bars.removeAll(bar);
+ }
break;
default:
break;
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index a1a98ba..81b923b 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -4255,8 +4255,15 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op
if (const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w)) {
const QAbstractScrollAreaPrivate *sap = sa->d_func();
rule.drawBackground(p, opt->rect, sap->contentsOffset());
- if (rule.hasBorder())
- rule.drawBorder(p, rule.borderRect(opt->rect));
+ if (rule.hasBorder()) {
+ QRect brect = rule.borderRect(opt->rect);
+ if (styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, opt, w)) {
+ QRect r = brect.adjusted(0, 0, sa->verticalScrollBar()->isVisible() ? -sa->verticalScrollBar()->width() : 0,
+ sa->horizontalScrollBar()->isVisible() ? -sa->horizontalScrollBar()->height() : 0);
+ brect = QStyle::visualRect(opt->direction, brect, r);
+ }
+ rule.drawBorder(p, brect);
+ }
break;
}
#endif
@@ -4641,6 +4648,11 @@ int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const
return msz.width() == -1 ? msz.height() : msz.width();
}
break;
+
+ case PM_ScrollView_ScrollBarSpacing:
+ if(!rule.hasNativeBorder() || rule.hasBox())
+ return 0;
+ break;
#endif // QT_NO_SCROLLBAR
case PM_ProgressBarChunkWidth:
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 6803120..ae5e9ca 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -83,7 +83,7 @@ QT_BEGIN_NAMESPACE
#define SMOOTH_SCALABLE 0xffff
-extern int qt_defaultDpiY(); // in qfont.cpp
+Q_GUI_EXPORT extern int qt_defaultDpiY(); // in qfont.cpp
bool qt_enable_test_font = false;
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 3a52e8e..5163c94 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -63,7 +63,7 @@ extern void qt_format_text(const QFont& font, const QRectF &_r,
int tf, const QString &text, QRectF *brect,
int tabStops, int *tabArray, int tabArrayLen,
QPainter *painter);
-extern int qt_defaultDpi();
+Q_GUI_EXPORT extern int qt_defaultDpi();
/*****************************************************************************
QFontMetrics member functions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 9a1b70c..3e556a7 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -1656,7 +1656,7 @@ static void printPage(int index, QPainter *painter, const QTextDocument *doc, co
painter->restore();
}
-extern int qt_defaultDpi();
+Q_GUI_EXPORT extern int qt_defaultDpi();
/*!
Prints the document to the given \a printer. The QPrinter must be
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index b45fcbb..f12bf0b 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -75,7 +75,7 @@
QT_BEGIN_NAMESPACE
-extern int qt_defaultDpi();
+Q_GUI_EXPORT extern int qt_defaultDpi();
// ################ should probably add frameFormatChange notification!
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 6485966..d34553f 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -856,7 +856,7 @@ void QTextEngine::shapeLine(const QScriptLine &line)
}
}
-extern int qt_defaultDpiY(); // in qfont.cpp
+Q_GUI_EXPORT extern int qt_defaultDpiY(); // in qfont.cpp
void QTextEngine::shapeText(int item) const
{
@@ -2494,7 +2494,7 @@ void QTextEngine::splitItem(int item, int pos) const
// qDebug("split at position %d itempos=%d", pos, item);
}
-extern int qt_defaultDpiY();
+Q_GUI_EXPORT extern int qt_defaultDpiY();
QFixed QTextEngine::calculateTabWidth(int item, QFixed x) const
{
diff --git a/src/gui/text/qtextimagehandler.cpp b/src/gui/text/qtextimagehandler.cpp
index fa49a32..6733793 100644
--- a/src/gui/text/qtextimagehandler.cpp
+++ b/src/gui/text/qtextimagehandler.cpp
@@ -123,7 +123,7 @@ static QSize getPixmapSize(QTextDocument *doc, const QTextImageFormat &format)
qreal scale = 1.0;
QPaintDevice *pdev = doc->documentLayout()->paintDevice();
if (pdev) {
- extern int qt_defaultDpi();
+ Q_GUI_EXPORT extern int qt_defaultDpi();
if (pm.isNull())
pm = getPixmap(doc, format);
if (!pm.isNull())
diff --git a/src/gui/widgets/qabstractbutton.cpp b/src/gui/widgets/qabstractbutton.cpp
index 5ceb237..995d659 100644
--- a/src/gui/widgets/qabstractbutton.cpp
+++ b/src/gui/widgets/qabstractbutton.cpp
@@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE
#define AUTO_REPEAT_DELAY 300
#define AUTO_REPEAT_INTERVAL 100
-extern bool qt_tab_all_widgets;
+Q_GUI_EXPORT extern bool qt_tab_all_widgets;
/*!
\class QAbstractButton
diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp
index 1d496d5..73ec53e 100644
--- a/src/gui/widgets/qabstractscrollarea.cpp
+++ b/src/gui/widgets/qabstractscrollarea.cpp
@@ -394,7 +394,7 @@ void QAbstractScrollAreaPrivate::layoutChildren()
if ((frameStyle != QFrame::NoFrame) &&
q->style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, &opt, q)) {
controlsRect = widgetRect;
- const int extra = q->style()->pixelMetric(QStyle::PM_ScrollView_ScrollBarSpacing);
+ const int extra = q->style()->pixelMetric(QStyle::PM_ScrollView_ScrollBarSpacing, &opt, q);
const QPoint cornerExtra(needv ? extra : 0, needh ? extra : 0);
QRect frameRect = widgetRect;
frameRect.adjust(0, 0, -cornerOffset.x() - cornerExtra.x(), -cornerOffset.y() - cornerExtra.y());
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index b1a27f2..ca58e6d 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -76,6 +76,10 @@
#ifndef QT_NO_EFFECTS
# include <private/qeffects_p.h>
#endif
+#if defined(Q_WS_S60)
+#include "private/qt_s60_p.h"
+#endif
+
QT_BEGIN_NAMESPACE
QComboBoxPrivate::QComboBoxPrivate()
@@ -2458,11 +2462,16 @@ void QComboBox::showPopup()
// in portait, menu should be positioned above softkeys
listRect.moveBottom(screen.bottom());
} else {
- // landscape, menu should be at the right and horizontally centered
+ TRect staConTopRect = TRect();
+ AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStaconTop, staConTopRect);
listRect.setWidth(listRect.height());
+ //by default popup is centered on screen in landscape
listRect.moveCenter(screen.center());
- (opt.direction == Qt::LeftToRight) ? listRect.setRight(screen.right()) :
- listRect.setLeft(screen.left());
+ if (staConTopRect.IsEmpty()) {
+ // landscape without stacon, menu should be at the right
+ (opt.direction == Qt::LeftToRight) ? listRect.setRight(screen.right()) :
+ listRect.setLeft(screen.left());
+ }
}
#endif
} else if (!boundToScreen || listRect.height() <= belowHeight) {
@@ -2690,13 +2699,18 @@ void QComboBox::changeEvent(QEvent *e)
// in portait, menu should be positioned above softkeys
listRect.moveBottom(screen.bottom());
} else {
- // landscape, menu should be at the right and horizontally centered
+ TRect staConTopRect = TRect();
+ AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStaconTop, staConTopRect);
listRect.setWidth(listRect.height());
+ //by default popup is centered on screen in landscape
listRect.moveCenter(screen.center());
- (opt.direction == Qt::LeftToRight) ? listRect.setRight(screen.right()) :
- listRect.setLeft(screen.left());
+ if (staConTopRect.IsEmpty()) {
+ // landscape without stacon, menu should be at the right
+ (opt.direction == Qt::LeftToRight) ? listRect.setRight(screen.right()) :
+ listRect.setLeft(screen.left());
+ }
+ d->container->setGeometry(listRect);
}
- d->container->setGeometry(listRect);
}
}
#endif