summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-02-10 11:57:05 +0100
committerOlivier Goffart <olivier.goffart@nokia.com>2011-02-10 12:23:31 +0100
commit72e0778c9b5bdae58596090b114d5d0e7092f911 (patch)
tree53c31d9b61700c2c6db672767e24953192c5373c /src/gui
parentabb425e3db6c20c5271788cb1ec4e1fe37b9ea5b (diff)
parent50bb35a5ca48816f7563d1055071b4caa7791056 (diff)
Merge remote-tracking branch 'origin/4.7' into qt-master-from-4.7
Conflicts: doc/src/development/qmake-manual.qdoc mkspecs/symbian-gcce/qmake.conf qmake/project.cpp src/corelib/global/qnamespace.qdoc src/declarative/graphicsitems/qdeclarativetext.cpp src/gui/text/qtextdocumentlayout.cpp src/gui/text/qtextdocumentlayout_p.h tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp tests/auto/networkselftest/networkselftest.pro tests/auto/qscriptengine/tst_qscriptengine.cpp tools/designer/src/components/signalsloteditor/signalslot_utils.cpp tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp tools/qdoc3/test/qt-build-docs.qdocconf tools/qdoc3/test/qt-html-templates.qdocconf tools/qdoc3/test/qt-html-templates_zh_CN.qdocconf tools/qdoc3/test/qt.qdocconf tools/qdoc3/test/qt_ja_JP.qdocconf tools/qdoc3/test/qt_zh_CN.qdocconf
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/dialogs/qpagesetupdialog.cpp8
-rw-r--r--src/gui/embedded/qscreen_qws.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout.cpp4
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp29
-rw-r--r--src/gui/image/qbmphandler.cpp2
-rw-r--r--src/gui/image/qimage.cpp8
-rw-r--r--src/gui/image/qpixmap_s60.cpp27
-rw-r--r--src/gui/image/qpixmap_s60_p.h2
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp4
-rw-r--r--src/gui/kernel/qapplication_s60.cpp14
-rw-r--r--src/gui/kernel/qapplication_x11.cpp17
-rw-r--r--src/gui/kernel/qgesture.cpp2
-rw-r--r--src/gui/kernel/qlayout.cpp6
-rw-r--r--src/gui/kernel/qwidget_s60.cpp37
-rw-r--r--src/gui/kernel/qwidget_x11.cpp28
-rw-r--r--src/gui/painting/qbrush.cpp8
-rw-r--r--src/gui/painting/qcolor.cpp4
-rw-r--r--src/gui/painting/qpainter.cpp12
-rw-r--r--src/gui/painting/qpainterpath.cpp18
-rw-r--r--src/gui/painting/qwindowsurface_s60.cpp17
-rw-r--r--src/gui/widgets/qscrollbar.cpp39
21 files changed, 165 insertions, 123 deletions
diff --git a/src/gui/dialogs/qpagesetupdialog.cpp b/src/gui/dialogs/qpagesetupdialog.cpp
index 2a7847eb67..4037e1cff8 100644
--- a/src/gui/dialogs/qpagesetupdialog.cpp
+++ b/src/gui/dialogs/qpagesetupdialog.cpp
@@ -107,10 +107,10 @@ class QPageSetupDialogPrivate : public QAbstractPageSetupDialogPrivate
This value is obsolete and does nothing since Qt 4.5:
- \value DontUseSheet In previous versions of Qt, exec() the page setup dialog
- would create a sheet by default if the dialog was given a parent.
- This is no longer supported in Qt 4.5. If you want to use sheets, use
- QPageSetupDialog::open() instead.
+ \value DontUseSheet In previous versions of QDialog::exec() the
+ page setup dialog would create a sheet by default if the dialog
+ was given a parent. This is no longer supported from Qt 4.5. If
+ you want to use sheets, use QPageSetupDialog::open() instead.
\omitvalue None
\omitvalue OwnsPrinter
diff --git a/src/gui/embedded/qscreen_qws.cpp b/src/gui/embedded/qscreen_qws.cpp
index 4656af8eea..e207ed1503 100644
--- a/src/gui/embedded/qscreen_qws.cpp
+++ b/src/gui/embedded/qscreen_qws.cpp
@@ -1768,7 +1768,7 @@ QImage::Format QScreenPrivate::preferredImageFormat() const
This function is called by every \l{Qt for Embedded Linux}
application on startup, and must be implemented to map in the
framebuffer and the accelerated drivers that the graphics card
- control registers. Note that coonnect must be called \e before
+ control registers. Note that connect must be called \e before
the initDevice() function.
Ensure that true is returned if a connection to the screen device
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp
index b059bd2460..014b61bfbc 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp
+++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp
@@ -56,9 +56,9 @@
Items that are anchored are automatically added to the layout, and if items
are removed, all their anchors will be automatically removed.
- \beginfloatleft
+ \div {float-left}
\inlineimage simpleanchorlayout-example.png Using an anchor layout to align simple colored widgets.
- \endfloat
+ \enddiv
Anchors are always set up between edges of an item, where the "center" is also considered to
be an edge. Consider the following example:
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 7b87239a68..77ccc8e492 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -130,7 +130,7 @@
item on the scene gains focus, the scene automatically gains focus. If the
scene has focus, hasFocus() will return true, and key events will be
forwarded to the focus item, if any. If the scene loses focus, (i.e.,
- someone calls clearFocus(),) while an item has focus, the scene will
+ someone calls clearFocus()) while an item has focus, the scene will
maintain its item focus information, and once the scene regains focus, it
will make sure the last focus item regains focus.
@@ -806,28 +806,23 @@ void QGraphicsScenePrivate::setFocusItemHelper(QGraphicsItem *item,
}
if (focusItem) {
- QFocusEvent event(QEvent::FocusOut, focusReason);
lastFocusItem = focusItem;
- focusItem = 0;
- sendEvent(lastFocusItem, &event);
#ifndef QT_NO_IM
if (lastFocusItem
&& (lastFocusItem->flags() & QGraphicsItem::ItemAcceptsInputMethod)) {
- // Reset any visible preedit text
- QInputMethodEvent imEvent;
- sendEvent(lastFocusItem, &imEvent);
-
// Close any external input method panel. This happens
// automatically by removing WA_InputMethodEnabled on
// the views, but if we are changing focus, we have to
// do it ourselves.
- if (item) {
- for (int i = 0; i < views.size(); ++i)
- if (views.at(i)->inputContext())
- views.at(i)->inputContext()->reset();
- }
+ for (int i = 0; i < views.size(); ++i)
+ if (views.at(i)->inputContext())
+ views.at(i)->inputContext()->reset();
}
+
+ focusItem = 0;
+ QFocusEvent event(QEvent::FocusOut, focusReason);
+ sendEvent(lastFocusItem, &event);
#endif //QT_NO_IM
}
@@ -3104,8 +3099,8 @@ bool QGraphicsScene::stickyFocus() const
\list
\o If the item receives a mouse release event when there are no other
buttons pressed, it loses the mouse grab.
- \o If the item becomes invisible (i.e., someone calls \c {item->setVisible(false))},
- or if it becomes disabled (i.e., someone calls \c {item->setEnabled(false))},
+ \o If the item becomes invisible (i.e., someone calls \c {item->setVisible(false)}),
+ or if it becomes disabled (i.e., someone calls \c {item->setEnabled(false)}),
it loses the mouse grab.
\o If the item is removed from the scene, it loses the mouse grab.
\endlist
@@ -5924,6 +5919,8 @@ bool QGraphicsScenePrivate::sendTouchBeginEvent(QGraphicsItem *origin, QTouchEve
}
if (item->isPanel())
break;
+ if (item->d_ptr->flags & QGraphicsItem::ItemStopsClickFocusPropagation)
+ break;
}
// If nobody could take focus, clear it.
@@ -5956,6 +5953,8 @@ bool QGraphicsScenePrivate::sendTouchBeginEvent(QGraphicsItem *origin, QTouchEve
}
if (item && item->isPanel())
break;
+ if (item && (item->d_ptr->flags & QGraphicsItem::ItemStopsClickFocusPropagation))
+ break;
}
touchEvent->setAccepted(eventAccepted);
diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp
index 09c086a85a..6dea9d9917 100644
--- a/src/gui/image/qbmphandler.cpp
+++ b/src/gui/image/qbmphandler.cpp
@@ -246,6 +246,8 @@ static bool read_dib_body(QDataStream &s, const BMP_INFOHDR &bi, int offset, int
if (depth != 32) {
ncols = bi.biClrUsed ? bi.biClrUsed : 1 << nbits;
+ if (ncols > 256) // sanity check - don't run out of mem if color table is broken
+ return false;
image.setColorCount(ncols);
}
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 91ee697d94..d992dd538f 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -477,12 +477,12 @@ bool QImageData::checkForAlphaPixels() const
function. For example:
\table
+ \header
+ \o {2,1}32-bit
\row
\o \inlineimage qimage-32bit_scaled.png
\o
\snippet doc/src/snippets/code/src_gui_image_qimage.cpp 0
- \header
- \o {2,1}32-bit
\endtable
In case of a 8-bit and monchrome images, the pixel value is only
@@ -498,12 +498,12 @@ bool QImageData::checkForAlphaPixels() const
example:
\table
+ \header
+ \o {2,1} 8-bit
\row
\o \inlineimage qimage-8bit_scaled.png
\o
\snippet doc/src/snippets/code/src_gui_image_qimage.cpp 1
- \header
- \o {2,1} 8-bit
\endtable
QImage also provide the scanLine() function which returns a
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
index dbe8177b71..ca5f133367 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -1012,6 +1012,33 @@ void QS60PixmapData::fromNativeType(void* pixmap, NativeType nativeType)
}
}
+void QS60PixmapData::convertToDisplayMode(int mode)
+{
+ const TDisplayMode displayMode = static_cast<TDisplayMode>(mode);
+ if (!cfbsBitmap || cfbsBitmap->DisplayMode() == displayMode)
+ return;
+ if (image.depth() != TDisplayModeUtils::NumDisplayModeBitsPerPixel(displayMode)) {
+ qWarning("Cannot convert display mode due to depth mismatch");
+ return;
+ }
+
+ const TSize size = cfbsBitmap->SizeInPixels();
+ QScopedPointer<CFbsBitmap> newBitmap(createSymbianCFbsBitmap(size, displayMode));
+
+ const uchar *sptr = const_cast<const QImage &>(image).bits();
+ symbianBitmapDataAccess->beginDataAccess(newBitmap.data());
+ uchar *dptr = (uchar*)newBitmap->DataAddress();
+ Mem::Copy(dptr, sptr, image.byteCount());
+ symbianBitmapDataAccess->endDataAccess(newBitmap.data());
+
+ QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock);
+ delete cfbsBitmap;
+ lock.relock();
+ cfbsBitmap = newBitmap.take();
+ setSerialNumber(cfbsBitmap->Handle());
+ UPDATE_BUFFER();
+}
+
QPixmapData *QS60PixmapData::createCompatiblePixmapData() const
{
return new QS60PixmapData(pixelType());
diff --git a/src/gui/image/qpixmap_s60_p.h b/src/gui/image/qpixmap_s60_p.h
index e4060dca33..c440bbc33a 100644
--- a/src/gui/image/qpixmap_s60_p.h
+++ b/src/gui/image/qpixmap_s60_p.h
@@ -107,6 +107,8 @@ public:
void* toNativeType(NativeType type);
void fromNativeType(void* pixmap, NativeType type);
+ void convertToDisplayMode(int mode);
+
private:
void release();
void fromSymbianBitmap(CFbsBitmap* bitmap, bool lockFormat=false);
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 4dd0aa31d8..291ec6e43a 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -657,9 +657,9 @@ QAbstractItemView::~QAbstractItemView()
deleteLater() functions to explicitly delete them.
The view \e{does not} take ownership of the model unless it is the model's
- parent object because the view may be shared between many different views.
+ parent object because the model may be shared between many different views.
- \sa selectionModel(), setSelectionModel()
+ \sa selectionModel(), setSelectionModel()
*/
void QAbstractItemView::setModel(QAbstractItemModel *model)
{
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index a9f57f430f..eb9c7edfa9 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1245,12 +1245,14 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */)
#ifdef Q_WS_S60
// If widget is fullscreen/minimized, hide status pane and button container otherwise show them.
QWidget *const window = qwidget->window();
- const bool visible = !(window->windowState() & (Qt::WindowFullScreen | Qt::WindowMinimized));
- const bool statusPaneVisibility = visible;
- const bool isFullscreen = window->windowState() & Qt::WindowFullScreen;
- const bool cbaVisibilityHint = window->windowFlags() & Qt::WindowSoftkeysVisibleHint;
- const bool buttonGroupVisibility = (visible || (isFullscreen && cbaVisibilityHint));
- S60->setStatusPaneAndButtonGroupVisibility(statusPaneVisibility, buttonGroupVisibility);
+ if (!window->parentWidget()) { // Only top level native windows have control over cba/status pane
+ const bool decorationsVisible = !(window->windowState() & (Qt::WindowFullScreen | Qt::WindowMinimized));
+ const bool statusPaneVisibility = decorationsVisible;
+ const bool isFullscreen = window->windowState() & Qt::WindowFullScreen;
+ const bool cbaVisibilityHint = window->windowFlags() & Qt::WindowSoftkeysVisibleHint;
+ const bool buttonGroupVisibility = (decorationsVisible || (isFullscreen && cbaVisibilityHint));
+ S60->setStatusPaneAndButtonGroupVisibility(statusPaneVisibility, buttonGroupVisibility);
+ }
#endif
} else if (QApplication::activeWindow() == qwidget->window()) {
bool focusedControlFound = false;
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index 2c5172231b..fbb4920a9a 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -5658,10 +5658,21 @@ static void sm_performSaveYourself(QSessionManagerPrivate* smd)
sm_setProperty(QString::fromLatin1(SmProgram), argument0);
// tell the session manager about our user as well.
struct passwd *entryPtr = 0;
-#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD)
- QVarLengthArray<char, 1024> buf(sysconf(_SC_GETPW_R_SIZE_MAX));
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
+ QVarLengthArray<char, 1024> buf(qMax<long>(sysconf(_SC_GETPW_R_SIZE_MAX), 1024L));
struct passwd entry;
- getpwuid_r(geteuid(), &entry, buf.data(), buf.size(), &entryPtr);
+ while (getpwuid_r(geteuid(), &entry, buf.data(), buf.size(), &entryPtr) == ERANGE) {
+ if (buf.size() >= 32768) {
+ // too big already, fail
+ static char badusername[] = "";
+ entryPtr = &entry;
+ entry.pw_name = badusername;
+ break;
+ }
+
+ // retry with a bigger buffer
+ buf.resize(buf.size() * 2);
+ }
#else
entryPtr = getpwuid(geteuid());
#endif
diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp
index 17ede026c2..56daba2efc 100644
--- a/src/gui/kernel/qgesture.cpp
+++ b/src/gui/kernel/qgesture.cpp
@@ -332,7 +332,7 @@ void QPanGesture::setAcceleration(qreal value)
/*!
\class QPinchGesture
\since 4.6
- \brief The QPinchGesture class describes a pinch gesture made my the user.
+ \brief The QPinchGesture class describes a pinch gesture made by the user.
\ingroup touch
\ingroup gestures
diff --git a/src/gui/kernel/qlayout.cpp b/src/gui/kernel/qlayout.cpp
index 1eeaf8efff..e014ec855f 100644
--- a/src/gui/kernel/qlayout.cpp
+++ b/src/gui/kernel/qlayout.cpp
@@ -980,10 +980,10 @@ void QLayoutPrivate::reparentChildWidgets(QWidget *mw)
/*!
This function is called from \c addWidget() functions in
- subclasses to add \a w as a child widget.
+ subclasses to add \a w as a managed widget of a layout.
- If \a w is already in a layout, this function will give a warning
- and remove \a w from the layout. This function must therefore be
+ If \a w is already managed by a layout, this function will give a warning
+ and remove \a w from that layout. This function must therefore be
called before adding \a w to the layout's data structure.
*/
void QLayout::addChildWidget(QWidget *w)
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index cb7280065a..d8779c88eb 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -54,6 +54,7 @@
#ifdef Q_WS_S60
#include <aknappui.h>
+#include <akntoolbar.h>
#include <eikbtgpc.h>
#endif
@@ -488,6 +489,7 @@ void QWidgetPrivate::show_sys()
QSymbianControl *id = static_cast<QSymbianControl *>(q->internalWinId());
const bool isFullscreen = q->windowState() & Qt::WindowFullScreen;
+ const TBool cbaRequested = q->windowFlags() & Qt::WindowSoftkeysVisibleHint;
#ifdef Q_WS_S60
// Lazily initialize the S60 screen furniture when the first window is shown.
@@ -507,11 +509,25 @@ void QWidgetPrivate::show_sys()
CEikButtonGroupContainer *cba = CEikButtonGroupContainer::NewL(CEikButtonGroupContainer::ECba,
CEikButtonGroupContainer::EHorizontal,ui,R_AVKON_SOFTKEYS_EMPTY_WITH_IDS);
+ if (isFullscreen && !cbaRequested)
+ cba->MakeVisible(false);
CEikButtonGroupContainer *oldCba = factory->SwapButtonGroup(cba);
Q_ASSERT(!oldCba);
S60->setButtonGroupContainer(cba);
+ // If the creation of the first widget is delayed, for example by doing it
+ // inside the event loop, S60 somehow "forgets" to set the visibility of the
+ // toolbar (the three middle softkeys) when you flip the phone over, so we
+ // need to do it ourselves to avoid a "hole" in the application, even though
+ // Qt itself does not use the toolbar directly..
+ CAknAppUi *appui = dynamic_cast<CAknAppUi *>(CEikonEnv::Static()->AppUi());
+ if (appui) {
+ CAknToolbar *toolbar = appui->PopupToolbar();
+ if (toolbar && !toolbar->IsVisible())
+ toolbar->SetToolbarVisibility(ETrue);
+ }
+
CEikMenuBar *menuBar = new(ELeave) CEikMenuBar;
menuBar->ConstructL(ui, 0, R_AVKON_MENUPANE_EMPTY);
menuBar->SetMenuType(CEikMenuBar::EMenuOptions);
@@ -1160,14 +1176,17 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
}
#ifdef Q_WS_S60
- // Hide window decoration when switching to fullsccreen / minimized otherwise show decoration.
- // The window decoration visibility has to be changed before doing actual window state
- // change since in that order the availableGeometry will return directly the right size and
- // we will avoid unnecessarty redraws
- const bool visible = !(newstate & (Qt::WindowFullScreen | Qt::WindowMinimized));
- const bool statusPaneVisibility = visible;
- const bool buttonGroupVisibility = (visible || (isFullscreen && cbaRequested));
- S60->setStatusPaneAndButtonGroupVisibility(statusPaneVisibility, buttonGroupVisibility);
+ bool decorationsVisible(false);
+ if (!parentWidget()) { // Only top level native windows have control over cba/status pane
+ // Hide window decoration when switching to fullscreen / minimized otherwise show decoration.
+ // The window decoration visibility has to be changed before doing actual window state
+ // change since in that order the availableGeometry will return directly the right size and
+ // we will avoid unnecessary redraws
+ decorationsVisible = !(newstate & (Qt::WindowFullScreen | Qt::WindowMinimized));
+ const bool statusPaneVisibility = decorationsVisible;
+ const bool buttonGroupVisibility = (decorationsVisible || (isFullscreen && cbaRequested));
+ S60->setStatusPaneAndButtonGroupVisibility(statusPaneVisibility, buttonGroupVisibility);
+ }
#endif // Q_WS_S60
// Ensure the initial size is valid, since we store it as normalGeometry below.
@@ -1191,7 +1210,7 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
// accurate because it did not consider the status pane. This means that when returning
// normal mode after showing the status pane, the geometry would overlap so we should
// move it if it never had an explicit position.
- if (!wasMoved && S60->statusPane() && visible) {
+ if (!wasMoved && S60->statusPane() && decorationsVisible) {
TPoint tl = static_cast<CEikAppUi*>(S60->appUi())->ClientRect().iTl;
normalGeometry.setTopLeft(QPoint(tl.iX, tl.iY));
}
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 1a5417d668..b378b78cef 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -1327,40 +1327,12 @@ QPoint QWidgetPrivate::mapFromGlobal(const QPoint &pos) const
QPoint QWidget::mapToGlobal(const QPoint &pos) const
{
Q_D(const QWidget);
- QPoint offset = data->crect.topLeft();
- const QWidget *w = this;
- const QWidget *p = w->parentWidget();
- while (!w->isWindow() && p) {
- w = p;
- p = p->parentWidget();
- offset += w->data->crect.topLeft();
- }
-
- const QWidgetPrivate *wd = w->d_func();
- QTLWExtra *tlw = wd->topData();
- if (!tlw->embedded)
- return pos + offset;
-
return d->mapToGlobal(pos);
}
QPoint QWidget::mapFromGlobal(const QPoint &pos) const
{
Q_D(const QWidget);
- QPoint offset = data->crect.topLeft();
- const QWidget *w = this;
- const QWidget *p = w->parentWidget();
- while (!w->isWindow() && p) {
- w = p;
- p = p->parentWidget();
- offset += w->data->crect.topLeft();
- }
-
- const QWidgetPrivate *wd = w->d_func();
- QTLWExtra *tlw = wd->topData();
- if (!tlw->embedded)
- return pos - offset;
-
return d->mapFromGlobal(pos);
}
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index 5741667ae9..811f3aef86 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -1217,14 +1217,14 @@ QDataStream &operator>>(QDataStream &s, QBrush &b)
Each of the types is represented by a subclass of QGradient:
\table
- \row
- \o \inlineimage qgradient-linear.png
- \o \inlineimage qgradient-radial.png
- \o \inlineimage qgradient-conical.png
\header
\o QLinearGradient
\o QRadialGradient
\o QConicalGradient
+ \row
+ \o \inlineimage qgradient-linear.png
+ \o \inlineimage qgradient-radial.png
+ \o \inlineimage qgradient-conical.png
\endtable
The colors in a gradient are defined using stop points of the
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index 173fb71c8a..73a6ed8835 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -78,12 +78,12 @@ QT_BEGIN_NAMESPACE
names.
\table
+ \header
+ \o RGB \o HSV \o CMYK
\row
\o \inlineimage qcolor-rgb.png
\o \inlineimage qcolor-hsv.png
\o \inlineimage qcolor-cmyk.png
- \header
- \o RGB \o HSV \o CMYK
\endtable
The QColor constructor creates the color based on RGB values. To
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index a5f4251074..2c25e70a2c 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -1126,14 +1126,14 @@ void QPainterPrivate::updateState(QPainterState *newState)
the range of available patterns.
\table
- \row
- \o \inlineimage qpainter-vectordeformation.png
- \o \inlineimage qpainter-gradients.png
- \o \inlineimage qpainter-pathstroking.png
\header
\o \l {demos/deform}{Vector Deformation}
\o \l {demos/gradients}{Gradients}
\o \l {demos/pathstroke}{Path Stroking}
+ \row
+ \o \inlineimage qpainter-vectordeformation.png
+ \o \inlineimage qpainter-gradients.png
+ \o \inlineimage qpainter-pathstroking.png
\endtable
@@ -1206,13 +1206,13 @@ void QPainterPrivate::updateState(QPainterState *newState)
coordinate transformations.
\table
+ \header
+ \o nop \o rotate() \o scale() \o translate()
\row
\o \inlineimage qpainter-clock.png
\o \inlineimage qpainter-rotation.png
\o \inlineimage qpainter-scale.png
\o \inlineimage qpainter-translation.png
- \header
- \o nop \o rotate() \o scale() \o translate()
\endtable
The most commonly used transformations are scaling, rotation,
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp
index 3d532d2524..81ca40fd2e 100644
--- a/src/gui/painting/qpainterpath.cpp
+++ b/src/gui/painting/qpainterpath.cpp
@@ -240,12 +240,12 @@ static void qt_debug_path(const QPainterPath &path)
provides two methods for filling paths:
\table
- \row
- \o \inlineimage qt-fillrule-oddeven.png
- \o \inlineimage qt-fillrule-winding.png
\header
\o Qt::OddEvenFill
\o Qt::WindingFill
+ \row
+ \o \inlineimage qt-fillrule-oddeven.png
+ \o \inlineimage qt-fillrule-winding.png
\endtable
See the Qt::FillRule documentation for the definition of the
@@ -315,12 +315,12 @@ static void qt_debug_path(const QPainterPath &path)
QPainterPath to draw text.
\table
- \row
- \o \inlineimage qpainterpath-example.png
- \o \inlineimage qpainterpath-demo.png
\header
\o \l {painting/painterpaths}{Painter Paths Example}
\o \l {demos/deform}{Vector Deformation Demo}
+ \row
+ \o \inlineimage qpainterpath-example.png
+ \o \inlineimage qpainterpath-demo.png
\endtable
\sa QPainterPathStroker, QPainter, QRegion, {Painter Paths Example}
@@ -1279,12 +1279,12 @@ Qt::FillRule QPainterPath::fillRule() const
fillRule. Qt provides two methods for filling paths:
\table
- \row
- \o \inlineimage qt-fillrule-oddeven.png
- \o \inlineimage qt-fillrule-winding.png
\header
\o Qt::OddEvenFill (default)
\o Qt::WindingFill
+ \row
+ \o \inlineimage qt-fillrule-oddeven.png
+ \o \inlineimage qt-fillrule-winding.png
\endtable
\sa fillRule()
diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp
index a8608181a9..71556d7231 100644
--- a/src/gui/painting/qwindowsurface_s60.cpp
+++ b/src/gui/painting/qwindowsurface_s60.cpp
@@ -61,13 +61,11 @@ struct QS60WindowSurfacePrivate
QList<QImage*> bufferImages;
};
-QS60WindowSurface::QS60WindowSurface(QWidget* widget)
- : QWindowSurface(widget), d_ptr(new QS60WindowSurfacePrivate)
+TDisplayMode displayMode(bool opaque)
{
TDisplayMode mode = S60->screenDevice()->DisplayMode();
- bool isOpaque = qt_widget_private(widget)->isOpaque;
- if (isOpaque) {
+ if (opaque) {
mode = EColor16MU;
} else {
if (QSysInfo::symbianVersion() >= QSysInfo::SV_SF_3)
@@ -75,7 +73,13 @@ QS60WindowSurface::QS60WindowSurface(QWidget* widget)
else
mode = EColor16MA; // Symbian prior to Symbian^3 sw accelerates EColor16MA
}
+ return mode;
+}
+QS60WindowSurface::QS60WindowSurface(QWidget* widget)
+ : QWindowSurface(widget), d_ptr(new QS60WindowSurfacePrivate)
+{
+ TDisplayMode mode = displayMode(qt_widget_private(widget)->isOpaque);
// We create empty CFbsBitmap here -> it will be resized in setGeometry
CFbsBitmap *bitmap = new CFbsBitmap; // CBase derived object needs check on new
Q_CHECK_PTR(bitmap);
@@ -122,6 +126,11 @@ void QS60WindowSurface::beginPaint(const QRegion &rgn)
if (!qt_widget_private(window())->isOpaque) {
QS60PixmapData *pixmapData = static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data());
+
+ TDisplayMode mode = displayMode(false);
+ if (pixmapData->cfbsBitmap->DisplayMode() != mode)
+ pixmapData->convertToDisplayMode(mode);
+
pixmapData->beginDataAccess();
QPainter p(&pixmapData->image);
diff --git a/src/gui/widgets/qscrollbar.cpp b/src/gui/widgets/qscrollbar.cpp
index 67f34ebe48..c895b1b275 100644
--- a/src/gui/widgets/qscrollbar.cpp
+++ b/src/gui/widgets/qscrollbar.cpp
@@ -82,21 +82,21 @@ QT_BEGIN_NAMESPACE
needs.
\table
- \row \i \image qscrollbar-picture.png
- \i Scroll bars typically include four separate controls: a slider,
+ \row \o \image qscrollbar-picture.png
+ \o Scroll bars typically include four separate controls: a slider,
scroll arrows, and a page control.
\list
- \i a. The slider provides a way to quickly go to any part of the
+ \o a. The slider provides a way to quickly go to any part of the
document, but does not support accurate navigation within large
documents.
- \i b. The scroll arrows are push buttons which can be used to accurately
+ \o b. The scroll arrows are push buttons which can be used to accurately
navigate to a particular place in a document. For a vertical scroll bar
connected to a text editor, these typically move the current position one
"line" up or down, and adjust the position of the slider by a small
amount. In editors and list boxes a "line" might mean one line of text;
in an image viewer it might mean 20 pixels.
- \i c. The page control is the area over which the slider is dragged (the
+ \o c. The page control is the area over which the slider is dragged (the
scroll bar's background). Clicking here moves the scroll bar towards
the click by one "page". This value is usually the same as the length of
the slider.
@@ -134,13 +134,12 @@ QT_BEGIN_NAMESPACE
value of 80. This would give us a scroll bar with five "pages".
\table
- \row \i \inlineimage qscrollbar-values.png
- \i The relationship between a document length, the range of values used
+ \row \o \inlineimage qscrollbar-values.png
+ \o The relationship between a document length, the range of values used
in a scroll bar, and the page step is simple in many common situations.
The scroll bar's range of values is determined by subtracting a
chosen page step from some value representing the length of the document.
In such cases, the following equation is useful:
-
\e{document length} = maximum() - minimum() + pageStep().
\endtable
@@ -153,18 +152,18 @@ QT_BEGIN_NAMESPACE
ScrollBar inherits a comprehensive set of signals from QAbstractSlider:
\list
- \i \l{QAbstractSlider::valueChanged()}{valueChanged()} is emitted when the
+ \o \l{QAbstractSlider::valueChanged()}{valueChanged()} is emitted when the
scroll bar's value has changed. The tracking() determines whether this
signal is emitted during user interaction.
- \i \l{QAbstractSlider::rangeChanged()}{rangeChanged()} is emitted when the
+ \o \l{QAbstractSlider::rangeChanged()}{rangeChanged()} is emitted when the
scroll bar's range of values has changed.
- \i \l{QAbstractSlider::sliderPressed()}{sliderPressed()} is emitted when
+ \o \l{QAbstractSlider::sliderPressed()}{sliderPressed()} is emitted when
the user starts to drag the slider.
- \i \l{QAbstractSlider::sliderMoved()}{sliderMoved()} is emitted when the user
+ \o \l{QAbstractSlider::sliderMoved()}{sliderMoved()} is emitted when the user
drags the slider.
- \i \l{QAbstractSlider::sliderReleased()}{sliderReleased()} is emitted when
+ \o \l{QAbstractSlider::sliderReleased()}{sliderReleased()} is emitted when
the user releases the slider.
- \i \l{QAbstractSlider::actionTriggered()}{actionTriggered()} is emitted
+ \o \l{QAbstractSlider::actionTriggered()}{actionTriggered()} is emitted
when the scroll bar is changed by user interaction or via the
\l{QAbstractSlider::triggerAction()}{triggerAction()} function.
\endlist
@@ -173,12 +172,12 @@ QT_BEGIN_NAMESPACE
default focusPolicy() of Qt::NoFocus. Use setFocusPolicy() to
enable keyboard interaction with the scroll bar:
\list
- \i Left/Right move a horizontal scroll bar by one single step.
- \i Up/Down move a vertical scroll bar by one single step.
- \i PageUp moves up one page.
- \i PageDown moves down one page.
- \i Home moves to the start (mininum).
- \i End moves to the end (maximum).
+ \o Left/Right move a horizontal scroll bar by one single step.
+ \o Up/Down move a vertical scroll bar by one single step.
+ \o PageUp moves up one page.
+ \o PageDown moves down one page.
+ \o Home moves to the start (mininum).
+ \o End moves to the end (maximum).
\endlist
The slider itself can be controlled by using the