summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-02-17 11:39:16 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-02-17 11:39:16 +0100
commitdbafabb019eac6ab21b43279b3a348e4afbd065e (patch)
tree24245148e3f0b948df06823d879f9158d1b81d2f /src
parent00b96399e6d3bcd7a1081721cafeb15da3ab9781 (diff)
parent9de2853a942529f88815ed29375ff4efc44d168c (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/corelib/global/qglobal.h Change-Id: I03d8b6e07135056baaa1d97c3c63fbe8b25583d9
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qglobal.h1
-rw-r--r--src/corelib/kernel/qmetaobject.cpp2
-rw-r--r--src/corelib/kernel/qmetaobject_moc_p.h31
-rw-r--r--src/corelib/tools/qset.qdoc3
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenubar.mm4
-rw-r--r--src/tools/moc/moc.cpp40
-rw-r--r--src/widgets/styles/qgtkstyle.cpp4
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm11
8 files changed, 62 insertions, 34 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 0396fbc0c7..b2f9e29b44 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1060,6 +1060,7 @@ QT_END_NAMESPACE
#include <QtCore/qatomic.h>
#include <QtCore/qglobalstatic.h>
+#include <QtCore/qnumeric.h>
#endif /* __cplusplus */
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 0e38f2a2bf..5be94429b4 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -677,7 +677,7 @@ QByteArray QMetaObjectPrivate::decodeMethodSignature(
const char *lparens = strchr(signature, '(');
if (!lparens)
return QByteArray();
- const char *rparens = strchr(lparens + 1, ')');
+ const char *rparens = strrchr(lparens + 1, ')');
if (!rparens || *(rparens+1))
return QByteArray();
int nameLength = lparens - signature;
diff --git a/src/corelib/kernel/qmetaobject_moc_p.h b/src/corelib/kernel/qmetaobject_moc_p.h
index c791f017d4..d26cd54e5d 100644
--- a/src/corelib/kernel/qmetaobject_moc_p.h
+++ b/src/corelib/kernel/qmetaobject_moc_p.h
@@ -155,21 +155,28 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc
//template recursion
const char* tt = t;
int templdepth = 1;
+ int scopeDepth = 0;
while (t != e) {
c = *t++;
- if (c == '<')
- ++templdepth;
- if (c == '>')
- --templdepth;
- if (templdepth == 0 || (templdepth == 1 && c == ',')) {
- result += normalizeTypeInternal(tt, t-1, fixScope, false);
- result += c;
- if (templdepth == 0) {
- if (*t == '>')
- result += ' '; // avoid >>
- break;
+ if (c == '{' || c == '(' || c == '[')
+ ++scopeDepth;
+ if (c == '}' || c == ')' || c == ']')
+ --scopeDepth;
+ if (scopeDepth == 0) {
+ if (c == '<')
+ ++templdepth;
+ if (c == '>')
+ --templdepth;
+ if (templdepth == 0 || (templdepth == 1 && c == ',')) {
+ result += normalizeTypeInternal(tt, t-1, fixScope, false);
+ result += c;
+ if (templdepth == 0) {
+ if (*t == '>')
+ result += ' '; // avoid >>
+ break;
+ }
+ tt = t;
}
- tt = t;
}
}
}
diff --git a/src/corelib/tools/qset.qdoc b/src/corelib/tools/qset.qdoc
index e66a59a09c..ab7d72611e 100644
--- a/src/corelib/tools/qset.qdoc
+++ b/src/corelib/tools/qset.qdoc
@@ -621,9 +621,6 @@
unless you need to change the QSet through the iterator. Const
iterators are slightly faster, and can improve code readability.
- QSet\<T\>::iterator allows you to iterate over a QSet\<T\> and
- modify it as you go (using QSet::erase()). However,
-
The default QSet::iterator constructor creates an uninitialized
iterator. You must initialize it using a function like
QSet::begin(), QSet::end(), or QSet::insert() before you can
diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm
index 5a8664747e..7335deb800 100644
--- a/src/plugins/platforms/cocoa/qcocoamenubar.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm
@@ -79,6 +79,10 @@ QCocoaMenuBar::~QCocoaMenuBar()
if (m_window && m_window->menubar() == this) {
m_window->setMenubar(0);
+ // Delete the children first so they do not cause
+ // the native menu items to be hidden after
+ // the menu bar was updated
+ qDeleteAll(children());
updateMenuBarImmediately();
}
}
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 2c3f795346..ea4838c8f2 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -224,14 +224,11 @@ Type Moc::parseType()
;
}
if (test(LANGLE)) {
- QByteArray templ = lexemUntil(RANGLE);
- for (int i = 0; i < templ.size(); ++i) {
- type.name += templ.at(i);
- if ((templ.at(i) == '<' && i+1 < templ.size() && templ.at(i+1) == ':')
- || (templ.at(i) == '>' && i+1 < templ.size() && templ.at(i+1) == '>')) {
- type.name += ' ';
- }
+ if (type.name.isEmpty()) {
+ // '<' cannot start a type
+ return type;
}
+ type.name += lexemUntil(RANGLE);
}
if (test(SCOPE)) {
type.name += lexem();
@@ -1402,10 +1399,14 @@ QByteArray Moc::lexemUntil(Token target)
QByteArray s;
while (from <= index) {
QByteArray n = symbols.at(from++-1).lexem();
- if (s.size() && n.size()
- && is_ident_char(s.at(s.size()-1))
- && is_ident_char(n.at(0)))
- s += ' ';
+ if (s.size() && n.size()) {
+ char prev = s.at(s.size()-1);
+ char next = n.at(0);
+ if ((is_ident_char(prev) && is_ident_char(next))
+ || (prev == '<' && next == ':')
+ || (prev == '>' && next == '>'))
+ s += ' ';
+ }
s += n;
}
return s;
@@ -1440,9 +1441,20 @@ bool Moc::until(Token target) {
case RBRACK: --brackCount; break;
case LPAREN: ++parenCount; break;
case RPAREN: --parenCount; break;
- case LANGLE: ++angleCount; break;
- case RANGLE: --angleCount; break;
- case GTGT: angleCount -= 2; t = RANGLE; break;
+ case LANGLE:
+ if (parenCount == 0 && braceCount == 0 && parenCount == 0)
+ ++angleCount;
+ break;
+ case RANGLE:
+ if (parenCount == 0 && braceCount == 0)
+ --angleCount;
+ break;
+ case GTGT:
+ if (parenCount == 0 && braceCount == 0) {
+ angleCount -= 2;
+ t = RANGLE;
+ }
+ break;
default: break;
}
if (t == target
diff --git a/src/widgets/styles/qgtkstyle.cpp b/src/widgets/styles/qgtkstyle.cpp
index b981aef98b..105aefb14c 100644
--- a/src/widgets/styles/qgtkstyle.cpp
+++ b/src/widgets/styles/qgtkstyle.cpp
@@ -2499,7 +2499,9 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
if ((option->subControls & SC_SliderGroove) && groove.isValid()) {
GtkRange *range = (GtkRange*)scaleWidget;
- GtkAdjustment *adjustment = d->gtk_range_get_adjustment(range);
+ GtkAdjustment *adjustment = 0;
+ if (d->gtk_adjustment_configure)
+ adjustment = d->gtk_range_get_adjustment(range);
if (adjustment) {
d->gtk_adjustment_configure(adjustment,
slider->sliderPosition,
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index d180122ab2..d8530bca1e 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -1717,8 +1717,9 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
}
}
- int width = int(macRect.size.width) + extraWidth;
- int height = int(macRect.size.height) + extraHeight;
+ int devicePixelRatio = p->device()->devicePixelRatio();
+ int width = devicePixelRatio * (int(macRect.size.width) + extraWidth);
+ int height = devicePixelRatio * (int(macRect.size.height) + extraHeight);
if (width <= 0 || height <= 0)
return; // nothing to draw
@@ -1730,6 +1731,7 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
QPixmap pm;
if (!QPixmapCache::find(key, pm)) {
QPixmap activePixmap(width, height);
+ activePixmap.setDevicePixelRatio(devicePixelRatio);
activePixmap.fill(Qt::transparent);
{
if (combo){
@@ -1780,6 +1782,7 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
QImage colorlessImage;
{
QPixmap colorlessPixmap(width, height);
+ colorlessPixmap.setDevicePixelRatio(devicePixelRatio);
colorlessPixmap.fill(Qt::transparent);
QMacCGContext cg(&colorlessPixmap);
@@ -1813,7 +1816,7 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
}
QPixmapCache::insert(key, pm);
}
- p->drawPixmap(int(macRect.origin.x) - xoff, int(macRect.origin.y) + finalyoff, width, height, pm);
+ p->drawPixmap(int(macRect.origin.x) - xoff, int(macRect.origin.y) + finalyoff, width / devicePixelRatio, height / devicePixelRatio , pm);
}
QMacStyle::QMacStyle()
@@ -6715,6 +6718,8 @@ CGContextRef qt_mac_cg_context(const QPaintDevice *pdev)
}
CGContextTranslateCTM(ret, 0, pm->height());
+ int devicePixelRatio = pdev->devicePixelRatio();
+ CGContextScaleCTM(ret, devicePixelRatio, devicePixelRatio);
CGContextScaleCTM(ret, 1, -1);
return ret;
} else if (pdev->devType() == QInternal::Widget) {