summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorSarah Smith <sarah.j.smith@nokia.com>2009-09-13 23:23:50 (GMT)
committerSarah Smith <sarah.j.smith@nokia.com>2009-09-13 23:23:50 (GMT)
commit1bcb6aead8dcb482b56147b1f0af4440b1008d1c (patch)
tree0a3f221d7bfe91bcf7a5333dac22f26703d20460 /src/gui
parent9e43002b7d7319c143c97b707e095fef434d0af2 (diff)
parentf393ae6dd4cc8e40c5b97c18efe7862253bc2bdd (diff)
downloadQt-1bcb6aead8dcb482b56147b1f0af4440b1008d1c.zip
Qt-1bcb6aead8dcb482b56147b1f0af4440b1008d1c.tar.gz
Qt-1bcb6aead8dcb482b56147b1f0af4440b1008d1c.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/dialogs/qfilesystemmodel.cpp6
-rw-r--r--src/gui/dialogs/qfilesystemmodel_p.h13
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.cpp45
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.h2
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp1
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp40
-rw-r--r--src/gui/kernel/qapplication_win.cpp8
-rw-r--r--src/gui/kernel/qcocoamenuloader_mac.mm2
-rw-r--r--src/gui/kernel/qguifunctions_wince.cpp13
-rw-r--r--src/gui/kernel/qsizepolicy.h4
-rw-r--r--src/gui/kernel/qwidget_mac.mm7
-rw-r--r--src/gui/kernel/qwidget_s60.cpp50
-rw-r--r--src/gui/painting/qoutlinemapper.cpp2
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp19
-rw-r--r--src/gui/painting/qpainter.cpp9
-rw-r--r--src/gui/painting/qprintengine_win.cpp10
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp6
-rw-r--r--src/gui/text/qfontdatabase_s60.cpp7
-rw-r--r--src/gui/text/qfontengine_qws.cpp6
-rw-r--r--src/gui/text/qtextdocument_p.cpp2
-rw-r--r--src/gui/util/qcompleter.cpp2
22 files changed, 176 insertions, 80 deletions
diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp
index 66d9bb0..b9012c7 100644
--- a/src/gui/dialogs/qfilesystemmodel.cpp
+++ b/src/gui/dialogs/qfilesystemmodel.cpp
@@ -1104,6 +1104,8 @@ void QFileSystemModelPrivate::sortChildren(int column, const QModelIndex &parent
qStableSort(values.begin(), values.end(), ms);
// First update the new visible list
indexNode->visibleChildren.clear();
+ //No more dirty item we reset our internal dirty index
+ indexNode->dirtyChildrenIndex = -1;
for (int i = 0; i < values.count(); ++i) {
indexNode->visibleChildren.append(values.at(i).first->fileName);
values.at(i).first->isVisible = true;
@@ -1706,6 +1708,10 @@ void QFileSystemModelPrivate::addVisibleFiles(QFileSystemNode *parentNode, const
if (!indexHidden) {
q->beginInsertRows(parent, parentNode->visibleChildren.count() , parentNode->visibleChildren.count() + newFiles.count() - 1);
}
+
+ if (parentNode->dirtyChildrenIndex == -1)
+ parentNode->dirtyChildrenIndex = parentNode->visibleChildren.count();
+
for (int i = 0; i < newFiles.count(); ++i) {
parentNode->visibleChildren.append(newFiles.at(i));
parentNode->children[newFiles.at(i)]->isVisible = true;
diff --git a/src/gui/dialogs/qfilesystemmodel_p.h b/src/gui/dialogs/qfilesystemmodel_p.h
index 9734f1c..175159f 100644
--- a/src/gui/dialogs/qfilesystemmodel_p.h
+++ b/src/gui/dialogs/qfilesystemmodel_p.h
@@ -84,7 +84,7 @@ public:
{
public:
QFileSystemNode(const QString &filename = QString(), QFileSystemNode *p = 0)
- : fileName(filename), populatedChildren(false), isVisible(false), parent(p), info(0) {}
+ : fileName(filename), populatedChildren(false), isVisible(false), dirtyChildrenIndex(-1), parent(p), info(0) {}
~QFileSystemNode() {
QHash<QString, QFileSystemNode*>::const_iterator i = children.constBegin();
while (i != children.constEnd()) {
@@ -194,6 +194,7 @@ public:
bool isVisible;
QHash<QString,QFileSystemNode *> children;
QList<QString> visibleChildren;
+ int dirtyChildrenIndex;
QFileSystemNode *parent;
@@ -237,7 +238,15 @@ public:
void sortChildren(int column, const QModelIndex &parent);
inline int translateVisibleLocation(QFileSystemNode *parent, int row) const {
- return (sortOrder == Qt::AscendingOrder) ? row : parent->visibleChildren.count() - row - 1;
+ if (sortOrder == Qt::AscendingOrder)
+ return row;
+ if (parent->dirtyChildrenIndex == -1 || row < parent->dirtyChildrenIndex)
+ if (parent->dirtyChildrenIndex != -1)
+ return parent->dirtyChildrenIndex - row - 1;
+ else
+ return parent->visibleChildren.count() - row - 1;
+ else
+ return row;
}
inline static QString myComputer() {
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp
index 3bb8c29..c7033c6 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp
+++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp
@@ -383,7 +383,7 @@ void QGraphicsAnchorLayout::setGeometry(const QRectF &geom)
QGraphicsLayout::setGeometry(geom);
d->calculateVertexPositions(QGraphicsAnchorLayoutPrivate::Horizontal);
d->calculateVertexPositions(QGraphicsAnchorLayoutPrivate::Vertical);
- d->setItemsGeometries();
+ d->setItemsGeometries(geom);
}
/*!
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
index 787060f..f81ede0 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
+++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
@@ -1772,20 +1772,42 @@ QGraphicsAnchorLayoutPrivate::getGraphParts(Orientation orientation)
Use the current vertices distance to calculate and set the geometry of
each item.
*/
-void QGraphicsAnchorLayoutPrivate::setItemsGeometries()
+void QGraphicsAnchorLayoutPrivate::setItemsGeometries(const QRectF &geom)
{
+ Q_Q(QGraphicsAnchorLayout);
AnchorVertex *firstH, *secondH, *firstV, *secondV;
+ qreal top;
+ qreal left;
+ qreal right;
+
+ q->getContentsMargins(&left, &top, &right, 0);
+ const Qt::LayoutDirection visualDir = visualDirection();
+ if (visualDir == Qt::RightToLeft)
+ qSwap(left, right);
+
+ left += geom.left();
+ top += geom.top();
+ right = geom.right() - right;
+
foreach (QGraphicsLayoutItem *item, items) {
firstH = internalVertex(item, Qt::AnchorLeft);
secondH = internalVertex(item, Qt::AnchorRight);
firstV = internalVertex(item, Qt::AnchorTop);
secondV = internalVertex(item, Qt::AnchorBottom);
- QPointF topLeft(firstH->distance, firstV->distance);
- QPointF bottomRight(secondH->distance, secondV->distance);
+ QRectF newGeom;
+ newGeom.setTop(top + firstV->distance);
+ newGeom.setBottom(top + secondV->distance);
- item->setGeometry(QRectF(topLeft, bottomRight));
+ if (visualDir == Qt::LeftToRight) {
+ newGeom.setLeft(left + firstH->distance);
+ newGeom.setRight(left + secondH->distance);
+ } else {
+ newGeom.setLeft(right - secondH->distance);
+ newGeom.setRight(right - firstH->distance);
+ }
+ item->setGeometry(newGeom);
}
}
@@ -1798,26 +1820,13 @@ void QGraphicsAnchorLayoutPrivate::setItemsGeometries()
void QGraphicsAnchorLayoutPrivate::calculateVertexPositions(
QGraphicsAnchorLayoutPrivate::Orientation orientation)
{
- Q_Q(QGraphicsAnchorLayout);
QQueue<QPair<AnchorVertex *, AnchorVertex *> > queue;
QSet<AnchorVertex *> visited;
// Get root vertex
AnchorVertex *root = graph[orientation].rootVertex();
- qreal widgetMargin;
- qreal layoutMargin;
-
- // Initialize the first vertex
- if (orientation == Horizontal) {
- widgetMargin = q->geometry().x();
- q->getContentsMargins(&layoutMargin, 0, 0, 0);
- } else {
- // Root position is equal to the top margin
- widgetMargin = q->geometry().y();
- q->getContentsMargins(0, &layoutMargin, 0, 0);
- }
- root->distance = widgetMargin + layoutMargin;
+ root->distance = 0;
visited.insert(root);
// Add initial edges to the queue
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.h b/src/gui/graphicsview/qgraphicsanchorlayout_p.h
index 1470fb3..31da1a1 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout_p.h
+++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.h
@@ -437,7 +437,7 @@ public:
void removeInternalVertex(QGraphicsLayoutItem *item, Qt::AnchorPoint edge);
// Geometry interpolation methods
- void setItemsGeometries();
+ void setItemsGeometries(const QRectF &geom);
void calculateVertexPositions(Orientation orientation);
void setupEdgesInterpolation(Orientation orientation);
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 0fd1647..fbd78d9 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -4460,6 +4460,7 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter *
painter->setWorldTransform(*transformPtr * *effectTransform);
else
painter->setWorldTransform(*transformPtr);
+ painter->setOpacity(opacity);
item->d_ptr->graphicsEffect->draw(painter, source);
painter->setWorldTransform(restoreTransform);
sourced->info = 0;
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index c9b2c0c..9d977a5 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -176,7 +176,45 @@ void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index
slots mechanism, enabling subclasses to be kept up-to-date with
changes to their models. This class provides standard support for
keyboard and mouse navigation, viewport scrolling, item editing,
- and selections.
+ and selections. The keyboard navigation implements this
+ functionality:
+
+ \table
+ \header
+ \o Keys
+ \o Functionality
+ \row
+ \o Arrow keys
+ \o Changes the current item and selects it.
+ \row
+ \o Ctrl+Arrow keys
+ \o Changes the current item but does not select it.
+ \row
+ \o Shift+Arrow keys
+ \o Changes the current item and selects it. The previously
+ selected item(s) is not deselected.
+ \row
+ \o Ctr+Space
+ \o Toggles selection of the current item.
+ \row
+ \o Tab/Backtab
+ \o Changes the current item to the next/previous item.
+ \row
+ \o Home/End
+ \o Selects the first/last item in the model.
+ \row
+ \o Page up/Page down
+ \o Scrolls the rows shown up/down by the number of
+ visible rows in the view.
+ \row
+ \o Ctrl+A
+ \o Selects all items in the model.
+ \endtable
+
+ Note that the above table assumes that the
+ \l{selectionMode}{selection mode} allows the operations. For
+ instance, you cannot select items if the selection mode is
+ QAbstractItemView::NoSelection.
The QAbstractItemView class is one of the \l{Model/View Classes}
and is part of Qt's \l{Model/View Programming}{model/view framework}.
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 99baada..2b1aaf5 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -2028,8 +2028,12 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
// where it got it from; it would simply get a 0 value as the old focus widget.
#ifdef Q_WS_WINCE
{
- if (widget->windowState() & Qt::WindowMinimized)
- widget->dataPtr()->window_state &= ~Qt::WindowMinimized;
+ if (widget->windowState() & Qt::WindowMinimized) {
+ if (widget->windowState() & Qt::WindowMaximized)
+ widget->showMaximized();
+ else
+ widget->show();
+ }
#else
if (!(widget->windowState() & Qt::WindowMinimized)) {
#endif
diff --git a/src/gui/kernel/qcocoamenuloader_mac.mm b/src/gui/kernel/qcocoamenuloader_mac.mm
index ce2a92c..9ab077f 100644
--- a/src/gui/kernel/qcocoamenuloader_mac.mm
+++ b/src/gui/kernel/qcocoamenuloader_mac.mm
@@ -44,6 +44,7 @@
#include <qaction.h>
#include <qcoreapplication.h>
#include <private/qcocoamenuloader_mac_p.h>
+#include <private/qapplication_p.h>
#include <private/qt_mac_p.h>
#include <qmenubar.h>
@@ -198,6 +199,7 @@ QT_USE_NAMESPACE
- (IBAction)qtDispatcherToQAction:(id)sender
{
+ QScopedLoopLevelCounter loopLevelCounter(QApplicationPrivate::instance()->threadData);
NSMenuItem *item = static_cast<NSMenuItem *>(sender);
if (QAction *action = reinterpret_cast<QAction *>([item tag])) {
action->trigger();
diff --git a/src/gui/kernel/qguifunctions_wince.cpp b/src/gui/kernel/qguifunctions_wince.cpp
index a6b8502..048780e 100644
--- a/src/gui/kernel/qguifunctions_wince.cpp
+++ b/src/gui/kernel/qguifunctions_wince.cpp
@@ -327,20 +327,23 @@ void qt_wince_maximize(QWidget *widget)
}
}
-void qt_wince_minimize(HWND hwnd) {
-
- uint exstyle = GetWindowLong(hwnd, GWL_EXSTYLE);
- uint style = GetWindowLong(hwnd, GWL_STYLE);
+void qt_wince_minimize(HWND hwnd)
+{
+ uint exstyle = GetWindowLongW(hwnd, GWL_EXSTYLE);
+ uint style = GetWindowLongW(hwnd, GWL_STYLE);
RECT rect;
RECT crect = {0,0,0,0};
GetWindowRect(hwnd, &rect);
AdjustWindowRectEx(&crect, style & ~WS_OVERLAPPED, FALSE, exstyle);
MoveWindow(hwnd, rect.left - crect.left, rect.top - crect.top, 0, 0, true);
SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong (hwnd, GWL_EXSTYLE) | WS_EX_NODRAG);
+#ifdef Q_OS_WINCE_WM
ShowWindow(hwnd, SW_HIDE);
+#else
+ ShowWindow(hwnd, SW_MINIMIZE);
+#endif
}
-
void qt_wince_hide_taskbar(HWND hwnd) {
if (ptrAygFullScreen)
ptrAygFullScreen(hwnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON | SHFS_HIDESTARTICON);
diff --git a/src/gui/kernel/qsizepolicy.h b/src/gui/kernel/qsizepolicy.h
index b0c6e9a..2914a21 100644
--- a/src/gui/kernel/qsizepolicy.h
+++ b/src/gui/kernel/qsizepolicy.h
@@ -224,8 +224,8 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QSizePolicy &);
inline void QSizePolicy::transpose() {
Policy hData = horizontalPolicy();
Policy vData = verticalPolicy();
- uchar hStretch = horizontalStretch();
- uchar vStretch = verticalStretch();
+ uchar hStretch = uchar(horizontalStretch());
+ uchar vStretch = uchar(verticalStretch());
setHorizontalPolicy(vData);
setVerticalPolicy(hData);
setHorizontalStretch(vStretch);
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index faf7f82..6b040bc 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -120,7 +120,7 @@ QT_BEGIN_NAMESPACE
extern "C" {
extern OSStatus _HIViewScrollRectWithOptions(HIViewRef, const HIRect *, CGFloat, CGFloat,
- OptionBits);
+ OptionBits) __attribute__ ((weak));
}
#define kHIViewScrollRectAdjustInvalid 1
#define kHIViewScrollRectDontInvalidateRevealedArea 2
@@ -3785,7 +3785,10 @@ static void qt_mac_update_widget_posisiton(QWidget *q, QRect oldRect, QRect newR
(oldRect.isValid() == false || newRect.isValid() == false) ||
// the position update is a part of a drag-and-drop operation
- QDragManager::self()->object
+ QDragManager::self()->object ||
+
+ // we are on Panther (no HIViewSetNeedsDisplayInRect)
+ QSysInfo::MacintoshVersion < QSysInfo::MV_10_4
){
HIViewSetFrame(view, &bounds);
return;
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 94f3532..744d20f 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -315,7 +315,7 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
id = (WId)control;
setWinId(id);
QT_TRAP_THROWING(control->ConstructL(true,desktop));
-
+
if (!desktop) {
TInt stackingFlags;
if ((q->windowType() & Qt::Popup) == Qt::Popup) {
@@ -989,6 +989,32 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
return;
if (isWindow()) {
+#ifdef Q_WS_S60
+ // Change window decoration visibility if switching to or from fullsccreen
+ // In addition decoration visibility is changed when the initial has been
+ // WindowNoState.
+ // 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
+ if((oldstate & Qt::WindowFullScreen) != (newstate & Qt::WindowFullScreen) ||
+ oldstate == Qt::WindowNoState) {
+ CEikStatusPane* statusPane = S60->statusPane();
+ CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer();
+ if (newstate & Qt::WindowFullScreen) {
+ if (statusPane)
+ statusPane->MakeVisible(false);
+ if (buttonGroup)
+ buttonGroup->MakeVisible(false);
+ } else {
+ if (statusPane)
+ statusPane->MakeVisible(true);
+ if (buttonGroup)
+ buttonGroup->MakeVisible(true);
+ }
+
+ }
+#endif // Q_WS_S60
+
createWinId();
Q_ASSERT(testAttribute(Qt::WA_WState_Created));
QTLWExtra *top = d->topData();
@@ -1013,30 +1039,15 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
}
}
if ((oldstate & Qt::WindowFullScreen) != (newstate & Qt::WindowFullScreen)) {
-#ifdef Q_WS_S60
- CEikStatusPane* statusPane = S60->statusPane();
- CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer();
-#endif
if (newstate & Qt::WindowFullScreen) {
const QRect normalGeometry = geometry();
const QRect r = top->normalGeometry;
setGeometry(qApp->desktop()->screenGeometry(this));
-#ifdef Q_WS_S60
- if (statusPane)
- statusPane->MakeVisible(false);
- if (buttonGroup)
- buttonGroup->MakeVisible(false);
-#endif
+
top->normalGeometry = r;
if (top->normalGeometry.width() < 0)
top->normalGeometry = normalGeometry;
} else {
-#ifdef Q_WS_S60
- if (statusPane)
- statusPane->MakeVisible(true);
- if (buttonGroup)
- buttonGroup->MakeVisible(true);
-#endif
if (newstate & Qt::WindowMaximized) {
const QRect r = top->normalGeometry;
setGeometry(qApp->desktop()->availableGeometry(this));
@@ -1199,10 +1210,9 @@ void QWidget::activateWindow()
Q_D(QWidget);
QWidget *tlw = window();
if (tlw->isVisible()) {
- S60->windowGroup().SetOrdinalPosition(0);
window()->createWinId();
- RDrawableWindow* rw = tlw->d_func()->topData()->rwindow;
- rw->SetOrdinalPosition(0);
+ WId id = tlw->internalWinId();
+ id->SetFocus(true);
}
}
QT_END_NAMESPACE
diff --git a/src/gui/painting/qoutlinemapper.cpp b/src/gui/painting/qoutlinemapper.cpp
index 6579cf6..ee33024 100644
--- a/src/gui/painting/qoutlinemapper.cpp
+++ b/src/gui/painting/qoutlinemapper.cpp
@@ -198,7 +198,7 @@ void QOutlineMapper::endOutline()
m_m22 * e.y() + m_m12 * e.x() + m_dy);
}
} else {
- const QVectorPath vp((qreal *)m_elements.data(), m_elements.size(), m_element_types.data());
+ const QVectorPath vp((qreal *)m_elements.data(), m_elements.size(), m_element_types.size() ? m_element_types.data() : 0);
QPainterPath path = vp.convertToPainterPath();
path = QTransform(m_m11, m_m12, m_m13, m_m21, m_m22, m_m23, m_dx, m_dy, m_m33).map(path);
if (!(m_outline.flags & QT_FT_OUTLINE_EVEN_ODD_FILL))
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 7a578b5..46a3362 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -2540,13 +2540,12 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
Q_D(QRasterPaintEngine);
QRasterPaintEngineState *s = state();
- const bool aa = s->flags.antialiased || s->flags.bilinear;
int sr_l = qFloor(sr.left());
int sr_r = qCeil(sr.right()) - 1;
int sr_t = qFloor(sr.top());
int sr_b = qCeil(sr.bottom()) - 1;
- if (!aa && sr_l == sr_r && sr_t == sr_b) {
+ if (!s->flags.antialiased && sr_l == sr_r && sr_t == sr_b) {
// as fillRect will apply the aliased coordinate delta we need to
// subtract it here as we don't use it for image drawing
QTransform old = s->matrix;
@@ -2623,7 +2622,7 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
return;
d->image_filler_xform.setupMatrix(copy, s->flags.bilinear);
- if (!aa && s->matrix.type() == QTransform::TxScale) {
+ if (!s->flags.antialiased && s->matrix.type() == QTransform::TxScale) {
QRectF rr = s->matrix.mapRect(r);
const int x1 = qRound(rr.x());
@@ -2639,9 +2638,9 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
ensureState();
if (s->flags.tx_noshear || s->matrix.type() == QTransform::TxScale) {
d->initializeRasterizer(&d->image_filler_xform);
- d->rasterizer->setAntialiased(aa);
+ d->rasterizer->setAntialiased(s->flags.antialiased);
- const QPointF offs = aa ? QPointF() : QPointF(aliasedCoordinateDelta, aliasedCoordinateDelta);
+ const QPointF offs = s->flags.antialiased ? QPointF() : QPointF(aliasedCoordinateDelta, aliasedCoordinateDelta);
const QRectF &rect = r.normalized();
const QPointF a = s->matrix.map((rect.topLeft() + rect.bottomLeft()) * 0.5f) - offs;
@@ -2654,9 +2653,6 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
return;
}
#endif
- bool wasAntialiased = s->flags.antialiased;
- if (!s->flags.antialiased)
- s->flags.antialiased = s->flags.bilinear;
const qreal offs = s->flags.antialiased ? qreal(0) : aliasedCoordinateDelta;
QPainterPath path;
path.addRect(r);
@@ -2666,7 +2662,6 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
m.m31() - offs, m.m32() - offs, m.m33());
fillPath(path, &d->image_filler_xform);
s->matrix = m;
- s->flags.antialiased = wasAntialiased;
} else {
if (s->flags.fast_images) {
@@ -2738,7 +2733,7 @@ void QRasterPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap,
ensureState();
if (s->flags.tx_noshear || s->matrix.type() == QTransform::TxScale) {
d->initializeRasterizer(&d->image_filler_xform);
- d->rasterizer->setAntialiased(s->flags.antialiased || s->flags.bilinear);
+ d->rasterizer->setAntialiased(s->flags.antialiased);
const QRectF &rect = r.normalized();
const QPointF a = s->matrix.map((rect.topLeft() + rect.bottomLeft()) * 0.5f);
@@ -2750,13 +2745,9 @@ void QRasterPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap,
return;
}
#endif
- bool wasAntialiased = s->flags.antialiased;
- if (!s->flags.antialiased)
- s->flags.antialiased = s->flags.bilinear;
QPainterPath path;
path.addRect(r);
fillPath(path, &d->image_filler_xform);
- s->flags.antialiased = wasAntialiased;
} else {
d->image_filler.clip = d->clip();
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 2dcc20c..a9257c7 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -1894,8 +1894,13 @@ QPaintEngine *QPainter::paintEngine() const
/*!
Flushes the painting pipeline and prepares for the user issuing
- native painting commands. Must be followed by a call to
- endNativePainting().
+ commands directly to the underlying graphics context. Must be
+ followed by a call to endNativePainting().
+
+ Here is an example that shows intermixing of painter commands
+ and raw OpenGL commands:
+
+ \snippet doc/src/snippets/code/src_gui_painting_qpainter.cpp 21
\sa endNativePainting()
*/
diff --git a/src/gui/painting/qprintengine_win.cpp b/src/gui/painting/qprintengine_win.cpp
index bd1d304..e59155c 100644
--- a/src/gui/painting/qprintengine_win.cpp
+++ b/src/gui/painting/qprintengine_win.cpp
@@ -367,11 +367,11 @@ void QWin32PrintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem
return ;
}
- // We only want to convert the glyphs to text if the entire string is latin1
- bool latin1String = true;
+ // We only want to convert the glyphs to text if the entire string is compatible with ASCII
+ bool convertToText = true;
for (int i=0; i < ti.num_chars; ++i) {
- if (ti.chars[i].unicode() >= 0x100) {
- latin1String = false;
+ if (ti.chars[i].unicode() >= 0x80) {
+ convertToText = false;
break;
}
}
@@ -381,7 +381,7 @@ void QWin32PrintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem
SelectObject(d->hdc, CreatePen(PS_SOLID, 1, cf));
SetTextColor(d->hdc, cf);
- draw_text_item_win(p, ti, d->hdc, latin1String, d->matrix, d->devPaperRect.topLeft());
+ draw_text_item_win(p, ti, d->hdc, convertToText, d->matrix, d->devPaperRect.topLeft());
DeleteObject(SelectObject(d->hdc,GetStockObject(HOLLOW_BRUSH)));
DeleteObject(SelectObject(d->hdc,GetStockObject(BLACK_PEN)));
}
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index 49337b5..9f2d245 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -84,6 +84,7 @@
#include "qdrawutil.h"
#include <limits.h>
+#include <QtGui/qtoolbar.h>
QT_BEGIN_NAMESPACE
@@ -2013,7 +2014,10 @@ QRenderRule QStyleSheetStyle::renderRule(const QWidget *w, const QStyleOption *o
}
} else
#endif
- { } // required for the above ifdef'ery
+ if (const QFrame *frm = qobject_cast<const QFrame *>(w)) {
+ if (frm->lineWidth() == 0)
+ extraClass |= PseudoClass_Frameless;
+ }
}
return renderRule(w, pseudoElement, pseudoClass(state) | extraClass);
diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp
index dd0fcb4..e1a2c47 100644
--- a/src/gui/text/qfontdatabase_s60.cpp
+++ b/src/gui/text/qfontdatabase_s60.cpp
@@ -221,12 +221,14 @@ static void initializeDb()
const int numTypeFaces = QS60Data::screenDevice()->NumTypefaces();
const QFontDatabaseS60StoreImplementation *store = dynamic_cast<const QFontDatabaseS60StoreImplementation*>(db->s60Store);
Q_ASSERT(store);
+ bool fontAdded = false;
for (int i = 0; i < numTypeFaces; i++) {
TTypefaceSupport typefaceSupport;
QS60Data::screenDevice()->TypefaceSupport(typefaceSupport, i);
CFont *font; // We have to get a font instance in order to know all the details
TFontSpec fontSpec(typefaceSupport.iTypeface.iName, 11);
- qt_symbian_throwIfError(QS60Data::screenDevice()->GetNearestFontInPixels(font, fontSpec));
+ if (QS60Data::screenDevice()->GetNearestFontInPixels(font, fontSpec) != KErrNone)
+ continue;
if (font->TypeUid() == KCFbsFontUid) {
TOpenFontFaceAttrib faceAttrib;
const CFbsFont *cfbsFont = dynamic_cast<const CFbsFont *>(font);
@@ -264,9 +266,12 @@ static void initializeDb()
determineWritingSystemsFromTrueTypeBits(unicodeRange, codePageRange);
foreach (const QFontDatabase::WritingSystem system, writingSystems)
family->writingSystems[system] = QtFontFamily::Supported;
+
+ fontAdded = true;
}
QS60Data::screenDevice()->ReleaseFont(font);
}
+ Q_ASSERT(fontAdded);
QS60WindowSurface::lockBitmapHeap();
#else // defined(QT_NO_FREETYPE)
QDir dir(QDesktopServices::storageLocation(QDesktopServices::FontsLocation));
diff --git a/src/gui/text/qfontengine_qws.cpp b/src/gui/text/qfontengine_qws.cpp
index 62a674a..888e1be 100644
--- a/src/gui/text/qfontengine_qws.cpp
+++ b/src/gui/text/qfontengine_qws.cpp
@@ -381,6 +381,8 @@ class QFontEngineQPF1Data
public:
QPFFontMetrics fm;
QPFGlyphTree *tree;
+ void *mmapStart;
+ size_t mmapLength;
};
@@ -410,6 +412,8 @@ QFontEngineQPF1::QFontEngineQPF1(const QFontDef&, const QString &fn)
QT_CLOSE(f);
d = new QFontEngineQPF1Data;
+ d->mmapStart = data;
+ d->mmapLength = st.st_size;
memcpy(reinterpret_cast<char*>(&d->fm),data,sizeof(d->fm));
data += sizeof(d->fm);
@@ -431,6 +435,8 @@ QFontEngineQPF1::QFontEngineQPF1(const QFontDef&, const QString &fn)
QFontEngineQPF1::~QFontEngineQPF1()
{
+ if (d->mmapStart)
+ munmap(d->mmapStart, d->mmapLength);
delete d->tree;
delete d;
}
diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp
index 566f9c5..7bfdf6c 100644
--- a/src/gui/text/qtextdocument_p.cpp
+++ b/src/gui/text/qtextdocument_p.cpp
@@ -1541,7 +1541,7 @@ void QTextDocumentPrivate::deleteObject(QTextObject *object)
void QTextDocumentPrivate::contentsChanged()
{
Q_Q(QTextDocument);
- if (editBlock)
+ if (editBlock || inEdit)
return;
bool m = undoEnabled ? (modifiedState != undoState) : true;
diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp
index 5a44352..30bccfb 100644
--- a/src/gui/util/qcompleter.cpp
+++ b/src/gui/util/qcompleter.cpp
@@ -1083,11 +1083,11 @@ void QCompleter::setPopup(QAbstractItemView *popup)
#else
popup->hide();
#endif
- popup->setParent(0, Qt::Popup);
Qt::FocusPolicy origPolicy = Qt::NoFocus;
if (d->widget)
origPolicy = d->widget->focusPolicy();
+ popup->setParent(0, Qt::Popup);
popup->setFocusPolicy(Qt::NoFocus);
if (d->widget)
d->widget->setFocusPolicy(origPolicy);