summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-09-01 14:49:13 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-09-01 14:49:13 (GMT)
commit93906071c31a5008625e727dad530a6f05441baa (patch)
tree8fc8dbc5b0bdb17a97d4c4909889c0aa9bcc0aaa /src/gui
parente48ad5a89deb5e73c28e689665dfdb71268be8e0 (diff)
parentefc616f2a1a83bd4ca50aea9d40a0df005ada063 (diff)
downloadQt-93906071c31a5008625e727dad530a6f05441baa.zip
Qt-93906071c31a5008625e727dad530a6f05441baa.tar.gz
Qt-93906071c31a5008625e727dad530a6f05441baa.tar.bz2
Merge commit 'qt/4.6' into kinetic-declarativeui
Conflicts: tools/qdoc3/test/classic.css
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/effects/qgraphicseffect.cpp56
-rw-r--r--src/gui/effects/qgraphicseffect.h20
-rw-r--r--src/gui/effects/qgraphicseffect_p.h1
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h3
-rw-r--r--src/gui/image/qicon.cpp13
-rw-r--r--src/gui/image/qiconloader.cpp7
-rw-r--r--src/gui/image/qimage.cpp6
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp8
-rw-r--r--src/gui/itemviews/qabstractitemview_p.h10
-rw-r--r--src/gui/itemviews/qheaderview.cpp4
-rw-r--r--src/gui/kernel/qwidget.cpp2
-rw-r--r--src/gui/kernel/qwidget_p.h10
-rw-r--r--src/gui/painting/qcolor.cpp2
-rw-r--r--src/gui/styles/qcleanlooksstyle.cpp364
-rw-r--r--src/gui/styles/qwindowsvistastyle.cpp2
-rw-r--r--src/gui/widgets/qcalendarwidget.cpp9
16 files changed, 348 insertions, 169 deletions
diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp
index ccbf7fc..f60e80e 100644
--- a/src/gui/effects/qgraphicseffect.cpp
+++ b/src/gui/effects/qgraphicseffect.cpp
@@ -335,7 +335,7 @@ void QGraphicsEffect::setEnabled(bool enable)
d->isEnabled = enable;
if (d->source)
- d->source->update();
+ d->source->d_func()->effectBoundingRectChanged();
emit enabledChanged(enable);
}
@@ -349,6 +349,22 @@ void QGraphicsEffect::setEnabled(bool enable)
*/
/*!
+ Schedules a redraw of the source. Call this function whenever the source
+ needs to be redrawn.
+
+ This convenience function is equivalent to calling
+ QGraphicsEffectSource::update().
+
+ \sa updateBoundingRect(), QGraphicsEffectSource::update()
+*/
+void QGraphicsEffect::update()
+{
+ Q_D(QGraphicsEffect);
+ if (d->source)
+ d->source->update();
+}
+
+/*!
Returns a pointer to the source, which provides extra context information
that can be useful for the effect.
@@ -366,13 +382,15 @@ QGraphicsEffectSource *QGraphicsEffect::source() const
function whenever you change any parameters that will cause the virtual
boundingRectFor() function to return a different value.
+ This function will call update() if this is necessary.
+
\sa boundingRectFor(), boundingRect()
*/
void QGraphicsEffect::updateBoundingRect()
{
Q_D(QGraphicsEffect);
if (d->source)
- d->source->update();
+ d->source->d_func()->effectBoundingRectChanged();
}
/*!
@@ -523,6 +541,7 @@ void QGraphicsColorizeEffect::setColor(const QColor &color)
return;
d->filter->setColor(color);
+ update();
emit colorChanged(color);
}
@@ -610,6 +629,7 @@ void QGraphicsPixelizeEffect::setPixelSize(int size)
return;
d->pixelSize = size;
+ update();
emit pixelSizeChanged(size);
}
@@ -820,7 +840,7 @@ QGraphicsDropShadowEffect::~QGraphicsDropShadowEffect()
By default, the offset is 8 pixels towards the lower right.
- \sa blurRadius(), color()
+ \sa xOffset(), yOffset(), blurRadius(), color()
*/
QPointF QGraphicsDropShadowEffect::offset() const
{
@@ -840,6 +860,24 @@ void QGraphicsDropShadowEffect::setOffset(const QPointF &offset)
}
/*!
+ \property QGraphicsDropShadowEffect::xOffset
+ \brief the horizontal shadow offset in pixels.
+
+ By default, the horizontal shadow offset is 8 pixels.
+
+ \sa yOffset(), offset()
+*/
+
+/*!
+ \property QGraphicsDropShadowEffect::yOffset
+ \brief the vertical shadow offset in pixels.
+
+ By default, the vertical shadow offset is 8 pixels.
+
+ \sa xOffset(), offset()
+*/
+
+/*!
\fn void QGraphicsDropShadowEffect::offsetChanged(const QPointF &offset)
This signal is emitted whenever the effect's shadow offset changes.
@@ -903,6 +941,7 @@ void QGraphicsDropShadowEffect::setColor(const QColor &color)
return;
d->filter->setColor(color);
+ update();
emit colorChanged(color);
}
@@ -1012,6 +1051,7 @@ void QGraphicsOpacityEffect::setOpacity(qreal opacity)
d->isFullyOpaque = 0;
else
d->isFullyOpaque = qFuzzyIsNull(d->opacity - 1);
+ update();
emit opacityChanged(opacity);
}
@@ -1050,6 +1090,7 @@ void QGraphicsOpacityEffect::setOpacityMask(const QBrush &mask)
d->opacityMask = mask;
d->hasOpacityMask = (mask.style() != Qt::NoBrush);
+ update();
emit opacityMaskChanged(mask);
}
@@ -1088,19 +1129,20 @@ void QGraphicsOpacityEffect::draw(QPainter *painter, QGraphicsEffectSource *sour
const QPixmap pixmap = source->pixmap(Qt::LogicalCoordinates, &offset);
painter->drawPixmap(offset, pixmap);
} else {
- QRectF srcBrect = source->boundingRect();
- QPixmap pixmap(srcBrect.size().toSize());
+ QRect srcBrect = source->boundingRect().toAlignedRect();
+ offset = srcBrect.topLeft();
+ QPixmap pixmap(srcBrect.size());
pixmap.fill(Qt::transparent);
QPainter pixmapPainter(&pixmap);
pixmapPainter.setRenderHints(painter->renderHints());
- pixmapPainter.translate(-srcBrect.topLeft());
+ pixmapPainter.translate(-offset);
source->draw(&pixmapPainter);
pixmapPainter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
pixmapPainter.fillRect(srcBrect, d->opacityMask);
pixmapPainter.end();
- painter->drawPixmap(srcBrect.topLeft(), pixmap);
+ painter->drawPixmap(offset, pixmap);
}
} else {
// Draw pixmap in device coordinates to avoid pixmap scaling;
diff --git a/src/gui/effects/qgraphicseffect.h b/src/gui/effects/qgraphicseffect.h
index 8e5384c..aee7834 100644
--- a/src/gui/effects/qgraphicseffect.h
+++ b/src/gui/effects/qgraphicseffect.h
@@ -118,7 +118,7 @@ public:
public Q_SLOTS:
void setEnabled(bool enable);
- // ### add update() slot
+ void update();
Q_SIGNALS:
void enabledChanged(bool enabled);
@@ -237,6 +237,8 @@ class Q_GUI_EXPORT QGraphicsDropShadowEffect: public QGraphicsEffect
{
Q_OBJECT
Q_PROPERTY(QPointF offset READ offset WRITE setOffset NOTIFY offsetChanged)
+ Q_PROPERTY(qreal xOffset READ xOffset WRITE setXOffset NOTIFY offsetChanged)
+ Q_PROPERTY(qreal yOffset READ yOffset WRITE setYOffset NOTIFY offsetChanged)
Q_PROPERTY(int blurRadius READ blurRadius WRITE setBlurRadius NOTIFY blurRadiusChanged)
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
public:
@@ -245,15 +247,31 @@ public:
QRectF boundingRectFor(const QRectF &rect) const;
QPointF offset() const;
+
+ inline qreal xOffset() const
+ { return offset().x(); }
+
+ inline qreal yOffset() const
+ { return offset().y(); }
+
int blurRadius() const;
QColor color() const;
public Q_SLOTS:
void setOffset(const QPointF &ofs);
+
inline void setOffset(qreal dx, qreal dy)
{ setOffset(QPointF(dx, dy)); }
+
inline void setOffset(qreal d)
{ setOffset(QPointF(d, d)); }
+
+ inline void setXOffset(qreal dx)
+ { setOffset(QPointF(dx, yOffset())); }
+
+ inline void setYOffset(qreal dy)
+ { setOffset(QPointF(xOffset(), dy)); }
+
void setBlurRadius(int blurRadius);
void setColor(const QColor &color);
diff --git a/src/gui/effects/qgraphicseffect_p.h b/src/gui/effects/qgraphicseffect_p.h
index bfabfc0..24b605f 100644
--- a/src/gui/effects/qgraphicseffect_p.h
+++ b/src/gui/effects/qgraphicseffect_p.h
@@ -76,6 +76,7 @@ public:
virtual void update() = 0;
virtual bool isPixmap() const = 0;
virtual QPixmap pixmap(Qt::CoordinateSystem system, QPoint *offset = 0) const = 0;
+ virtual void effectBoundingRectChanged() = 0;
friend class QGraphicsScenePrivate;
friend class QGraphicsItem;
friend class QGraphicsItemPrivate;
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index 9dc1204..cf34c6e 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -611,6 +611,9 @@ public:
inline void update()
{ item->update(); }
+ inline void effectBoundingRectChanged()
+ { item->prepareGeometryChange(); }
+
inline bool isPixmap() const
{
return (item->type() == QGraphicsPixmapItem::Type);
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index a4ea6af..e23677f 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -888,10 +888,9 @@ void QIcon::setThemeSearchPaths(const QStringList &paths)
On X11, the search path will use the XDG_DATA_DIRS environment
variable if available.
- On Windows the search path defaults to [Application Directory]/icons
-
- On Mac the default search path will search in the
- [Contents/Resources/icons] part of the application bundle.
+ By default all platforms will have the resource directory
+ ":\icons" as their fallback. You can use "rcc -project"
+ to generate a resource file from your icon theme.
\sa setThemeSearchPaths(), fromTheme(), setThemeName()
*/
@@ -906,7 +905,7 @@ QStringList QIcon::themeSearchPaths()
Sets the current icon theme to \a name.
The \a name should correspond to a directory name in the
- current themeSearchPath() containing an index.theme
+ themeSearchPath() containing an index.theme
file describing it's contents.
\sa themeSearchPaths(), themeName()
@@ -939,10 +938,6 @@ QString QIcon::themeName()
icon theme. If no such icon is found in the current theme
\a fallback is return instead.
- To use an icon theme on Windows or Mac, you will need to
- bundle a compliant theme with your application and make sure
- it is located in your themeSarchPaths.
-
The lastest version of the freedesktop icon specification and naming
spesification can be obtained here:
http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp
index 279703c..cb1cc61 100644
--- a/src/gui/image/qiconloader.cpp
+++ b/src/gui/image/qiconloader.cpp
@@ -187,14 +187,17 @@ QStringList QIconLoader::themeSearchPaths() const
QDir homeDir(QDir::homePath() + QLatin1String("/.icons"));
if (homeDir.exists())
m_iconDirs.prepend(homeDir.path());
-
-#elif defined(Q_WS_WIN)
+#endif
+
+#if defined(Q_WS_WIN)
m_iconDirs.append(qApp->applicationDirPath() +
QLatin1String("/icons"));
#elif defined(Q_WS_MAC)
m_iconDirs.append(qApp->applicationDirPath() +
QLatin1String("/../Resources/icons"));
#endif
+ // Allways add resource directory as search path
+ m_iconDirs.append(QLatin1String(":/icons"));
}
return m_iconDirs;
}
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 2b82f49..89af452 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -2892,6 +2892,12 @@ static void convert_Indexed8_to_X32(QImageData *dest, const QImageData *src, Qt:
Q_ASSERT(src->height == dest->height);
QVector<QRgb> colorTable = fix_color_table(src->colortable, dest->format);
+ if (colorTable.size() == 0) {
+ colorTable.resize(256);
+ for (int i=0; i<256; ++i)
+ colorTable[i] = qRgb(i, i, i);
+
+ }
int w = src->width;
const uchar *src_data = src->data;
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 07c5454..ea98cb2 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -956,6 +956,7 @@ QModelIndex QAbstractItemView::currentIndex() const
void QAbstractItemView::reset()
{
Q_D(QAbstractItemView);
+ d->delayedReset.stop(); //make sure we stop the timer
QList<QEditorInfo>::const_iterator it = d->editors.constBegin();
for (; it != d->editors.constEnd(); ++it)
d->releaseEditor(it->editor);
@@ -2208,7 +2209,9 @@ void QAbstractItemView::timerEvent(QTimerEvent *event)
Q_D(QAbstractItemView);
if (event->timerId() == d->fetchMoreTimer.timerId())
d->fetchMore();
- if (event->timerId() == d->autoScrollTimer.timerId())
+ else if (event->timerId() == d->delayedReset.timerId())
+ reset();
+ else if (event->timerId() == d->autoScrollTimer.timerId())
doAutoScroll();
else if (event->timerId() == d->updateTimer.timerId())
d->updateDirtyRegion();
@@ -3132,9 +3135,8 @@ void QAbstractItemViewPrivate::_q_columnsInserted(const QModelIndex &, int, int)
*/
void QAbstractItemViewPrivate::_q_modelDestroyed()
{
- Q_Q(QAbstractItemView);
model = QAbstractItemModelPrivate::staticEmptyModel();
- QMetaObject::invokeMethod(q, "reset", Qt::QueuedConnection);
+ doDelayedReset();
}
/*!
diff --git a/src/gui/itemviews/qabstractitemview_p.h b/src/gui/itemviews/qabstractitemview_p.h
index 4517941..434d644 100644
--- a/src/gui/itemviews/qabstractitemview_p.h
+++ b/src/gui/itemviews/qabstractitemview_p.h
@@ -328,6 +328,15 @@ public:
QStyleOptionViewItemV4 viewOptionsV4() const;
+ void doDelayedReset()
+ {
+ //we delay the reset of the timer because some views (QTableView)
+ //with headers can't handle the fact that the model has been destroyed
+ //all _q_modelDestroyed slots must have been called
+ if (!delayedReset.isActive())
+ delayedReset.start(0, q_func());
+ }
+
QAbstractItemModel *model;
QPointer<QAbstractItemDelegate> itemDelegate;
QMap<int, QPointer<QAbstractItemDelegate> > rowDelegates;
@@ -389,6 +398,7 @@ public:
QBasicTimer updateTimer;
QBasicTimer delayedEditing;
QBasicTimer delayedAutoScroll; //used when an item is clicked
+ QBasicTimer delayedReset;
QAbstractItemView::ScrollMode verticalScrollMode;
QAbstractItemView::ScrollMode horizontalScrollMode;
diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp
index a1c3e4e..4dbd6dc 100644
--- a/src/gui/itemviews/qheaderview.cpp
+++ b/src/gui/itemviews/qheaderview.cpp
@@ -1047,7 +1047,9 @@ int QHeaderView::visualIndex(int logicalIndex) const
/*!
Returns the logicalIndex for the section at the given \a visualIndex
- position, or -1 otherwise.
+ position, or -1 if visualIndex < 0 or visualIndex >= QHeaderView::count().
+
+ Note that the visualIndex is not affected by hidden sections.
\sa visualIndex(), sectionPosition()
*/
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 37ffa8fb..863c43e 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -5962,6 +5962,8 @@ bool QWidget::hasFocus() const
isActiveWindow() active window\endlink. The \a reason argument will
be passed into any focus event sent from this function, it is used
to give an explanation of what caused the widget to get focus.
+ If the window is not active, the widget will be given the focus when
+ the window becomes active.
First, a focus out event is sent to the focus widget (if any) to
tell it that it is about to lose the focus. Then a focus in event
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index ff0c453..f69c3a7 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -727,6 +727,16 @@ public:
inline bool isPixmap() const
{ return false; }
+ inline void effectBoundingRectChanged()
+ {
+ // ### This function should take a rect parameter; then we can avoid
+ // updating too much on the parent widget.
+ if (QWidget *parent = m_widget->parentWidget())
+ parent->update();
+ else
+ m_widget->update();
+ }
+
inline const QStyleOption *styleOption() const
{ return 0; }
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index 422d5a3..173c870 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -298,7 +298,7 @@ QT_BEGIN_NAMESPACE
/*!
\enum QColor::Spec
- The type of color specified, either RGB, HSV or CMYK.
+ The type of color specified, either RGB, HSV, CMYK or HSL.
\value Rgb
\value Hsv
diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp
index 6d957ca..20f1d26 100644
--- a/src/gui/styles/qcleanlooksstyle.cpp
+++ b/src/gui/styles/qcleanlooksstyle.cpp
@@ -561,14 +561,20 @@ static void qt_cleanlooks_draw_mdibutton(QPainter *painter, const QStyleOptionTi
QColor mdiButtonBorderColor(active ? option->palette.highlight().color().darker(180): dark.darker(110));
painter->setPen(QPen(mdiButtonBorderColor, 1));
- painter->drawLine(tmp.left() + 2, tmp.top(), tmp.right() - 2, tmp.top());
- painter->drawLine(tmp.left() + 2, tmp.bottom(), tmp.right() - 2, tmp.bottom());
- painter->drawLine(tmp.left(), tmp.top() + 2, tmp.left(), tmp.bottom() - 2);
- painter->drawLine(tmp.right(), tmp.top() + 2, tmp.right(), tmp.bottom() - 2);
- painter->drawPoint(tmp.left() + 1, tmp.top() + 1);
- painter->drawPoint(tmp.right() - 1, tmp.top() + 1);
- painter->drawPoint(tmp.left() + 1, tmp.bottom() - 1);
- painter->drawPoint(tmp.right() - 1, tmp.bottom() - 1);
+ const QLine lines[4] = {
+ QLine(tmp.left() + 2, tmp.top(), tmp.right() - 2, tmp.top()),
+ QLine(tmp.left() + 2, tmp.bottom(), tmp.right() - 2, tmp.bottom()),
+ QLine(tmp.left(), tmp.top() + 2, tmp.left(), tmp.bottom() - 2),
+ QLine(tmp.right(), tmp.top() + 2, tmp.right(), tmp.bottom() - 2)
+ };
+ painter->drawLines(lines, 4);
+ const QPoint points[4] = {
+ QPoint(tmp.left() + 1, tmp.top() + 1),
+ QPoint(tmp.right() - 1, tmp.top() + 1),
+ QPoint(tmp.left() + 1, tmp.bottom() - 1),
+ QPoint(tmp.right() - 1, tmp.bottom() - 1)
+ };
+ painter->drawPoints(points, 4);
painter->setPen(titleBarHighlight);
painter->drawLine(tmp.left() + 2, tmp.top() + 1, tmp.right() - 2, tmp.top() + 1);
@@ -900,14 +906,17 @@ void QCleanlooksStyle::drawPrimitive(PrimitiveElement elem,
QRect r = rect.adjusted(0, 1, 0, -1);
painter->setPen(buttonShadowAlpha);
painter->drawLine(QPoint(r.left() + 2, r.top() - 1), QPoint(r.right() - 2, r.top() - 1));
- painter->drawPoint(r.right() - 1, r.top());
- painter->drawPoint(r.right(), r.top() + 1);
- painter->drawPoint(r.right() - 1, r.bottom());
- painter->drawPoint(r.right(), r.bottom() - 1);
- painter->drawPoint(r.left() + 1, r.top() );
- painter->drawPoint(r.left(), r.top() + 1);
- painter->drawPoint(r.left() + 1, r.bottom() );
- painter->drawPoint(r.left(), r.bottom() - 1);
+ const QPoint points[8] = {
+ QPoint(r.right() - 1, r.top()),
+ QPoint(r.right(), r.top() + 1),
+ QPoint(r.right() - 1, r.bottom()),
+ QPoint(r.right(), r.bottom() - 1),
+ QPoint(r.left() + 1, r.top() ),
+ QPoint(r.left(), r.top() + 1),
+ QPoint(r.left() + 1, r.bottom() ),
+ QPoint(r.left(), r.bottom() - 1)
+ };
+ painter->drawPoints(points, 8);
painter->setPen(QPen(option->palette.background().color(), 1));
painter->drawLine(QPoint(r.left() + 2, r.top() + 1), QPoint(r.right() - 2, r.top() + 1));
@@ -939,10 +948,13 @@ void QCleanlooksStyle::drawPrimitive(PrimitiveElement elem,
painter->drawLine(QPoint(r.left(), r.top() + 2), QPoint(r.left(), r.bottom() - 2));
painter->drawLine(QPoint(r.right(), r.top() + 2), QPoint(r.right(), r.bottom() - 2));
painter->drawLine(QPoint(r.left() + 2, r.bottom()), QPoint(r.right() - 2, r.bottom()));
- painter->drawPoint(QPoint(r.right() - 1, r.bottom() - 1));
- painter->drawPoint(QPoint(r.right() - 1, r.top() + 1));
- painter->drawPoint(QPoint(r.left() + 1, r.bottom() - 1));
- painter->drawPoint(QPoint(r.left() + 1, r.top() + 1));
+ const QPoint points2[4] = {
+ QPoint(r.right() - 1, r.bottom() - 1),
+ QPoint(r.right() - 1, r.top() + 1),
+ QPoint(r.left() + 1, r.bottom() - 1),
+ QPoint(r.left() + 1, r.top() + 1)
+ };
+ painter->drawPoints(points2, 4);
painter->drawLine(QPoint(r.left() + 2, r.top()), QPoint(r.right() - 2, r.top()));
painter->setPen(oldPen);
}
@@ -1040,10 +1052,13 @@ void QCleanlooksStyle::drawPrimitive(PrimitiveElement elem,
painter->setBrush(QBrush(dark.darker(120), Qt::Dense4Pattern));
painter->setBrushOrigin(rect.topLeft());
painter->setPen(Qt::NoPen);
- painter->drawRect(rect.left(), rect.top(), rect.width(), 1); // Top
- painter->drawRect(rect.left(), rect.bottom(), rect.width(), 1); // Bottom
- painter->drawRect(rect.left(), rect.top(), 1, rect.height()); // Left
- painter->drawRect(rect.right(), rect.top(), 1, rect.height()); // Right
+ const QRect rects[4] = {
+ QRect(rect.left(), rect.top(), rect.width(), 1), // Top
+ QRect(rect.left(), rect.bottom(), rect.width(), 1), // Bottom
+ QRect(rect.left(), rect.top(), 1, rect.height()), // Left
+ QRect(rect.right(), rect.top(), 1, rect.height()) // Right
+ };
+ painter->drawRects(rects, 4);
painter->restore();
}
break;
@@ -1065,18 +1080,24 @@ void QCleanlooksStyle::drawPrimitive(PrimitiveElement elem,
if (isDefault) {
r = option->rect.adjusted(0, 1, 0, -1);
painter->setPen(QPen(Qt::black, 0));
- painter->drawLine(QPoint(r.left() + 2, r.top()),
- QPoint(r.right() - 2, r.top()));
- painter->drawLine(QPoint(r.left(), r.top() + 2),
- QPoint(r.left(), r.bottom() - 2));
- painter->drawLine(QPoint(r.right(), r.top() + 2),
- QPoint(r.right(), r.bottom() - 2));
- painter->drawLine(QPoint(r.left() + 2, r.bottom()),
- QPoint(r.right() - 2, r.bottom()));
- painter->drawPoint(QPoint(r.right() - 1, r.bottom() - 1));
- painter->drawPoint(QPoint(r.right() - 1, r.top() + 1));
- painter->drawPoint(QPoint(r.left() + 1, r.bottom() - 1));
- painter->drawPoint(QPoint(r.left() + 1, r.top() + 1));
+ const QLine lines[4] = {
+ QLine(QPoint(r.left() + 2, r.top()),
+ QPoint(r.right() - 2, r.top())),
+ QLine(QPoint(r.left(), r.top() + 2),
+ QPoint(r.left(), r.bottom() - 2)),
+ QLine(QPoint(r.right(), r.top() + 2),
+ QPoint(r.right(), r.bottom() - 2)),
+ QLine(QPoint(r.left() + 2, r.bottom()),
+ QPoint(r.right() - 2, r.bottom()))
+ };
+ painter->drawLines(lines, 4);
+ const QPoint points[4] = {
+ QPoint(r.right() - 1, r.bottom() - 1),
+ QPoint(r.right() - 1, r.top() + 1),
+ QPoint(r.left() + 1, r.bottom() - 1),
+ QPoint(r.left() + 1, r.top() + 1)
+ };
+ painter->drawPoints(points, 4);
painter->setPen(oldPen);
}
return;
@@ -1140,10 +1161,13 @@ void QCleanlooksStyle::drawPrimitive(PrimitiveElement elem,
QPoint(r.right(), r.bottom() - 2));
p->drawLine(QPoint(r.left() + 2, r.bottom()),
QPoint(r.right() - 2, r.bottom()));
- p->drawPoint(QPoint(r.right() - 1, r.bottom() - 1));
- p->drawPoint(QPoint(r.right() - 1, r.top() + 1));
- p->drawPoint(QPoint(r.left() + 1, r.bottom() - 1));
- p->drawPoint(QPoint(r.left() + 1, r.top() + 1));
+ const QPoint points[4] = {
+ QPoint(r.right() - 1, r.bottom() - 1),
+ QPoint(r.right() - 1, r.top() + 1),
+ QPoint(r.left() + 1, r.bottom() - 1),
+ QPoint(r.left() + 1, r.top() + 1)
+ };
+ p->drawPoints(points, 4);
if (!isDefault && !hasFocus && isEnabled)
p->setPen(QPen(darkOutline.darker(110), 0));
@@ -1163,14 +1187,17 @@ void QCleanlooksStyle::drawPrimitive(PrimitiveElement elem,
topShadow.setAlpha(60);
p->setPen(topShadow);
- p->drawPoint(QPoint(r.right(), r.top() + 1));
- p->drawPoint(QPoint(r.right() - 1, r.top() ));
- p->drawPoint(QPoint(r.right(), r.bottom() - 1));
- p->drawPoint(QPoint(r.right() - 1, r.bottom() ));
- p->drawPoint(QPoint(r.left() + 1, r.bottom()));
- p->drawPoint(QPoint(r.left(), r.bottom() - 1));
- p->drawPoint(QPoint(r.left() + 1, r.top()));
- p->drawPoint(QPoint(r.left(), r.top() + 1));
+ const QPoint points2[8] = {
+ QPoint(r.right(), r.top() + 1),
+ QPoint(r.right() - 1, r.top() ),
+ QPoint(r.right(), r.bottom() - 1),
+ QPoint(r.right() - 1, r.bottom() ),
+ QPoint(r.left() + 1, r.bottom()),
+ QPoint(r.left(), r.bottom() - 1),
+ QPoint(r.left() + 1, r.top()),
+ QPoint(r.left(), r.top() + 1)
+ };
+ p->drawPoints(points2, 8);
topShadow.setAlpha(30);
p->setPen(topShadow);
@@ -1183,18 +1210,24 @@ void QCleanlooksStyle::drawPrimitive(PrimitiveElement elem,
if (isDefault) {
r.adjust(-1, -1, 1, 1);
p->setPen(buttonShadowAlpha.darker(120));
- p->drawLine(r.topLeft() + QPoint(3, 0), r.topRight() - QPoint(3, 0));
- p->drawLine(r.bottomLeft() + QPoint(3, 0), r.bottomRight() - QPoint(3, 0));
- p->drawLine(r.topLeft() + QPoint(0, 3), r.bottomLeft() - QPoint(0, 3));
- p->drawLine(r.topRight() + QPoint(0, 3), r.bottomRight() - QPoint(0, 3));
- p->drawPoint(r.topRight() + QPoint(-2, 1));
- p->drawPoint(r.topRight() + QPoint(-1, 2));
- p->drawPoint(r.bottomRight() + QPoint(-1, -2));
- p->drawPoint(r.bottomRight() + QPoint(-2, -1));
- p->drawPoint(r.topLeft() + QPoint(1, 2));
- p->drawPoint(r.topLeft() + QPoint(2, 1));
- p->drawPoint(r.bottomLeft() + QPoint(1, -2));
- p->drawPoint(r.bottomLeft() + QPoint(2, -1));
+ const QLine lines[4] = {
+ QLine(r.topLeft() + QPoint(3, 0), r.topRight() - QPoint(3, 0)),
+ QLine(r.bottomLeft() + QPoint(3, 0), r.bottomRight() - QPoint(3, 0)),
+ QLine(r.topLeft() + QPoint(0, 3), r.bottomLeft() - QPoint(0, 3)),
+ QLine(r.topRight() + QPoint(0, 3), r.bottomRight() - QPoint(0, 3))
+ };
+ p->drawLines(lines, 4);
+ const QPoint points3[8] = {
+ r.topRight() + QPoint(-2, 1),
+ r.topRight() + QPoint(-1, 2),
+ r.bottomRight() + QPoint(-1, -2),
+ r.bottomRight() + QPoint(-2, -1),
+ r.topLeft() + QPoint(1, 2),
+ r.topLeft() + QPoint(2, 1),
+ r.bottomLeft() + QPoint(1, -2),
+ r.bottomLeft() + QPoint(2, -1)
+ };
+ p->drawPoints(points3, 8);
}
painter->setPen(oldPen);
painter->setBrush(oldBrush);
@@ -1307,12 +1340,15 @@ void QCleanlooksStyle::drawPrimitive(PrimitiveElement elem,
painter->drawLine(innerBottomLine);
painter->setPen(alphaCornerColor);
- painter->drawPoint(leftBottomInnerCorner1);
- painter->drawPoint(leftBottomInnerCorner2);
- painter->drawPoint(rightBottomInnerCorner1);
- painter->drawPoint(rightBottomInnerCorner2);
- painter->drawPoint(leftTopInnerCorner1);
- painter->drawPoint(leftTopInnerCorner2);
+ const QPoint points[6] = {
+ leftBottomInnerCorner1,
+ leftBottomInnerCorner2,
+ rightBottomInnerCorner1,
+ rightBottomInnerCorner2,
+ leftTopInnerCorner1,
+ leftTopInnerCorner2
+ };
+ painter->drawPoints(points, 6);
}
#endif // QT_NO_TABWIDGET
painter->restore();
@@ -1670,19 +1706,25 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o
painter->fillRect(rect, option->palette.base());
QColor borderColor = dark.lighter(110);
painter->setPen(QPen(borderColor, 0));
- painter->drawLine(QPoint(rect.left() + 1, rect.top()), QPoint(rect.right() - 1, rect.top()));
- painter->drawLine(QPoint(rect.left() + 1, rect.bottom()), QPoint(rect.right() - 1, rect.bottom()));
- painter->drawLine(QPoint(rect.left(), rect.top() + 1), QPoint(rect.left(), rect.bottom() - 1));
- painter->drawLine(QPoint(rect.right(), rect.top() + 1), QPoint(rect.right(), rect.bottom() - 1));
+ const QLine lines[4] = {
+ QLine(QPoint(rect.left() + 1, rect.top()), QPoint(rect.right() - 1, rect.top())),
+ QLine(QPoint(rect.left() + 1, rect.bottom()), QPoint(rect.right() - 1, rect.bottom())),
+ QLine(QPoint(rect.left(), rect.top() + 1), QPoint(rect.left(), rect.bottom() - 1)),
+ QLine(QPoint(rect.right(), rect.top() + 1), QPoint(rect.right(), rect.bottom() - 1))
+ };
+ painter->drawLines(lines, 4);
QColor alphaCorner = mergedColors(borderColor, option->palette.background().color());
QColor innerShadow = mergedColors(borderColor, option->palette.base().color());
//corner smoothing
painter->setPen(alphaCorner);
- painter->drawPoint(rect.topRight());
- painter->drawPoint(rect.topLeft());
- painter->drawPoint(rect.bottomRight());
- painter->drawPoint(rect.bottomLeft());
+ const QPoint points[4] = {
+ rect.topRight(),
+ rect.topLeft(),
+ rect.bottomRight(),
+ rect.bottomLeft()
+ };
+ painter->drawPoints(points, 4);
//inner shadow
painter->setPen(innerShadow);
@@ -1807,10 +1849,13 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o
option->palette.highlight());
painter->setPen(QPen(highlightOutline, 0));
- painter->drawLine(QPoint(r.left(), r.top() + 1), QPoint(r.left(), r.bottom()));
- painter->drawLine(QPoint(r.right(), r.top() + 1), QPoint(r.right(), r.bottom()));
- painter->drawLine(QPoint(r.left() + 1, r.bottom()), QPoint(r.right() - 1, r.bottom()));
- painter->drawLine(QPoint(r.left() + 1, r.top()), QPoint(r.right() - 1, r.top()));
+ const QLine lines[4] = {
+ QLine(QPoint(r.left(), r.top() + 1), QPoint(r.left(), r.bottom())),
+ QLine(QPoint(r.right(), r.top() + 1), QPoint(r.right(), r.bottom())),
+ QLine(QPoint(r.left() + 1, r.bottom()), QPoint(r.right() - 1, r.bottom())),
+ QLine(QPoint(r.left() + 1, r.top()), QPoint(r.right() - 1, r.top()))
+ };
+ painter->drawLines(lines, 4);
//draw text
QPalette::ColorRole textRole = dis ? QPalette::Text : QPalette::HighlightedText;
@@ -1864,10 +1909,13 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o
highlight);
r = r.adjusted(-1, 0, 1, 0);
painter->setPen(QPen(highlightOutline, 0));
- painter->drawLine(QPoint(r.left(), r.top() + 1), QPoint(r.left(), r.bottom() - 1));
- painter->drawLine(QPoint(r.right(), r.top() + 1), QPoint(r.right(), r.bottom() - 1));
- painter->drawLine(QPoint(r.left() + 1, r.bottom()), QPoint(r.right() - 1, r.bottom()));
- painter->drawLine(QPoint(r.left() + 1, r.top()), QPoint(r.right() - 1, r.top()));
+ const QLine lines[4] = {
+ QLine(QPoint(r.left(), r.top() + 1), QPoint(r.left(), r.bottom() - 1)),
+ QLine(QPoint(r.right(), r.top() + 1), QPoint(r.right(), r.bottom() - 1)),
+ QLine(QPoint(r.left() + 1, r.bottom()), QPoint(r.right() - 1, r.bottom())),
+ QLine(QPoint(r.left() + 1, r.top()), QPoint(r.right() - 1, r.top()))
+ };
+ painter->drawLines(lines, 4);
} else {
painter->fillRect(option->rect, menuBackground);
}
@@ -2447,14 +2495,17 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
cachePainter.setPen(topShadow);
// antialias corners
- cachePainter.drawPoint(QPoint(r.right(), r.top() + 1));
- cachePainter.drawPoint(QPoint(r.right() - 1, r.top() ));
- cachePainter.drawPoint(QPoint(r.right(), r.bottom() - 1));
- cachePainter.drawPoint(QPoint(r.right() - 1, r.bottom() ));
- cachePainter.drawPoint(QPoint(r.left() + 1, r.bottom()));
- cachePainter.drawPoint(QPoint(r.left(), r.bottom() - 1));
- cachePainter.drawPoint(QPoint(r.left() + 1, r.top()));
- cachePainter.drawPoint(QPoint(r.left(), r.top() + 1));
+ const QPoint points[8] = {
+ QPoint(r.right(), r.top() + 1),
+ QPoint(r.right() - 1, r.top() ),
+ QPoint(r.right(), r.bottom() - 1),
+ QPoint(r.right() - 1, r.bottom() ),
+ QPoint(r.left() + 1, r.bottom()),
+ QPoint(r.left(), r.bottom() - 1),
+ QPoint(r.left() + 1, r.top()),
+ QPoint(r.left(), r.top() + 1)
+ };
+ cachePainter.drawPoints(points, 8);
// draw frame
topShadow.setAlpha(30);
@@ -2482,10 +2533,13 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
cachePainter.setPen(QPen(darkOutline, 1));
// top and bottom lines
- cachePainter.drawLine(QPoint(r.left() + 2, r.bottom()), QPoint(r.right()- 2, r.bottom()));
- cachePainter.drawLine(QPoint(r.left() + 2, r.top()), QPoint(r.right() - 2, r.top()));
- cachePainter.drawLine(QPoint(r.right(), r.top() + 2), QPoint(r.right(), r.bottom() - 2));
- cachePainter.drawLine(QPoint(r.left(), r.top() + 2), QPoint(r.left(), r.bottom() - 2));
+ const QLine lines[4] = {
+ QLine(QPoint(r.left() + 2, r.bottom()), QPoint(r.right()- 2, r.bottom())),
+ QLine(QPoint(r.left() + 2, r.top()), QPoint(r.right() - 2, r.top())),
+ QLine(QPoint(r.right(), r.top() + 2), QPoint(r.right(), r.bottom() - 2)),
+ QLine(QPoint(r.left(), r.top() + 2), QPoint(r.left(), r.bottom() - 2))
+ };
+ cachePainter.drawLines(lines, 4);
}
// gradients
@@ -2519,10 +2573,13 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
if (spinBox->frame) {
// rounded corners
- cachePainter.drawPoint(QPoint(r.left() + 1, r.bottom() - 1));
- cachePainter.drawPoint(QPoint(r.left() + 1, r.top() + 1));
- cachePainter.drawPoint(QPoint(r.right() - 1, r.bottom() - 1));
- cachePainter.drawPoint(QPoint(r.right() - 1, r.top() + 1));
+ const QPoint points[4] = {
+ QPoint(r.left() + 1, r.bottom() - 1),
+ QPoint(r.left() + 1, r.top() + 1),
+ QPoint(r.right() - 1, r.bottom() - 1),
+ QPoint(r.right() - 1, r.top() + 1)
+ };
+ cachePainter.drawPoints(points, 4);
if (option->state & State_HasFocus) {
QColor darkoutline = option->palette.highlight().color().darker(150);
@@ -2531,10 +2588,13 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
if (spinBox->direction == Qt::LeftToRight) {
cachePainter.drawRect(rect.adjusted(1, 2, -3 -downRect.width(), -3));
cachePainter.setPen(QPen(darkoutline, 0));
- cachePainter.drawLine(QPoint(r.left() + 2, r.bottom()), QPoint(r.right()- downRect.width() - 1, r.bottom()));
- cachePainter.drawLine(QPoint(r.left() + 2, r.top()), QPoint(r.right() - downRect.width() - 1, r.top()));
- cachePainter.drawLine(QPoint(r.right() - downRect.width() - 1, r.top() + 1), QPoint(r.right()- downRect.width() - 1, r.bottom() - 1));
- cachePainter.drawLine(QPoint(r.left(), r.top() + 2), QPoint(r.left(), r.bottom() - 2));
+ const QLine lines[4] = {
+ QLine(QPoint(r.left() + 2, r.bottom()), QPoint(r.right()- downRect.width() - 1, r.bottom())),
+ QLine(QPoint(r.left() + 2, r.top()), QPoint(r.right() - downRect.width() - 1, r.top())),
+ QLine(QPoint(r.right() - downRect.width() - 1, r.top() + 1), QPoint(r.right()- downRect.width() - 1, r.bottom() - 1)),
+ QLine(QPoint(r.left(), r.top() + 2), QPoint(r.left(), r.bottom() - 2))
+ };
+ cachePainter.drawLines(lines, 4);
cachePainter.drawPoint(QPoint(r.left() + 1, r.bottom() - 1));
cachePainter.drawPoint(QPoint(r.left() + 1, r.top() + 1));
cachePainter.drawLine(QPoint(r.left(), r.top() + 2), QPoint(r.left(), r.bottom() - 2));
@@ -2679,18 +2739,24 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
// top outline
painter->drawLine(fullRect.left() + 5, fullRect.top(), fullRect.right() - 5, fullRect.top());
painter->drawLine(fullRect.left(), fullRect.top() + 4, fullRect.left(), fullRect.bottom());
- painter->drawPoint(fullRect.left() + 4, fullRect.top() + 1);
- painter->drawPoint(fullRect.left() + 3, fullRect.top() + 1);
- painter->drawPoint(fullRect.left() + 2, fullRect.top() + 2);
- painter->drawPoint(fullRect.left() + 1, fullRect.top() + 3);
- painter->drawPoint(fullRect.left() + 1, fullRect.top() + 4);
+ const QPoint points[5] = {
+ QPoint(fullRect.left() + 4, fullRect.top() + 1),
+ QPoint(fullRect.left() + 3, fullRect.top() + 1),
+ QPoint(fullRect.left() + 2, fullRect.top() + 2),
+ QPoint(fullRect.left() + 1, fullRect.top() + 3),
+ QPoint(fullRect.left() + 1, fullRect.top() + 4)
+ };
+ painter->drawPoints(points, 5);
painter->drawLine(fullRect.right(), fullRect.top() + 4, fullRect.right(), fullRect.bottom());
- painter->drawPoint(fullRect.right() - 3, fullRect.top() + 1);
- painter->drawPoint(fullRect.right() - 4, fullRect.top() + 1);
- painter->drawPoint(fullRect.right() - 2, fullRect.top() + 2);
- painter->drawPoint(fullRect.right() - 1, fullRect.top() + 3);
- painter->drawPoint(fullRect.right() - 1, fullRect.top() + 4);
+ const QPoint points2[5] = {
+ QPoint(fullRect.right() - 3, fullRect.top() + 1),
+ QPoint(fullRect.right() - 4, fullRect.top() + 1),
+ QPoint(fullRect.right() - 2, fullRect.top() + 2),
+ QPoint(fullRect.right() - 1, fullRect.top() + 3),
+ QPoint(fullRect.right() - 1, fullRect.top() + 4)
+ };
+ painter->drawPoints(points2, 5);
// draw bottomline
painter->drawLine(fullRect.right(), fullRect.bottom(), fullRect.left(), fullRect.bottom());
@@ -2749,10 +2815,13 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
painter->drawLine(maxButtonIconRect.left() + 1, maxButtonIconRect.top() + 1,
maxButtonIconRect.right() - 1, maxButtonIconRect.top() + 1);
painter->setPen(textAlphaColor);
- painter->drawPoint(maxButtonIconRect.topLeft());
- painter->drawPoint(maxButtonIconRect.topRight());
- painter->drawPoint(maxButtonIconRect.bottomLeft());
- painter->drawPoint(maxButtonIconRect.bottomRight());
+ const QPoint points[4] = {
+ maxButtonIconRect.topLeft(),
+ maxButtonIconRect.topRight(),
+ maxButtonIconRect.bottomLeft(),
+ maxButtonIconRect.bottomRight()
+ };
+ painter->drawPoints(points, 4);
}
}
@@ -2765,18 +2834,24 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
qt_cleanlooks_draw_mdibutton(painter, titleBar, closeButtonRect, hover, sunken);
QRect closeIconRect = closeButtonRect.adjusted(buttonMargin, buttonMargin, -buttonMargin, -buttonMargin);
painter->setPen(textAlphaColor);
- painter->drawLine(closeIconRect.left() + 1, closeIconRect.top(),
- closeIconRect.right(), closeIconRect.bottom() - 1);
- painter->drawLine(closeIconRect.left(), closeIconRect.top() + 1,
- closeIconRect.right() - 1, closeIconRect.bottom());
- painter->drawLine(closeIconRect.right() - 1, closeIconRect.top(),
- closeIconRect.left(), closeIconRect.bottom() - 1);
- painter->drawLine(closeIconRect.right(), closeIconRect.top() + 1,
- closeIconRect.left() + 1, closeIconRect.bottom());
- painter->drawPoint(closeIconRect.topLeft());
- painter->drawPoint(closeIconRect.topRight());
- painter->drawPoint(closeIconRect.bottomLeft());
- painter->drawPoint(closeIconRect.bottomRight());
+ const QLine lines[4] = {
+ QLine(closeIconRect.left() + 1, closeIconRect.top(),
+ closeIconRect.right(), closeIconRect.bottom() - 1),
+ QLine(closeIconRect.left(), closeIconRect.top() + 1,
+ closeIconRect.right() - 1, closeIconRect.bottom()),
+ QLine(closeIconRect.right() - 1, closeIconRect.top(),
+ closeIconRect.left(), closeIconRect.bottom() - 1),
+ QLine(closeIconRect.right(), closeIconRect.top() + 1,
+ closeIconRect.left() + 1, closeIconRect.bottom())
+ };
+ painter->drawLines(lines, 4);
+ const QPoint points[4] = {
+ closeIconRect.topLeft(),
+ closeIconRect.topRight(),
+ closeIconRect.bottomLeft(),
+ closeIconRect.bottomRight()
+ };
+ painter->drawPoints(points, 4);
painter->setPen(textColor);
painter->drawLine(closeIconRect.left() + 1, closeIconRect.top() + 1,
@@ -2806,10 +2881,13 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
painter->drawLine(frontWindowRect.left() + 1, frontWindowRect.top() + 1,
frontWindowRect.right() - 1, frontWindowRect.top() + 1);
painter->setPen(textAlphaColor);
- painter->drawPoint(frontWindowRect.topLeft());
- painter->drawPoint(frontWindowRect.topRight());
- painter->drawPoint(frontWindowRect.bottomLeft());
- painter->drawPoint(frontWindowRect.bottomRight());
+ const QPoint points[4] = {
+ frontWindowRect.topLeft(),
+ frontWindowRect.topRight(),
+ frontWindowRect.bottomLeft(),
+ frontWindowRect.bottomRight()
+ };
+ painter->drawPoints(points, 4);
QRect backWindowRect = normalButtonIconRect.adjusted(3, 0, 0, -3);
QRegion clipRegion = backWindowRect;
@@ -2821,10 +2899,13 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
painter->drawLine(backWindowRect.left() + 1, backWindowRect.top() + 1,
backWindowRect.right() - 1, backWindowRect.top() + 1);
painter->setPen(textAlphaColor);
- painter->drawPoint(backWindowRect.topLeft());
- painter->drawPoint(backWindowRect.topRight());
- painter->drawPoint(backWindowRect.bottomLeft());
- painter->drawPoint(backWindowRect.bottomRight());
+ const QPoint points2[4] = {
+ backWindowRect.topLeft(),
+ backWindowRect.topRight(),
+ backWindowRect.bottomLeft(),
+ backWindowRect.bottomRight()
+ };
+ painter->drawPoints(points2, 4);
painter->restore();
}
}
@@ -3498,10 +3579,13 @@ void QCleanlooksStyle::drawComplexControl(ComplexControl control, const QStyleOp
handlePainter.save();
handlePainter.setRenderHint(QPainter::Antialiasing);
handlePainter.translate(0.5, 0.5);
- handlePainter.drawLine(QPoint(r.left(), r.bottom() - 2), QPoint(r.left() + 2, r.bottom()));
- handlePainter.drawLine(QPoint(r.left(), r.top() + 2), QPoint(r.left() + 2, r.top()));
- handlePainter.drawLine(QPoint(r.right(), r.bottom() - 2), QPoint(r.right() - 2, r.bottom()));
- handlePainter.drawLine(QPoint(r.right(), r.top() + 2), QPoint(r.right() - 2, r.top()));
+ const QLine lines[4] = {
+ QLine(QPoint(r.left(), r.bottom() - 2), QPoint(r.left() + 2, r.bottom())),
+ QLine(QPoint(r.left(), r.top() + 2), QPoint(r.left() + 2, r.top())),
+ QLine(QPoint(r.right(), r.bottom() - 2), QPoint(r.right() - 2, r.bottom())),
+ QLine(QPoint(r.right(), r.top() + 2), QPoint(r.right() - 2, r.top()))
+ };
+ handlePainter.drawLines(lines, 4);
handlePainter.restore();;
handlePainter.setPen(QPen(outline.darker(130), 1));
handlePainter.drawLine(QPoint(r.left() + 3, r.top()), QPoint(r.right() - 3, r.top()));
diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp
index a54c701..3789854 100644
--- a/src/gui/styles/qwindowsvistastyle.cpp
+++ b/src/gui/styles/qwindowsvistastyle.cpp
@@ -1094,7 +1094,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
XPThemeData theme(widget, painter, QLatin1String("PROGRESS"), vertical ? PP_FILLVERT : PP_FILL);
theme.rect = option->rect;
- bool reverse = bar->direction == (Qt::LeftToRight && inverted) || (bar->direction == Qt::RightToLeft && !inverted);
+ bool reverse = (bar->direction == Qt::LeftToRight && inverted) || (bar->direction == Qt::RightToLeft && !inverted);
QTime current = QTime::currentTime();
if (isIndeterminate) {
diff --git a/src/gui/widgets/qcalendarwidget.cpp b/src/gui/widgets/qcalendarwidget.cpp
index dfd8639..8ed57cd 100644
--- a/src/gui/widgets/qcalendarwidget.cpp
+++ b/src/gui/widgets/qcalendarwidget.cpp
@@ -1967,9 +1967,7 @@ void QCalendarWidgetPrivate::_q_editingFinished()
The widget is initialized with the current month and year, but
QCalendarWidget provides several public slots to change the year
- and month that is shown. The currently displayed month and year
- can be retrieved using the currentPageMonth() and currentPageYear()
- functions, respectively.
+ and month that is shown.
By default, today's date is selected, and the user can select a
date using both mouse and keyboard. The currently selected date
@@ -1982,6 +1980,9 @@ void QCalendarWidgetPrivate::_q_editingFinished()
all. Note that a date also can be selected programmatically using
the setSelectedDate() slot.
+ The currently displayed month and year can be retrieved using the
+ monthShown() and yearShown() functions, respectively.
+
A newly created calendar widget uses abbreviated day names, and
both Saturdays and Sundays are marked in red. The calendar grid is
not visible. The week numbers are displayed, and the first column
@@ -2287,7 +2288,7 @@ int QCalendarWidget::monthShown() const
selected date.
The currently displayed month and year can be retrieved using the
- currentPageMonth() and currentPageYear() functions respectively.
+ monthShown() and yearShown() functions respectively.
\sa yearShown(), monthShown(), showPreviousMonth(), showNextMonth(),
showPreviousYear(), showNextYear()