summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authoraavit <qt-info@nokia.com>2011-10-26 08:58:13 (GMT)
committeraavit <qt-info@nokia.com>2011-10-26 08:58:13 (GMT)
commit4310e4325498fa6613aef53d61f2c5e1cec151c8 (patch)
tree8cca71edbd04ef311acdc12f9736e2be500d5766 /src/gui
parent207fb45ce7bac66ab53a0770d2bfb50d8d1997d8 (diff)
parent9ff6bc28d5977bde97e8429328028e46572be445 (diff)
downloadQt-4310e4325498fa6613aef53d61f2c5e1cec151c8.zip
Qt-4310e4325498fa6613aef53d61f2c5e1cec151c8.tar.gz
Qt-4310e4325498fa6613aef53d61f2c5e1cec151c8.tar.bz2
Merge remote-tracking branch 'qt-mainline/4.8'
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/accessible/qaccessible_win.cpp11
-rw-r--r--src/gui/dialogs/qdialog.cpp4
-rw-r--r--src/gui/dialogs/qfiledialog_win.cpp30
-rw-r--r--src/gui/dialogs/qwizard_win.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp20
-rw-r--r--src/gui/image/qpixmap_mac.cpp4
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp1
-rw-r--r--src/gui/itemviews/qabstractitemview_p.h2
-rw-r--r--src/gui/itemviews/qlistview.cpp8
-rw-r--r--src/gui/itemviews/qtableview.cpp2
-rw-r--r--src/gui/itemviews/qtreeview.cpp113
-rw-r--r--src/gui/itemviews/qtreeview_p.h5
-rw-r--r--src/gui/kernel/qapplication.cpp4
-rw-r--r--src/gui/kernel/qapplication_p.h1
-rw-r--r--src/gui/kernel/qapplication_s60.cpp44
-rw-r--r--src/gui/kernel/qapplication_win.cpp53
-rw-r--r--src/gui/kernel/qguifunctions_wince.cpp5
-rw-r--r--src/gui/kernel/qmime_mac.cpp4
-rw-r--r--src/gui/kernel/qt_s60_p.h3
-rw-r--r--src/gui/kernel/qwidget_s60.cpp84
-rw-r--r--src/gui/styles/qwindowsstyle.cpp3
-rw-r--r--src/gui/styles/qwindowsvistastyle.cpp2
-rw-r--r--src/gui/styles/qwindowsxpstyle.cpp2
-rw-r--r--src/gui/text/qfontengine_win.cpp5
-rw-r--r--src/gui/text/qtextcontrol.cpp8
-rw-r--r--src/gui/widgets/qmenu_wince.cpp2
26 files changed, 234 insertions, 188 deletions
diff --git a/src/gui/accessible/qaccessible_win.cpp b/src/gui/accessible/qaccessible_win.cpp
index 1fd1bfd..f404535 100644
--- a/src/gui/accessible/qaccessible_win.cpp
+++ b/src/gui/accessible/qaccessible_win.cpp
@@ -353,8 +353,8 @@ void QAccessible::updateAccessibility(QObject *o, int who, Event reason)
static PtrNotifyWinEvent ptrNotifyWinEvent = 0;
static bool resolvedNWE = false;
if (!resolvedNWE) {
- resolvedNWE = true;
ptrNotifyWinEvent = (PtrNotifyWinEvent)QSystemLibrary::resolve(QLatin1String("user32"), "NotifyWinEvent");
+ resolvedNWE = true;
}
if (!ptrNotifyWinEvent)
return;
@@ -691,14 +691,7 @@ private:
static inline BSTR QStringToBSTR(const QString &str)
{
- BSTR bstrVal;
-
- int wlen = str.length()+1;
- bstrVal = SysAllocStringByteLen(0, wlen*2);
- memcpy(bstrVal, str.unicode(), sizeof(QChar)*(wlen));
- bstrVal[wlen] = 0;
-
- return bstrVal;
+ return SysAllocStringLen((OLECHAR*)str.unicode(), str.length());
}
/*
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp
index 2fb6c67..d2211af 100644
--- a/src/gui/dialogs/qdialog.cpp
+++ b/src/gui/dialogs/qdialog.cpp
@@ -909,6 +909,10 @@ bool QDialog::symbianAdjustedPosition()
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStatusPane, statusPaneRect);
} else {
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStaconTop, statusPaneRect);
+ // In some native layouts, StaCon is not used. Try to fetch the status pane
+ // height from StatusPane component.
+ if (statusPaneRect.IsEmpty())
+ AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStatusPane, statusPaneRect);
}
p.setX(0);
diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp
index 6691ff1..2d4769a 100644
--- a/src/gui/dialogs/qfiledialog_win.cpp
+++ b/src/gui/dialogs/qfiledialog_win.cpp
@@ -55,10 +55,6 @@
#include <private/qsystemlibrary_p.h>
#include "qfiledialog_win_p.h"
-#ifndef QT_NO_THREAD
-# include <private/qmutexpool_p.h>
-#endif
-
#ifdef Q_WS_WINCE
#include <commdlg.h>
bool qt_priv_ptr_valid = false;
@@ -83,35 +79,23 @@ QT_BEGIN_NAMESPACE
static void qt_win_resolve_libs()
{
static bool triedResolve = false;
-
if (!triedResolve) {
-#ifndef QT_NO_THREAD
- // protect initialization
- QMutexLocker locker(QMutexPool::globalInstanceGet(&triedResolve));
- // check triedResolve again, since another thread may have already
- // done the initialization
- if (triedResolve) {
- // another thread did initialize the security function pointers,
- // so we shouldn't do it again.
- return;
- }
-#endif
-
- triedResolve = true;
#if !defined(Q_WS_WINCE)
- QSystemLibrary lib(L"shell32");
+ QSystemLibrary lib(QLatin1String("shell32"));
ptrSHBrowseForFolder = (PtrSHBrowseForFolder)lib.resolve("SHBrowseForFolderW");
ptrSHGetPathFromIDList = (PtrSHGetPathFromIDList)lib.resolve("SHGetPathFromIDListW");
ptrSHGetMalloc = (PtrSHGetMalloc)lib.resolve("SHGetMalloc");
#else
// CE stores them in a different lib and does not use unicode version
- HINSTANCE handle = LoadLibrary(L"Ceshell");
- ptrSHBrowseForFolder = (PtrSHBrowseForFolder)GetProcAddress(handle, L"SHBrowseForFolder");
- ptrSHGetPathFromIDList = (PtrSHGetPathFromIDList)GetProcAddress(handle, L"SHGetPathFromIDList");
- ptrSHGetMalloc = (PtrSHGetMalloc)GetProcAddress(handle, L"SHGetMalloc");
+ QSystemLibrary lib(QLatin1String("Ceshell"));
+ ptrSHBrowseForFolder = (PtrSHBrowseForFolder)lib.resolve("SHBrowseForFolder");
+ ptrSHGetPathFromIDList = (PtrSHGetPathFromIDList)lib.resolve("SHGetPathFromIDList");
+ ptrSHGetMalloc = (PtrSHGetMalloc)lib.resolve("SHGetMalloc");
if (ptrSHBrowseForFolder && ptrSHGetPathFromIDList && ptrSHGetMalloc)
qt_priv_ptr_valid = true;
#endif
+
+ triedResolve = true;
}
}
diff --git a/src/gui/dialogs/qwizard_win.cpp b/src/gui/dialogs/qwizard_win.cpp
index 9ea114c..00ebbfd 100644
--- a/src/gui/dialogs/qwizard_win.cpp
+++ b/src/gui/dialogs/qwizard_win.cpp
@@ -705,7 +705,6 @@ bool QVistaHelper::resolveSymbols()
{
static bool tried = false;
if (!tried) {
- tried = true;
QSystemLibrary dwmLib(L"dwmapi");
pDwmIsCompositionEnabled =
(PtrDwmIsCompositionEnabled)dwmLib.resolve("DwmIsCompositionEnabled");
@@ -727,6 +726,7 @@ bool QVistaHelper::resolveSymbols()
pDrawThemeTextEx = (PtrDrawThemeTextEx)themeLib.resolve("DrawThemeTextEx");
pSetWindowThemeAttribute = (PtrSetWindowThemeAttribute)themeLib.resolve("SetWindowThemeAttribute");
}
+ tried = true;
}
return (
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index cb7349c..73e8eed 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -2237,7 +2237,8 @@ bool QGraphicsItem::isVisible() const
returned. \a parent can be 0, in which case this function will return
whether the item is visible to the scene or not.
- An item may not be visible to its ancestors even if isVisible() is true. If
+ An item may not be visible to its ancestors even if isVisible() is true. It
+ may also be visible to its ancestors even if isVisible() is false. If
any ancestor is hidden, the item itself will be implicitly hidden, in which
case this function will return false.
@@ -2245,15 +2246,16 @@ bool QGraphicsItem::isVisible() const
*/
bool QGraphicsItem::isVisibleTo(const QGraphicsItem *parent) const
{
- if (!d_ptr->visible)
+ const QGraphicsItem *p = this;
+ if (d_ptr->explicitlyHidden)
return false;
- if (parent == this)
- return true;
- if (parentItem() && parentItem()->isVisibleTo(parent))
- return true;
- if (!parent && !parentItem())
- return true;
- return false;
+ do {
+ if (p == parent)
+ return true;
+ if (p->d_ptr->explicitlyHidden)
+ return false;
+ } while ((p = p->d_ptr->parent));
+ return parent == 0;
}
/*!
diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp
index 47b6eef..aa1571b 100644
--- a/src/gui/image/qpixmap_mac.cpp
+++ b/src/gui/image/qpixmap_mac.cpp
@@ -752,7 +752,8 @@ static PtrglReadPixels ptrglReadPixels = 0;
static bool resolveOpenGLSymbols()
{
- if (ptrCGLChoosePixelFormat == 0) {
+ static bool triedResolve = false;
+ if (!triedResolve) {
QLibrary library(QLatin1String("/System/Library/Frameworks/OpenGL.framework/OpenGL"));
ptrCGLChoosePixelFormat = (PtrCGLChoosePixelFormat)(library.resolve("CGLChoosePixelFormat"));
ptrCGLClearDrawable = (PtrCGLClearDrawable)(library.resolve("CGLClearDrawable"));
@@ -765,6 +766,7 @@ static bool resolveOpenGLSymbols()
ptrglPixelStorei = (PtrglPixelStorei)(library.resolve("glPixelStorei"));
ptrglReadBuffer = (PtrglReadBuffer)(library.resolve("glReadBuffer"));
ptrglReadPixels = (PtrglReadPixels)(library.resolve("glReadPixels"));
+ triedResolve = true;
}
return ptrCGLChoosePixelFormat && ptrCGLClearDrawable && ptrCGLCreateContext
&& ptrCGLDestroyContext && ptrCGLDestroyPixelFormat && ptrCGLSetCurrentContext
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index ded4d63..1676c46 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -4238,6 +4238,7 @@ QPixmap QAbstractItemViewPrivate::renderToPixmap(const QModelIndexList &indexes,
for (int j = 0; j < paintPairs.count(); ++j) {
option.rect = paintPairs.at(j).first.translated(-r->topLeft());
const QModelIndex &current = paintPairs.at(j).second;
+ adjustViewOptionsForIndex(&option, current);
delegateForIndex(current)->paint(&painter, option, current);
}
return pixmap;
diff --git a/src/gui/itemviews/qabstractitemview_p.h b/src/gui/itemviews/qabstractitemview_p.h
index 04babde..b742529 100644
--- a/src/gui/itemviews/qabstractitemview_p.h
+++ b/src/gui/itemviews/qabstractitemview_p.h
@@ -193,6 +193,8 @@ public:
#endif
virtual QItemViewPaintPairs draggablePaintPairs(const QModelIndexList &indexes, QRect *r) const;
+ // reimplemented in subclasses
+ virtual void adjustViewOptionsForIndex(QStyleOptionViewItemV4*, const QModelIndex&) const {}
inline void releaseEditor(QWidget *editor) const {
if (editor) {
diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp
index a0955d2..01a9eec 100644
--- a/src/gui/itemviews/qlistview.cpp
+++ b/src/gui/itemviews/qlistview.cpp
@@ -1475,7 +1475,7 @@ void QListView::doItemsLayout()
void QListView::updateGeometries()
{
Q_D(QListView);
- if (d->model->rowCount(d->root) <= 0 || d->model->columnCount(d->root) <= 0) {
+ if (geometry().isEmpty() || d->model->rowCount(d->root) <= 0 || d->model->columnCount(d->root) <= 0) {
horizontalScrollBar()->setRange(0, 0);
verticalScrollBar()->setRange(0, 0);
} else {
@@ -1490,15 +1490,15 @@ void QListView::updateGeometries()
// if the scroll bars are turned off, we resize the contents to the viewport
if (d->movement == Static && !d->isWrapping()) {
- const QSize maxSize = maximumViewportSize();
+ d->layoutChildren(); // we need the viewport size to be updated
if (d->flow == TopToBottom) {
if (horizontalScrollBarPolicy() == Qt::ScrollBarAlwaysOff) {
- d->setContentsSize(maxSize.width(), contentsSize().height());
+ d->setContentsSize(viewport()->width(), contentsSize().height());
horizontalScrollBar()->setRange(0, 0); // we see all the contents anyway
}
} else { // LeftToRight
if (verticalScrollBarPolicy() == Qt::ScrollBarAlwaysOff) {
- d->setContentsSize(contentsSize().width(), maxSize.height());
+ d->setContentsSize(contentsSize().width(), viewport()->height());
verticalScrollBar()->setRange(0, 0); // we see all the contents anyway
}
}
diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp
index 6f532eb..356f187 100644
--- a/src/gui/itemviews/qtableview.cpp
+++ b/src/gui/itemviews/qtableview.cpp
@@ -3205,7 +3205,7 @@ void QTableView::selectionChanged(const QItemSelection &selected,
QModelIndex desel = deselected.indexes().value(0);
if (desel.isValid()) {
#ifdef Q_WS_X11
- int entry = d->accessibleTable2Index(sel);
+ int entry = d->accessibleTable2Index(desel);
QAccessible::updateAccessibility(this, entry, QAccessible::SelectionRemove);
#else
int entry = visualIndex(sel);
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index 9228ac8..868cd92 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -1378,6 +1378,23 @@ QItemViewPaintPairs QTreeViewPrivate::draggablePaintPairs(const QModelIndexList
return ret;
}
+void QTreeViewPrivate::adjustViewOptionsForIndex(QStyleOptionViewItemV4 *option, const QModelIndex &current) const
+{
+ const int row = current.row();
+ option->state = option->state | (viewItems.at(row).expanded ? QStyle::State_Open : QStyle::State_None)
+ | (viewItems.at(row).hasChildren ? QStyle::State_Children : QStyle::State_None)
+ | (viewItems.at(row).hasMoreSiblings ? QStyle::State_Sibling : QStyle::State_None);
+
+ option->showDecorationSelected = (selectionBehavior & QTreeView::SelectRows)
+ || option->showDecorationSelected;
+
+ QVector<int> logicalIndices;
+ QVector<QStyleOptionViewItemV4::ViewItemPosition> viewItemPosList; // vector of left/middle/end for each logicalIndex
+ calcLogicalIndices(&logicalIndices, &viewItemPosList);
+ int logicalIndex = header->logicalIndex(current.column());
+ option->viewItemPosition = viewItemPosList.at(logicalIndex);
+}
+
/*!
\since 4.2
@@ -1463,6 +1480,59 @@ static inline bool ancestorOf(QObject *widget, QObject *other)
return false;
}
+void QTreeViewPrivate::calcLogicalIndices(QVector<int> *logicalIndices, QVector<QStyleOptionViewItemV4::ViewItemPosition> *itemPositions) const
+{
+ const int left = (spanning ? header->visualIndex(0) : leftAndRight.first);
+ const int right = (spanning ? header->visualIndex(0) : leftAndRight.second);
+ const int columnCount = header->count();
+ /* 'left' and 'right' are the left-most and right-most visible visual indices.
+ Compute the first visible logical indices before and after the left and right.
+ We will use these values to determine the QStyleOptionViewItemV4::viewItemPosition. */
+ int logicalIndexBeforeLeft = -1, logicalIndexAfterRight = -1;
+ for (int visualIndex = left - 1; visualIndex >= 0; --visualIndex) {
+ int logicalIndex = header->logicalIndex(visualIndex);
+ if (!header->isSectionHidden(logicalIndex)) {
+ logicalIndexBeforeLeft = logicalIndex;
+ break;
+ }
+ }
+
+ for (int visualIndex = left; visualIndex < columnCount; ++visualIndex) {
+ int logicalIndex = header->logicalIndex(visualIndex);
+ if (!header->isSectionHidden(logicalIndex)) {
+ if (visualIndex > right) {
+ logicalIndexAfterRight = logicalIndex;
+ break;
+ }
+ logicalIndices->append(logicalIndex);
+ }
+ }
+
+ itemPositions->resize(logicalIndices->count());
+ for (int currentLogicalSection = 0; currentLogicalSection < logicalIndices->count(); ++currentLogicalSection) {
+ const int headerSection = logicalIndices->at(currentLogicalSection);
+ // determine the viewItemPosition depending on the position of column 0
+ int nextLogicalSection = currentLogicalSection + 1 >= logicalIndices->count()
+ ? logicalIndexAfterRight
+ : logicalIndices->at(currentLogicalSection + 1);
+ int prevLogicalSection = currentLogicalSection - 1 < 0
+ ? logicalIndexBeforeLeft
+ : logicalIndices->at(currentLogicalSection - 1);
+ QStyleOptionViewItemV4::ViewItemPosition pos;
+ if (columnCount == 1 || (nextLogicalSection == 0 && prevLogicalSection == -1)
+ || (headerSection == 0 && nextLogicalSection == -1) || spanning)
+ pos = QStyleOptionViewItemV4::OnlyOne;
+ else if (headerSection == 0 || (nextLogicalSection != 0 && prevLogicalSection == -1))
+ pos = QStyleOptionViewItemV4::Beginning;
+ else if (nextLogicalSection == 0 || nextLogicalSection == -1)
+ pos = QStyleOptionViewItemV4::End;
+ else
+ pos = QStyleOptionViewItemV4::Middle;
+ (*itemPositions)[currentLogicalSection] = pos;
+ }
+}
+
+
/*!
Draws the row in the tree view that contains the model item \a index,
using the \a painter given. The \a option control how the item is
@@ -1531,33 +1601,13 @@ void QTreeView::drawRow(QPainter *painter, const QStyleOptionViewItem &option,
int width, height = option.rect.height();
int position;
QModelIndex modelIndex;
- int columnCount = header->count();
const bool hoverRow = selectionBehavior() == QAbstractItemView::SelectRows
&& index.parent() == hover.parent()
&& index.row() == hover.row();
- /* 'left' and 'right' are the left-most and right-most visible visual indices.
- Compute the first visible logical indices before and after the left and right.
- We will use these values to determine the QStyleOptionViewItemV4::viewItemPosition. */
- int logicalIndexBeforeLeft = -1, logicalIndexAfterRight = -1;
- for (int visualIndex = left - 1; visualIndex >= 0; --visualIndex) {
- int logicalIndex = header->logicalIndex(visualIndex);
- if (!header->isSectionHidden(logicalIndex)) {
- logicalIndexBeforeLeft = logicalIndex;
- break;
- }
- }
- QVector<int> logicalIndices; // vector of currently visibly logical indices
- for (int visualIndex = left; visualIndex < columnCount; ++visualIndex) {
- int logicalIndex = header->logicalIndex(visualIndex);
- if (!header->isSectionHidden(logicalIndex)) {
- if (visualIndex > right) {
- logicalIndexAfterRight = logicalIndex;
- break;
- }
- logicalIndices.append(logicalIndex);
- }
- }
+ QVector<int> logicalIndices;
+ QVector<QStyleOptionViewItemV4::ViewItemPosition> viewItemPosList; // vector of left/middle/end for each logicalIndex
+ d->calcLogicalIndices(&logicalIndices, &viewItemPosList);
for (int currentLogicalSection = 0; currentLogicalSection < logicalIndices.count(); ++currentLogicalSection) {
int headerSection = logicalIndices.at(currentLogicalSection);
@@ -1579,22 +1629,7 @@ void QTreeView::drawRow(QPainter *painter, const QStyleOptionViewItem &option,
continue;
opt.state = state;
- // determine the viewItemPosition depending on the position of column 0
- int nextLogicalSection = currentLogicalSection + 1 >= logicalIndices.count()
- ? logicalIndexAfterRight
- : logicalIndices.at(currentLogicalSection + 1);
- int prevLogicalSection = currentLogicalSection - 1 < 0
- ? logicalIndexBeforeLeft
- : logicalIndices.at(currentLogicalSection - 1);
- if (columnCount == 1 || (nextLogicalSection == 0 && prevLogicalSection == -1)
- || (headerSection == 0 && nextLogicalSection == -1) || spanning)
- opt.viewItemPosition = QStyleOptionViewItemV4::OnlyOne;
- else if (headerSection == 0 || (nextLogicalSection != 0 && prevLogicalSection == -1))
- opt.viewItemPosition = QStyleOptionViewItemV4::Beginning;
- else if (nextLogicalSection == 0 || nextLogicalSection == -1)
- opt.viewItemPosition = QStyleOptionViewItemV4::End;
- else
- opt.viewItemPosition = QStyleOptionViewItemV4::Middle;
+ opt.viewItemPosition = viewItemPosList.at(currentLogicalSection);
// fake activeness when row editor has focus
if (indexWidgetHasFocus)
diff --git a/src/gui/itemviews/qtreeview_p.h b/src/gui/itemviews/qtreeview_p.h
index a9dc452..ef8f11c 100644
--- a/src/gui/itemviews/qtreeview_p.h
+++ b/src/gui/itemviews/qtreeview_p.h
@@ -97,6 +97,7 @@ public:
void initialize();
QItemViewPaintPairs draggablePaintPairs(const QModelIndexList &indexes, QRect *r) const;
+ void adjustViewOptionsForIndex(QStyleOptionViewItemV4 *option, const QModelIndex &current) const;
#ifndef QT_NO_ANIMATION
struct AnimatedOperation : public QVariantAnimation
@@ -167,6 +168,10 @@ public:
void paintAlternatingRowColors(QPainter *painter, QStyleOptionViewItemV4 *option, int y, int bottom) const;
+ // logicalIndices: vector of currently visibly logical indices
+ // itemPositions: vector of view item positions (beginning/middle/end/onlyone)
+ void calcLogicalIndices(QVector<int> *logicalIndices, QVector<QStyleOptionViewItemV4::ViewItemPosition> *itemPositions) const;
+
QHeaderView *header;
int indent;
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 15d37c3..35a9559 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -874,6 +874,10 @@ void QApplicationPrivate::construct(
if (qt_is_gui_used)
qt_guiPlatformPlugin();
#endif
+
+#ifdef Q_OS_SYMBIAN
+ symbianHandleLiteModeStartup();
+#endif
}
#if defined(Q_WS_X11)
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h
index e1252a9..0756d6c 100644
--- a/src/gui/kernel/qapplication_p.h
+++ b/src/gui/kernel/qapplication_p.h
@@ -561,6 +561,7 @@ public:
int symbianProcessWsEvent(const QSymbianEvent *symbianEvent);
int symbianHandleCommand(const QSymbianEvent *symbianEvent);
int symbianResourceChange(const QSymbianEvent *symbianEvent);
+ void symbianHandleLiteModeStartup();
void _q_aboutToQuit();
#endif
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 03da630..7d198ce 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -201,6 +201,32 @@ bool QS60Data::setRecursiveDecorationsVisibility(QWidget *window, Qt::WindowStat
}
#endif
+void QS60Data::createStatusPaneAndCBA()
+{
+ CEikAppUi *ui = static_cast<CEikAppUi *>(S60->appUi());
+ MEikAppUiFactory *factory = CEikonEnv::Static()->AppUiFactory();
+ QT_TRAP_THROWING(
+ factory->CreateResourceIndependentFurnitureL(ui);
+ CEikButtonGroupContainer *cba = CEikButtonGroupContainer::NewL(CEikButtonGroupContainer::ECba,
+ CEikButtonGroupContainer::EHorizontal, ui, R_AVKON_SOFTKEYS_EMPTY_WITH_IDS);
+ CEikButtonGroupContainer *oldCba = factory->SwapButtonGroup(cba);
+ Q_ASSERT(!oldCba);
+ S60->setButtonGroupContainer(cba);
+ CEikMenuBar *menuBar = new(ELeave) CEikMenuBar;
+ menuBar->ConstructL(ui, 0, R_AVKON_MENUPANE_EMPTY);
+ menuBar->SetMenuType(CEikMenuBar::EMenuOptions);
+ S60->appUi()->AddToStackL(menuBar, ECoeStackPriorityMenu, ECoeStackFlagRefusesFocus);
+ CEikMenuBar *oldMenu = factory->SwapMenuBar(menuBar);
+ Q_ASSERT(!oldMenu);
+ )
+ if (S60->statusPane()) {
+ // Use QDesktopWidget as the status pane observer to proxy for the AppUi.
+ // Can't use AppUi directly because it privately inherits from MEikStatusPaneObserver.
+ QSymbianControl *desktopControl = static_cast<QSymbianControl *>(QApplication::desktop()->winId());
+ S60->statusPane()->SetObserver(desktopControl);
+ }
+}
+
void QS60Data::controlVisibilityChanged(CCoeControl *control, bool visible)
{
if (QWidgetPrivate::mapper && QWidgetPrivate::mapper->contains(control)) {
@@ -2580,6 +2606,24 @@ int QApplicationPrivate::symbianResourceChange(const QSymbianEvent *symbianEvent
return ret;
}
+void QApplicationPrivate::symbianHandleLiteModeStartup()
+{
+ if (QCoreApplication::arguments().contains(QLatin1String("--startup-lite"))) {
+ if (!QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes)
+ && !S60->buttonGroupContainer() && !S60->statusPane()) {
+ // hide and force this app to the background before creating screen furniture to avoid flickers
+ CAknAppUi *appui = static_cast<CAknAppUi*>(CCoeEnv::Static()->AppUi());
+ if (appui)
+ appui->HideApplicationFromFSW(ETrue);
+ CCoeEnv::Static()->RootWin().SetOrdinalPosition(-1);
+ S60->createStatusPaneAndCBA();
+ if (S60->statusPane()) {
+ S60->setStatusPaneAndButtonGroupVisibility(false, false);
+ }
+ }
+ }
+}
+
#ifndef QT_NO_WHEELEVENT
int QApplication::wheelScrollLines()
{
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index c472738..19e7ba5 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -218,9 +218,9 @@ static bool aygResolved = false;
static void resolveAygLibs()
{
if (!aygResolved) {
- aygResolved = true;
QSystemLibrary ayglib(QLatin1String("aygshell"));
ptrRecognizeGesture = (AygRecognizeGesture) ayglib.resolve("SHRecognizeGesture");
+ aygResolved = true;
}
}
#endif // QT_NO_GESTURES
@@ -854,19 +854,15 @@ void qt_init(QApplicationPrivate *priv, int)
qt_win_initialize_directdraw();
#ifndef Q_OS_WINCE
- ptrUpdateLayeredWindowIndirect =
- (PtrUpdateLayeredWindowIndirect) QSystemLibrary::resolve(QLatin1String("user32"),
- "UpdateLayeredWindowIndirect");
- ptrUpdateLayeredWindow =
- (PtrUpdateLayeredWindow) QSystemLibrary::resolve(QLatin1String("user32"),
- "UpdateLayeredWindow");
+ QSystemLibrary user32(QLatin1String("user32"));
+ ptrUpdateLayeredWindowIndirect = (PtrUpdateLayeredWindowIndirect)user32.resolve("UpdateLayeredWindowIndirect");
+ ptrUpdateLayeredWindow = (PtrUpdateLayeredWindow)user32.resolve("UpdateLayeredWindow");
if (ptrUpdateLayeredWindow && !ptrUpdateLayeredWindowIndirect)
ptrUpdateLayeredWindowIndirect = qt_updateLayeredWindowIndirect;
// Notify Vista and Windows 7 that we support highter DPI settings
- ptrSetProcessDPIAware = (PtrSetProcessDPIAware)
- QSystemLibrary::resolve(QLatin1String("user32"), "SetProcessDPIAware");
+ ptrSetProcessDPIAware = (PtrSetProcessDPIAware)user32.resolve("SetProcessDPIAware");
if (ptrSetProcessDPIAware)
ptrSetProcessDPIAware();
#endif
@@ -886,29 +882,16 @@ void qt_init(QApplicationPrivate *priv, int)
priv->GetGestureExtraArgs = (PtrGetGestureExtraArgs) &TKGetGestureExtraArguments;
#elif !defined(Q_WS_WINCE)
#if !defined(QT_NO_NATIVE_GESTURES)
- priv->GetGestureInfo =
- (PtrGetGestureInfo)QSystemLibrary::resolve(QLatin1String("user32"),
- "GetGestureInfo");
- priv->GetGestureExtraArgs =
- (PtrGetGestureExtraArgs)QSystemLibrary::resolve(QLatin1String("user32"),
- "GetGestureExtraArgs");
- priv->CloseGestureInfoHandle =
- (PtrCloseGestureInfoHandle)QSystemLibrary::resolve(QLatin1String("user32"),
- "CloseGestureInfoHandle");
- priv->SetGestureConfig =
- (PtrSetGestureConfig)QSystemLibrary::resolve(QLatin1String("user32"),
- "SetGestureConfig");
- priv->GetGestureConfig =
- (PtrGetGestureConfig)QSystemLibrary::resolve(QLatin1String("user32"),
- "GetGestureConfig");
+ priv->GetGestureInfo = (PtrGetGestureInfo)user32.resolve("GetGestureInfo");
+ priv->GetGestureExtraArgs = (PtrGetGestureExtraArgs)user32.resolve("GetGestureExtraArgs");
+ priv->CloseGestureInfoHandle = (PtrCloseGestureInfoHandle)user32.resolve("CloseGestureInfoHandle");
+ priv->SetGestureConfig = (PtrSetGestureConfig)user32.resolve("SetGestureConfig");
+ priv->GetGestureConfig = (PtrGetGestureConfig)user32.resolve("GetGestureConfig");
#endif // QT_NO_NATIVE_GESTURES
QSystemLibrary libTheme(QLatin1String("uxtheme"));
- priv->BeginPanningFeedback =
- (PtrBeginPanningFeedback)libTheme.resolve("BeginPanningFeedback");
- priv->UpdatePanningFeedback =
- (PtrUpdatePanningFeedback)libTheme.resolve("UpdatePanningFeedback");
- priv->EndPanningFeedback =
- (PtrEndPanningFeedback)libTheme.resolve("EndPanningFeedback");
+ priv->BeginPanningFeedback = (PtrBeginPanningFeedback)libTheme.resolve("BeginPanningFeedback");
+ priv->UpdatePanningFeedback = (PtrUpdatePanningFeedback)libTheme.resolve("UpdatePanningFeedback");
+ priv->EndPanningFeedback = (PtrEndPanningFeedback)libTheme.resolve("EndPanningFeedback");
#endif
#endif // QT_NO_GESTURES
}
@@ -2388,15 +2371,14 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
break;
}
+#if !defined(Q_OS_WINCE)
typedef LRESULT (WINAPI *PtrLresultFromObject)(REFIID, WPARAM, LPUNKNOWN);
static PtrLresultFromObject ptrLresultFromObject = 0;
static bool oleaccChecked = false;
-
if (!oleaccChecked) {
+ QSystemLibrary oleacclib(QLatin1String("oleacc"));
+ ptrLresultFromObject = (PtrLresultFromObject)oleacclib.resolve("LresultFromObject");
oleaccChecked = true;
-#if !defined(Q_OS_WINCE)
- ptrLresultFromObject = (PtrLresultFromObject)QSystemLibrary::resolve(QLatin1String("oleacc"), "LresultFromObject");
-#endif
}
if (ptrLresultFromObject) {
QAccessibleInterface *acc = QAccessible::queryAccessibleInterface(widget);
@@ -2413,6 +2395,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
if (res > 0)
RETURN(res);
}
+#endif
}
result = false;
break;
@@ -3198,8 +3181,8 @@ bool QETWidget::translateMouseEvent(const MSG &msg)
if (curWin != 0) {
if (!trackMouseEventLookup) {
- trackMouseEventLookup = true;
ptrTrackMouseEvent = (PtrTrackMouseEvent)QSystemLibrary::resolve(QLatin1String("comctl32"), "_TrackMouseEvent");
+ trackMouseEventLookup = true;
}
if (ptrTrackMouseEvent && !qApp->d_func()->inPopupMode()) {
// We always have to set the tracking, since
diff --git a/src/gui/kernel/qguifunctions_wince.cpp b/src/gui/kernel/qguifunctions_wince.cpp
index 78dc469..ae2ca04 100644
--- a/src/gui/kernel/qguifunctions_wince.cpp
+++ b/src/gui/kernel/qguifunctions_wince.cpp
@@ -125,17 +125,16 @@ static AygInitDialog ptrAygInitDialog = 0;
static AygFullScreen ptrAygFullScreen = 0;
static AygSHSipInfo ptrAygSHSipInfo = 0;
static AygSHDoneButton ptrAygSHDoneButton = 0;
-static bool aygResolved = false;
-
static void resolveAygLibs()
{
+ static bool aygResolved = false;
if (!aygResolved) {
- aygResolved = true;
QLibrary ayglib(QLatin1String("aygshell"));
ptrAygInitDialog = (AygInitDialog) ayglib.resolve("SHInitDialog");
ptrAygFullScreen = (AygFullScreen) ayglib.resolve("SHFullScreen");
ptrAygSHSipInfo = (AygSHSipInfo) ayglib.resolve("SHSipInfo");
ptrAygSHDoneButton = (AygSHDoneButton) ayglib.resolve("SHDoneButton");
+ aygResolved = true;
}
}
diff --git a/src/gui/kernel/qmime_mac.cpp b/src/gui/kernel/qmime_mac.cpp
index 8b47d8e..e92bd49 100644
--- a/src/gui/kernel/qmime_mac.cpp
+++ b/src/gui/kernel/qmime_mac.cpp
@@ -520,13 +520,15 @@ static PtrGraphicsExportDoExport ptrGraphicsExportDoExport = 0;
static bool resolveMimeQuickTimeSymbols()
{
- if (ptrGraphicsImportSetDataHandle == 0) {
+ static bool triedResolve = false;
+ if (!triedResolve) {
QLibrary library(QLatin1String("/System/Library/Frameworks/QuickTime.framework/QuickTime"));
ptrGraphicsImportSetDataHandle = reinterpret_cast<PtrGraphicsImportSetDataHandle>(library.resolve("GraphicsImportSetDataHandle"));
ptrGraphicsImportCreateCGImage = reinterpret_cast<PtrGraphicsImportCreateCGImage>(library.resolve("GraphicsImportCreateCGImage"));
ptrGraphicsExportSetInputCGImage = reinterpret_cast<PtrGraphicsExportSetInputCGImage>(library.resolve("GraphicsExportSetInputCGImage"));
ptrGraphicsExportSetOutputHandle = reinterpret_cast<PtrGraphicsExportSetOutputHandle>(library.resolve("GraphicsExportSetOutputHandle"));
ptrGraphicsExportDoExport = reinterpret_cast<PtrGraphicsExportDoExport>(library.resolve("GraphicsExportDoExport"));
+ triedResolve = true;
}
return ptrGraphicsImportSetDataHandle != 0
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index 96b8141..5ad5b00 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -163,6 +163,7 @@ public:
int partial_keyboardAutoTranslation : 1;
int partialKeyboardOpen : 1;
int handleStatusPaneResizeNotifications : 1;
+ int screenFurnitureFullyCreated : 1;
QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type
QPointer<QWidget> splitViewLastWidget;
@@ -198,6 +199,7 @@ public:
static inline void setButtonGroupContainer(CEikButtonGroupContainer* newCba);
static void setStatusPaneAndButtonGroupVisibility(bool statusPaneVisible, bool buttonGroupVisible);
static bool setRecursiveDecorationsVisibility(QWidget *window, Qt::WindowStates newState);
+ static void createStatusPaneAndCBA();
#endif
static void controlVisibilityChanged(CCoeControl *control, bool visible);
static TRect clientRect();
@@ -365,6 +367,7 @@ inline QS60Data::QS60Data()
partial_keyboardAutoTranslation(1),
partialKeyboardOpen(0),
handleStatusPaneResizeNotifications(1),
+ screenFurnitureFullyCreated(0),
s60ApplicationFactory(0)
#ifdef Q_OS_SYMBIAN
,s60InstalledTrapHandler(0)
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 00661ae..396c306 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -505,63 +505,41 @@ void QWidgetPrivate::show_sys()
#ifdef Q_WS_S60
// Lazily initialize the S60 screen furniture when the first window is shown.
if (q->isWindow() && !QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes)
- && !S60->buttonGroupContainer() && !S60->statusPane()) {
-
- if (!q->testAttribute(Qt::WA_DontShowOnScreen)) {
-
- // Create the status pane and CBA here
- CEikAppUi *ui = static_cast<CEikAppUi *>(S60->appUi());
- MEikAppUiFactory *factory = CEikonEnv::Static()->AppUiFactory();
-
- QT_TRAP_THROWING(
- factory->CreateResourceIndependentFurnitureL(ui);
-
- 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);
- }
+ && !q->testAttribute(Qt::WA_DontShowOnScreen) && !S60->screenFurnitureFullyCreated) {
+ // Create the status pane and CBA here if not yet done. These could be created earlier
+ // if application was launched in "App-Lite" version
+ if (!S60->buttonGroupContainer() && !S60->statusPane())
+ S60->createStatusPaneAndCBA();
+
+ if (S60->buttonGroupContainer()) {
+ if (isFullscreen && !cbaRequested)
+ S60->buttonGroupContainer()->MakeVisible(false);
+ }
+
+ // 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);
- S60->appUi()->AddToStackL(menuBar,ECoeStackPriorityMenu,ECoeStackFlagRefusesFocus);
-
- CEikMenuBar *oldMenu = factory->SwapMenuBar(menuBar);
- Q_ASSERT(!oldMenu);
- )
-
- if (S60->statusPane()) {
- // Use QDesktopWidget as the status pane observer to proxy for the AppUi.
- // Can't use AppUi directly because it privately inherits from MEikStatusPaneObserver.
- QSymbianControl *desktopControl = static_cast<QSymbianControl *>(QApplication::desktop()->winId());
- S60->statusPane()->SetObserver(desktopControl);
- if (isFullscreen) {
- const bool cbaVisible = S60->buttonGroupContainer() && S60->buttonGroupContainer()->IsVisible();
- S60->setStatusPaneAndButtonGroupVisibility(false, cbaVisible);
- if (cbaVisible) {
- // Fix window dimensions as without screen furniture they will have
- // defaulted to full screen dimensions initially.
- id->handleClientAreaChange();
- }
+ if (S60->statusPane()) {
+ if (isFullscreen) {
+ const bool cbaVisible = S60->buttonGroupContainer() && S60->buttonGroupContainer()->IsVisible();
+ S60->setStatusPaneAndButtonGroupVisibility(false, cbaVisible);
+ if (cbaVisible) {
+ // Fix window dimensions as without screen furniture they will have
+ // defaulted to full screen dimensions initially.
+ id->handleClientAreaChange();
}
}
}
+ S60->screenFurnitureFullyCreated = true;
}
#endif
diff --git a/src/gui/styles/qwindowsstyle.cpp b/src/gui/styles/qwindowsstyle.cpp
index 342c4c6..2244c11 100644
--- a/src/gui/styles/qwindowsstyle.cpp
+++ b/src/gui/styles/qwindowsstyle.cpp
@@ -221,7 +221,8 @@ bool QWindowsStyle::eventFilter(QObject *o, QEvent *e)
d->bars << bar;
if (d->bars.size() == 1) {
Q_ASSERT(d->animationFps> 0);
- d->animateTimer = startTimer(1000 / d->animationFps);
+ if (d->animateTimer == 0)
+ d->animateTimer = startTimer(1000 / d->animationFps);
}
}
}
diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp
index 997d429..5525468 100644
--- a/src/gui/styles/qwindowsvistastyle.cpp
+++ b/src/gui/styles/qwindowsvistastyle.cpp
@@ -2586,7 +2586,6 @@ bool QWindowsVistaStylePrivate::resolveSymbols()
{
static bool tried = false;
if (!tried) {
- tried = true;
QSystemLibrary themeLib(QLatin1String("uxtheme"));
pSetWindowTheme = (PtrSetWindowTheme )themeLib.resolve("SetWindowTheme");
pIsThemePartDefined = (PtrIsThemePartDefined )themeLib.resolve("IsThemePartDefined");
@@ -2611,6 +2610,7 @@ bool QWindowsVistaStylePrivate::resolveSymbols()
pGetThemeString = (PtrGetThemeString )themeLib.resolve("GetThemeString");
pGetThemeTransitionDuration = (PtrGetThemeTransitionDuration)themeLib.resolve("GetThemeTransitionDuration");
pGetThemePropertyOrigin = (PtrGetThemePropertyOrigin)themeLib.resolve("GetThemePropertyOrigin");
+ tried = true;
}
return pGetThemeTransitionDuration != 0;
}
diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp
index 343f262..9934545 100644
--- a/src/gui/styles/qwindowsxpstyle.cpp
+++ b/src/gui/styles/qwindowsxpstyle.cpp
@@ -343,7 +343,6 @@ bool QWindowsXPStylePrivate::resolveSymbols()
{
static bool tried = false;
if (!tried) {
- tried = true;
QSystemLibrary themeLib(QLatin1String("uxtheme"));
pIsAppThemed = (PtrIsAppThemed)themeLib.resolve("IsAppThemed");
if (pIsAppThemed) {
@@ -372,6 +371,7 @@ bool QWindowsXPStylePrivate::resolveSymbols()
pGetThemeDocumentationProperty = (PtrGetThemeDocumentationProperty )themeLib.resolve("GetThemeDocumentationProperty");
pIsThemeBackgroundPartiallyTransparent = (PtrIsThemeBackgroundPartiallyTransparent)themeLib.resolve("IsThemeBackgroundPartiallyTransparent");
}
+ tried = true;
}
return pIsAppThemed != 0;
diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp
index fc11387..bb5e041 100644
--- a/src/gui/text/qfontengine_win.cpp
+++ b/src/gui/text/qfontengine_win.cpp
@@ -138,8 +138,11 @@ static void resolveGetCharWidthI()
{
if (resolvedGetCharWidthI)
return;
+
+ QSystemLibrary gdi32(QLatin1String("gdi32"));
+ ptrGetCharWidthI = (PtrGetCharWidthI)gdi32.resolve("GetCharWidthI");
+
resolvedGetCharWidthI = true;
- ptrGetCharWidthI = (PtrGetCharWidthI)QSystemLibrary::resolve(QLatin1String("gdi32"), "GetCharWidthI");
}
#endif // !defined(Q_WS_WINCE)
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index aeeef85..5babbc2 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -408,7 +408,6 @@ void QTextControlPrivate::init(Qt::TextFormat format, const QString &text, QText
setContent(format, text, document);
doc->setUndoRedoEnabled(interactionFlags & Qt::TextEditable);
- q->setCursorWidth(-1);
}
void QTextControlPrivate::setContent(Qt::TextFormat format, const QString &text, QTextDocument *document)
@@ -2236,7 +2235,10 @@ int QTextControl::cursorWidth() const
{
#ifndef QT_NO_PROPERTIES
Q_D(const QTextControl);
- return d->doc->documentLayout()->property("cursorWidth").toInt();
+ int width = d->doc->documentLayout()->property("cursorWidth").toInt();
+ if (width == -1)
+ width = QApplication::style()->pixelMetric(QStyle::PM_TextCursorWidth);
+ return width;
#else
return 1;
#endif
@@ -2248,8 +2250,6 @@ void QTextControl::setCursorWidth(int width)
#ifdef QT_NO_PROPERTIES
Q_UNUSED(width);
#else
- if (width == -1)
- width = QApplication::style()->pixelMetric(QStyle::PM_TextCursorWidth);
d->doc->documentLayout()->setProperty("cursorWidth", width);
#endif
d->repaintCursor();
diff --git a/src/gui/widgets/qmenu_wince.cpp b/src/gui/widgets/qmenu_wince.cpp
index b0c6c1b..d45daf8 100644
--- a/src/gui/widgets/qmenu_wince.cpp
+++ b/src/gui/widgets/qmenu_wince.cpp
@@ -111,10 +111,10 @@ static AygEnableSoftKey ptrEnableSoftKey = 0;
static void resolveAygLibs()
{
if (!aygResolved) {
- aygResolved = true;
QLibrary aygLib(QLatin1String("aygshell"));
ptrCreateMenuBar = (AygCreateMenuBar) aygLib.resolve("SHCreateMenuBar");
ptrEnableSoftKey = (AygEnableSoftKey) aygLib.resolve("SHEnableSoftkey");
+ aygResolved = true;
}
}