Merge branch 'stable' into dev

Change-Id: I7f0dab6bdb1f3cc1d3e6c30166ff6db9dfae37e9
This commit is contained in:
Sergio Ahumada 2013-01-09 11:49:43 +01:00
commit 63f24f6ba8
91 changed files with 59525 additions and 156 deletions

View File

@ -1,11 +1,15 @@
equals(MAKEFILE_GENERATOR, UNIX): \
equals(MAKEFILE_GENERATOR, UNIX) {
QMAKE_MAKE = make
else:equals(MAKEFILE_GENERATOR, MINGW): \
QMAKE_MAKE = mingw32-make
else:if(equals(MAKEFILE_GENERATOR, MSVC.NET)|equals(MAKEFILE_GENERATOR, MSBUILD)): \
} else:equals(MAKEFILE_GENERATOR, MINGW) {
!equals(QMAKE_HOST.os, Windows): \
QMAKE_MAKE = make
else: \
QMAKE_MAKE = mingw32-make
} else:if(equals(MAKEFILE_GENERATOR, MSVC.NET)|equals(MAKEFILE_GENERATOR, MSBUILD)) {
QMAKE_MAKE = nmake
else: \
} else {
error("Configure tests are not supported with the $$MAKEFILE_GENERATOR Makefile generator.")
}
# Ensure that a cache is present. If none was found on startup, this will create
# one in the build directory of the project which loads this feature.

View File

@ -223,8 +223,8 @@ MakefileGenerator::initOutPaths()
//some builtin directories
if(project->isEmpty("PRECOMPILED_DIR") && !project->isEmpty("OBJECTS_DIR"))
v["PRECOMPILED_DIR"] = v["OBJECTS_DIR"];
static const char * const dirs[] = { "OBJECTS_DIR", "DESTDIR", "QMAKE_PKGCONFIG_DESTDIR",
"SUBLIBS_DIR", "DLLDESTDIR", "QMAKE_LIBTOOL_DESTDIR",
static const char * const dirs[] = { "OBJECTS_DIR", "DESTDIR",
"SUBLIBS_DIR", "DLLDESTDIR",
"PRECOMPILED_DIR", 0 };
for (int x = 0; dirs[x]; x++) {
const ProKey dkey(dirs[x]);

View File

@ -665,20 +665,16 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
writeMakeQmake(t);
if(project->isEmpty("QMAKE_FAILED_REQUIREMENTS") && !project->isActiveConfig("no_autoqmake")) {
QString meta_files;
QStringList meta_files;
if(project->isActiveConfig("create_libtool") && project->first("TEMPLATE") == "lib" &&
!project->isActiveConfig("compile_libtool")) { //libtool
if(!meta_files.isEmpty())
meta_files += " ";
meta_files += libtoolFileName();
}
if(project->isActiveConfig("create_pc") && project->first("TEMPLATE") == "lib") { //pkg-config
if(!meta_files.isEmpty())
meta_files += " ";
meta_files += pkgConfigFileName();
}
if(!meta_files.isEmpty())
t << escapeDependencyPath(meta_files) << ": " << "\n\t"
t << escapeDependencyPaths(meta_files).join(" ") << ": " << "\n\t"
<< "@$(QMAKE) -prl " << buildArgs() << " " << project->projectFile() << endl;
}

View File

@ -53,7 +53,7 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
#ifdef qdoc
#ifdef Q_QDOC
namespace QtConcurrent {
@ -258,7 +258,7 @@ OutputSequence blockingFiltered(Iterator begin, Iterator end, KeepFunctor keep)
} // namespace QtConcurrent
#endif // qdoc
#endif // Q_QDOC
QT_END_NAMESPACE
QT_END_HEADER

View File

@ -54,7 +54,7 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
#ifndef qdoc
#ifndef Q_QDOC
namespace QtConcurrent {
@ -340,7 +340,7 @@ inline ThreadEngineStarter<ResultType> startFilteredReduced(Iterator begin, Iter
} // namespace QtConcurrent
#endif // qdoc
#endif // Q_QDOC
QT_END_NAMESPACE
QT_END_HEADER

View File

@ -51,7 +51,7 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
#ifndef qdoc
#ifndef Q_QDOC
namespace QtConcurrent {
@ -294,7 +294,7 @@ struct MapResultType<QStringList, U(C::*)() const>
} // namespace QtPrivate.
#endif //qdoc
#endif //Q_QDOC
QT_END_NAMESPACE
QT_END_HEADER

View File

@ -56,7 +56,7 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
#ifndef qdoc
#ifndef Q_QDOC
namespace QtConcurrent {
@ -300,7 +300,7 @@ public:
} // namespace QtConcurrent
#endif //qdoc
#endif //Q_QDOC
QT_END_NAMESPACE
QT_END_HEADER

View File

@ -55,7 +55,7 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
#ifdef qdoc
#ifdef Q_QDOC
namespace QtConcurrent {
@ -309,7 +309,7 @@ typename QtPrivate::MapResultType<Iterator, MapFunctor>::ResultType blockingMapp
} // namespace QtConcurrent
#endif // qdoc
#endif // Q_QDOC
QT_END_NAMESPACE
QT_END_HEADER

View File

@ -53,7 +53,7 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
#ifndef qdoc
#ifndef Q_QDOC
namespace QtConcurrent {
// map kernel, works with both parallel-for and parallel-while
@ -262,7 +262,7 @@ inline ThreadEngineStarter<ResultType> startMappedReduced(Iterator begin, Iterat
} // namespace QtConcurrent
#endif //qdoc
#endif //Q_QDOC
QT_END_NAMESPACE
QT_END_HEADER

View File

@ -53,7 +53,7 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
#ifndef qdoc
#ifndef Q_QDOC
namespace QtConcurrent {
@ -119,7 +119,7 @@ private:
} // namespace QtConcurrent
#endif //qdoc
#endif //Q_QDOC
QT_END_NAMESPACE
QT_END_HEADER

View File

@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
namespace QtConcurrent {
#ifndef qdoc
#ifndef Q_QDOC
/*
The ReduceQueueStartLimit and ReduceQueueThrottleLimit constants
@ -85,7 +85,7 @@ public:
QVector<T> vector;
};
#endif // qdoc
#endif // Q_QDOC
enum ReduceOption {
UnorderedReduce = 0x1,
@ -96,7 +96,7 @@ enum ReduceOption {
Q_DECLARE_FLAGS(ReduceOptions, ReduceOption)
Q_DECLARE_OPERATORS_FOR_FLAGS(ReduceOptions)
#ifndef qdoc
#ifndef Q_QDOC
// supports both ordered and out-of-order reduction
template <typename ReduceFunctor, typename ReduceResultType, typename T>
@ -242,7 +242,7 @@ struct SequenceHolder2 : public Base
}
};
#endif //qdoc
#endif //Q_QDOC
} // namespace QtConcurrent

View File

@ -54,7 +54,7 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
#ifdef qdoc
#ifdef Q_QDOC
namespace QtConcurrent {
@ -337,7 +337,7 @@ QFuture<T> run(const Class *object, T (Class::*fn)(Param1, Param2, Param3, Param
} //namespace QtConcurrent
#endif // qdoc
#endif // Q_QDOC
QT_END_NAMESPACE
QT_END_HEADER

View File

@ -54,7 +54,7 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
#ifndef qdoc
#ifndef Q_QDOC
namespace QtConcurrent {
@ -144,7 +144,7 @@ public:
} //namespace QtConcurrent
#endif //qdoc
#endif //Q_QDOC
QT_END_NAMESPACE
QT_END_HEADER

View File

@ -52,7 +52,7 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
#ifndef qdoc
#ifndef Q_QDOC
namespace QtConcurrent {
template <typename T, typename FunctionPointer>
@ -1302,7 +1302,7 @@ private:
} //namespace QtConcurrent
#endif // qdoc
#endif // Q_QDOC
QT_END_NAMESPACE
QT_END_HEADER

View File

@ -58,7 +58,7 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
#ifndef qdoc
#ifndef Q_QDOC
namespace QtConcurrent {
@ -270,7 +270,7 @@ inline ThreadEngineStarter<typename ThreadEngine::ResultType> startThreadEngine(
} // namespace QtConcurrent
#endif //qdoc
#endif //Q_QDOC
QT_END_NAMESPACE
QT_END_HEADER

View File

@ -673,6 +673,7 @@
# endif
# if _MSC_VER >= 1600
/* C++11 features supported in VC10 = VC2010: */
# define Q_COMPILER_AUTO_FUNCTION
# define Q_COMPILER_AUTO_TYPE
# define Q_COMPILER_LAMBDA
# define Q_COMPILER_DECLTYPE

View File

@ -85,7 +85,7 @@ class QFlags
struct Private;
typedef int (Private::*Zero);
public:
#ifndef qdoc
#ifndef Q_QDOC
typedef typename QtPrivate::if_<
QtPrivate::is_unsigned<Enum>::value,
unsigned int,
@ -94,7 +94,7 @@ public:
#endif
typedef Enum enum_type;
// compiler-generated copy/move ctor/assignment operators are fine!
#ifdef qdoc
#ifdef Q_QDOC
typedef int Int; // the real typedef above is too complex for qdoc
inline QFlags(const QFlags &other);
inline QFlags &operator=(const QFlags &other);

View File

@ -70,7 +70,7 @@ public:
BigEndian,
LittleEndian
# ifdef qdoc
# ifdef Q_QDOC
, ByteOrder = <platform-dependent>
# elif Q_BYTE_ORDER == Q_BIG_ENDIAN
, ByteOrder = BigEndian

View File

@ -369,7 +369,7 @@ Q_OUTOFLINE_TEMPLATE QDataStream &operator<<(QDataStream &out, const QHash<Key,
}
return out;
}
#ifdef qdoc
#ifdef Q_QDOC
template <class Key, class T>
Q_OUTOFLINE_TEMPLATE QDataStream &operator>>(QDataStream &in, QMap<Key, T> &map)
#else

View File

@ -73,12 +73,12 @@ public:
Q_SIGNALS:
void fileChanged(const QString &path
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);
void directoryChanged(const QString &path
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);

View File

@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_PROCESS
#if !defined(Q_OS_WIN) || defined(qdoc)
#if !defined(Q_OS_WIN) || defined(Q_QDOC)
typedef qint64 Q_PID;
#else
QT_END_NAMESPACE
@ -211,7 +211,7 @@ public Q_SLOTS:
Q_SIGNALS:
void started(
#if !defined(qdoc)
#if !defined(Q_QDOC)
QPrivateSignal
#endif
);
@ -219,18 +219,18 @@ Q_SIGNALS:
void finished(int exitCode, QProcess::ExitStatus exitStatus);
void error(QProcess::ProcessError error);
void stateChanged(QProcess::ProcessState state
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);
void readyReadStandardOutput(
#if !defined(qdoc)
#if !defined(Q_QDOC)
QPrivateSignal
#endif
);
void readyReadStandardError(
#if !defined(qdoc)
#if !defined(Q_QDOC)
QPrivateSignal
#endif
);

View File

@ -154,7 +154,7 @@ public:
FullyDecoded = FullyEncoded | DecodeReserved | 0x4000000
};
Q_DECLARE_FLAGS(ComponentFormattingOptions, ComponentFormattingOption)
#ifdef qdoc
#ifdef Q_QDOC
Q_DECLARE_FLAGS(FormattingOptions, UrlFormattingOption)
#else
typedef QUrlTwoFlags<UrlFormattingOption, ComponentFormattingOption> FormattingOptions;

View File

@ -252,78 +252,78 @@ Q_SIGNALS:
void layoutAboutToBeChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint);
void rowsAboutToBeInserted(const QModelIndex &parent, int first, int last
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);
void rowsInserted(const QModelIndex &parent, int first, int last
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);
void rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);
void rowsRemoved(const QModelIndex &parent, int first, int last
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);
void columnsAboutToBeInserted(const QModelIndex &parent, int first, int last
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);
void columnsInserted(const QModelIndex &parent, int first, int last
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);
void columnsAboutToBeRemoved(const QModelIndex &parent, int first, int last
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);
void columnsRemoved(const QModelIndex &parent, int first, int last
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);
void modelAboutToBeReset(
#if !defined(qdoc)
#if !defined(Q_QDOC)
QPrivateSignal
#endif
);
void modelReset(
#if !defined(qdoc)
#if !defined(Q_QDOC)
QPrivateSignal
#endif
);
void rowsAboutToBeMoved( const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);
void rowsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);
void columnsAboutToBeMoved( const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);
void columnsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);

