summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qabstracteventdispatcher.cpp2
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp22
-rw-r--r--src/corelib/kernel/qcoreevent.cpp10
-rw-r--r--src/corelib/kernel/qjni.cpp9
-rw-r--r--src/corelib/kernel/qjni_p.h8
-rw-r--r--src/corelib/kernel/qmetatype.cpp2
-rw-r--r--src/corelib/kernel/qobject.cpp14
-rw-r--r--src/corelib/kernel/qobject.h10
-rw-r--r--src/corelib/kernel/qpointer.cpp2
-rw-r--r--src/corelib/kernel/qtimer.cpp2
-rw-r--r--src/corelib/kernel/qvariant.cpp6
11 files changed, 48 insertions, 39 deletions
diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp
index 67ce7d45fc..0b5898a6b9 100644
--- a/src/corelib/kernel/qabstracteventdispatcher.cpp
+++ b/src/corelib/kernel/qabstracteventdispatcher.cpp
@@ -386,7 +386,7 @@ void QAbstractEventDispatcher::closingDown()
\note The filter function set here receives native messages,
that is, MSG or XEvent structs.
- For maximum portability, you should always try to use QEvents
+ For maximum portability, you should always try to use QEvent objects
and QObject::installEventFilter() whenever possible.
\sa QObject::installEventFilter()
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 194c3f1cba..18a379f8b9 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -80,6 +80,11 @@
#ifdef Q_OS_WIN
# ifdef Q_OS_WINRT
# include "qeventdispatcher_winrt_p.h"
+# include "qfunctions_winrt.h"
+# include <wrl.h>
+# include <Windows.ApplicationModel.core.h>
+ using namespace ABI::Windows::ApplicationModel::Core;
+ using namespace Microsoft::WRL;
# else
# include "qeventdispatcher_win_p.h"
# endif
@@ -1244,6 +1249,19 @@ void QCoreApplication::exit(int returnCode)
QEventLoop *eventLoop = data->eventLoops.at(i);
eventLoop->exit(returnCode);
}
+#ifdef Q_OS_WINRT
+ qWarning("QCoreApplication::exit: It is not recommended to explicitly exit an application on Windows Store Apps");
+ ComPtr<ICoreApplication> app;
+ HRESULT hr = RoGetActivationFactory(Wrappers::HString::MakeReference(RuntimeClass_Windows_ApplicationModel_Core_CoreApplication).Get(),
+ IID_PPV_ARGS(&app));
+ RETURN_VOID_IF_FAILED("Could not acquire ICoreApplication object");
+ ComPtr<ICoreApplicationExit> appExit;
+
+ hr = app.As(&appExit);
+ RETURN_VOID_IF_FAILED("Could not acquire ICoreApplicationExit object");
+ hr = appExit->Exit();
+ RETURN_VOID_IF_FAILED("Could not exit application");
+#endif // Q_OS_WINRT
}
/*****************************************************************************
@@ -2405,7 +2423,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QMutex, libraryPathMutex, (QMutex::Recursive))
INSTALL/plugins, where \c INSTALL is the directory where Qt was
installed). The directory of the application executable (NOT the
working directory) is always added, as well as the colon separated
- entries of the QT_PLUGIN_PATH environment variable.
+ entries of the \c QT_PLUGIN_PATH environment variable.
If you want to iterate over the list, you can use the \l foreach
pseudo-keyword:
@@ -2550,7 +2568,7 @@ void QCoreApplication::removeLibraryPath(const QString &path)
\note Native event filters will be disabled when the application the
Qt::AA_MacPluginApplication attribute is set.
- For maximum portability, you should always try to use QEvents
+ For maximum portability, you should always try to use QEvent
and QObject::installEventFilter() whenever possible.
\sa QObject::installEventFilter()
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index 301f123032..b2b22ad99c 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
send events using QCoreApplication::sendEvent() and
QCoreApplication::postEvent() (spontaneous() returns \c false).
- QObjects receive events by having their QObject::event() function
+ \l {QObject}{QObjects} receive events by having their QObject::event() function
called. The function can be reimplemented in subclasses to
customize event handling and add additional event types;
QWidget::event() is a notable example. By default, events are
@@ -102,13 +102,13 @@ QT_BEGIN_NAMESPACE
\value ChildAdded An object gets a child (QChildEvent).
\value ChildPolished A widget child gets polished (QChildEvent).
\value ChildRemoved An object loses a child (QChildEvent).
- \value Clipboard The clipboard contents have changed (QClipboardEvent).
+ \value Clipboard The clipboard contents have changed.
\value Close Widget was closed (QCloseEvent).
\value CloseSoftwareInputPanel A widget wants to close the software input panel (SIP).
\value ContentsRectChange The margins of the widget's content rect changed.
\value ContextMenu Context popup menu (QContextMenuEvent).
\value CursorChange The widget's cursor has changed.
- \value DeferredDelete The object will be deleted after it has cleaned up (QDeferredDeleteEvent).
+ \value DeferredDelete The object will be deleted after it has cleaned up (QDeferredDeleteEvent)
\value DragEnter The cursor enters a widget during a drag and drop operation (QDragEnterEvent).
\value DragLeave The cursor leaves a widget during a drag and drop operation (QDragLeaveEvent).
\value DragMove A drag and drop operation is in progress (QDragMoveEvent).
@@ -116,7 +116,7 @@ QT_BEGIN_NAMESPACE
\value DynamicPropertyChange A dynamic property was added, changed, or removed from the object.
\value EnabledChange Widget's enabled state has changed.
\value Enter Mouse enters widget's boundaries (QEnterEvent).
- \value EnterEditFocus An editor widget gains focus for editing. QT_KEYPAD_NAVIGATION must be defined.
+ \value EnterEditFocus An editor widget gains focus for editing. \c QT_KEYPAD_NAVIGATION must be defined.
\value EnterWhatsThisMode Send to toplevel widgets when the application enters "What's This?" mode.
\value Expose Sent to a window when its on-screen contents are invalidated and need to be flushed from the backing store.
\value FileOpen File open request (QFileOpenEvent).
@@ -177,7 +177,7 @@ QT_BEGIN_NAMESPACE
\value MouseTrackingChange The mouse tracking state has changed.
\value Move Widget's position changed (QMoveEvent).
\value NativeGesture The system has detected a gesture (QNativeGestureEvent).
- \value OrientationChange The screens orientation has changes (QScreenOrientationChangeEvent)
+ \value OrientationChange The screens orientation has changes (QScreenOrientationChangeEvent).
\value Paint Screen update necessary (QPaintEvent).
\value PaletteChange Palette of the widget changed.
\value ParentAboutToChange The widget parent is about to change.
diff --git a/src/corelib/kernel/qjni.cpp b/src/corelib/kernel/qjni.cpp
index a7f98bc532..694463b9d8 100644
--- a/src/corelib/kernel/qjni.cpp
+++ b/src/corelib/kernel/qjni.cpp
@@ -96,7 +96,7 @@ static jclass loadClassDotEnc(const QString &classDotEnc, JNIEnv *env)
if (clazz != 0 || isCached)
return clazz;
- QJNIObjectPrivate classLoader = QtAndroidPrivate::classLoader();
+ QJNIObjectPrivate classLoader(QtAndroidPrivate::classLoader());
if (!classLoader.isValid())
return 0;
@@ -2239,6 +2239,13 @@ bool QJNIObjectPrivate::isValid() const
return d->m_jobject;
}
+QJNIObjectPrivate QJNIObjectPrivate::fromLocalRef(jobject lref)
+{
+ QJNIObjectPrivate o(lref);
+ QJNIEnvironmentPrivate()->DeleteLocalRef(lref);
+ return o;
+}
+
bool QJNIObjectPrivate::isSameObject(jobject obj) const
{
QJNIEnvironmentPrivate env;
diff --git a/src/corelib/kernel/qjni_p.h b/src/corelib/kernel/qjni_p.h
index a7859a800f..e79caed5b8 100644
--- a/src/corelib/kernel/qjni_p.h
+++ b/src/corelib/kernel/qjni_p.h
@@ -84,7 +84,10 @@ public:
QJNIObjectPrivate(const char *className, const char *sig, ...);
explicit QJNIObjectPrivate(jclass clazz);
QJNIObjectPrivate(jclass clazz, const char *sig, ...);
- QJNIObjectPrivate(jobject obj);
+ // In most cases you should never call this function with a local ref. unless you intend
+ // to manage the local ref. yourself.
+ // NOTE: see fromLocalRef() for converting a local ref. to QJNIObjectPrivate.
+ explicit QJNIObjectPrivate(jobject globalRef);
template <typename T>
T callMethod(const char *methodName,
@@ -183,6 +186,9 @@ public:
return *this;
}
+ // This function takes ownership of the jobject and releases the local ref. before returning.
+ static QJNIObjectPrivate fromLocalRef(jobject lref);
+
private:
friend class QAndroidJniObject;
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 8f79bf5645..8adb4a4903 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -201,6 +201,8 @@ struct DefinedTypesFilter {
\enum QMetaType::Type
These are the built-in types supported by QMetaType:
+ Read doc on QChar
+ Read doc on \l QChar
\value Void \c void
\value Bool \c bool
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 98e3f6b5bd..265cc68db5 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -4106,20 +4106,6 @@ QDebug operator<<(QDebug dbg, const QObject *o)
dbg << ')';
return dbg;
}
-
-QDebug qt_QMetaEnum_debugOperator(QDebug &dbg, int value, const QMetaObject *meta, const char *name)
-{
- QDebugStateSaver saver(dbg);
- QMetaEnum me = meta->enumerator(meta->indexOfEnumerator(name));
- const char *key = me.valueToKey(value);
- dbg.nospace() << meta->className() << "::" << name << '(';
- if (key)
- dbg << key;
- else
- dbg << value;
- dbg << ')';
- return dbg;
-}
#endif
/*!
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index ae1c92f127..42d18d6c41 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -547,16 +547,6 @@ template <class T> inline const char * qobject_interface_iid()
#ifndef QT_NO_DEBUG_STREAM
Q_CORE_EXPORT QDebug operator<<(QDebug, const QObject *);
-Q_CORE_EXPORT QDebug qt_QMetaEnum_debugOperator(QDebug&, int value, const QMetaObject *meta, const char *name);
-
-template<typename T>
-typename QtPrivate::QEnableIf<QtPrivate::IsQEnumHelper<T>::Value , QDebug>::Type
-operator<<(QDebug &dbg, T value)
-{
- const QMetaObject *obj = qt_getEnumMetaObject(value);
- const char *name = qt_getEnumName(value);
- return qt_QMetaEnum_debugOperator(dbg, typename QFlags<T>::Int(value), obj, name);
-}
#endif
class QSignalBlocker
diff --git a/src/corelib/kernel/qpointer.cpp b/src/corelib/kernel/qpointer.cpp
index 2abed68826..2c872716d1 100644
--- a/src/corelib/kernel/qpointer.cpp
+++ b/src/corelib/kernel/qpointer.cpp
@@ -55,7 +55,7 @@
\li When using QPointer on a QWidget (or a subclass of QWidget), previously
the QPointer would be cleared by the QWidget destructor. Now, the QPointer
- is cleared by the QObject destructor (since this is when QWeakPointers are
+ is cleared by the QObject destructor (since this is when QWeakPointer objects are
cleared). Any QPointers tracking a widget will \b NOT be cleared before the
QWidget destructor destroys the children for the widget being tracked.
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index 3f98655988..b9109a96aa 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -91,7 +91,7 @@ QT_BEGIN_NAMESPACE
its work. This is the traditional way of implementing heavy work
in GUI applications, but as multithreading is nowadays becoming available on
more and more platforms, we expect that zero-millisecond
- QTimers will gradually be replaced by \l{QThread}s.
+ QTimer objects will gradually be replaced by \l{QThread}s.
\section1 Accuracy and Timer Resolution
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 34f4c6884f..3dc0805dd1 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -1410,13 +1410,13 @@ QVariant::QVariant(const char *val)
/*!
\fn QVariant::QVariant(const QMap<QString, QVariant> &val)
- Constructs a new variant with a map of QVariants, \a val.
+ Constructs a new variant with a map of \l {QVariant}s, \a val.
*/
/*!
\fn QVariant::QVariant(const QHash<QString, QVariant> &val)
- Constructs a new variant with a hash of QVariants, \a val.
+ Constructs a new variant with a hash of \l {QVariant}s, \a val.
*/
/*!
@@ -3610,7 +3610,7 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p)
Q_OBJECT macro.
If the QVariant contains a sequential container and \c{T} is QVariantList, the
- elements of the container will be converted into QVariants and returned as a QVariantList.
+ elements of the container will be converted into \l {QVariant}s and returned as a QVariantList.
\snippet code/src_corelib_kernel_qvariant.cpp 9