Merge remote-tracking branch 'origin/5.9' into dev

Conflicts:
	src/plugins/platforms/cocoa/qcocoamenu.h
	src/plugins/platforms/cocoa/qcocoamenu.mm
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/widgets/styles/qstylehelper_p.h

Change-Id: I54247c98dd79d2b3826fc062b8b11048c9c7d9bb
This commit is contained in:
Liang Qi 2017-08-15 16:30:10 +02:00
commit 106d3b9bf9
174 changed files with 97797 additions and 765 deletions

View File

@ -39,4 +39,4 @@ QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_LFLAGS_RELEASE -g
QMAKE_LFLAGS_CXX11 += --c++11 --thread_local_storage
QMAKE_LFLAGS_EXCEPTIONS_ON += --exceptions
QMAKE_LIBS_CORE = -lposix -livfs -lsocket -lnet -ldl
QMAKE_LIBS_CORE = -lposix -livfs -lsocket -lnet -lshm_client

View File

@ -492,8 +492,8 @@ defineTest(qtConfSetupLibraries) {
# overrides from the command line are accepted.
defineTest(qtConfLibrary_inline) {
lib = $$eval($${1}.library)
!defined($${1}.libs, var): \
error("'inline' source in library '$$lib' does not specify 'libs'.")
!defined($${1}.libs, var):isEmpty($${1}.builds._KEYS_): \
error("'inline' source in library '$$lib' specifies neither 'libs' nor 'builds'.")
# if multiple libraries provide the same export, it makes sense
# to make them recognize the same input variables.
@ -2028,10 +2028,7 @@ for (currentConfig, allConfigs) {
}
qtConfCheckErrors()
!isEmpty(_QMAKE_SUPER_CACHE_): \
QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_SUPER_CACHE_)/config.cache
else: \
QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_CACHE_)/config.cache
QMAKE_CONFIG_CACHE = $$OUT_PWD/config.cache
QMAKE_CONFIG_CACHE_USE = $$eval(config.input.cache_use)
isEmpty(QMAKE_CONFIG_CACHE_USE): \
QMAKE_CONFIG_CACHE_USE = all

View File