View File

@ -161,7 +161,7 @@ public Q_SLOTS:
Q_SIGNALS:
void aboutToQuit(
#if !defined(qdoc)
#if !defined(Q_QDOC)
QPrivateSignal
#endif
);

View File

@ -574,7 +574,7 @@ namespace QtPrivate {
template <typename T>
int qRegisterNormalizedMetaType(const QT_PREPEND_NAMESPACE(QByteArray) &normalizedTypeName
#ifndef qdoc
#ifndef Q_QDOC
, T * dummy = 0
, typename QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::DefinedType defined = QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::Defined
#endif
@ -604,7 +604,7 @@ int qRegisterNormalizedMetaType(const QT_PREPEND_NAMESPACE(QByteArray) &normaliz
template <typename T>
int qRegisterMetaType(const char *typeName
#ifndef qdoc
#ifndef Q_QDOC
, T * dummy = 0
, typename QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::DefinedType defined = QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::Defined
#endif
@ -621,7 +621,7 @@ int qRegisterMetaType(const char *typeName
#ifndef QT_NO_DATASTREAM
template <typename T>
void qRegisterMetaTypeStreamOperators(const char *typeName
#ifndef qdoc
#ifndef Q_QDOC
, T * /* dummy */ = 0
#endif
)
@ -634,7 +634,7 @@ void qRegisterMetaTypeStreamOperators(const char *typeName
template <typename T>
inline Q_DECL_CONSTEXPR int qMetaTypeId(
#ifndef qdoc
#ifndef Q_QDOC
T * /* dummy */ = 0
#endif
)
@ -645,7 +645,7 @@ inline Q_DECL_CONSTEXPR int qMetaTypeId(
template <typename T>
inline Q_DECL_CONSTEXPR int qRegisterMetaType(
#if !defined(qdoc) && !defined(Q_CC_SUN)
#if !defined(Q_QDOC) && !defined(Q_CC_SUN)
T * dummy = 0
#endif
)

View File

@ -125,7 +125,7 @@ public:
virtual bool event(QEvent *);
virtual bool eventFilter(QObject *, QEvent *);
#ifdef qdoc
#ifdef Q_QDOC
static QString tr(const char *sourceText, const char *comment = 0, int n = -1);
static QString trUtf8(const char *sourceText, const char *comment = 0, int n = -1);
virtual const QMetaObject *metaObject() const;
@ -367,7 +367,7 @@ public:
Q_SIGNALS:
void destroyed(QObject * = 0);
void objectNameChanged(const QString &objectName
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);
@ -438,7 +438,7 @@ public:
};
#endif
#ifdef qdoc
#ifdef Q_QDOC
T qFindChild(const QObject *o, const QString &name = QString());
QList<T> qFindChildren(const QObject *oobj, const QString &name = QString());
QList<T> qFindChildren(const QObject *o, const QRegExp &re);

View File

@ -95,7 +95,7 @@ public:
{ return *data(); }
inline operator T*() const
{ return data(); }
#ifdef qdoc
#ifdef Q_QDOC
inline bool isNull() const;
inline void clear();
#else

View File

@ -70,7 +70,7 @@ public Q_SLOTS:
Q_SIGNALS:
void activated(int socket
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);

View File

@ -117,7 +117,7 @@ static int qt_eval_days_left()
QDate today = QDate::currentDate();
QDate build = QLibraryInfo::buildDate();
return qMax(-1, today.daysTo(build) + 30);
return qMax<qint64>(-1, today.daysTo(build) + 30);
}
static QString qt_eval_string()
@ -198,7 +198,7 @@ void qt_core_eval_init(uint type)
}
#endif
#ifdef QT_BUILD_GUI_LIB
#ifdef QT_BUILD_WIDGETS_LIB
QT_BEGIN_INCLUDE_NAMESPACE
#include <qdialog.h>
@ -464,7 +464,7 @@ public:
QFrame *border = new QFrame(this);
QLabel *pixmap_label = new QLabel(border);
pixmap_label->setPixmap(qtlogo_eval_xpm);
pixmap_label->setPixmap(QPixmap(qtlogo_eval_xpm));
pixmap_label->setAlignment(Qt::AlignTop);
QLabel *text_label = new QLabel(str, border);

View File

@ -89,7 +89,7 @@ public Q_SLOTS:
Q_SIGNALS:
void timeout(
#if !defined(qdoc)
#if !defined(Q_QDOC)
QPrivateSignal
#endif
);

View File

@ -357,7 +357,7 @@ class Q_CORE_EXPORT QVariant
{ return canConvert(qMetaTypeId<T>()); }
public:
#ifndef qdoc
#ifndef Q_QDOC
struct PrivateShared
{
inline PrivateShared(void *v) : ptr(v), ref(1) { }
@ -535,7 +535,7 @@ inline bool QVariant::isDetached() const
{ return !d.is_shared || d.data.shared->ref.load() == 1; }
#ifdef qdoc
#ifdef Q_QDOC
inline bool operator==(const QVariant &v1, const QVariant &v2);
inline bool operator!=(const QVariant &v1, const QVariant &v2);
#else

View File

@ -72,7 +72,7 @@ public Q_SLOTS:
Q_SIGNALS:
void activated(HANDLE hEvent
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);

View File

@ -60,7 +60,7 @@ extern QString qt_error_string(int code);
QStringList QLibraryPrivate::suffixes_sys(const QString& fullVersion)
{
Q_UNUSED(fullVersion);
return QStringList() << ".dll";
return QStringList(QStringLiteral(".dll"));
}
QStringList QLibraryPrivate::prefixes_sys()

View File

@ -66,12 +66,12 @@ public:
Q_SIGNALS:
void entered(
#if !defined(qdoc)
#if !defined(Q_QDOC)
QPrivateSignal
#endif
);
void exited(
#if !defined(qdoc)
#if !defined(Q_QDOC)
QPrivateSignal
#endif
);

View File

@ -89,7 +89,7 @@ public:
Q_SIGNALS:
void triggered(
#if !defined(qdoc)
#if !defined(Q_QDOC)
QPrivateSignal
#endif
);

View File

@ -101,12 +101,12 @@ public:
Q_SIGNALS:
void finished(
#if !defined(qdoc)
#if !defined(Q_QDOC)
QPrivateSignal
#endif
);
void propertiesAssigned(
#if !defined(qdoc)
#if !defined(Q_QDOC)
QPrivateSignal
#endif
);

View File

@ -154,12 +154,12 @@ public Q_SLOTS:
Q_SIGNALS:
void started(
#if !defined(qdoc)
#if !defined(Q_QDOC)
QPrivateSignal
#endif
);
void stopped(
#if !defined(qdoc)
#if !defined(Q_QDOC)
QPrivateSignal
#endif
);

View File

@ -81,7 +81,7 @@ public:
return *this;
}
#ifdef qdoc
#ifdef Q_QDOC
int load() const;
int loadAcquire() const;
void store(int newValue);
@ -143,7 +143,7 @@ public:
return *this;
}
#ifdef qdoc
#ifdef Q_QDOC
T *load() const;
T *loadAcquire() const;
void store(T *newValue);

View File

@ -137,7 +137,7 @@ QUnhandledException *QUnhandledException::clone() const
return new QUnhandledException(*this);
}
#ifndef qdoc
#ifndef Q_QDOC
namespace QtPrivate {
@ -200,7 +200,7 @@ bool ExceptionStore::hasThrown() const { return exceptionHolder.base->hasThrown;
} // namespace QtPrivate
#endif //qdoc
#endif //Q_QDOC
QT_END_NAMESPACE

View File

@ -131,7 +131,7 @@ public:
T result() const { return m_future.result(); }
T resultAt(int index) const { return m_future.resultAt(index); }
#ifdef qdoc
#ifdef Q_QDOC
int progressValue() const;
int progressMinimum() const;
int progressMaximum() const;

View File

@ -51,7 +51,7 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
#if !defined(QT_NO_THREAD) && !defined(qdoc)
#if !defined(QT_NO_THREAD) && !defined(Q_QDOC)
#ifdef Q_OS_LINUX
# define QT_MUTEX_LOCK_NOEXCEPT Q_DECL_NOTHROW
@ -173,7 +173,7 @@ private:
quintptr val;
};
#else // QT_NO_THREAD or qdoc
#else // QT_NO_THREAD or Q_QDOC
class Q_CORE_EXPORT QMutex
{
@ -207,7 +207,7 @@ private:
typedef QMutex QBasicMutex;
#endif // QT_NO_THREAD or qdoc
#endif // QT_NO_THREAD or Q_QDOC
QT_END_NAMESPACE

View File

@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
either individually or in batches.
*/
#ifndef qdoc
#ifndef Q_QDOC
namespace QtPrivate {
@ -231,7 +231,7 @@ public:
} // namespace QtPrivate
#endif //qdoc
#endif //Q_QDOC
QT_END_NAMESPACE
QT_END_HEADER

View File

@ -113,12 +113,12 @@ public:
Q_SIGNALS:
void started(
#if !defined(qdoc)
#if !defined(Q_QDOC)
QPrivateSignal
#endif
);
void finished(
#if !defined(qdoc)
#if !defined(Q_QDOC)
QPrivateSignal
#endif
);

View File

@ -140,7 +140,7 @@ inline void qCount(const Container &container, const T &value, Size &n)
qCount(container.constBegin(), container.constEnd(), value, n);
}
#ifdef qdoc
#ifdef Q_QDOC
template <typename T>
LessThan qLess()
{

View File

@ -126,22 +126,22 @@ public Q_SLOTS:
Q_SIGNALS:
void valueChanged(qreal x
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);
void frameChanged(int
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);
void stateChanged(QTimeLine::State newState
#if !defined(qdoc)
#if !defined(Q_QDOC)
, QPrivateSignal
#endif
);
void finished(
#if !defined(qdoc)
#if !defined(Q_QDOC)
QPrivateSignal
#endif
);

View File

@ -76,7 +76,7 @@ void qDBusDemarshallHelper(const QDBusArgument &arg, T *t)
template<typename T>
int qDBusRegisterMetaType(
#ifndef qdoc
#ifndef Q_QDOC
T * /* dummy */ = 0
#endif
)

View File

@ -64,7 +64,7 @@ class QWindow;
// We need to inherit QObject to expose the enums to QML.
class Q_GUI_EXPORT QAccessible
#ifndef qdoc
#ifndef Q_QDOC
:public QObject
#endif
{
@ -269,7 +269,7 @@ public:
StaticText = 0x00000029,
EditableText = 0x0000002A, // Editable, selectable, etc.
Button = 0x0000002B,
#ifndef qdoc
#ifndef Q_QDOC
PushButton = Button, // deprecated
#endif
CheckBox = 0x0000002C,

View File

@ -122,7 +122,7 @@ public:
Format_Grayscale2,
Format_Grayscale2LSB
#endif
#ifndef qdoc
#ifndef Q_QDOC
NImageFormats
#endif
};

View File

@ -61,7 +61,7 @@ Q_GUI_EXPORT QDataStream &operator<<(QDataStream &in, const QKeySequence &ks);
Q_GUI_EXPORT QDataStream &operator>>(QDataStream &out, QKeySequence &ks);
#endif
#ifdef qdoc
#ifdef Q_QDOC
void qt_set_sequence_auto_mnemonic(bool b);
#endif

View File

@ -96,7 +96,7 @@ NEON_HEADERS += painting/qdrawhelper_neon_p.h
NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S
MIPS_DSP_SOURCES += painting/qdrawhelper_mips_dsp.cpp
MIPS_DSP_HEADERS += painting/qdrawhelper_mips_dsp_p.h painting/qt_mips_asm_dsp.h
MIPS_DSP_HEADERS += painting/qdrawhelper_mips_dsp_p.h painting/qt_mips_asm_dsp_p.h
MIPS_DSP_ASM += painting/qdrawhelper_mips_dsp_asm.S
MIPS_DSPR2_ASM += painting/qdrawhelper_mips_dspr2_asm.S

View File

@ -39,7 +39,7 @@
**
****************************************************************************/
#include "qt_mips_asm_dsp.h"
#include "qt_mips_asm_dsp_p.h"
LEAF_MIPS_DSP(destfetchARGB32_asm_mips_dsp)
/*

View File

@ -42,6 +42,17 @@
#ifndef QDRAWHELPER_MIPS_DSP_P_H
#define QDRAWHELPER_MIPS_DSP_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <private/qdrawhelper_p.h>
QT_BEGIN_NAMESPACE

View File

@ -39,7 +39,7 @@
**
****************************************************************************/
#include "qt_mips_asm_dsp.h"
#include "qt_mips_asm_dsp_p.h"
LEAF_MIPS_DSPR2(qConvertRgb16To32_asm_mips_dspr2)
/*

View File

@ -57,7 +57,6 @@ QT_BEGIN_NAMESPACE
#define Q_TRIANGULATE_END_OF_POLYGON quint32(-1)
namespace {
//============================================================================//
// QPoint //
@ -83,6 +82,8 @@ inline bool operator >= (const QPoint &a, const QPoint &b)
return !(a < b);
}
namespace {
inline int cross(const QPoint &u, const QPoint &v)
{
return u.x() * v.y() - u.y() * v.x();

View File

@ -42,6 +42,17 @@
#ifndef QT_MIPS_ASM_DSP_H
#define QT_MIPS_ASM_DSP_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#if 0
#pragma qt_sync_stop_processing
#endif

View File

@ -52,6 +52,7 @@ QT_BEGIN_HEADER
class QShapedPixmapWindow : public QWindow
{
Q_OBJECT
public:
QShapedPixmapWindow();

View File

@ -68,6 +68,17 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_DRAGANDDROP
static QWindow* topLevelAt(const QPoint &pos)
{
QWindowList list = QGuiApplication::topLevelWindows();
for (int i = list.count()-1; i >= 0; --i) {
QWindow *w = list.at(i);
if (w->isVisible() && w->geometry().contains(pos) && !qobject_cast<QShapedPixmapWindow*>(w))
return w;
}
return 0;
}
/*!
\class QBasicDrag
\brief QBasicDrag is a base class for implementing platform drag and drop.
@ -298,7 +309,7 @@ QMimeData *QSimpleDrag::platformDropData()
void QSimpleDrag::startDrag()
{
QBasicDrag::startDrag();
m_current_window = QGuiApplication::topLevelAt(QCursor::pos());
m_current_window = topLevelAt(QCursor::pos());
if (m_current_window) {
QPlatformDragQtResponse response = QWindowSystemInterface::handleDrag(m_current_window, drag()->mimeData(), QCursor::pos(), drag()->supportedActions());
setCanDrop(response.isAccepted());
@ -321,7 +332,7 @@ void QSimpleDrag::cancel()
void QSimpleDrag::move(const QMouseEvent *me)
{
QBasicDrag::move(me);
QWindow *window = QGuiApplication::topLevelAt(me->globalPos());
QWindow *window = topLevelAt(me->globalPos());
if (!window)
return;
@ -336,7 +347,7 @@ void QSimpleDrag::move(const QMouseEvent *me)
void QSimpleDrag::drop(const QMouseEvent *me)
{
QBasicDrag::drop(me);
QWindow *window = QGuiApplication::topLevelAt(me->globalPos());
QWindow *window = topLevelAt(me->globalPos());
if (!window)
return;

View File

@ -186,7 +186,10 @@ void QQnxClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
if (mode != QClipboard::Clipboard)
return;
if (data == m_mimeData || data == m_mimeData->userMimeData())
if (m_mimeData == data)
return;
if (m_mimeData->userMimeData() && m_mimeData->userMimeData() == data)
return;
empty_clipboard();
@ -194,8 +197,10 @@ void QQnxClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
m_mimeData->clear();
m_mimeData->setUserMimeData(data);
if (data == 0)
if (data == 0) {
emitChanged(QClipboard::Clipboard);
return;
}
const QStringList formats = data->formats();
qClipboardDebug() << Q_FUNC_INFO << "formats=" << formats;

View File

@ -91,7 +91,7 @@ public:
#endif
void open(QObject *receiver, const char *member);
#ifdef qdoc
#ifdef Q_QDOC
QPrinter *printer();
#endif

View File

@ -221,7 +221,7 @@ public:
QRectF paperRect(Unit) const;
QRectF pageRect(Unit) const;
#if !defined(Q_OS_WIN) || defined(qdoc)
#if !defined(Q_OS_WIN) || defined(Q_QDOC)
QString printerSelectionOption() const;
void setPrinterSelectionOption(const QString &);
#endif

View File

@ -249,7 +249,7 @@ namespace QTest
Q_TESTLIB_EXPORT bool compare_string_helper(const char *t1, const char *t2, const char *actual,
const char *expected, const char *file, int line);
#ifndef qdoc
#ifndef Q_QDOC
QTEST_COMPARE_DECL(short)
QTEST_COMPARE_DECL(ushort)
QTEST_COMPARE_DECL(int)

View File

@ -292,7 +292,7 @@ public:
Q_SIGNALS:
void buttonClicked(QAbstractButton *button);
#ifdef qdoc
#ifdef Q_QDOC
public Q_SLOTS:
int exec();
#endif

View File

@ -86,6 +86,20 @@ qreal dpiScaled(qreal value)
#endif
}
bool isInstanceOf(QObject *obj, QAccessible::Role role)
{
bool match = false;
#ifndef QT_NO_ACCESSIBILITY
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(obj);
match = iface && iface->role() == role;
delete iface;
#else
Q_UNUSED(obj)
Q_UNUSED(role)
#endif // QT_NO_ACCESSIBILITY
return match;
}
// Searches for an ancestor of a particular accessible role
bool hasAncestor(QObject *obj, QAccessible::Role role)
{
@ -93,10 +107,8 @@ bool hasAncestor(QObject *obj, QAccessible::Role role)
#ifndef QT_NO_ACCESSIBILITY
QObject *parent = obj ? obj->parent() : 0;
while (parent && !found) {
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(parent);
if (iface && iface->role() == role)
if (isInstanceOf(parent, role))
found = true;
delete iface;
parent = parent->parent();
}
#else

View File

@ -82,6 +82,7 @@ namespace QStyleHelper
void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rect,
int left = 0, int top = 0, int right = 0,
int bottom = 0);
bool isInstanceOf(QObject *obj, QAccessible::Role role);
bool hasAncestor(QObject *obj, QAccessible::Role role);
}

View File

@ -502,29 +502,33 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
}
break;
case PE_Frame: {
painter->save();
int stateId = ETS_NORMAL;
if (!(state & State_Enabled))
stateId = ETS_DISABLED;
else if (state & State_ReadOnly)
stateId = ETS_READONLY;
else if (state & State_HasFocus)
stateId = ETS_SELECTED;
XPThemeData theme(widget, painter,
QWindowsXPStylePrivate::EditTheme,
EP_EDITBORDER_HVSCROLL, stateId, option->rect);
uint resolve_mask = option->palette.resolve();
if (resolve_mask & (1 << QPalette::Base)) {
// Since EP_EDITBORDER_HVSCROLL does not us borderfill, theme.noContent cannot be used for clipping
int borderSize = 1;
pGetThemeInt(theme.handle(), theme.partId, theme.stateId, TMT_BORDERSIZE, &borderSize);
QRegion clipRegion = option->rect;
QRegion content = option->rect.adjusted(borderSize, borderSize, -borderSize, -borderSize);
clipRegion ^= content;
painter->setClipRegion(clipRegion);
if (QStyleHelper::isInstanceOf(option->styleObject, QAccessible::EditableText)) {
painter->save();
int stateId = ETS_NORMAL;
if (!(state & State_Enabled))
stateId = ETS_DISABLED;
else if (state & State_ReadOnly)
stateId = ETS_READONLY;
else if (state & State_HasFocus)
stateId = ETS_SELECTED;
XPThemeData theme(widget, painter,
QWindowsXPStylePrivate::EditTheme,
EP_EDITBORDER_HVSCROLL, stateId, option->rect);
uint resolve_mask = option->palette.resolve();
if (resolve_mask & (1 << QPalette::Base)) {
// Since EP_EDITBORDER_HVSCROLL does not us borderfill, theme.noContent cannot be used for clipping
int borderSize = 1;
pGetThemeInt(theme.handle(), theme.partId, theme.stateId, TMT_BORDERSIZE, &borderSize);
QRegion clipRegion = option->rect;
QRegion content = option->rect.adjusted(borderSize, borderSize, -borderSize, -borderSize);
clipRegion ^= content;
painter->setClipRegion(clipRegion);
}
d->drawBackground(theme);
painter->restore();
} else {
QWindowsXPStyle::drawPrimitive(element, option, painter, widget);
}
d->drawBackground(theme);
painter->restore();
}
break;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -60,6 +60,7 @@
#include <QtNetwork/QAbstractNetworkCache>
#include <QtNetwork/qauthenticator.h>
#include <QtNetwork/qnetworkaccessmanager.h>
#include <QtNetwork/qnetworkdiskcache.h>
#include <QtNetwork/qnetworkrequest.h>
#include <QtNetwork/qnetworkreply.h>
#include <QtNetwork/qnetworkcookie.h>
@ -379,6 +380,8 @@ private Q_SLOTS:
void qtbug27161httpHeaderMayBeDamaged_data();
void qtbug27161httpHeaderMayBeDamaged();
void qtbug28035browserDoesNotLoadQtProjectOrgCorrectly();
void synchronousRequest_data();
void synchronousRequest();
#ifndef QT_NO_SSL
@ -510,6 +513,11 @@ public:
}
}
void setDataToTransmit(const QByteArray &data)
{
dataToTransmit = data;
}
protected:
void incomingConnection(qintptr socketDescriptor)
{
@ -6516,6 +6524,123 @@ void tst_QNetworkReply::qtbug27161httpHeaderMayBeDamaged(){
QCOMPARE(reply->readAll(), QByteArray("ABC"));
}
void tst_QNetworkReply::qtbug28035browserDoesNotLoadQtProjectOrgCorrectly() {
QByteArray getReply =
"HTTP/1.1 200\r\n"
"Connection: keep-alive\r\n"
"Content-Type: text/plain\r\n"
"Cache-control: max-age = 6000\r\n"
"\r\n"
"GET";
QByteArray postReply =
"HTTP/1.1 200\r\n"
"Connection: keep-alive\r\n"
"Content-Type: text/plain\r\n"
"Cache-control: max-age = 6000\r\n"
"Content-length: 4\r\n"
"\r\n"
"POST";
QByteArray putReply =
"HTTP/1.1 201\r\n"
"Connection: keep-alive\r\n"
"Content-Type: text/plain\r\n"
"Cache-control: max-age = 6000\r\n"
"\r\n";
QByteArray postData = "ACT=100";
QTemporaryDir tempDir(QDir::tempPath() + "/tmp_cache_28035");
tempDir.setAutoRemove(true);
QNetworkDiskCache *diskCache = new QNetworkDiskCache();
diskCache->setCacheDirectory(tempDir.path());
manager.setCache(diskCache);
MiniHttpServer server(getReply);
QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort())));
QNetworkReplyPtr reply(manager.get(request));
QVERIFY(waitForFinish(reply) == Success);
QVERIFY(reply->isFinished());
QCOMPARE(reply->error(), QNetworkReply::NoError);
QCOMPARE(reply->readAll(), QByteArray("GET"));
QCOMPARE(reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(), false);
server.setDataToTransmit(getReply);
reply.reset(manager.get(request));
QVERIFY(waitForFinish(reply) == Success);
QVERIFY(reply->isFinished());
QCOMPARE(reply->error(), QNetworkReply::NoError);
QCOMPARE(reply->readAll(), QByteArray("GET"));
QCOMPARE(reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(), true);
server.setDataToTransmit(postReply);
request.setRawHeader("Content-Type", "text/plain");
reply.reset(manager.post(request, postData));
QVERIFY(waitForFinish(reply) == Success);
QVERIFY(reply->isFinished());
QCOMPARE(reply->error(), QNetworkReply::NoError);
QCOMPARE(reply->rawHeader("Content-length"), QByteArray("4"));
QCOMPARE(reply->readAll(), QByteArray("POST"));
QCOMPARE(reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(), false);
server.setDataToTransmit(getReply);
reply.reset(manager.get(request));
QVERIFY(waitForFinish(reply) == Success);
QVERIFY(reply->isFinished());
QCOMPARE(reply->error(), QNetworkReply::NoError);
QCOMPARE(reply->readAll(), QByteArray("GET"));
QCOMPARE(reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(), false);
server.setDataToTransmit(getReply);
reply.reset(manager.get(request));
QVERIFY(waitForFinish(reply) == Success);
QVERIFY(reply->isFinished());
QCOMPARE(reply->error(), QNetworkReply::NoError);
QCOMPARE(reply->readAll(), QByteArray("GET"));
QCOMPARE(reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(), true);
server.setDataToTransmit(putReply);
reply.reset(manager.put(request, postData));
QVERIFY(waitForFinish(reply) == Success);
QVERIFY(reply->isFinished());
QCOMPARE(reply->error(), QNetworkReply::NoError);
QCOMPARE(reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(), false);
server.setDataToTransmit(getReply);
reply.reset(manager.get(request));
QVERIFY(waitForFinish(reply) == Success);
QVERIFY(reply->isFinished());
QCOMPARE(reply->error(), QNetworkReply::NoError);
QCOMPARE(reply->readAll(), QByteArray("GET"));
QCOMPARE(reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(), false);
server.setDataToTransmit(getReply);
reply.reset(manager.get(request));
QVERIFY(waitForFinish(reply) == Success);
QVERIFY(reply->isFinished());
QCOMPARE(reply->error(), QNetworkReply::NoError);
QCOMPARE(reply->readAll(), QByteArray("GET"));
QCOMPARE(reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(), true);
}
void tst_QNetworkReply::synchronousRequest_data()
{
QTest::addColumn<QUrl>("url");

View File

@ -172,10 +172,10 @@ void tst_QDialog::showExtension_data()
QTest::addColumn<QSize>("result");
//next we fill it with data
QTest::newRow( "data0" ) << QSize(100,100) << QSize(50,50) << false << QSize(100,150);
QTest::newRow( "data1" ) << QSize(100,100) << QSize(120,50) << false << QSize(120,150);
QTest::newRow( "data2" ) << QSize(100,100) << QSize(50,50) << true << QSize(150,100);
QTest::newRow( "data3" ) << QSize(100,100) << QSize(50,120) << true << QSize(150,120);
QTest::newRow( "data0" ) << QSize(200,100) << QSize(50,50) << false << QSize(200,150);
QTest::newRow( "data1" ) << QSize(200,100) << QSize(220,50) << false << QSize(220,150);
QTest::newRow( "data2" ) << QSize(200,100) << QSize(50,50) << true << QSize(250,100);
QTest::newRow( "data3" ) << QSize(200,100) << QSize(50,120) << true << QSize(250,120);
}
void tst_QDialog::showExtension()

View File

@ -7890,6 +7890,7 @@ void tst_QGraphicsItem::itemUsesExtendedStyleOption()
scene.addItem(rect);
rect->setPos(200, 200);
QWidget topLevel;
topLevel.resize(200, 200);
QGraphicsView view(&scene, &topLevel);
topLevel.setWindowFlags(Qt::X11BypassWindowManagerHint);
rect->startTrack = false;

View File

@ -133,6 +133,14 @@ class FriendlyGraphicsScene : public QGraphicsScene
};
#endif
static inline void setFrameless(QWidget *w)
{
Qt::WindowFlags flags = w->windowFlags();
flags |= Qt::FramelessWindowHint;
flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
w->setWindowFlags(flags);
}
class tst_QGraphicsView : public QObject
{
Q_OBJECT
@ -366,6 +374,7 @@ void tst_QGraphicsView::alignment()
scene.addRect(QRectF(-10, -10, 20, 20));
QGraphicsView view(&scene);
setFrameless(&view);
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
@ -649,6 +658,7 @@ void tst_QGraphicsView::dragMode_scrollHand()
{
for (int j = 0; j < 2; ++j) {
QGraphicsView view;
setFrameless(&view);
QCOMPARE(view.dragMode(), QGraphicsView::NoDrag);
view.setSceneRect(-1000, -1000, 2000, 2000);
@ -875,6 +885,7 @@ void tst_QGraphicsView::dragMode_rubberBand()
void tst_QGraphicsView::rubberBandSelectionMode()
{
QWidget toplevel;
setFrameless(&toplevel);
QGraphicsScene scene;
QGraphicsRectItem *rect = scene.addRect(QRectF(10, 10, 80, 80));
@ -1094,6 +1105,7 @@ void tst_QGraphicsView::matrix_combine()
void tst_QGraphicsView::centerOnPoint()
{
QWidget toplevel;
setFrameless(&toplevel);
QGraphicsScene scene;
scene.addEllipse(QRectF(-100, -100, 50, 50));
@ -1757,6 +1769,7 @@ void tst_QGraphicsView::mapToScenePoint()
{
QGraphicsScene scene;
QGraphicsView view(&scene);
setFrameless(&view);
view.rotate(90);
view.setFixedSize(117, 117);
view.show();
@ -1816,6 +1829,7 @@ void tst_QGraphicsView::mapToScenePoly()
{
QGraphicsScene scene;
QGraphicsView view(&scene);
setFrameless(&view);
view.translate(100, 100);
view.setFixedSize(117, 117);
view.show();
@ -2197,6 +2211,7 @@ void tst_QGraphicsView::transformationAnchor()
scene.addRect(QRectF(-50, -50, 100, 100), QPen(Qt::black), QBrush(Qt::blue));
QGraphicsView view(&scene);
setFrameless(&view);
for (int i = 0; i < 2; ++i) {
view.resize(100, 100);
@ -2235,6 +2250,7 @@ void tst_QGraphicsView::resizeAnchor()
scene.addRect(QRectF(-50, -50, 100, 100), QPen(Qt::black), QBrush(Qt::blue));
QGraphicsView view(&scene);
setFrameless(&view);
for (int i = 0; i < 2; ++i) {
view.resize(100, 100);
@ -3175,6 +3191,7 @@ void tst_QGraphicsView::task239047_fitInViewSmallViewport()
// Ensure that with a small viewport, fitInView doesn't mirror the
// scene.
QWidget widget;
setFrameless(&widget);
QGraphicsScene scene;
QGraphicsView *view = new QGraphicsView(&scene, &widget);
view->resize(3, 3);
@ -4434,6 +4451,7 @@ void tst_QGraphicsView::QTBUG_4151_clipAndIgnore()
scene.addItem(ignore);
QGraphicsView view(&scene);
setFrameless(&view);
view.setFrameStyle(0);
view.resize(75, 75);
view.show();
@ -4592,6 +4610,7 @@ void tst_QGraphicsView::QTBUG_16063_microFocusRect()
scene.addItem(item);
QGraphicsView view(&scene);
setFrameless(&view);
view.setFixedSize(40, 40);
view.show();

View File

@ -70,6 +70,14 @@
QCOMPARE(expr, expected); \
} while(0)
static inline void setFrameless(QWidget *w)
{
Qt::WindowFlags flags = w->windowFlags();
flags |= Qt::FramelessWindowHint;
flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
w->setWindowFlags(flags);
}
class TestView : public QAbstractItemView
{
Q_OBJECT
@ -622,6 +630,7 @@ void tst_QAbstractItemView::noModel()
QStandardItemModel model(20,20);
QTreeView view;
setFrameless(&view);
view.setModel(&model);
// Make the viewport smaller than the contents, so that we can scroll

View File

@ -70,6 +70,16 @@ static inline HWND getHWNDForWidget(const QWidget *widget)
}
#endif // Q_OS_WIN
// Make a widget frameless to prevent size constraints of title bars
// from interfering (Windows).
static inline void setFrameless(QWidget *w)
{
Qt::WindowFlags flags = w->windowFlags();
flags |= Qt::FramelessWindowHint;
flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
w->setWindowFlags(flags);
}
class tst_QListView : public QObject
{
Q_OBJECT
@ -1178,6 +1188,7 @@ void tst_QListView::selection()
void tst_QListView::scrollTo()
{
QWidget topLevel;
setFrameless(&topLevel);
QListView lv(&topLevel);
QStringListModel model(&lv);
QStringList list;
@ -1842,6 +1853,7 @@ void tst_QListView::taskQTBUG_2233_scrollHiddenItems()
const int rowCount = 200;
QWidget topLevel;
setFrameless(&topLevel);
QListView view(&topLevel);
QStringListModel model(&view);
QStringList list;
@ -1993,6 +2005,7 @@ void tst_QListView::taskQTBUG_9455_wrongScrollbarRanges()
QStringListModel model(list);
ListView_9455 w;
setFrameless(&w);
w.setModel(&model);
w.setViewMode(QListView::IconMode);
w.resize(116, 132);

View File

@ -57,6 +57,16 @@ typedef QList<int> IntList;
typedef QList<bool> BoolList;
// Make a widget frameless to prevent size constraints of title bars
// from interfering (Windows).
static inline void setFrameless(QWidget *w)
{
Qt::WindowFlags flags = w->windowFlags();
flags |= Qt::FramelessWindowHint;
flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
w->setWindowFlags(flags);
}
class tst_QTableView : public QObject
{
Q_OBJECT
@ -2147,6 +2157,7 @@ void tst_QTableView::rowViewportPosition()
QtTestTableModel model(rowCount, 1);
QtTestTableView view;
setFrameless(&view);
view.resize(100, 2 * rowHeight);
view.show();
@ -2309,6 +2320,7 @@ void tst_QTableView::columnViewportPosition()
QtTestTableModel model(1, columnCount);
QtTestTableView view;
setFrameless(&view);
view.resize(2 * columnWidth, 100);
view.show();
@ -2586,6 +2598,7 @@ void tst_QTableView::scrollTo()
QtTestTableModel model(rowCount, columnCount);
QWidget toplevel;
setFrameless(&toplevel);
QtTestTableView view(&toplevel);
toplevel.show();
@ -3343,6 +3356,7 @@ void tst_QTableView::tabFocus()
// to change focus on an empty table view, or on a table view that doesn't
// have this property set.
QWidget window;
window.resize(200, 200);
QTableView *view = new QTableView(&window);
QLineEdit *edit = new QLineEdit(&window);

View File

@ -111,6 +111,16 @@ struct PublicView : public QTreeView
QAbstractItemViewPrivate* aiv_priv() { return static_cast<QAbstractItemViewPrivate*>(d_ptr.data()); }
};
// Make a widget frameless to prevent size constraints of title bars
// from interfering (Windows).
static inline void setFrameless(QWidget *w)
{
Qt::WindowFlags flags = w->windowFlags();
flags |= Qt::FramelessWindowHint;
flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
w->setWindowFlags(flags);
}
class tst_QTreeView : public QObject
{
Q_OBJECT
@ -877,6 +887,7 @@ void tst_QTreeView::horizontalScrollMode()
}
QTreeView view;
setFrameless(&view);
view.setModel(&model);
view.setFixedSize(100, 100);
view.header()->resizeSection(0, 200);
@ -3417,6 +3428,7 @@ void tst_QTreeView::task224091_appendColumns()
{
QStandardItemModel *model = new QStandardItemModel();
QWidget* topLevel= new QWidget;
setFrameless(topLevel);
QTreeView *treeView = new QTreeView(topLevel);
treeView->setModel(model);
topLevel->show();

View File

@ -1945,6 +1945,7 @@ void tst_QApplication::touchEventPropagation()
{
// touch event behavior on a window
TouchEventPropagationTestWidget window;
window.resize(200, 200);
window.setObjectName("1. window");
window.show(); // Must have an explicitly specified QWindow for handleTouchEvent,
// passing 0 would result in using topLevelAt() which is not ok in this case
@ -1999,6 +2000,7 @@ void tst_QApplication::touchEventPropagation()
{
// touch event behavior on a window with a child widget
TouchEventPropagationTestWidget window;
window.resize(200, 200);
window.setObjectName("2. window");
TouchEventPropagationTestWidget widget(&window);
widget.setObjectName("2. widget");

View File

@ -44,6 +44,14 @@
#include <QtGui>
#include <QtWidgets>
static inline void setFrameless(QWidget *w)
{
Qt::WindowFlags flags = w->windowFlags();
flags |= Qt::FramelessWindowHint;
flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
w->setWindowFlags(flags);
}
class tst_QBoxLayout : public QObject
{
Q_OBJECT
@ -198,6 +206,7 @@ void tst_QBoxLayout::sizeConstraints()
void tst_QBoxLayout::setGeometry()
{
QWidget toplevel;
setFrameless(&toplevel);
QWidget w(&toplevel);
QVBoxLayout *lay = new QVBoxLayout;
lay->setMargin(0);

View File

@ -55,6 +55,14 @@
#include <qformlayout.h>
static inline void setFrameless(QWidget *w)
{
Qt::WindowFlags flags = w->windowFlags();
flags |= Qt::FramelessWindowHint;
flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
w->setWindowFlags(flags);
}
class tst_QFormLayout : public QObject
{
Q_OBJECT
@ -345,6 +353,7 @@ void tst_QFormLayout::spacing()
void tst_QFormLayout::contentsRect()
{
QWidget w;
setFrameless(&w);
QFormLayout form;
w.setLayout(&form);
form.addRow("Label", new QPushButton(&w));

View File

@ -57,6 +57,14 @@
#include <QRadioButton>
#include <private/qlayoutengine_p.h>
static inline void setFrameless(QWidget *w)
{
Qt::WindowFlags flags = w->windowFlags();
flags |= Qt::FramelessWindowHint;
flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
w->setWindowFlags(flags);
}
class tst_QLayout : public QObject
{
Q_OBJECT
@ -126,6 +134,7 @@ void tst_QLayout::geometry()
// should be the same.
QApplication::setStyle(QStyleFactory::create(QLatin1String("Windows")));
QWidget topLevel;
setFrameless(&topLevel);
QWidget w(&topLevel);
QVBoxLayout layout(&w);
SizeHinterFrame widget(QSize(100,100));

View File

@ -213,7 +213,7 @@ void tst_QShortcut::initTestCase()
mainW = new QMainWindow(0);
mainW->setWindowFlags(Qt::X11BypassWindowManagerHint);
edit = new TestEdit(mainW, "test_edit");
mainW->setFixedSize( 100, 100 );
mainW->setFixedSize( 200, 200 );
mainW->setCentralWidget( edit );
mainW->show();
mainW->activateWindow();

View File

@ -154,6 +154,16 @@ bool macHasAccessToWindowsServer()
}
#endif
// Make a widget frameless to prevent size constraints of title bars
// from interfering (Windows).
static inline void setFrameless(QWidget *w)
{
Qt::WindowFlags flags = w->windowFlags();
flags |= Qt::FramelessWindowHint;
flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
w->setWindowFlags(flags);
}
class tst_QWidget : public QObject
{
Q_OBJECT
@ -1969,6 +1979,7 @@ void tst_QWidget::showMaximized()
{
QWidget widget;
setFrameless(&widget);
widget.setGeometry(0, 0, 10, 10);
widget.showMaximized();
QTRY_VERIFY(widget.size().width() > 20 && widget.size().height() > 20);
@ -2080,6 +2091,7 @@ void tst_QWidget::resizeEvent()
{
{
QWidget wParent;
wParent.resize(200, 200);
ResizeWidget wChild(&wParent);
wParent.show();
QCOMPARE (wChild.m_resizeEventCount, 1); // initial resize event before paint
@ -2095,6 +2107,7 @@ void tst_QWidget::resizeEvent()
{
ResizeWidget wTopLevel;
wTopLevel.resize(200, 200);
wTopLevel.show();
QCOMPARE (wTopLevel.m_resizeEventCount, 1); // initial resize event before paint for toplevels
wTopLevel.hide();
@ -2182,6 +2195,7 @@ void tst_QWidget::showMinimizedKeepsFocus()
//testing deletion of the focusWidget
{
QWidget window;
window.resize(200, 200);
QWidget *child = new QWidget(&window);
child->setFocusPolicy(Qt::StrongFocus);
window.show();
@ -2199,6 +2213,7 @@ void tst_QWidget::showMinimizedKeepsFocus()
//testing reparenting the focus widget
{
QWidget window;
window.resize(200, 200);
QWidget *child = new QWidget(&window);
child->setFocusPolicy(Qt::StrongFocus);
window.show();
@ -2216,6 +2231,7 @@ void tst_QWidget::showMinimizedKeepsFocus()
//testing setEnabled(false)
{
QWidget window;
window.resize(200, 200);
QWidget *child = new QWidget(&window);
child->setFocusPolicy(Qt::StrongFocus);
window.show();
@ -2233,6 +2249,7 @@ void tst_QWidget::showMinimizedKeepsFocus()
//testing clearFocus
{
QWidget window;
window.resize(200, 200);
QWidget *firstchild = new QWidget(&window);
firstchild->setFocusPolicy(Qt::StrongFocus);
QWidget *child = new QWidget(&window);
@ -4501,6 +4518,7 @@ void tst_QWidget::setWindowGeometry()
void tst_QWidget::setGeometry_win()
{
QWidget widget;
setFrameless(&widget);
widget.setGeometry(0, 600, 100,100);
widget.show();
widget.setWindowState(widget.windowState() | Qt::WindowMaximized);
@ -5727,6 +5745,7 @@ void tst_QWidget::childEvents()
{
// no children created, not shown
QWidget widget;
widget.resize(200, 200);
EventRecorder spy;
widget.installEventFilter(&spy);
@ -5746,6 +5765,7 @@ void tst_QWidget::childEvents()
{
// no children, shown
QWidget widget;
widget.resize(200, 200);
EventRecorder spy;
widget.installEventFilter(&spy);
@ -5786,6 +5806,7 @@ void tst_QWidget::childEvents()
{
// 2 children, not shown
QWidget widget;
widget.resize(200, 200);
EventRecorder spy;
widget.installEventFilter(&spy);
@ -5821,6 +5842,7 @@ void tst_QWidget::childEvents()
{
// 2 children, widget shown
QWidget widget;
widget.resize(200, 200);
EventRecorder spy;
widget.installEventFilter(&spy);
@ -5877,6 +5899,7 @@ void tst_QWidget::childEvents()
{
// 2 children, but one is reparented away, not shown
QWidget widget;
widget.resize(200, 200);
EventRecorder spy;
widget.installEventFilter(&spy);
@ -5913,6 +5936,7 @@ void tst_QWidget::childEvents()
{
// 2 children, but one is reparented away, then widget is shown
QWidget widget;
widget.resize(200, 200);
EventRecorder spy;
widget.installEventFilter(&spy);
@ -7328,6 +7352,7 @@ void tst_QWidget::alienWidgets()
QWidget *toolBar = new QWidget(&mainWindow);
QWidget *dockWidget = new QWidget(&mainWindow);
QWidget *centralWidget = new QWidget(&mainWindow);
centralWidget->setMinimumSize(QSize(200, 200));
QWidget *button = new QWidget(centralWidget);
QWidget *mdiArea = new QWidget(centralWidget);
@ -7844,6 +7869,7 @@ void tst_QWidget::immediateRepaintAfterInvalidateBuffer()
void tst_QWidget::effectiveWinId()
{
QWidget parent;
parent.resize(200, 200);
QWidget child(&parent);
// Shouldn't crash.

View File

@ -53,6 +53,13 @@
#include <qpushbutton.h>
#include <qboxlayout.h>
static inline void setFrameless(QWidget *w)
{
Qt::WindowFlags flags = w->windowFlags();
flags |= Qt::FramelessWindowHint;
flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
w->setWindowFlags(flags);
}
class tst_QWidget_window : public QWidget
{
@ -116,6 +123,7 @@ void tst_QWidget_window::tst_min_max_size()
const QSize minSize(300, 400);
const QSize maxSize(1000, 500);
QWidget w1;
setFrameless(&w1);
(new QVBoxLayout(&w1))->addWidget(new QPushButton("Test"));
if (setMinMaxSizeBeforeShow) {
w1.setMinimumSize(minSize);

View File

@ -51,6 +51,14 @@
#include <qmainwindow.h>
#include <qmenubar.h>
static inline void setFrameless(QWidget *w)
{
Qt::WindowFlags flags = w->windowFlags();
flags |= Qt::FramelessWindowHint;
flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
w->setWindowFlags(flags);
}
class tst_QWidgetAction : public QObject
{
Q_OBJECT
@ -98,6 +106,7 @@ void tst_QWidgetAction::defaultWidget()
}
{
QPointer<QComboBox> combo = new QComboBox(0);
setFrameless(combo.data());
combo->show();
QWidgetAction *action = new QWidgetAction(0);
@ -110,8 +119,10 @@ void tst_QWidgetAction::defaultWidget()
}
{
QToolBar tb1;
setFrameless(&tb1);
tb1.show();
QToolBar tb2;
setFrameless(&tb2);
tb2.show();
QPointer<QComboBox> combo = new QComboBox(0);
@ -175,6 +186,7 @@ void tst_QWidgetAction::visibilityUpdate()
// actually keeping the widget's state in sync with the
// action in terms of visibility is QToolBar's responsibility.
QToolBar tb;
setFrameless(&tb);
tb.show();
QComboBox *combo = new QComboBox(0);
@ -213,8 +225,10 @@ QWidget *ComboAction::createWidget(QWidget *parent)
void tst_QWidgetAction::customWidget()
{
QToolBar tb1;
setFrameless(&tb1);
tb1.show();
QToolBar tb2;
setFrameless(&tb2);
tb2.show();
ComboAction *action = new ComboAction(0);
@ -273,6 +287,7 @@ void tst_QWidgetAction::visibility()
a->setDefaultWidget(combo);
QToolBar *tb = new QToolBar;
setFrameless(tb);
tb->addAction(a);
QVERIFY(!combo->isVisible());
tb->show();
@ -292,6 +307,7 @@ void tst_QWidgetAction::visibility()
QVERIFY(!combo->isVisible());
QToolBar *tb2 = new QToolBar;
setFrameless(tb2);
tb->removeAction(a);
tb2->addAction(a);
QVERIFY(!combo->isVisible());
@ -308,6 +324,7 @@ void tst_QWidgetAction::visibility()
void tst_QWidgetAction::setEnabled()
{
QToolBar toolbar;
setFrameless(&toolbar);
QComboBox *combobox = new QComboBox;
QAction *action = toolbar.addWidget(combobox);
toolbar.show();

View File

@ -49,6 +49,14 @@
#include "../../../../shared/filesystem.h"
static inline void setFrameless(QWidget *w)
{
Qt::WindowFlags flags = w->windowFlags();
flags |= Qt::FramelessWindowHint;
flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
w->setWindowFlags(flags);
}
class CsvCompleter : public QCompleter
{
Q_OBJECT
@ -1282,6 +1290,7 @@ private slots:
void tst_QCompleter::task246056_setCompletionPrefix()
{
task246056_ComboBox *comboBox = new task246056_ComboBox;
setFrameless(comboBox);
QVERIFY(comboBox->completer());
comboBox->addItem("");
comboBox->addItem("a1");

View File

@ -52,6 +52,14 @@
// defined to be 120 by the wheel mouse vendors according to the docs
#define WHEEL_DELTA 120
static inline void setFrameless(QWidget *w)
{
Qt::WindowFlags flags = w->windowFlags();
flags |= Qt::FramelessWindowHint;
flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
w->setWindowFlags(flags);
}
class Slider : public QAbstractSlider
{
public:
@ -937,6 +945,7 @@ void tst_QAbstractSlider::sliderPressedReleased()
QFETCH(int, expectedCount);
QWidget topLevel;
setFrameless(&topLevel);
QAbstractSlider *slider;
switch (control) {
default: