summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-05 22:24:17 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-05 22:24:17 (GMT)
commitb7513f4a15ecac1adf54f2abdda6b56c89d6bef4 (patch)
tree55e4da4115f3f8833e6772d2c4500af1657704ba
parent4d0c9cfe654c82f99249142f5a51c2b8dd38d80b (diff)
parent2cc7a785eff228f414faa09ff882c2f0a2092cfd (diff)
downloadQt-b7513f4a15ecac1adf54f2abdda6b56c89d6bef4.zip
Qt-b7513f4a15ecac1adf54f2abdda6b56c89d6bef4.tar.gz
Qt-b7513f4a15ecac1adf54f2abdda6b56c89d6bef4.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: fix qt_wince_bsearch for low nonexistent key values WindowsMobileStyle: fix QTreeView indicator size document that QMenuBar::setDefaultAction is only available on Win Mobile
-rw-r--r--src/corelib/kernel/qfunctions_wince.cpp10
-rw-r--r--src/gui/styles/qwindowsmobilestyle.cpp44
-rw-r--r--src/gui/widgets/qmenubar.cpp2
3 files changed, 51 insertions, 5 deletions
diff --git a/src/corelib/kernel/qfunctions_wince.cpp b/src/corelib/kernel/qfunctions_wince.cpp
index 8ad6126..e58feb3 100644
--- a/src/corelib/kernel/qfunctions_wince.cpp
+++ b/src/corelib/kernel/qfunctions_wince.cpp
@@ -352,16 +352,18 @@ void *qt_wince_bsearch(const void *key,
size_t low = 0;
size_t high = num - 1;
while (low <= high) {
- unsigned int mid = ((unsigned) (low + high)) >> 1;
+ size_t mid = (low + high) >> 1;
int c = compare(key, (char*)base + mid * size);
- if (c < 0)
+ if (c < 0) {
+ if (!mid)
+ break;
high = mid - 1;
- else if (c > 0)
+ } else if (c > 0)
low = mid + 1;
else
return (char*) base + mid * size;
}
- return (NULL);
+ return 0;
}
void *lfind(const void* key, const void* base, size_t* elements, size_t size,
diff --git a/src/gui/styles/qwindowsmobilestyle.cpp b/src/gui/styles/qwindowsmobilestyle.cpp
index 5f939d0..67eb1ef 100644
--- a/src/gui/styles/qwindowsmobilestyle.cpp
+++ b/src/gui/styles/qwindowsmobilestyle.cpp
@@ -5356,6 +5356,50 @@ void QWindowsMobileStyle::drawPrimitive(PrimitiveElement element, const QStyleOp
painter->setPen(option->palette.text().color());
painter->drawLines(a);
break; }
+ case PE_IndicatorBranch: {
+ // Copied from the Windows style.
+ static const int decoration_size = d->doubleControls ? 18 : 9;
+ static const int ofsA = d->doubleControls ? 4 : 2;
+ static const int ofsB = d->doubleControls ? 8 : 4;
+ static const int ofsC = d->doubleControls ? 12 : 6;
+ static const int ofsD = d->doubleControls ? 1 : 0;
+ int mid_h = option->rect.x() + option->rect.width() / 2;
+ int mid_v = option->rect.y() + option->rect.height() / 2;
+ int bef_h = mid_h;
+ int bef_v = mid_v;
+ int aft_h = mid_h;
+ int aft_v = mid_v;
+ if (option->state & State_Children) {
+ int delta = decoration_size / 2;
+ bef_h -= delta;
+ bef_v -= delta;
+ aft_h += delta;
+ aft_v += delta;
+ QPen oldPen = painter->pen();
+ QPen crossPen = oldPen;
+ crossPen.setWidth(2);
+ painter->setPen(crossPen);
+ painter->drawLine(bef_h + ofsA + ofsD, bef_v + ofsB + ofsD, bef_h + ofsC + ofsD, bef_v + ofsB + ofsD);
+ if (!(option->state & State_Open))
+ painter->drawLine(bef_h + ofsB + ofsD, bef_v + ofsA + ofsD, bef_h + ofsB + ofsD, bef_v + ofsC + ofsD);
+ painter->setPen(option->palette.dark().color());
+ painter->drawRect(bef_h, bef_v, decoration_size - 1, decoration_size - 1);
+ if (d->doubleControls)
+ painter->drawRect(bef_h + 1, bef_v + 1, decoration_size - 3, decoration_size - 3);
+ painter->setPen(oldPen);
+ }
+ QBrush brush(option->palette.dark().color(), Qt::Dense4Pattern);
+ if (option->state & State_Item) {
+ if (option->direction == Qt::RightToLeft)
+ painter->fillRect(option->rect.left(), mid_v, bef_h - option->rect.left(), 1, brush);
+ else
+ painter->fillRect(aft_h, mid_v, option->rect.right() - aft_h + 1, 1, brush);
+ }
+ if (option->state & State_Sibling)
+ painter->fillRect(mid_h, aft_v, 1, option->rect.bottom() - aft_v + 1, brush);
+ if (option->state & (State_Open | State_Children | State_Item | State_Sibling))
+ painter->fillRect(mid_h, option->rect.y(), 1, bef_v - option->rect.y(), brush);
+ break; }
case PE_Frame:
qDrawPlainRect(painter, option->rect, option->palette.shadow().color(),
d->doubleControls ? 2 : 1, &option->palette.background());
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp
index e368d3d..734ed70 100644
--- a/src/gui/widgets/qmenubar.cpp
+++ b/src/gui/widgets/qmenubar.cpp
@@ -1957,7 +1957,7 @@ bool QMenuBar::isNativeMenuBar() const
to the right soft key.
Currently there is only support for the default action on Windows
- Mobile. All other platforms ignore the default action.
+ Mobile. On all other platforms this method is not available.
\sa defaultAction()
*/