@ -9,11 +9,6 @@
# We mean it.
#
contains(TEMPLATE, .*app): \
qtSetQmlPath()
contains(TEMPLATE, "vc.*"): return()
defineTest(addInstallFiles) {
for(sf, 2) {
sf = $$relative_path($$sf, $$_PRO_FILE_PWD_)
@ -31,99 +26,112 @@ defineTest(addInstallFiles) {
}
probase = $$relative_path($$_PRO_FILE_PWD_, $$dirname(_QMAKE_CONF_)/examples)
!isEmpty(probase):!contains(probase, ^\\..*):!isEmpty(_QMAKE_CACHE_) {
for(ex, EXAMPLE_FILES): \
sourcefiles += $$files($$absolute_path($$ex, $$_PRO_FILE_PWD_))
for(res, RESOURCES) {
rfile = $$cat($$absolute_path($$res, $$_PRO_FILE_PWD_), lines)
for(rline, rfile) {
resrc = $$replace(rline, ^[ \\t]*<file[^>]*>([^<]+)</file>[ \\t]*$, \\1)
!equals(resrc, $$rline): \
sourcefiles += $$resrc
}
}
for(res, RC_FILE) {
rfile = $$cat($$absolute_path($$res, $$_PRO_FILE_PWD_), lines)
for(rline, rfile) {
resrc = $$replace(rline, "^\\d+\\s+ICON\\s+[^\"]*\"([^\"]+)\"\$", \\1)
!equals(resrc, $$rline): \
sourcefiles += $$resrc
}
}
sourcefiles += \
$$ANDROID_PACKAGE_SOURCE_DIR \
$$QMAKE_INFO_PLIST \
$$DISTFILES
extras = \
$$_PRO_FILE_PWD_/README \
$$_PRO_FILE_PWD_/README.TXT \
$$files($$_PRO_FILE_PWD_/*.pri) \
$$replace(_PRO_FILE_, \\.pro$, .qmlproject) \
$$replace(_PRO_FILE_, \\.pro$, .json) \
$$replace(_PRO_FILE_, \\.pro$, .inf)
for(extra, extras): \
exists($$extra): \
sourcefiles += $$extra
isEmpty(probase)|contains(probase, ^\\..*): \
return()
# Just for Qt Creator
OTHER_FILES += $$sourcefiles
isEmpty(_QMAKE_CACHE_) {
!equals(OUT_PWD, $$_PRO_FILE_PWD_): \
return()
error("You cannot build examples inside the Qt source tree, except as part of a proper Qt build.")
}
sourcefiles += \
$$_PRO_FILE_ $$RC_FILE $$DEF_FILE \
$$SOURCES $$HEADERS $$FORMS $$RESOURCES $$TRANSLATIONS \
$$DBUS_ADAPTORS $$DBUS_INTERFACES
addInstallFiles(sources.files, $$sourcefiles)
sources.path = $$[QT_INSTALL_EXAMPLES]/$$probase
INSTALLS += sources
contains(TEMPLATE, "vc.*"): \
return()
check_examples {
srcfiles = $$sources.files
for(inst, INSTALLS): \
!equals(inst, target):!contains($${inst}.CONFIG, no_check_exist): \
for(file, $${inst}.files): \
instfiles += $$files($$absolute_path($$file, $$_PRO_FILE_PWD_))
addInstallFiles(srcfiles, $$instfiles)
contains(TEMPLATE, .*app): \
qtSetQmlPath()
thefiles = $$files($$_PRO_FILE_PWD_/*)
for(i, thefiles): \
allfiles += $$relative_path($$i, $$_PRO_FILE_PWD_)
for(i, srcfiles): \
allfiles -= $$relative_path($$i, $$_PRO_FILE_PWD_)
for(i, SUBDIRS) {
sd = $$eval($${i}.file)
!isEmpty(sd) {
sd ~= s,/.*,,
} else {
sd = $$eval($${i}.subdir)
isEmpty(sd): sd = $$i
}
allfiles -= $$sd
}
allfiles -= doc
!isEmpty(allfiles): warning("remaining files in $$_PRO_FILE_PWD_: $$allfiles")
}
equals(TEMPLATE, app)|equals(TEMPLATE, lib) {
!contains(INSTALLS, target) {
!install_ok: \
error("$$_PRO_FILE_ is lacking an install target.")
else: check_examples: \
warning("$$_PRO_FILE_ is lacking an install target.")
} else: !equals(target.path, $$sources.path) {
!install_ok: \
error("$$_PRO_FILE_ installs target to unexpected location.")
else: check_examples: \
warning("$$_PRO_FILE_ installs target to unexpected location.")
}
}
!equals(TEMPLATE, subdirs):!compile_examples {
TEMPLATE = aux
CONFIG -= have_target qt staticlib dll
SOURCES =
OBJECTIVE_SOURCES =
INSTALLS -= target
} else {
CONFIG += relative_qt_rpath # Examples built as part of Qt should be relocatable
for(ex, EXAMPLE_FILES): \
sourcefiles += $$files($$absolute_path($$ex, $$_PRO_FILE_PWD_))
for(res, RESOURCES) {
rfile = $$cat($$absolute_path($$res, $$_PRO_FILE_PWD_), lines)
for(rline, rfile) {
resrc = $$replace(rline, ^[ \\t]*<file[^>]*>([^<]+)</file>[ \\t]*$, \\1)
!equals(resrc, $$rline): \
sourcefiles += $$resrc
}
}
for(res, RC_FILE) {
rfile = $$cat($$absolute_path($$res, $$_PRO_FILE_PWD_), lines)
for(rline, rfile) {
resrc = $$replace(rline, "^\\d+\\s+ICON\\s+[^\"]*\"([^\"]+)\"\$", \\1)
!equals(resrc, $$rline): \
sourcefiles += $$resrc
}
}
sourcefiles += \
$$ANDROID_PACKAGE_SOURCE_DIR \
$$QMAKE_INFO_PLIST \
$$DISTFILES
extras = \
$$_PRO_FILE_PWD_/README \
$$_PRO_FILE_PWD_/README.TXT \
$$files($$_PRO_FILE_PWD_/*.pri) \
$$replace(_PRO_FILE_, \\.pro$, .qmlproject) \
$$replace(_PRO_FILE_, \\.pro$, .json) \
$$replace(_PRO_FILE_, \\.pro$, .inf)
for(extra, extras): \
exists($$extra): \
sourcefiles += $$extra
# Just for Qt Creator
OTHER_FILES += $$sourcefiles
sourcefiles += \
$$_PRO_FILE_ $$RC_FILE $$DEF_FILE \
$$SOURCES $$HEADERS $$FORMS $$RESOURCES $$TRANSLATIONS \
$$DBUS_ADAPTORS $$DBUS_INTERFACES
addInstallFiles(sources.files, $$sourcefiles)
sources.path = $$[QT_INSTALL_EXAMPLES]/$$probase
INSTALLS += sources
check_examples {
srcfiles = $$sources.files
for(inst, INSTALLS): \
!equals(inst, target):!contains($${inst}.CONFIG, no_check_exist): \
for(file, $${inst}.files): \
instfiles += $$files($$absolute_path($$file, $$_PRO_FILE_PWD_))
addInstallFiles(srcfiles, $$instfiles)
thefiles = $$files($$_PRO_FILE_PWD_/*)
for(i, thefiles): \
allfiles += $$relative_path($$i, $$_PRO_FILE_PWD_)
for(i, srcfiles): \
allfiles -= $$relative_path($$i, $$_PRO_FILE_PWD_)
for(i, SUBDIRS) {
sd = $$eval($${i}.file)
!isEmpty(sd) {
sd ~= s,/.*,,
} else {
sd = $$eval($${i}.subdir)
isEmpty(sd): sd = $$i
}
allfiles -= $$sd
}
allfiles -= doc
!isEmpty(allfiles): warning("remaining files in $$_PRO_FILE_PWD_: $$allfiles")
}
equals(TEMPLATE, app)|equals(TEMPLATE, lib) {
!contains(INSTALLS, target) {
!install_ok: \
error("$$_PRO_FILE_ is lacking an install target.")
else: check_examples: \
warning("$$_PRO_FILE_ is lacking an install target.")
} else: !equals(target.path, $$sources.path) {
!install_ok: \
error("$$_PRO_FILE_ installs target to unexpected location.")
else: check_examples: \
warning("$$_PRO_FILE_ installs target to unexpected location.")
}
}
!equals(TEMPLATE, subdirs):!compile_examples {
TEMPLATE = aux
CONFIG -= have_target qt staticlib dll
SOURCES =
OBJECTIVE_SOURCES =
INSTALLS -= target
} else {
CONFIG += relative_qt_rpath # Examples built as part of Qt should be relocatable
}

View File

@ -12,6 +12,16 @@ defineReplace(qtMakeExpand) {
}
}
defineTest(qtCompilerErrror) {
!cross_compile: \
what =
else: host_build: \
what = " host"
else: \
what = " target"
error("Cannot run$$what compiler '$$1'. Maybe you forgot to setup the environment?")
}
cross_compile:host_build: \
target_prefix = QMAKE_HOST_CXX
else: \
@ -58,8 +68,7 @@ isEmpty($${target_prefix}.INCDIRS) {
cxx_flags += -E -v
output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ - 2>&1 $$cmd_suffix", lines, ec)
!equals(ec, 0): \
error("Cannot run compiler '$$QMAKE_CXX'. Maybe you forgot to setup the environment?")
!equals(ec, 0): qtCompilerErrror($$QMAKE_CXX)
rim_qcc {
for (line, output) {
@ -119,8 +128,7 @@ isEmpty($${target_prefix}.INCDIRS) {
# What's more, -print-search-dirs can't be used on clang on Apple because it
# won't print all the library paths (only the clang-internal ones).
output = $$system("$$cmd_prefix $$QMAKE_CXX -print-search-dirs", lines, ec)
!equals(ec, 0): \
error("Cannot run compiler '$$QMAKE_CXX'. Maybe you forgot to setup the environment?")
!equals(ec, 0): qtCompilerErrror($$QMAKE_CXX)
for (line, output) {
contains(line, "^libraries: .*") {
@ -162,8 +170,7 @@ isEmpty($${target_prefix}.INCDIRS) {
defineReplace(qtVariablesFromMSVC) {
ret = $$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) <NUL 2>NUL", lines, ec)
!equals(ec, 0): \
error("Cannot run compiler '$$1'. Maybe you forgot to setup the environment?")
!equals(ec, 0): qtCompilerErrror($$1)
return($$ret)
}
@ -171,8 +178,7 @@ defineReplace(qtVariablesFromGCC) {
null_device = /dev/null
equals(QMAKE_HOST.os, Windows): null_device = NUL
ret = $$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) <$$null_device 2>$$null_device", lines, ec)
!equals(ec, 0): \
error("Cannot run compiler '$$1'. Maybe you forgot to setup the environment?")
!equals(ec, 0): qtCompilerErrror($$1)
return($$ret)
}

View File

@ -52,8 +52,10 @@ QMAKE_LFLAGS_CONSOLE = -Wl,-subsystem,console
QMAKE_LFLAGS_WINDOWS = -Wl,-subsystem,windows
QMAKE_LFLAGS_DLL = -shared
QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections
QMAKE_LINK_OBJECT_MAX = 10
QMAKE_LINK_OBJECT_SCRIPT = object_script
equals(QMAKE_HOST.os, Windows) {
QMAKE_LINK_OBJECT_MAX = 10
QMAKE_LINK_OBJECT_SCRIPT = object_script
}
QMAKE_PREFIX_SHLIB =
QMAKE_EXTENSION_SHLIB = dll
QMAKE_PREFIX_STATICLIB = lib

View File

@ -285,7 +285,8 @@ void MingwMakefileGenerator::writeLibsPart(QTextStream &t)
void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
{
if (project->values("OBJECTS").count() < var("QMAKE_LINK_OBJECT_MAX").toInt()) {
const ProString &objmax = project->first("QMAKE_LINK_OBJECT_MAX");
if (objmax.isEmpty() || project->values("OBJECTS").count() < objmax.toInt()) {
objectsLinkLine = "$(OBJECTS)";
} else if (project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
QString ar_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");

View File

@ -477,9 +477,10 @@ bool ProStringList::contains(const char *str, Qt::CaseSensitivity cs) const
return false;
}
ProFile::ProFile(const QString &fileName)
ProFile::ProFile(int id, const QString &fileName)
: m_refCount(1),
m_fileName(fileName),
m_id(id),
m_ok(true),
m_hostBuild(false)
{
@ -496,7 +497,7 @@ ProString ProFile::getStr(const ushort *&tPtr)
{
uint len = *tPtr++;
ProString ret(items(), tPtr - tokPtr(), len);
ret.setSource(this);
ret.setSource(m_id);
tPtr += len;
return ret;
}

View File

@ -73,8 +73,8 @@ public:
void setValue(const QString &str);
void clear() { m_string.clear(); m_length = 0; }
ProString &setSource(const ProString &other) { m_file = other.m_file; return *this; }
ProString &setSource(const ProFile *pro) { m_file = pro; return *this; }
const ProFile *sourceFile() const { return m_file; }
ProString &setSource(int id) { m_file = id; return *this; }
int sourceFile() const { return m_file; }
ProString &prepend(const ProString &other);
ProString &append(const ProString &other, bool *pending = 0);
@ -164,7 +164,7 @@ private:
QString m_string;
int m_offset, m_length;
const ProFile *m_file;
int m_file;
mutable uint m_hash;
QChar *prepareExtend(int extraLen, int thisTarget, int extraTarget);
uint updatedHash() const;
@ -341,9 +341,10 @@ enum ProToken {
class QMAKE_EXPORT ProFile
{
public:
explicit ProFile(const QString &fileName);
ProFile(int id, const QString &fileName);
~ProFile();
int id() const { return m_id; }
QString fileName() const { return m_fileName; }
QString directoryName() const { return m_directoryName; }
const QString &items() const { return m_proitems; }
@ -368,6 +369,7 @@ private:
QString m_proitems;
QString m_fileName;
QString m_directoryName;
int m_id;
bool m_ok;
bool m_hostBuild;
};

View File

@ -717,9 +717,9 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
after = args[3];
const ProStringList &var = values(map(args.at(0)));
if (!var.isEmpty()) {
const ProFile *src = currentProFile();
int src = currentFileId();
for (const ProString &v : var)
if (const ProFile *s = v.sourceFile()) {
if (int s = v.sourceFile()) {
src = s;
break;
}
@ -1068,7 +1068,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
dirs.append(fname + QLatin1Char('/'));
}
if (regex.exactMatch(qdir[i]))
ret += ProString(fname).setSource(currentProFile());
ret += ProString(fname).setSource(currentFileId());
}
}
}
@ -1335,7 +1335,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
return ReturnFalse;
}
QString fn = resolvePath(args.at(0).toQString(m_tmp1));
ProFile *pro = m_parser->parsedProFile(fn, QMakeParser::ParseOnlyCached);
int pro = m_parser->idForFileName(fn);
if (!pro)
return ReturnFalse;
ProValueMap &vmap = m_valuemapStack.first();
@ -1355,18 +1355,17 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
++vit;
}
for (auto fit = m_functionDefs.testFunctions.begin(); fit != m_functionDefs.testFunctions.end(); ) {
if (fit->pro() == pro)
if (fit->pro()->id() == pro)
fit = m_functionDefs.testFunctions.erase(fit);
else
++fit;
}
for (auto fit = m_functionDefs.replaceFunctions.begin(); fit != m_functionDefs.replaceFunctions.end(); ) {
if (fit->pro() == pro)
if (fit->pro()->id() == pro)
fit = m_functionDefs.replaceFunctions.erase(fit);
else
++fit;
}
pro->deref();
ProStringList &iif = m_valuemapStack.first()[ProKey("QMAKE_INTERNAL_INCLUDED_FILES")];
int idx = iif.indexOf(ProString(fn));
if (idx >= 0)

View File

@ -271,13 +271,13 @@ void QMakeEvaluator::skipHashStr(const ushort *&tokPtr)
// FIXME: this should not build new strings for direct sections.
// Note that the E_SPRINTF and E_LIST implementations rely on the deep copy.
ProStringList QMakeEvaluator::split_value_list(const QStringRef &vals, const ProFile *source)
ProStringList QMakeEvaluator::split_value_list(const QStringRef &vals, int source)
{
QString build;
ProStringList ret;
if (!source)
source = currentProFile();
source = currentFileId();
const QChar *vals_data = vals.data();
const int vals_len = vals.length();
@ -1299,7 +1299,7 @@ void QMakeEvaluator::setupProject()
{
setTemplate();
ProValueMap &vars = m_valuemapStack.top();
ProFile *proFile = currentProFile();
int proFile = currentFileId();
vars[ProKey("TARGET")] << ProString(QFileInfo(currentFileName()).baseName()).setSource(proFile);
vars[ProKey("_PRO_FILE_")] << ProString(currentFileName()).setSource(proFile);
vars[ProKey("_PRO_FILE_PWD_")] << ProString(currentDirectory()).setSource(proFile);
@ -1593,6 +1593,14 @@ ProFile *QMakeEvaluator::currentProFile() const
return 0;
}
int QMakeEvaluator::currentFileId() const
{
ProFile *pro = currentProFile();
if (pro)
return pro->id();
return 0;
}
QString QMakeEvaluator::currentFileName() const
{
ProFile *pro = currentProFile();

View File

@ -176,12 +176,13 @@ public:
void setTemplate();
ProStringList split_value_list(const QStringRef &vals, const ProFile *source = 0);
ProStringList split_value_list(const QStringRef &vals, int source = 0);
VisitReturn expandVariableReferences(const ushort *&tokPtr, int sizeHint, ProStringList *ret, bool joined);
QString currentFileName() const;
QString currentDirectory() const;
ProFile *currentProFile() const;
int currentFileId() const;
QString resolvePath(const QString &fileName) const
{ return QMakeInternal::IoUtils::resolvePath(currentDirectory(), fileName); }

View File

@ -167,7 +167,7 @@ QMakeParser::QMakeParser(ProFileCache *cache, QMakeVfs *vfs, QMakeParserHandler
ProFile *QMakeParser::parsedProFile(const QString &fileName, ParseFlags flags)
{
ProFile *pro;
if ((flags & (ParseUseCache|ParseOnlyCached)) && m_cache) {
if ((flags & ParseUseCache) && m_cache) {
ProFileCache::Entry *ent;
#ifdef PROPARSER_THREAD_SAFE
QMutexLocker locker(&m_cache->mutex);
@ -189,13 +189,13 @@ ProFile *QMakeParser::parsedProFile(const QString &fileName, ParseFlags flags)
#endif
if ((pro = ent->pro))
pro->ref();
} else if (!(flags & ParseOnlyCached)) {
} else {
ent = &m_cache->parsed_files[fileName];
#ifdef PROPARSER_THREAD_SAFE
ent->locker = new ProFileCache::Entry::Locker;
locker.unlock();
#endif
pro = new ProFile(fileName);
pro = new ProFile(idForFileName(fileName), fileName);
if (!read(pro, flags)) {
delete pro;
pro = 0;
@ -214,17 +214,13 @@ ProFile *QMakeParser::parsedProFile(const QString &fileName, ParseFlags flags)
ent->locker = 0;
}
#endif
} else {
pro = 0;
}
} else if (!(flags & ParseOnlyCached)) {
pro = new ProFile(fileName);
} else {
pro = new ProFile(idForFileName(fileName), fileName);
if (!read(pro, flags)) {
delete pro;
pro = 0;
}
} else {
pro = 0;
}
return pro;
}
@ -232,11 +228,22 @@ ProFile *QMakeParser::parsedProFile(const QString &fileName, ParseFlags flags)
ProFile *QMakeParser::parsedProBlock(
const QStringRef &contents, const QString &name, int line, SubGrammar grammar)
{
ProFile *pro = new ProFile(name);
ProFile *pro = new ProFile(0, name);
read(pro, contents, line, grammar);
return pro;
}
int QMakeParser::idForFileName(const QString &fileName)
{
#ifdef PROPARSER_THREAD_SAFE
QMutexLocker lck(&fileIdMutex);
#endif
int &place = fileIdMap[fileName];
if (!place)
place = ++fileIdCounter;
return place;
}
void QMakeParser::discardFileFromCache(const QString &fileName)
{
if (m_cache)

View File

@ -78,7 +78,6 @@ public:
enum ParseFlag {
ParseDefault = 0,
ParseUseCache = 1,
ParseOnlyCached = 2,
ParseReportMissing = 4
};
Q_DECLARE_FLAGS(ParseFlags, ParseFlag)
@ -91,6 +90,8 @@ public:
ProFile *parsedProBlock(const QStringRef &contents, const QString &name, int line = 0,
SubGrammar grammar = FullGrammar);
int idForFileName(const QString &fileName);
void discardFileFromCache(const QString &fileName);
#ifdef PROPARSER_DEBUG
@ -181,6 +182,12 @@ private:
QString m_tmp; // Temporary for efficient toQString
QHash<QString, int> fileIdMap;
#ifdef PROEVALUATOR_THREAD_SAFE
QMutex fileIdMutex;
#endif
int fileIdCounter = 0;
ProFileCache *m_cache;
QMakeParserHandler *m_handler;
QMakeVfs *m_vfs;

View File

@ -94,6 +94,19 @@
#include <sys/sysctl.h>
#endif
#if defined(Q_OS_INTEGRITY)
extern "C" {
// Function mmap resides in libshm_client.a. To be able to link with it one needs
// to define symbols 'shm_area_password' and 'shm_area_name', because the library
// is meant to allow the application that links to it to use POSIX shared memory
// without full system POSIX.
# pragma weak shm_area_password
# pragma weak shm_area_name
char *shm_area_password = "dummy";
char *shm_area_name = "dummy";
}
#endif
#include "archdetect.cpp"
#ifdef qFatal

View File

@ -362,6 +362,9 @@ bool QSharedMemory::create(int size, AccessMode mode)
Returns the size of the attached shared memory segment. If no shared
memory segment is attached, 0 is returned.
\note The size of the segment may be larger than the requested size that was
passed to create().
\sa create(), attach()
*/
int QSharedMemory::size() const

View File

@ -311,6 +311,7 @@ private:
// will be default-initialized
# pragma warning ( push )
# pragma warning ( disable : 4345 )
# pragma warning(disable : 4127) // conditional expression is constant
#endif
template <typename T>
@ -325,10 +326,6 @@ void QVector<T>::defaultConstruct(T *from, T *to)
}
}
#ifdef Q_CC_MSVC
# pragma warning ( pop )
#endif
template <typename T>
void QVector<T>::copyConstruct(const T *srcFrom, const T *srcTo, T *dstFrom)
{
@ -340,11 +337,6 @@ void QVector<T>::copyConstruct(const T *srcFrom, const T *srcTo, T *dstFrom)
}
}
#if defined(Q_CC_MSVC)
#pragma warning( push )
#pragma warning( disable : 4127 ) // conditional expression is constant
#endif
template <typename T>
void QVector<T>::destruct(T *from, T *to)
{
@ -355,10 +347,6 @@ void QVector<T>::destruct(T *from, T *to)
}
}
#if defined(Q_CC_MSVC)
#pragma warning( pop )
#endif
template <typename T>
inline QVector<T>::QVector(const QVector<T> &v)
{
@ -380,6 +368,10 @@ inline QVector<T>::QVector(const QVector<T> &v)
}
}
#if defined(Q_CC_MSVC)
#pragma warning( pop )
#endif
template <typename T>
void QVector<T>::detach()
{
@ -507,6 +499,11 @@ QVector<T>::QVector(int asize, const T &t)
}
#ifdef Q_COMPILER_INITIALIZER_LISTS
# if defined(Q_CC_MSVC)
QT_WARNING_PUSH
QT_WARNING_DISABLE_MSVC(4127) // conditional expression is constant
# endif // Q_CC_MSVC
template <typename T>
QVector<T>::QVector(std::initializer_list<T> args)
{
@ -521,7 +518,10 @@ QVector<T>::QVector(std::initializer_list<T> args)
d = Data::sharedNull();
}
}
#endif
# if defined(Q_CC_MSVC)
QT_WARNING_POP
# endif // Q_CC_MSVC
#endif // Q_COMPILER_INITALIZER_LISTS
template <typename T>
void QVector<T>::freeData(Data *x)
@ -530,6 +530,11 @@ void QVector<T>::freeData(Data *x)
Data::deallocate(x);
}
#if defined(Q_CC_MSVC)
QT_WARNING_PUSH
QT_WARNING_DISABLE_MSVC(4127) // conditional expression is constant
#endif
template <typename T>
void QVector<T>::reallocData(const int asize, const int aalloc, QArrayData::AllocationOptions options)
{
@ -621,6 +626,10 @@ void QVector<T>::reallocData(const int asize, const int aalloc, QArrayData::Allo
Q_ASSERT(d->size == asize);
}
#if defined(Q_CC_MSVC)
QT_WARNING_POP
#endif
template<typename T>
Q_OUTOFLINE_TEMPLATE T QVector<T>::value(int i) const
{

View File

@ -331,7 +331,7 @@ void QOffscreenSurface::setScreen(QScreen *newScreen)
{
Q_D(QOffscreenSurface);
if (!newScreen)
newScreen = QGuiApplication::primaryScreen();
newScreen = QCoreApplication::instance() ? QGuiApplication::primaryScreen() : nullptr;
if (newScreen != d->screen) {
const bool wasCreated = d->platformOffscreenSurface != 0 || d->offscreenWindow != 0;
if (wasCreated)

View File

@ -972,8 +972,11 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
// emit error for all waiting replies
do {
// Need to dequeu the request so that we can emit the error.
if (!reply)
// First requeue the already pipelined requests for the current failed reply,
// then dequeue pending requests so we can also mark them as finished with error
if (reply)
requeueCurrentlyPipelinedRequests();
else
connection->d_func()->dequeueRequest(socket);
if (reply) {

View File

@ -165,7 +165,7 @@ static inline int qt_safe_connect(int sockfd, const struct sockaddr *addr, QT_SO
// VxWorks' headers specify 'int' instead of '...' for the 3rd ioctl() parameter.
template <typename T>
static inline int qt_safe_ioctl(int sockfd, int request, T arg)
static inline int qt_safe_ioctl(int sockfd, unsigned long request, T arg)
{
#ifdef Q_OS_VXWORKS
return ::ioctl(sockfd, request, (int) arg);

View File

@ -246,7 +246,7 @@ bool QEvdevTabletHandler::queryLimits()
void QEvdevTabletHandler::readData()
{
static input_event buffer[32];
input_event buffer[32];
int n = 0;
for (; ;) {
int result = QT_READ(m_fd, reinterpret_cast<char*>(buffer) + n, sizeof(buffer) - n);

View File

@ -91,13 +91,17 @@ public:
bool isOpen() const;
void setIsOpen(bool isOpen);
void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
private:
QCocoaMenuItem *itemOrNull(int index) const;
void insertNative(QCocoaMenuItem *item, QCocoaMenuItem *beforeItem);
void scheduleUpdate();
QList<QCocoaMenuItem *> m_menuItems;
NSMenu *m_nativeMenu;
NSMenuItem *m_attachedItem;
int m_updateTimer;
bool m_enabled:1;
bool m_parentEnabled:1;
bool m_visible:1;

View File

@ -259,6 +259,7 @@ QT_BEGIN_NAMESPACE
QCocoaMenu::QCocoaMenu() :
m_attachedItem(0),
m_updateTimer(0),
m_enabled(true),
m_parentEnabled(true),
m_visible(true),
@ -326,6 +327,13 @@ void QCocoaMenu::insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *
}
insertNative(cocoaItem, beforeItem);
// Empty menus on a menubar are hidden by default. If the menu gets
// added to the menubar before it contains any item, we need to sync.
if (isVisible() && attachedItem().hidden) {
if (auto *mb = qobject_cast<QCocoaMenuBar *>(menuParent()))
mb->syncMenu(this);
}
}
void QCocoaMenu::insertNative(QCocoaMenuItem *item, QCocoaMenuItem *beforeItem)
@ -409,6 +417,20 @@ QCocoaMenuItem *QCocoaMenu::itemOrNull(int index) const
return m_menuItems.at(index);
}
void QCocoaMenu::scheduleUpdate()
{
if (!m_updateTimer)
m_updateTimer = startTimer(0);
}
void QCocoaMenu::timerEvent(QTimerEvent *e)
{
if (e->timerId() == m_updateTimer) {
m_updateTimer = 0;
[m_nativeMenu update];
}
}
void QCocoaMenu::syncMenuItem(QPlatformMenuItem *menuItem)
{
QMacAutoReleasePool pool;
@ -435,9 +457,9 @@ void QCocoaMenu::syncMenuItem(QPlatformMenuItem *menuItem)
QCocoaMenuItem* beforeItem = itemOrNull(m_menuItems.indexOf(cocoaItem) + 1);
insertNative(cocoaItem, beforeItem);
} else {
// Force NSMenuValidation to kick in. This is needed e.g.
// Schedule NSMenuValidation to kick in. This is needed e.g.
// when an item's enabled state changes after menuWillOpen:
[m_nativeMenu update];
scheduleUpdate();
}
}

View File

@ -370,7 +370,7 @@ void QCocoaMenuBar::updateMenuBarImmediately()
QCocoaMenuLoader *loader = [QCocoaMenuLoader sharedMenuLoader];
[loader ensureAppMenuInMenu:mb->nsMenu()];
NSMutableSet *mergedItems = [[NSMutableSet setWithCapacity:0] retain];
NSMutableSet *mergedItems = [[NSMutableSet setWithCapacity:mb->merged().count()] retain];
foreach (QCocoaMenuItem *m, mb->merged()) {
[mergedItems addObject:m->nsItem()];
m->syncMerged();

View File

@ -588,7 +588,16 @@ void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags)
}
setWindowZoomButton(flags);
m_view.window.ignoresMouseEvents = flags & Qt::WindowTransparentForInput;
// Make window ignore mouse events if WindowTransparentForInput is set.
// Note that ignoresMouseEvents has a special initial state where events
// are ignored (passed through) based on window transparency, and that
// setting the property to false does not return us to that state. Instead,
// this makes the window capture all mouse events. Take care to only
// set the property if needed. FIXME: recreate window if needed or find
// some other way to implement WindowTransparentForInput.
bool ignoreMouse = flags & Qt::WindowTransparentForInput;
if (m_view.window.ignoresMouseEvents != ignoreMouse)
m_view.window.ignoresMouseEvents = ignoreMouse;
}
m_windowFlags = flags;

View File

@ -102,6 +102,15 @@ QGtk3Theme::QGtk3Theme()
g_log_set_handler("Gtk", G_LOG_LEVEL_MESSAGE, gtkMessageHandler, NULL);
}
static inline QVariant gtkGetLongPressTime()
{
const char *gtk_long_press_time = "gtk-long-press-time";
static bool found = g_object_class_find_property(G_OBJECT_GET_CLASS(gtk_settings_get_default()), gtk_long_press_time);
if (!found)
return QVariant();
return QVariant(gtkSetting<guint>(gtk_long_press_time)); // Since 3.14, apparently we support >= 3.6
}
QVariant QGtk3Theme::themeHint(QPlatformTheme::ThemeHint hint) const
{
switch (hint) {
@ -111,8 +120,12 @@ QVariant QGtk3Theme::themeHint(QPlatformTheme::ThemeHint hint) const
return QVariant(gtkSetting<gint>("gtk-double-click-distance"));
case QPlatformTheme::MouseDoubleClickInterval:
return QVariant(gtkSetting<gint>("gtk-double-click-time"));
case QPlatformTheme::MousePressAndHoldInterval:
return QVariant(gtkSetting<guint>("gtk-long-press-time"));
case QPlatformTheme::MousePressAndHoldInterval: {
QVariant v = gtkGetLongPressTime();
if (!v.isValid())
v = QGnomeTheme::themeHint(hint);
return v;
}
case QPlatformTheme::PasswordMaskDelay:
return QVariant(gtkSetting<guint>("gtk-entry-password-hint-timeout"));
case QPlatformTheme::StartDragDistance:

View File

@ -82,7 +82,9 @@
#include <qpainter.h>
#include <qpixmapcache.h>
#include <qpointer.h>
#if QT_CONFIG(progressbar)
#include <qprogressbar.h>
#endif
#if QT_CONFIG(pushbutton)
#include <qpushbutton.h>
#endif
@ -90,11 +92,15 @@
#if QT_CONFIG(rubberband)
#include <qrubberband.h>
#endif
#if QT_CONFIG(scrollbar)
#include <qscrollbar.h>
#endif
#include <qsizegrip.h>
#include <qstyleoption.h>
#include <qtoolbar.h>
#if QT_CONFIG(toolbutton)
#include <qtoolbutton.h>
#endif
#if QT_CONFIG(treeview)
#include <qtreeview.h>
#endif
@ -112,7 +118,9 @@
#endif
#include <qmath.h>
#include <QtWidgets/qgraphicsproxywidget.h>
#if QT_CONFIG(graphicsview)
#include <QtWidgets/qgraphicsview.h>
#endif
#include <QtCore/qvariant.h>
#include <private/qstylehelper_p.h>
#include <private/qstyleanimation_p.h>
@ -781,13 +789,13 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
else if (qobject_cast<const QComboBox *>(widg))
ct = QStyle::CT_ComboBox;
#endif
#ifndef QT_NO_TOOLBUTTON
#if QT_CONFIG(toolbutton)
else if (qobject_cast<const QToolButton *>(widg))
ct = QStyle::CT_ToolButton;
#endif
else if (qobject_cast<const QSlider *>(widg))
ct = QStyle::CT_Slider;
#ifndef QT_NO_PROGRESSBAR
#if QT_CONFIG(progressbar)
else if (qobject_cast<const QProgressBar *>(widg))
ct = QStyle::CT_ProgressBar;
#endif
@ -916,7 +924,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
if (sz == QStyleHelper::SizeSmall) {
int width = 0, height = 0;
if (szHint == QSize(-1, -1)) { //just 'guess'..
#ifndef QT_NO_TOOLBUTTON
#if QT_CONFIG(toolbutton)
const QToolButton *bt = qobject_cast<const QToolButton *>(widg);
// If this conversion fails then the widget was not what it claimed to be.
if(bt) {
@ -1003,7 +1011,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
ret.setWidth(w);
break;
}
#ifndef QT_NO_PROGRESSBAR
#if QT_CONFIG(progressbar)
case QStyle::CT_ProgressBar: {
int finalValue = -1;
Qt::Orientation orient = Qt::Horizontal;
@ -3336,7 +3344,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
HIThemeGroupBoxDrawInfo gdi;
gdi.version = qt_mac_hitheme_version;
gdi.state = tds;
#ifndef QT_NO_GROUPBOX
#if QT_CONFIG(groupbox)
if (w && qobject_cast<QGroupBox *>(w->parentWidget()))
gdi.kind = kHIThemeGroupBoxKindSecondary;
else
@ -5901,7 +5909,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
#endif
}
break;
#ifndef QT_NO_DIAL
#if QT_CONFIG(dial)
case CC_Dial:
if (const QStyleOptionSlider *dial = qstyleoption_cast<const QStyleOptionSlider *>(opt))
QStyleHelper::drawDial(dial, p);
@ -6721,7 +6729,7 @@ bool QMacStyle::event(QEvent *e)
if(e->type() == QEvent::FocusIn) {
QWidget *f = 0;
QWidget *focusWidget = QApplication::focusWidget();
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
if (QGraphicsView *graphicsView = qobject_cast<QGraphicsView *>(focusWidget)) {
QGraphicsItem *focusItem = graphicsView->scene() ? graphicsView->scene()->focusItem() : 0;
if (focusItem && focusItem->type() == QGraphicsProxyWidget::Type) {

View File

@ -68,7 +68,9 @@
#include <qevent.h>
#include <qfocusframe.h>
#include <qformlayout.h>
#if QT_CONFIG(groupbox)
#include <qgroupbox.h>
#endif
#include <qhash.h>
#include <qheaderview.h>
#include <qlayout.h>
@ -83,7 +85,9 @@
#include <qpainter.h>
#include <qpixmapcache.h>
#include <qpointer.h>
#if QT_CONFIG(progressbar)
#include <qprogressbar.h>
#endif
#if QT_CONFIG(pushbutton)
#include <qpushbutton.h>
#endif
@ -93,12 +97,16 @@
#endif
#include <qsizegrip.h>
#include <qspinbox.h>
#if QT_CONFIG(splitter)
#include <qsplitter.h>
#endif
#include <qstyleoption.h>
#include <qtextedit.h>
#include <qtextstream.h>
#include <qtoolbar.h>
#if QT_CONFIG(toolbutton)
#include <qtoolbutton.h>
#endif
#if QT_CONFIG(treeview)
#include <qtreeview.h>
#endif

View File

@ -67,14 +67,20 @@
#include <qradiobutton.h>
#include <qlineedit.h>
#include <qgroupbox.h>
#if QT_CONFIG(toolbutton)
#include <qtoolbutton.h>
#endif
#include <qspinbox.h>
#include <qtoolbar.h>
#if QT_CONFIG(combobox)
#include <qcombobox.h>
#endif
#if QT_CONFIG(scrollbar)
#include <qscrollbar.h>
#endif
#if QT_CONFIG(progressbar)
#include <qprogressbar.h>
#endif
#if QT_CONFIG(dockwidget)
#include <qdockwidget.h>
#endif

View File

@ -55,14 +55,18 @@
#include <qpa/qplatformnativeinterface.h>
#include <qdesktopwidget.h>
#if QT_CONFIG(toolbutton)
#include <qtoolbutton.h>
#endif
#if QT_CONFIG(tabbar)
#include <qtabbar.h>
#endif
#if QT_CONFIG(combobox)
#include <qcombobox.h>
#endif
#if QT_CONFIG(scrollbar)
#include <qscrollbar.h>
#endif
#include <qheaderview.h>
#include <qspinbox.h>
#if QT_CONFIG(listview)
@ -2857,7 +2861,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
}
break;
#endif
#ifndef QT_NO_TOOLBUTTON
#if QT_CONFIG(toolbutton)
case CC_ToolButton:
if (const QStyleOptionToolButton *toolbutton
= qstyleoption_cast<const QStyleOptionToolButton *>(option)) {
@ -2971,7 +2975,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
}
}
break;
#endif // QT_NO_TOOLBUTTON
#endif // QT_CONFIG(toolbutton)
case CC_TitleBar:
{
@ -3231,12 +3235,12 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
}
break;
#endif //QT_NO_MDIAREA
#ifndef QT_NO_DIAL
#if QT_CONFIG(dial)
case CC_Dial:
if (const QStyleOptionSlider *dial = qstyleoption_cast<const QStyleOptionSlider *>(option))
QStyleHelper::drawDial(dial, p);
break;
#endif // QT_NO_DIAL
#endif // QT_CONFIG(dial)
default:
QWindowsStyle::drawComplexControl(cc, option, p, widget);
break;

View File

@ -61,7 +61,9 @@
#endif
#include <QAbstractScrollArea>
#include <QScrollArea>
#if QT_CONFIG(scrollbar)
#include <QScrollBar>
#endif
#include <QDebug>
#ifndef QT_NO_ACCESSIBILITY

View File

@ -43,7 +43,9 @@
#include "qaction.h"
#include "qapplication.h"
#if QT_CONFIG(groupbox)
#include "qgroupbox.h"
#endif
#if QT_CONFIG(label)
#include "qlabel.h"
#endif
@ -95,7 +97,7 @@ static QString buddyString(const QWidget *widget)
}
#endif
#ifndef QT_NO_GROUPBOX
#if QT_CONFIG(groupbox)
QGroupBox *groupbox = qobject_cast<QGroupBox*>(parent);
if (groupbox)
return groupbox->title();
@ -331,7 +333,7 @@ QAccessibleWidget::relations(QAccessible::Relation match /*= QAccessible::AllRel
}
}
#endif
#ifndef QT_NO_GROUPBOX
#if QT_CONFIG(groupbox)
QGroupBox *groupbox = qobject_cast<QGroupBox*>(parent);
if (groupbox && !groupbox->title().isEmpty()) {
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(groupbox);

View File

@ -47,7 +47,9 @@
#include "itemviews_p.h"
#endif
#if QT_CONFIG(toolbutton)
#include <qtoolbutton.h>
#endif
#if QT_CONFIG(treeview)
#include <qtreeview.h>
#endif
@ -93,7 +95,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
} else if (classname == QLatin1String("QDoubleSpinBox")) {
iface = new QAccessibleDoubleSpinBox(widget);
#endif
#ifndef QT_NO_SCROLLBAR
#if QT_CONFIG(scrollbar)
} else if (classname == QLatin1String("QScrollBar")) {
iface = new QAccessibleScrollBar(widget);
#endif
@ -103,10 +105,10 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
} else if (classname == QLatin1String("QSlider")) {
iface = new QAccessibleSlider(widget);
#endif
#ifndef QT_NO_TOOLBUTTON
#if QT_CONFIG(toolbutton)
} else if (classname == QLatin1String("QToolButton")) {
iface = new QAccessibleToolButton(widget);
#endif // QT_NO_TOOLBUTTON
#endif // QT_CONFIG(toolbutton)
#if QT_CONFIG(abstractbutton)
} else if (classname == QLatin1String("QCheckBox")
|| classname == QLatin1String("QRadioButton")
@ -124,13 +126,13 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
#endif
} else if (classname == QLatin1String("QLabel") || classname == QLatin1String("QLCDNumber")) {
iface = new QAccessibleDisplay(widget);
#ifndef QT_NO_GROUPBOX
#if QT_CONFIG(groupbox)
} else if (classname == QLatin1String("QGroupBox")) {
iface = new QAccessibleGroupBox(widget);
#endif
} else if (classname == QLatin1String("QStatusBar")) {
iface = new QAccessibleDisplay(widget);
#ifndef QT_NO_PROGRESSBAR
#if QT_CONFIG(progressbar)
} else if (classname == QLatin1String("QProgressBar")) {
iface = new QAccessibleProgressBar(widget);
#endif
@ -159,7 +161,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
#endif
} else if (classname == QLatin1String("QSizeGrip")) {
iface = new QAccessibleWidget(widget, QAccessible::Grip);
#ifndef QT_NO_SPLITTER
#if QT_CONFIG(splitter)
} else if (classname == QLatin1String("QSplitter")) {
iface = new QAccessibleWidget(widget, QAccessible::Splitter);
} else if (classname == QLatin1String("QSplitterHandle")) {
@ -179,7 +181,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
} else if (classname == QLatin1String("QStackedWidget")) {
iface = new QAccessibleStackedWidget(widget);
#endif
#ifndef QT_NO_TOOLBOX
#if QT_CONFIG(toolbox)
} else if (classname == QLatin1String("QToolBox")) {
iface = new QAccessibleToolBox(widget);
#endif
@ -193,7 +195,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
} else if (classname == QLatin1String("QDialogButtonBox")) {
iface = new QAccessibleDialogButtonBox(widget);
#endif
#ifndef QT_NO_DIAL
#if QT_CONFIG(dial)
} else if (classname == QLatin1String("QDial")) {
iface = new QAccessibleDial(widget);
#endif
@ -201,7 +203,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
} else if (classname == QLatin1String("QRubberBand")) {
iface = new QAccessibleWidget(widget, QAccessible::Border);
#endif
#if !defined(QT_NO_TEXTBROWSER) && !defined(QT_NO_CURSOR)
#if QT_CONFIG(textbrowser) && !defined(QT_NO_CURSOR)
} else if (classname == QLatin1String("QTextBrowser")) {
iface = new QAccessibleTextBrowser(widget);
#endif

View File

@ -47,11 +47,15 @@
#include "qtextobject.h"
#include "qplaintextedit.h"
#include "qtextboundaryfinder.h"
#if QT_CONFIG(scrollbar)
#include "qscrollbar.h"
#endif
#include "qdebug.h"
#include <QApplication>
#include <QStackedWidget>
#if QT_CONFIG(toolbox)
#include <QToolBox>
#endif
#include <QMdiArea>
#include <QMdiSubWindow>
#if QT_CONFIG(dialogbuttonbox)
@ -61,7 +65,9 @@
#if QT_CONFIG(rubberband)
#include <QRubberBand>
#endif
#if QT_CONFIG(textbrowser)
#include <QTextBrowser>
#endif
#if QT_CONFIG(calendarwidget)
#include <QCalendarWidget>
#endif
@ -352,7 +358,7 @@ QStackedWidget *QAccessibleStackedWidget::stackedWidget() const
}
#endif // QT_NO_STACKEDWIDGET
#ifndef QT_NO_TOOLBOX
#if QT_CONFIG(toolbox)
// ======================= QAccessibleToolBox ======================
QAccessibleToolBox::QAccessibleToolBox(QWidget *widget)
: QAccessibleWidget(widget, QAccessible::LayeredPane)
@ -364,7 +370,7 @@ QToolBox * QAccessibleToolBox::toolBox() const
{
return static_cast<QToolBox *>(object());
}
#endif // QT_NO_TOOLBOX
#endif // QT_CONFIG(toolbox)
// ======================= QAccessibleMdiArea ======================
#ifndef QT_NO_MDIAREA
@ -499,7 +505,7 @@ QAccessibleDialogButtonBox::QAccessibleDialogButtonBox(QWidget *widget)
#endif // QT_CONFIG(dialogbuttonbox)
#if !defined(QT_NO_TEXTBROWSER) && !defined(QT_NO_CURSOR)
#if QT_CONFIG(textbrowser) && !defined(QT_NO_CURSOR)
QAccessibleTextBrowser::QAccessibleTextBrowser(QWidget *widget)
: QAccessibleTextEdit(widget)
{
@ -510,7 +516,7 @@ QAccessible::Role QAccessibleTextBrowser::role() const
{
return QAccessible::StaticText;
}
#endif // QT_NO_TEXTBROWSER && QT_NO_CURSOR
#endif // QT_CONFIG(textbrowser) && QT_NO_CURSOR
#if QT_CONFIG(calendarwidget)
// ===================== QAccessibleCalendarWidget ========================

View File

@ -256,7 +256,7 @@ public:
};
#endif
#if !defined(QT_NO_TEXTBROWSER) && !defined(QT_NO_CURSOR)
#if QT_CONFIG(textbrowser) && !defined(QT_NO_CURSOR)
class QAccessibleTextBrowser : public QAccessibleTextEdit
{
public:
@ -264,7 +264,7 @@ public:
QAccessible::Role role() const Q_DECL_OVERRIDE;
};
#endif // QT_NO_TEXTBROWSER && QT_NO_CURSOR
#endif // QT_CONFIG(textbrowser) && QT_NO_CURSOR
#if QT_CONFIG(calendarwidget)
class QAccessibleCalendarWidget : public QAccessibleWidget

View File

@ -40,15 +40,18 @@
#include "rangecontrols_p.h"
#include <qslider.h>
#if QT_CONFIG(dial)
#include <qdial.h>
#endif
#include <qspinbox.h>
#if QT_CONFIG(scrollbar)
#include <qscrollbar.h>
#endif
#include <qstyle.h>
#include <qstyleoption.h>
#include <qdebug.h>
#include <qglobal.h>
#include <QDoubleSpinBox>
#include <QDial>
#include <QtWidgets/qlineedit.h>
#include <qmath.h>
#include <private/qmath_p.h>
@ -284,7 +287,7 @@ QString QAccessibleDoubleSpinBox::text(QAccessible::Text textType) const
#endif // QT_NO_SPINBOX
#ifndef QT_NO_SCROLLBAR
#if QT_CONFIG(scrollbar)
/*!
\class QAccessibleScrollBar
\brief The QAccessibleScrollBar class implements the QAccessibleInterface for scroll bars.
@ -317,7 +320,7 @@ QString QAccessibleScrollBar::text(QAccessible::Text t) const
return QAccessibleAbstractSlider::text(t);
}
#endif // QT_NO_SCROLLBAR
#endif // QT_CONFIG(scrollbar)
#ifndef QT_NO_SLIDER
/*!
@ -398,7 +401,7 @@ QAbstractSlider *QAccessibleAbstractSlider::abstractSlider() const
#endif // QT_NO_SLIDER
#ifndef QT_NO_DIAL
#if QT_CONFIG(dial)
// ======================================= QAccessibleDial ======================================
QAccessibleDial::QAccessibleDial(QWidget *widget)
: QAccessibleAbstractSlider(widget, QAccessible::Dial)
@ -419,7 +422,7 @@ QDial *QAccessibleDial::dial() const
{
return static_cast<QDial*>(object());
}
#endif // QT_NO_DIAL
#endif // QT_CONFIG(dial)
#endif // QT_NO_ACCESSIBILITY

View File

@ -162,7 +162,7 @@ protected:
};
#endif // QT_CONFIG(slider)
#ifndef QT_NO_SCROLLBAR
#if QT_CONFIG(scrollbar)
class QAccessibleScrollBar : public QAccessibleAbstractSlider
{
public:
@ -172,7 +172,7 @@ public:
protected:
QScrollBar *scrollBar() const;
};
#endif // QT_NO_SCROLLBAR
#endif // QT_CONFIG(scrollbar)
#ifndef QT_NO_SLIDER
class QAccessibleSlider : public QAccessibleAbstractSlider
@ -186,7 +186,7 @@ protected:
};
#endif // QT_NO_SLIDER
#ifndef QT_NO_DIAL
#if QT_CONFIG(dial)
class QAccessibleDial : public QAccessibleAbstractSlider
{
public:
@ -197,7 +197,7 @@ public:
protected:
QDial *dial() const;
};
#endif // QT_NO_DIAL
#endif // QT_CONFIG(dial)
#endif // QT_NO_ACCESSIBILITY

View File

@ -48,17 +48,25 @@
#if QT_CONFIG(pushbutton)
#include <qpushbutton.h>
#endif
#if QT_CONFIG(progressbar)
#include <qprogressbar.h>
#endif
#if QT_CONFIG(statusbar)
#include <qstatusbar.h>
#endif
#if QT_CONFIG(radiobutton)
#include <qradiobutton.h>
#endif
#if QT_CONFIG(toolbutton)
#include <qtoolbutton.h>
#endif
#include <qmenu.h>
#if QT_CONFIG(label)
#include <qlabel.h>
#endif
#if QT_CONFIG(groupbox)
#include <qgroupbox.h>
#endif
#if QT_CONFIG(lcdnumber)
#include <qlcdnumber.h>
#endif
@ -274,7 +282,7 @@ QStringList QAccessibleButton::keyBindingsForAction(const QString &actionName) c
}
#endif // QT_CONFIG(abstractbutton)
#ifndef QT_NO_TOOLBUTTON
#if QT_CONFIG(toolbutton)
/*!
\class QAccessibleToolButton
\brief The QAccessibleToolButton class implements the QAccessibleInterface for tool buttons.
@ -394,7 +402,7 @@ void QAccessibleToolButton::doAction(const QString &actionName)
}
#endif // QT_NO_TOOLBUTTON
#endif // QT_CONFIG(toolbutton)
/*!
\class QAccessibleDisplay
@ -428,11 +436,11 @@ QAccessible::Role QAccessibleDisplay::role() const
if (l->movie())
return QAccessible::Animation;
#endif
#ifndef QT_NO_PROGRESSBAR
#if QT_CONFIG(progressbar)
} else if (qobject_cast<QProgressBar*>(object())) {
return QAccessible::ProgressBar;
#endif
#ifndef QT_NO_STATUSBAR
#if QT_CONFIG(statusbar)
} else if (qobject_cast<QStatusBar*>(object())) {
return QAccessible::StatusBar;
#endif
@ -474,7 +482,7 @@ QString QAccessibleDisplay::text(QAccessible::Text t) const
else
str = QString::number(l->intValue());
#endif
#ifndef QT_NO_STATUSBAR
#if QT_CONFIG(statusbar)
} else if (qobject_cast<QStatusBar*>(object())) {
return qobject_cast<QStatusBar*>(object())->currentMessage();
#endif
@ -482,7 +490,7 @@ QString QAccessibleDisplay::text(QAccessible::Text t) const
}
break;
case QAccessible::Value:
#ifndef QT_NO_PROGRESSBAR
#if QT_CONFIG(progressbar)
if (qobject_cast<QProgressBar*>(object()))
str = QString::number(qobject_cast<QProgressBar*>(object())->value());
#endif
@ -562,7 +570,7 @@ QPoint QAccessibleDisplay::imagePosition() const
#endif
}
#ifndef QT_NO_GROUPBOX
#if QT_CONFIG(groupbox)
QAccessibleGroupBox::QAccessibleGroupBox(QWidget *w)
: QAccessibleWidget(w)
{
@ -889,7 +897,7 @@ void QAccessibleLineEdit::replaceText(int startOffset, int endOffset, const QStr
#endif // QT_NO_LINEEDIT
#ifndef QT_NO_PROGRESSBAR
#if QT_CONFIG(progressbar)
QAccessibleProgressBar::QAccessibleProgressBar(QWidget *o)
: QAccessibleDisplay(o)
{

View File

@ -86,7 +86,7 @@ protected:
};
#endif
#ifndef QT_NO_TOOLBUTTON
#if QT_CONFIG(toolbutton)
class QAccessibleToolButton : public QAccessibleButton
{
public:
@ -107,7 +107,7 @@ protected:
bool isSplitButton() const;
};
#endif // QT_NO_TOOLBUTTON
#endif // QT_CONFIG(toolbutton)
class QAccessibleDisplay : public QAccessibleWidget, public QAccessibleImageInterface
{
@ -126,7 +126,7 @@ public:
QPoint imagePosition() const Q_DECL_OVERRIDE;
};
#ifndef QT_NO_GROUPBOX
#if QT_CONFIG(groupbox)
class QAccessibleGroupBox : public QAccessibleWidget
{
public:
@ -190,7 +190,7 @@ protected:
};
#endif // QT_NO_LINEEDIT
#ifndef QT_NO_PROGRESSBAR
#if QT_CONFIG(progressbar)
class QAccessibleProgressBar : public QAccessibleDisplay, public QAccessibleValueInterface
{
public:

View File

@ -55,7 +55,6 @@
#include <QtGui/qtextdocument.h>
#include <QtWidgets/qapplication.h>
#include <QtWidgets/qtextedit.h>
#include <QtWidgets/qtextbrowser.h>
#include <QtWidgets/qmenu.h>
#include "qdialog_p.h"
#include <QtGui/qfont.h>

View File

@ -61,6 +61,8 @@
#include <float.h>
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
template <typename Vertex, typename EdgeData>

View File

@ -135,7 +135,7 @@
*/
#include "qgraphicsanchorlayout_p.h"
#ifndef QT_NO_GRAPHICSVIEW
QT_BEGIN_NAMESPACE
QGraphicsAnchor::QGraphicsAnchor(QGraphicsAnchorLayout *parentLayout)
@ -531,5 +531,3 @@ QSizeF QGraphicsAnchorLayout::sizeHint(Qt::SizeHint which, const QSizeF &constra
QT_END_NAMESPACE
#include "moc_qgraphicsanchorlayout.cpp"
#endif //QT_NO_GRAPHICSVIEW

View File

@ -44,12 +44,10 @@
#include <QtWidgets/qgraphicsitem.h>
#include <QtWidgets/qgraphicslayout.h>
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
#if !defined(QT_NO_GRAPHICSVIEW)
class QGraphicsAnchorPrivate;
class QGraphicsAnchorLayout;
class QGraphicsAnchorLayoutPrivate;
@ -115,8 +113,6 @@ private:
friend class QGraphicsAnchor;
};
#endif
QT_END_NAMESPACE
#endif

View File

@ -50,7 +50,6 @@
#include <numeric>
#ifndef QT_NO_GRAPHICSVIEW
QT_BEGIN_NAMESPACE
// To ensure that all variables inside the simplex solver are non-negative,
@ -2976,4 +2975,3 @@ void QGraphicsAnchorLayoutPrivate::dumpGraph(const QString &name)
#endif
QT_END_NAMESPACE
#endif //QT_NO_GRAPHICSVIEW

View File

@ -59,7 +59,9 @@
#include "qgraphicsanchorlayout.h"
#include "qgraph_p.h"
#include "qsimplex_p.h"
#ifndef QT_NO_GRAPHICSVIEW
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
/*
@ -591,6 +593,5 @@ public:
};
QT_END_NAMESPACE
#endif //QT_NO_GRAPHICSVIEW
#endif

View File

@ -79,8 +79,6 @@
#include "qglobal.h"
#ifndef QT_NO_GRAPHICSVIEW
#include "qapplication.h"
#include "qwidget.h"
#include "qgraphicslayout_p.h"
@ -694,5 +692,3 @@ QSizePolicy::ControlTypes QGraphicsGridLayout::controlTypes(LayoutSide side) con
#endif
QT_END_NAMESPACE
#endif //QT_NO_GRAPHICSVIEW

View File

@ -44,11 +44,10 @@
#include <QtWidgets/qgraphicsitem.h>
#include <QtWidgets/qgraphicslayout.h>
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
#if !defined(QT_NO_GRAPHICSVIEW)
class QGraphicsGridLayoutPrivate;
class Q_WIDGETS_EXPORT QGraphicsGridLayout : public QGraphicsLayout
@ -130,9 +129,6 @@ private:
inline void QGraphicsGridLayout::addItem(QGraphicsLayoutItem *aitem, int arow, int acolumn, Qt::Alignment aalignment)
{ addItem(aitem, arow, acolumn, 1, 1, aalignment); }
#endif
QT_END_NAMESPACE
#endif

View File

@ -39,8 +39,6 @@
#include "qgraphicsgridlayoutengine_p.h"
#ifndef QT_NO_GRAPHICSVIEW
#include "qgraphicslayoutitem_p.h"
#include "qgraphicslayout_p.h"
#include "qgraphicswidget.h"
@ -118,7 +116,4 @@ int QGraphicsGridLayoutEngine::stretchFactor(QGraphicsLayoutItem *layoutItem, Qt
return 0;
}
QT_END_NAMESPACE
#endif // QT_NO_GRAPHICSVIEW

View File

@ -54,13 +54,13 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include <QtGui/private/qgridlayoutengine_p.h>
#ifndef QT_NO_GRAPHICSVIEW
#include <QtWidgets/qsizepolicy.h>
#include <QtWidgets/qstyle.h>
#include <QtWidgets/qstyleoption.h>
#include "qgraphicslayoutitem.h"
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
class QGraphicsLayoutPrivate;
@ -138,6 +138,4 @@ public:
QT_END_NAMESPACE
#endif // QT_NO_GRAPHICSVIEW
#endif // QGRAPHICSGRIDLAYOUTENGINE_P_H

View File

@ -732,8 +732,6 @@
#include "qgraphicsitem.h"
#ifndef QT_NO_GRAPHICSVIEW
#include "qgraphicsscene.h"
#include "qgraphicsscene_p.h"
#include "qgraphicssceneevent.h"
@ -11635,5 +11633,3 @@ QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemFlags flags)
QT_END_NAMESPACE
#include "moc_qgraphicsitem.cpp"
#endif // QT_NO_GRAPHICSVIEW

View File

@ -50,11 +50,10 @@
class tst_QGraphicsItem;
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
#if !defined(QT_NO_GRAPHICSVIEW)
class QBrush;
class QCursor;
class QFocusEvent;
@ -1050,8 +1049,6 @@ Q_DECLARE_METATYPE(QGraphicsItem *)
QT_BEGIN_NAMESPACE
#endif // QT_NO_GRAPHICSVIEW
QT_END_NAMESPACE
#endif // QGRAPHICSITEM_H

View File

@ -61,7 +61,7 @@
#include <QtCore/qpoint.h>
#if !defined(QT_NO_GRAPHICSVIEW)
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
@ -815,6 +815,4 @@ inline void QGraphicsItemPrivate::markParentDirty(bool updateBoundingRect)
QT_END_NAMESPACE
#endif // QT_NO_GRAPHICSVIEW
#endif

View File

@ -81,8 +81,6 @@
#include "qgraphicsitemanimation.h"
#ifndef QT_NO_GRAPHICSVIEW
#include "qgraphicsitem.h"
#include <QtCore/qtimeline.h>
@ -595,5 +593,3 @@ void QGraphicsItemAnimation::afterAnimationStep(qreal step)
QT_END_NAMESPACE
#include "moc_qgraphicsitemanimation.cpp"
#endif // QT_NO_GRAPHICSVIEW

View File

@ -43,11 +43,10 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtCore/qobject.h>
#if !defined(QT_NO_GRAPHICSVIEW)
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
class QGraphicsItem;
class QMatrix;
class QPointF;
@ -110,5 +109,4 @@ private:
QT_END_NAMESPACE
#endif // QT_NO_GRAPHICSVIEW
#endif

View File

@ -39,7 +39,6 @@
#include "qapplication.h"
#ifndef QT_NO_GRAPHICSVIEW
#include "qgraphicslayout.h"
#include "qgraphicslayout_p.h"
#include "qgraphicslayoutitem.h"
@ -521,5 +520,3 @@ bool QGraphicsLayout::instantInvalidatePropagation()
}
QT_END_NAMESPACE
#endif //QT_NO_GRAPHICSVIEW

View File

@ -43,11 +43,10 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qgraphicslayoutitem.h>
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
#if !defined(QT_NO_GRAPHICSVIEW)
class QGraphicsLayoutPrivate;
class QGraphicsLayoutItem;
class QGraphicsWidget;
@ -86,9 +85,6 @@ private:
Q_DECLARE_INTERFACE(QGraphicsLayout, "org.qt-project.Qt.QGraphicsLayout")
#endif
QT_END_NAMESPACE
#endif

View File

@ -39,8 +39,6 @@
#include "qglobal.h"
#ifndef QT_NO_GRAPHICSVIEW
#include "qgraphicslayout_p.h"
#include "qgraphicslayout.h"
#include "qgraphicswidget.h"
@ -195,7 +193,4 @@ void QGraphicsLayoutPrivate::activateRecursive(QGraphicsLayoutItem *item)
}
}
QT_END_NAMESPACE
#endif //QT_NO_GRAPHICSVIEW

View File

@ -53,14 +53,14 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#if !defined(QT_NO_GRAPHICSVIEW)
#include "qgraphicslayout.h"
#include "qgraphicslayoutitem_p.h"
#include <QtWidgets/qstyle.h>
#include <QtWidgets/qwidget.h>
#include <QtWidgets/qstyleoption.h>
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
class QGraphicsLayoutItem;
@ -144,9 +144,6 @@ public:
bool activated;
};
QT_END_NAMESPACE
#endif //QT_NO_GRAPHICSVIEW
#endif

View File

@ -39,8 +39,6 @@
#include "qglobal.h"
#ifndef QT_NO_GRAPHICSVIEW
#include "qgraphicslayout.h"
#include "qgraphicsscene.h"
#include "qgraphicslayoutitem.h"
@ -930,5 +928,3 @@ void QGraphicsLayoutItem::setGraphicsItem(QGraphicsItem *item)
}
QT_END_NAMESPACE
#endif //QT_NO_GRAPHICSVIEW

View File

@ -45,11 +45,10 @@
#include <QtWidgets/qsizepolicy.h>
#include <QtGui/qevent.h>
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
#if !defined(QT_NO_GRAPHICSVIEW)
class QGraphicsLayoutItemPrivate;
class QGraphicsItem;
class Q_WIDGETS_EXPORT QGraphicsLayoutItem
@ -141,8 +140,6 @@ inline qreal QGraphicsLayoutItem::maximumWidth() const
inline qreal QGraphicsLayoutItem::maximumHeight() const
{ return effectiveSizeHint(Qt::MaximumSize).height(); }
#endif
QT_END_NAMESPACE
#endif

View File

@ -55,6 +55,8 @@
#include <QtCore/QSizeF>
#include <QtWidgets/QSizePolicy>
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
class QGraphicsLayoutItem;

View File

@ -39,8 +39,6 @@
#include "qgraphicslayoutstyleinfo_p.h"
#ifndef QT_NO_GRAPHICSVIEW
#include "qgraphicslayout_p.h"
#include "qgraphicswidget.h"
#include <QtWidgets/qstyle.h>
@ -108,5 +106,3 @@ QStyle *QGraphicsLayoutStyleInfo::style() const
}
QT_END_NAMESPACE
#endif // QT_NO_GRAPHICSVIEW

View File

@ -54,6 +54,8 @@
#include <QtGui/private/qabstractlayoutstyleinfo_p.h>
#include <QtWidgets/qstyleoption.h>
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
class QStyle;

View File

@ -113,8 +113,6 @@
#include "qapplication.h"
#ifndef QT_NO_GRAPHICSVIEW
#include "qwidget.h"
#include "qgraphicslayout_p.h"
#include "qgraphicslayoutitem.h"
@ -566,5 +564,3 @@ void QGraphicsLinearLayout::dump(int indent) const
}
QT_END_NAMESPACE
#endif //QT_NO_GRAPHICSVIEW

View File

@ -44,11 +44,10 @@
#include <QtWidgets/qgraphicsitem.h>
#include <QtWidgets/qgraphicslayout.h>
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
#if !defined(QT_NO_GRAPHICSVIEW)
class QGraphicsLinearLayoutPrivate;
class Q_WIDGETS_EXPORT QGraphicsLinearLayout : public QGraphicsLayout
@ -105,9 +104,6 @@ private:
Q_DECLARE_PRIVATE(QGraphicsLinearLayout)
};
#endif
QT_END_NAMESPACE
#endif

View File

@ -39,8 +39,6 @@
#include "qglobal.h"
#ifndef QT_NO_GRAPHICSVIEW
#include "qgraphicslayout.h"
#include "qgraphicsproxywidget.h"
#include "private/qgraphicsproxywidget_p.h"
@ -1606,5 +1604,3 @@ QGraphicsProxyWidget *QGraphicsProxyWidget::newProxyWidget(const QWidget *)
QT_END_NAMESPACE
#include "moc_qgraphicsproxywidget.cpp"
#endif //QT_NO_GRAPHICSVIEW

View File

@ -43,11 +43,10 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qgraphicswidget.h>
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
#if !defined(QT_NO_GRAPHICSVIEW)
class QGraphicsProxyWidgetPrivate;
class Q_WIDGETS_EXPORT QGraphicsProxyWidget : public QGraphicsWidget
@ -133,9 +132,6 @@ private:
friend class QGraphicsItem;
};
#endif
QT_END_NAMESPACE
#endif

View File

@ -55,7 +55,7 @@
#include "qgraphicsproxywidget.h"
#include "private/qgraphicswidget_p.h"
#if !defined(QT_NO_GRAPHICSVIEW)
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
@ -114,5 +114,3 @@ public:
QT_END_NAMESPACE
#endif
#endif

View File

@ -203,8 +203,6 @@
#include "qgraphicsscene.h"
#ifndef QT_NO_GRAPHICSVIEW
#include "qgraphicsitem.h"
#include "qgraphicsitem_p.h"
#include "qgraphicslayout.h"
@ -6585,5 +6583,3 @@ void QGraphicsScenePrivate::ungrabGesture(QGraphicsItem *item, Qt::GestureType g
QT_END_NAMESPACE
#include "moc_qgraphicsscene.cpp"
#endif // QT_NO_GRAPHICSVIEW

View File

@ -50,11 +50,10 @@
#include <QtGui/qmatrix.h>
#include <QtGui/qpen.h>
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
#if !defined(QT_NO_GRAPHICSVIEW)
template<typename T> class QList;
class QFocusEvent;
class QFont;
@ -328,8 +327,6 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QGraphicsScene::SceneLayers)
#endif // QT_NO_GRAPHICSVIEW
QT_END_NAMESPACE
#endif

View File

@ -39,8 +39,6 @@
#include "qgraphicsscene_bsp_p.h"
#ifndef QT_NO_GRAPHICSVIEW
#include <QtCore/qstring.h>
#include <private/qgraphicsitem_p.h>
@ -290,5 +288,3 @@ QRectF QGraphicsSceneBspTree::rectForIndex(int index) const
}
QT_END_NAMESPACE
#endif // QT_NO_GRAPHICSVIEW

View File

@ -54,12 +54,12 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include <QtCore/qlist.h>
#if !defined(QT_NO_GRAPHICSVIEW)
#include <QtCore/qrect.h>
#include <QtCore/qset.h>
#include <QtCore/qvector.h>
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
class QGraphicsItem;
@ -126,6 +126,4 @@ public:
QT_END_NAMESPACE
#endif // QT_NO_GRAPHICSVIEW
#endif // QGRAPHICSSCENEBSPTREE_P_H

View File

@ -54,8 +54,6 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "qgraphicsscene.h"
#if !defined(QT_NO_GRAPHICSVIEW)
#include "qgraphicssceneevent.h"
#include "qgraphicsview.h"
#include "qgraphicsview_p.h"
@ -71,6 +69,8 @@
#include <QtWidgets/qstyle.h>
#include <QtWidgets/qstyleoption.h>
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
class QGraphicsSceneIndex;
@ -356,6 +356,4 @@ static inline QRectF adjustedItemEffectiveBoundingRect(const QGraphicsItem *item
QT_END_NAMESPACE
#endif // QT_NO_GRAPHICSVIEW
#endif

View File

@ -74,8 +74,6 @@
#include <QtCore/qglobal.h>
#ifndef QT_NO_GRAPHICSVIEW
#include <private/qgraphicsscene_p.h>
#include <private/qgraphicsscenebsptreeindex_p.h>
#include <private/qgraphicssceneindex_p.h>
@ -710,6 +708,3 @@ bool QGraphicsSceneBspTreeIndex::event(QEvent *event)
QT_END_NAMESPACE
#include "moc_qgraphicsscenebsptreeindex_p.cpp"
#endif // QT_NO_GRAPHICSVIEW

View File

@ -53,8 +53,6 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#if !defined(QT_NO_GRAPHICSVIEW)
#include "qgraphicssceneindex_p.h"
#include "qgraphicsitem_p.h"
#include "qgraphicsscene_bsp_p.h"
@ -62,6 +60,8 @@
#include <QtCore/qrect.h>
#include <QtCore/qlist.h>
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
static const int QGRAPHICSSCENE_INDEXTIMER_TIMEOUT = 2000;
@ -199,6 +199,4 @@ static inline bool QRectF_intersects(const QRectF &s, const QRectF &r)
QT_END_NAMESPACE
#endif // QT_NO_GRAPHICSVIEW
#endif // QGRAPHICSBSPTREEINDEX_H

View File

@ -259,8 +259,6 @@
#include "qgraphicssceneevent.h"
#ifndef QT_NO_GRAPHICSVIEW
#ifndef QT_NO_DEBUG
#include <QtCore/qdebug.h>
#endif
@ -1733,5 +1731,3 @@ void QGraphicsSceneMoveEvent::setNewPos(const QPointF &pos)
}
QT_END_NAMESPACE
#endif // QT_NO_GRAPHICSVIEW

View File

@ -51,11 +51,10 @@
#include <QtCore/qhash.h>
#endif
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
#if !defined(QT_NO_GRAPHICSVIEW)
class QMimeData;
class QPointF;
class QSizeF;
@ -321,8 +320,6 @@ public:
void setNewPos(const QPointF &pos);
};
#endif // QT_NO_GRAPHICSVIEW
QT_END_NAMESPACE
#endif

View File

@ -61,8 +61,6 @@
#include "qgraphicssceneindex_p.h"
#include "qgraphicsscenebsptreeindex_p.h"
#ifndef QT_NO_GRAPHICSVIEW
QT_BEGIN_NAMESPACE
namespace QtPrivate { // just to keep indentation of the following functions at the same level
@ -627,5 +625,3 @@ void QGraphicsSceneIndex::prepareBoundingRectChange(const QGraphicsItem *item)
QT_END_NAMESPACE
#include "moc_qgraphicssceneindex_p.cpp"
#endif // QT_NO_GRAPHICSVIEW

View File

@ -60,11 +60,10 @@
#include <QtCore/qobject.h>
#include <QtGui/qtransform.h>
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
#if !defined(QT_NO_GRAPHICSVIEW)
class QGraphicsSceneIndexPrivate;
class QPointF;
class QRectF;
@ -156,8 +155,6 @@ inline void QGraphicsSceneIndexPrivate::items_helper(const QRectF &rect, QGraphi
}
}
#endif // QT_NO_GRAPHICSVIEW
QT_END_NAMESPACE
#endif // QGRAPHICSSCENEINDEX_H

View File

@ -53,15 +53,14 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#if !defined(QT_NO_GRAPHICSVIEW)
#include <QtCore/qrect.h>
#include <QtCore/qlist.h>
#include <QtWidgets/qgraphicsitem.h>
#include <private/qgraphicssceneindex_p.h>
QT_BEGIN_NAMESPACE
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
class Q_AUTOTEST_EXPORT QGraphicsSceneLinearIndex : public QGraphicsSceneIndex
{
@ -116,6 +115,4 @@ private:
QT_END_NAMESPACE
#endif // QT_NO_GRAPHICSVIEW
#endif // QGRAPHICSSCENELINEARINDEX_H

View File

@ -93,7 +93,6 @@
#include <QtCore/qmath.h>
#include <QtCore/qnumeric.h>
#ifndef QT_NO_GRAPHICSVIEW
QT_BEGIN_NAMESPACE
QGraphicsTransformPrivate::~QGraphicsTransformPrivate()
@ -597,4 +596,3 @@ void QGraphicsRotation::applyTo(QMatrix4x4 *matrix) const
#include "moc_qgraphicstransform.cpp"
QT_END_NAMESPACE
#endif //QT_NO_GRAPHICSVIEW

View File

@ -46,9 +46,9 @@
#include <QtGui/QTransform>
#include <QtGui/QMatrix4x4>
#ifndef QT_NO_GRAPHICSVIEW
QT_BEGIN_NAMESPACE
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
class QGraphicsItem;
class QGraphicsTransformPrivate;
@ -149,6 +149,4 @@ private:
QT_END_NAMESPACE
#endif //QT_NO_GRAPHICSVIEW
#endif // QFXTRANSFORM_H

View File

@ -54,7 +54,7 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "private/qobject_p.h"
#ifndef QT_NO_GRAPHICSVIEW
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
@ -77,6 +77,4 @@ public:
QT_END_NAMESPACE
#endif //QT_NO_GRAPHICSVIEW
#endif // QGRAPHICSTRANSFORM_P_H

View File

@ -271,8 +271,6 @@ static const int QGRAPHICSVIEW_PREALLOC_STYLE_OPTIONS = 503; // largest prime <
#include "qgraphicsview.h"
#include "qgraphicsview_p.h"
#ifndef QT_NO_GRAPHICSVIEW
#include "qgraphicsitem.h"
#include "qgraphicsitem_p.h"
#include "qgraphicsscene.h"
@ -3935,5 +3933,3 @@ QRectF QGraphicsViewPrivate::mapToScene(const QRectF &rect) const
QT_END_NAMESPACE
#include "moc_qgraphicsview.cpp"
#endif // QT_NO_GRAPHICSVIEW

View File

@ -46,11 +46,10 @@
#include <QtWidgets/qscrollarea.h>
#include <QtWidgets/qgraphicsscene.h>
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
#if !defined(QT_NO_GRAPHICSVIEW)
class QGraphicsItem;
class QPainterPath;
class QPolygonF;
@ -313,8 +312,6 @@ inline QPoint QGraphicsView::mapFromScene(qreal ax, qreal ay) const
inline QPolygon QGraphicsView::mapFromScene(qreal ax, qreal ay, qreal w, qreal h) const
{ return mapFromScene(QRectF(ax, ay, w, h)); }
#endif // QT_NO_GRAPHICSVIEW
QT_END_NAMESPACE
#endif // QGRAPHICSVIEW_H

View File

@ -54,8 +54,6 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "qgraphicsview.h"
#if !defined(QT_NO_GRAPHICSVIEW)
#include <QtGui/qevent.h>
#include <QtCore/qcoreapplication.h>
#include "qgraphicssceneevent.h"
@ -63,6 +61,8 @@
#include <private/qabstractscrollarea_p.h>
#include <private/qapplication_p.h>
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
class Q_WIDGETS_EXPORT QGraphicsViewPrivate : public QAbstractScrollAreaPrivate
@ -231,6 +231,4 @@ public:
QT_END_NAMESPACE
#endif // QT_NO_GRAPHICSVIEW
#endif

View File

@ -39,8 +39,6 @@
#include "qglobal.h"
#ifndef QT_NO_GRAPHICSVIEW
#include "qgraphicswidget.h"
#include "qgraphicswidget_p.h"
#include "qgraphicslayout.h"
@ -2425,5 +2423,3 @@ void QGraphicsWidget::dumpFocusChain()
QT_END_NAMESPACE
#include "moc_qgraphicswidget.cpp"
#endif //QT_NO_GRAPHICSVIEW

View File

@ -46,8 +46,9 @@
#include <QtWidgets/qgraphicsitem.h>
#include <QtGui/qpalette.h>
QT_BEGIN_NAMESPACE
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
class QFont;
class QFontMetrics;
@ -58,8 +59,6 @@ class QGraphicsSceneResizeEvent;
class QStyle;
class QStyleOption;
#if !defined(QT_NO_GRAPHICSVIEW)
class QGraphicsWidgetPrivate;
class Q_WIDGETS_EXPORT QGraphicsWidget : public QGraphicsObject, public QGraphicsLayoutItem
@ -239,8 +238,6 @@ private:
inline void QGraphicsWidget::setGeometry(qreal ax, qreal ay, qreal aw, qreal ah)
{ setGeometry(QRectF(ax, ay, aw, ah)); }
#endif
QT_END_NAMESPACE
#endif

View File

@ -39,8 +39,6 @@
#include "qglobal.h"
#ifndef QT_NO_GRAPHICSVIEW
#include <QtCore/qdebug.h>
#include <QtCore/qnumeric.h>
#include "qgraphicswidget_p.h"
@ -897,5 +895,3 @@ void QGraphicsWidgetPrivate::setGeometryFromSetPos()
}
QT_END_NAMESPACE
#endif //QT_NO_GRAPHICSVIEW

View File

@ -60,13 +60,13 @@
#include <QtWidgets/qsizepolicy.h>
#include <QtWidgets/qstyle.h>
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
class QGraphicsLayout;
class QStyleOptionTitleBar;
#if !defined(QT_NO_GRAPHICSVIEW)
class QGraphicsWidgetPrivate : public QGraphicsItemPrivate
{
Q_DECLARE_PUBLIC(QGraphicsWidget)
@ -201,8 +201,6 @@ public:
#endif
};
#endif
QT_END_NAMESPACE
#endif //QGRAPHICSWIDGET_P_H

View File

@ -56,6 +56,8 @@
#include <QtCore/qpair.h>
#include <QtCore/qstring.h>
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
struct QSimplexVariable

View File

@ -114,7 +114,7 @@ void QActionPrivate::sendDataChanged()
QWidget *w = widgets.at(i);
QApplication::sendEvent(w, &e);
}
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
for (int i = 0; i < graphicsWidgets.size(); ++i) {
QGraphicsWidget *w = graphicsWidgets.at(i);
QApplication::sendEvent(w, &e);
@ -279,6 +279,8 @@ void QActionPrivate::setShortcutEnabled(bool enable, QShortcutMap &map)
/*!
Constructs an action with \a parent. If \a parent is an action
group the action will be automatically inserted into the group.
\note The \a parent argument is optional since Qt 5.7.
*/
QAction::QAction(QObject* parent)
: QAction(*new QActionPrivate, parent)
@ -360,7 +362,7 @@ QList<QWidget *> QAction::associatedWidgets() const
return d->widgets;
}
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
/*!
\since 4.5
Returns a list of widgets this action has been added to.
@ -565,7 +567,7 @@ QAction::~QAction()
QWidget *w = d->widgets.at(i);
w->removeAction(this);
}
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
for (int i = d->graphicsWidgets.size()-1; i >= 0; --i) {
QGraphicsWidget *w = d->graphicsWidgets.at(i);
w->removeAction(this);

View File

@ -175,7 +175,7 @@ public:
QWidget *parentWidget() const;
QList<QWidget *> associatedWidgets() const;
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
QList<QGraphicsWidget *> associatedGraphicsWidgets() const; // ### suboptimal
#endif

View File

@ -54,7 +54,9 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "QtWidgets/qaction.h"
#include "QtWidgets/qmenu.h"
#if QT_CONFIG(graphicsview)
#include "private/qgraphicswidget_p.h"
#endif
#include "private/qobject_p.h"
QT_BEGIN_NAMESPACE
@ -112,7 +114,7 @@ public:
QAction::Priority priority;
QList<QWidget *> widgets;
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
QList<QGraphicsWidget *> graphicsWidgets;
#endif
#ifndef QT_NO_SHORTCUT

View File

@ -47,7 +47,10 @@
#include "qevent.h"
#include "qfile.h"
#include "qfileinfo.h"
#if QT_CONFIG(graphicsview)
#include "qgraphicsscene.h"
#include <QtWidgets/qgraphicsproxywidget.h>
#endif
#include "qhash.h"
#include "qset.h"
#include "qlayout.h"
@ -70,7 +73,6 @@
#include "qmessagebox.h"
#endif
#include "qwidgetwindow_p.h"
#include <QtWidgets/qgraphicsproxywidget.h>
#include <QtGui/qstylehints.h>
#include <QtGui/qinputmethod.h>
#include <QtGui/private/qwindow_p.h>
@ -1443,13 +1445,13 @@ void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char*
}
// Send to all scenes as well.
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
QList<QGraphicsScene *> &scenes = qApp->d_func()->scene_list;
for (QList<QGraphicsScene *>::ConstIterator it = scenes.constBegin();
it != scenes.constEnd(); ++it) {
QApplication::sendEvent(*it, &e);
}
#endif //QT_NO_GRAPHICSVIEW
#endif // QT_CONFIG(graphicsview)
}
if (!className && (!QApplicationPrivate::sys_pal || !palette.isCopyOf(*QApplicationPrivate::sys_pal))) {
if (!QApplicationPrivate::set_pal)
@ -1627,14 +1629,14 @@ void QApplication::setFont(const QFont &font, const char *className)
sendEvent(w, &e);
}
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
// Send to all scenes as well.
QList<QGraphicsScene *> &scenes = qApp->d_func()->scene_list;
for (QList<QGraphicsScene *>::ConstIterator it = scenes.constBegin();
it != scenes.constEnd(); ++it) {
QApplication::sendEvent(*it, &e);
}
#endif //QT_NO_GRAPHICSVIEW
#endif // QT_CONFIG(graphicsview)
}
if (!className && (!QApplicationPrivate::sys_font || !font.isCopyOf(*QApplicationPrivate::sys_font))) {
if (!QApplicationPrivate::set_font)
@ -1769,7 +1771,7 @@ QWidget *QApplication::focusWidget()
void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason)
{
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
if (focus && focus->window()->graphicsProxyWidget())
return;
#endif
@ -2076,7 +2078,7 @@ void QApplication::setActiveWindow(QWidget* act)
if (QApplicationPrivate::active_window == window)
return;
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
if (window && window->graphicsProxyWidget()) {
// Activate the proxy's view->viewport() ?
return;
@ -2386,7 +2388,7 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave, con
//check that we will not call qt_x11_enforce_cursor twice with the same native widget
if (parentOfLeavingCursor && (!enterOnAlien
|| parentOfLeavingCursor->effectiveWinId() != enter->effectiveWinId())) {
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
if (!parentOfLeavingCursor->window()->graphicsProxyWidget())
#endif
{
@ -2405,7 +2407,7 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave, con
if (!cursorWidget)
return;
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
if (cursorWidget->window()->graphicsProxyWidget()) {
QWidgetPrivate::nearestGraphicsProxyWidget(cursorWidget)->setCursor(cursorWidget->cursor());
} else
@ -3099,7 +3101,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
case QEvent::KeyRelease:
{
bool isWidget = receiver->isWidgetType();
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
const bool isGraphicsWidget = !isWidget && qobject_cast<QGraphicsWidget *>(receiver);
#endif
QKeyEvent* key = static_cast<QKeyEvent*>(e);
@ -3111,7 +3113,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
else
key->ignore();
QWidget *w = isWidget ? static_cast<QWidget *>(receiver) : 0;
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
QGraphicsWidget *gw = isGraphicsWidget ? static_cast<QGraphicsWidget *>(receiver) : 0;
#endif
res = d->notify_helper(receiver, e);
@ -3131,14 +3133,14 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
*/
|| !pr
|| (isWidget && (w->isWindow() || !w->parentWidget()))
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
|| (isGraphicsWidget && (gw->isWindow() || !gw->parentWidget()))
#endif
) {
break;
}
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
receiver = w ? (QObject *)w->parentWidget() : (QObject *)gw->parentWidget();
#else
receiver = w->parentWidget();
@ -3431,7 +3433,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
case QEvent::DragEnter: {
QWidget* w = static_cast<QWidget *>(receiver);
QDragEnterEvent *dragEvent = static_cast<QDragEnterEvent *>(e);
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
// QGraphicsProxyWidget handles its own propagation,
// and we must not change QDragManagers currentTarget.
QWExtra *extra = w->window()->d_func()->extra;
@ -3459,7 +3461,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
case QEvent::Drop:
case QEvent::DragLeave: {
QWidget* w = static_cast<QWidget *>(receiver);
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
// QGraphicsProxyWidget handles its own propagation,
// and we must not change QDragManagers currentTarget.
QWExtra *extra = w->window()->d_func()->extra;
@ -3481,7 +3483,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
}
res = d->notify_helper(w, e);
if (e->type() != QEvent::DragMove
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
&& !isProxyWidget
#endif
)

View File

@ -165,7 +165,7 @@ public:
static QWidget *focusNextPrevChild_helper(QWidget *toplevel, bool next,
bool *wrappingOccurred = 0);
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
// Maintain a list of all scenes to ensure font and palette propagation to
// all scenes.
QList<QGraphicsScene *> scene_list;

View File

@ -40,7 +40,9 @@
#include "qgesture.h"
#include "private/qgesture_p.h"
#include "private/qstandardgestures_p.h"
#if QT_CONFIG(graphicsview)
#include "qgraphicsview.h"
#endif
#include <private/qdebug_p.h>
#ifndef QT_NO_GESTURES
@ -1067,7 +1069,7 @@ QWidget *QGestureEvent::widget() const
return m_widget;
}
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
/*!
Returns the scene-local coordinates if the \a gesturePoint is inside a
graphics view.
@ -1089,7 +1091,7 @@ QPointF QGestureEvent::mapToGraphicsScene(const QPointF &gesturePoint) const
}
return QPointF();
}
#endif //QT_NO_GRAPHICSVIEW
#endif // QT_CONFIG(graphicsview)
#ifndef QT_NO_DEBUG_STREAM

View File

@ -301,7 +301,7 @@ public:
void setWidget(QWidget *widget);
QWidget *widget() const;
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
QPointF mapToGraphicsScene(const QPointF &gesturePoint) const;
#endif

View File

@ -41,13 +41,15 @@
#include "private/qstandardgestures_p.h"
#include "private/qwidget_p.h"
#include "private/qgesture_p.h"
#if QT_CONFIG(graphicsview)
#include "private/qgraphicsitem_p.h"
#include "qgraphicsitem.h"
#endif
#include "private/qevent_p.h"
#include "private/qapplication_p.h"
#include "private/qwidgetwindow_p.h"
#include "qgesture.h"
#include "qevent.h"
#include "qgraphicsitem.h"
#ifdef Q_OS_OSX
#include "qmacgesturerecognizer_p.h"
@ -207,7 +209,7 @@ QGesture *QGestureManager::getState(QObject *object, QGestureRecognizer *recogni
return 0;
} else if (QGesture *g = qobject_cast<QGesture *>(object)) {
return g;
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
} else {
Q_ASSERT(qobject_cast<QGraphicsObject *>(object));
QGraphicsObject *graphicsObject = static_cast<QGraphicsObject *>(object);
@ -510,7 +512,7 @@ bool QGestureManager::filterEvent(QWidget *receiver, QEvent *event)
return contexts.isEmpty() ? false : filterEventThroughContexts(contexts, event);
}
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
bool QGestureManager::filterEvent(QGraphicsObject *receiver, QEvent *event)
{
QMap<Qt::GestureType, int> types;

View File

@ -75,9 +75,9 @@ public:
bool filterEvent(QWidget *receiver, QEvent *event);
bool filterEvent(QObject *receiver, QEvent *event);
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
bool filterEvent(QGraphicsObject *receiver, QEvent *event);
#endif //QT_NO_GRAPHICSVIEW
#endif // QT_CONFIG(graphicsview)
static QGestureManager* instance(); // declared in qapplication.cpp
static bool gesturePending(QObject *o);

View File

@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE
static bool correctWidgetContext(Qt::ShortcutContext context, QWidget *w, QWidget *active_window);
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
static bool correctGraphicsWidgetContext(Qt::ShortcutContext context, QGraphicsWidget *w, QWidget *active_window);
#endif
#ifndef QT_NO_ACTION
@ -110,7 +110,7 @@ bool qWidgetShortcutContextMatcher(QObject *object, Qt::ShortcutContext context)
return correctActionContext(context, a, active_window);
#endif
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
if (QGraphicsWidget *gw = qobject_cast<QGraphicsWidget *>(object))
return correctGraphicsWidgetContext(context, gw, active_window);
#endif
@ -168,7 +168,7 @@ static bool correctWidgetContext(Qt::ShortcutContext context, QWidget *w, QWidge
// Below is Qt::WindowShortcut context
QWidget *tlw = w->window();
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
if (QWExtra *topData = static_cast<QWidgetPrivate *>(QObjectPrivate::get(tlw))->extra) {
if (topData->proxyWidget) {
bool res = correctGraphicsWidgetContext(context, (QGraphicsWidget *)topData->proxyWidget, active_window);
@ -204,7 +204,7 @@ static bool correctWidgetContext(Qt::ShortcutContext context, QWidget *w, QWidge
return true;
}
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
static bool correctGraphicsWidgetContext(Qt::ShortcutContext context, QGraphicsWidget *w, QWidget *active_window)
{
bool visible = w->isVisible();
@ -298,7 +298,7 @@ static bool correctActionContext(Qt::ShortcutContext context, QAction *a, QWidge
return true;
}
#ifndef QT_NO_GRAPHICSVIEW
#if QT_CONFIG(graphicsview)
const QList<QGraphicsWidget *> &graphicsWidgets = static_cast<QActionPrivate *>(QObjectPrivate::get(a))->graphicsWidgets;
#if defined(DEBUG_QSHORTCUTMAP)
if (graphicsWidgets.isEmpty())

Some files were not shown because too many files have changed in this diff Show More