Adjust code format, add space after 'if'
Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
parent
802e5a45ba
commit
e13173c112
@ -293,7 +293,7 @@ void QUnifiedTimer::stopAnimationDriver()
|
|||||||
void QUnifiedTimer::updateAnimationTimers()
|
void QUnifiedTimer::updateAnimationTimers()
|
||||||
{
|
{
|
||||||
//setCurrentTime can get this called again while we're the for loop. At least with pauseAnimations
|
//setCurrentTime can get this called again while we're the for loop. At least with pauseAnimations
|
||||||
if(insideTick)
|
if (insideTick)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const qint64 totalElapsed = elapsed();
|
const qint64 totalElapsed = elapsed();
|
||||||
|
@ -700,7 +700,7 @@ QLibraryInfo::rawLocation(LibraryPath loc, PathGroup group)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(!key.isNull()) {
|
if (!key.isNull()) {
|
||||||
QSettings *config = QLibraryInfoPrivate::configuration();
|
QSettings *config = QLibraryInfoPrivate::configuration();
|
||||||
config->beginGroup(QLatin1String(
|
config->beginGroup(QLatin1String(
|
||||||
#ifdef QT_BUILD_QMAKE
|
#ifdef QT_BUILD_QMAKE
|
||||||
|
@ -355,9 +355,9 @@ bool QDirIteratorPrivate::matchesFilters(const QString &fileName, const QFileInf
|
|||||||
// skip symlinks
|
// skip symlinks
|
||||||
const bool skipSymlinks = (filters & QDir::NoSymLinks);
|
const bool skipSymlinks = (filters & QDir::NoSymLinks);
|
||||||
const bool includeSystem = (filters & QDir::System);
|
const bool includeSystem = (filters & QDir::System);
|
||||||
if(skipSymlinks && fi.isSymLink()) {
|
if (skipSymlinks && fi.isSymLink()) {
|
||||||
// The only reason to save this file is if it is a broken link and we are requesting system files.
|
// The only reason to save this file is if it is a broken link and we are requesting system files.
|
||||||
if(!includeSystem || fi.exists())
|
if (!includeSystem || fi.exists())
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -453,7 +453,7 @@ QFile::remove()
|
|||||||
}
|
}
|
||||||
unsetError();
|
unsetError();
|
||||||
close();
|
close();
|
||||||
if(error() == QFile::NoError) {
|
if (error() == QFile::NoError) {
|
||||||
if (d->engine()->remove()) {
|
if (d->engine()->remove()) {
|
||||||
unsetError();
|
unsetError();
|
||||||
return true;
|
return true;
|
||||||
@ -630,7 +630,7 @@ QFile::rename(const QString &newName)
|
|||||||
}
|
}
|
||||||
unsetError();
|
unsetError();
|
||||||
close();
|
close();
|
||||||
if(error() == QFile::NoError) {
|
if (error() == QFile::NoError) {
|
||||||
if (changingCase ? d->engine()->renameOverwrite(newName) : d->engine()->rename(newName)) {
|
if (changingCase ? d->engine()->renameOverwrite(newName) : d->engine()->rename(newName)) {
|
||||||
unsetError();
|
unsetError();
|
||||||
// engine was able to handle the new name so we just reset it
|
// engine was able to handle the new name so we just reset it
|
||||||
@ -661,7 +661,7 @@ QFile::rename(const QString &newName)
|
|||||||
d->setError(QFile::RenameError, errorString());
|
d->setError(QFile::RenameError, errorString());
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
if(!error) {
|
if (!error) {
|
||||||
if (!remove()) {
|
if (!remove()) {
|
||||||
d->setError(QFile::RenameError, tr("Cannot remove source file"));
|
d->setError(QFile::RenameError, tr("Cannot remove source file"));
|
||||||
error = true;
|
error = true;
|
||||||
@ -785,13 +785,13 @@ QFile::copy(const QString &newName)
|
|||||||
}
|
}
|
||||||
unsetError();
|
unsetError();
|
||||||
close();
|
close();
|
||||||
if(error() == QFile::NoError) {
|
if (error() == QFile::NoError) {
|
||||||
if (d->engine()->copy(newName)) {
|
if (d->engine()->copy(newName)) {
|
||||||
unsetError();
|
unsetError();
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
bool error = false;
|
bool error = false;
|
||||||
if(!open(QFile::ReadOnly)) {
|
if (!open(QFile::ReadOnly)) {
|
||||||
error = true;
|
error = true;
|
||||||
d->setError(QFile::CopyError, tr("Cannot open %1 for input").arg(d->fileName));
|
d->setError(QFile::CopyError, tr("Cannot open %1 for input").arg(d->fileName));
|
||||||
} else {
|
} else {
|
||||||
@ -855,7 +855,7 @@ QFile::copy(const QString &newName)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!error) {
|
if (!error) {
|
||||||
QFile::setPermissions(newName, permissions());
|
QFile::setPermissions(newName, permissions());
|
||||||
close();
|
close();
|
||||||
unsetError();
|
unsetError();
|
||||||
@ -920,7 +920,7 @@ bool QFile::open(OpenMode mode)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
QFile::FileError err = d->fileEngine->error();
|
QFile::FileError err = d->fileEngine->error();
|
||||||
if(err == QFile::UnspecifiedError)
|
if (err == QFile::UnspecifiedError)
|
||||||
err = QFile::OpenError;
|
err = QFile::OpenError;
|
||||||
d->setError(err, d->fileEngine->errorString());
|
d->setError(err, d->fileEngine->errorString());
|
||||||
return false;
|
return false;
|
||||||
|
@ -792,7 +792,7 @@ bool QFileSystemEngine::fillPermissions(const QFileSystemEntry &entry, QFileSyst
|
|||||||
DWORD res = GetNamedSecurityInfo(reinterpret_cast<const wchar_t*>(fname.utf16()), SE_FILE_OBJECT,
|
DWORD res = GetNamedSecurityInfo(reinterpret_cast<const wchar_t*>(fname.utf16()), SE_FILE_OBJECT,
|
||||||
OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
|
OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
|
||||||
&pOwner, &pGroup, &pDacl, 0, &pSD);
|
&pOwner, &pGroup, &pDacl, 0, &pSD);
|
||||||
if(res == ERROR_SUCCESS) {
|
if (res == ERROR_SUCCESS) {
|
||||||
ACCESS_MASK access_mask;
|
ACCESS_MASK access_mask;
|
||||||
TRUSTEE_W trustee;
|
TRUSTEE_W trustee;
|
||||||
if (what & QFileSystemMetaData::UserPermissions) { // user
|
if (what & QFileSystemMetaData::UserPermissions) { // user
|
||||||
@ -845,11 +845,11 @@ bool QFileSystemEngine::fillPermissions(const QFileSystemEntry &entry, QFileSyst
|
|||||||
BuildTrusteeWithSid(&trustee, pOwner);
|
BuildTrusteeWithSid(&trustee, pOwner);
|
||||||
if (GetEffectiveRightsFromAcl(pDacl, &trustee, &access_mask) != ERROR_SUCCESS)
|
if (GetEffectiveRightsFromAcl(pDacl, &trustee, &access_mask) != ERROR_SUCCESS)
|
||||||
access_mask = (ACCESS_MASK)-1;
|
access_mask = (ACCESS_MASK)-1;
|
||||||
if(access_mask & ReadMask)
|
if (access_mask & ReadMask)
|
||||||
data.entryFlags |= QFileSystemMetaData::OwnerReadPermission;
|
data.entryFlags |= QFileSystemMetaData::OwnerReadPermission;
|
||||||
if(access_mask & WriteMask)
|
if (access_mask & WriteMask)
|
||||||
data.entryFlags |= QFileSystemMetaData::OwnerWritePermission;
|
data.entryFlags |= QFileSystemMetaData::OwnerWritePermission;
|
||||||
if(access_mask & ExecMask)
|
if (access_mask & ExecMask)
|
||||||
data.entryFlags |= QFileSystemMetaData::OwnerExecutePermission;
|
data.entryFlags |= QFileSystemMetaData::OwnerExecutePermission;
|
||||||
}
|
}
|
||||||
if (what & QFileSystemMetaData::GroupPermissions) { // group
|
if (what & QFileSystemMetaData::GroupPermissions) { // group
|
||||||
@ -857,22 +857,22 @@ bool QFileSystemEngine::fillPermissions(const QFileSystemEntry &entry, QFileSyst
|
|||||||
BuildTrusteeWithSid(&trustee, pGroup);
|
BuildTrusteeWithSid(&trustee, pGroup);
|
||||||
if (GetEffectiveRightsFromAcl(pDacl, &trustee, &access_mask) != ERROR_SUCCESS)
|
if (GetEffectiveRightsFromAcl(pDacl, &trustee, &access_mask) != ERROR_SUCCESS)
|
||||||
access_mask = (ACCESS_MASK)-1;
|
access_mask = (ACCESS_MASK)-1;
|
||||||
if(access_mask & ReadMask)
|
if (access_mask & ReadMask)
|
||||||
data.entryFlags |= QFileSystemMetaData::GroupReadPermission;
|
data.entryFlags |= QFileSystemMetaData::GroupReadPermission;
|
||||||
if(access_mask & WriteMask)
|
if (access_mask & WriteMask)
|
||||||
data.entryFlags |= QFileSystemMetaData::GroupWritePermission;
|
data.entryFlags |= QFileSystemMetaData::GroupWritePermission;
|
||||||
if(access_mask & ExecMask)
|
if (access_mask & ExecMask)
|
||||||
data.entryFlags |= QFileSystemMetaData::GroupExecutePermission;
|
data.entryFlags |= QFileSystemMetaData::GroupExecutePermission;
|
||||||
}
|
}
|
||||||
if (what & QFileSystemMetaData::OtherPermissions) { // other (world)
|
if (what & QFileSystemMetaData::OtherPermissions) { // other (world)
|
||||||
data.knownFlagsMask |= QFileSystemMetaData::OtherPermissions;
|
data.knownFlagsMask |= QFileSystemMetaData::OtherPermissions;
|
||||||
if (GetEffectiveRightsFromAcl(pDacl, &worldTrusteeW, &access_mask) != ERROR_SUCCESS)
|
if (GetEffectiveRightsFromAcl(pDacl, &worldTrusteeW, &access_mask) != ERROR_SUCCESS)
|
||||||
access_mask = (ACCESS_MASK)-1; // ###
|
access_mask = (ACCESS_MASK)-1; // ###
|
||||||
if(access_mask & ReadMask)
|
if (access_mask & ReadMask)
|
||||||
data.entryFlags |= QFileSystemMetaData::OtherReadPermission;
|
data.entryFlags |= QFileSystemMetaData::OtherReadPermission;
|
||||||
if(access_mask & WriteMask)
|
if (access_mask & WriteMask)
|
||||||
data.entryFlags |= QFileSystemMetaData::OtherWritePermission;
|
data.entryFlags |= QFileSystemMetaData::OtherWritePermission;
|
||||||
if(access_mask & ExecMask)
|
if (access_mask & ExecMask)
|
||||||
data.entryFlags |= QFileSystemMetaData::OwnerExecutePermission;
|
data.entryFlags |= QFileSystemMetaData::OwnerExecutePermission;
|
||||||
}
|
}
|
||||||
LocalFree(pSD);
|
LocalFree(pSD);
|
||||||
@ -1281,7 +1281,7 @@ bool QFileSystemEngine::setCurrentPath(const QFileSystemEntry &entry)
|
|||||||
{
|
{
|
||||||
QFileSystemMetaData meta;
|
QFileSystemMetaData meta;
|
||||||
fillMetaData(entry, meta, QFileSystemMetaData::ExistsAttribute | QFileSystemMetaData::DirectoryType);
|
fillMetaData(entry, meta, QFileSystemMetaData::ExistsAttribute | QFileSystemMetaData::DirectoryType);
|
||||||
if(!(meta.exists() && meta.isDirectory()))
|
if (!(meta.exists() && meta.isDirectory()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
//TODO: this should really be using nativeFilePath(), but that returns a path in long format \\?\c:\foo
|
//TODO: this should really be using nativeFilePath(), but that returns a path in long format \\?\c:\foo
|
||||||
@ -1326,7 +1326,7 @@ bool QFileSystemEngine::copyFile(const QFileSystemEntry &source, const QFileSyst
|
|||||||
{
|
{
|
||||||
bool ret = ::CopyFile((wchar_t*)source.nativeFilePath().utf16(),
|
bool ret = ::CopyFile((wchar_t*)source.nativeFilePath().utf16(),
|
||||||
(wchar_t*)target.nativeFilePath().utf16(), true) != 0;
|
(wchar_t*)target.nativeFilePath().utf16(), true) != 0;
|
||||||
if(!ret)
|
if (!ret)
|
||||||
error = QSystemError(::GetLastError(), QSystemError::NativeError);
|
error = QSystemError(::GetLastError(), QSystemError::NativeError);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1339,7 +1339,7 @@ bool QFileSystemEngine::renameFile(const QFileSystemEntry &source, const QFileSy
|
|||||||
|
|
||||||
bool ret = ::MoveFile((wchar_t*)source.nativeFilePath().utf16(),
|
bool ret = ::MoveFile((wchar_t*)source.nativeFilePath().utf16(),
|
||||||
(wchar_t*)target.nativeFilePath().utf16()) != 0;
|
(wchar_t*)target.nativeFilePath().utf16()) != 0;
|
||||||
if(!ret)
|
if (!ret)
|
||||||
error = QSystemError(::GetLastError(), QSystemError::NativeError);
|
error = QSystemError(::GetLastError(), QSystemError::NativeError);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1364,7 +1364,7 @@ bool QFileSystemEngine::removeFile(const QFileSystemEntry &entry, QSystemError &
|
|||||||
Q_CHECK_FILE_NAME(entry, false);
|
Q_CHECK_FILE_NAME(entry, false);
|
||||||
|
|
||||||
bool ret = ::DeleteFile((wchar_t*)entry.nativeFilePath().utf16()) != 0;
|
bool ret = ::DeleteFile((wchar_t*)entry.nativeFilePath().utf16()) != 0;
|
||||||
if(!ret)
|
if (!ret)
|
||||||
error = QSystemError(::GetLastError(), QSystemError::NativeError);
|
error = QSystemError(::GetLastError(), QSystemError::NativeError);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1477,7 +1477,7 @@ bool QFileSystemEngine::setPermissions(const QFileSystemEntry &entry, QFile::Per
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
bool ret = ::_wchmod(reinterpret_cast<const wchar_t*>(entry.nativeFilePath().utf16()), mode) == 0;
|
bool ret = ::_wchmod(reinterpret_cast<const wchar_t*>(entry.nativeFilePath().utf16()), mode) == 0;
|
||||||
if(!ret)
|
if (!ret)
|
||||||
error = QSystemError(errno, QSystemError::StandardLibraryError);
|
error = QSystemError(errno, QSystemError::StandardLibraryError);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ void QFileSystemWatcherPrivate::init()
|
|||||||
|
|
||||||
void QFileSystemWatcherPrivate::initPollerEngine()
|
void QFileSystemWatcherPrivate::initPollerEngine()
|
||||||
{
|
{
|
||||||
if(poller)
|
if (poller)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Q_Q(QFileSystemWatcher);
|
Q_Q(QFileSystemWatcher);
|
||||||
@ -379,7 +379,7 @@ QStringList QFileSystemWatcher::addPaths(const QStringList &paths)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// Normal runtime case - search intelligently for best engine
|
// Normal runtime case - search intelligently for best engine
|
||||||
if(d->native) {
|
if (d->native) {
|
||||||
return d->native;
|
return d->native;
|
||||||
} else {
|
} else {
|
||||||
d_func()->initPollerEngine();
|
d_func()->initPollerEngine();
|
||||||
|
@ -797,7 +797,7 @@ QString QTemporaryFile::fileName() const
|
|||||||
if (tef && tef->isReallyOpen())
|
if (tef && tef->isReallyOpen())
|
||||||
const_cast<QTemporaryFilePrivate *>(d)->materializeUnnamedFile();
|
const_cast<QTemporaryFilePrivate *>(d)->materializeUnnamedFile();
|
||||||
|
|
||||||
if(d->fileName.isEmpty())
|
if (d->fileName.isEmpty())
|
||||||
return QString();
|
return QString();
|
||||||
return d->engine()->fileName(QAbstractFileEngine::DefaultName);
|
return d->engine()->fileName(QAbstractFileEngine::DefaultName);
|
||||||
}
|
}
|
||||||
@ -887,12 +887,12 @@ bool QTemporaryFile::rename(const QString &newName)
|
|||||||
QTemporaryFile *QTemporaryFile::createNativeFile(QFile &file)
|
QTemporaryFile *QTemporaryFile::createNativeFile(QFile &file)
|
||||||
{
|
{
|
||||||
if (QAbstractFileEngine *engine = file.d_func()->engine()) {
|
if (QAbstractFileEngine *engine = file.d_func()->engine()) {
|
||||||
if(engine->fileFlags(QAbstractFileEngine::FlagsMask) & QAbstractFileEngine::LocalDiskFlag)
|
if (engine->fileFlags(QAbstractFileEngine::FlagsMask) & QAbstractFileEngine::LocalDiskFlag)
|
||||||
return nullptr; // native already
|
return nullptr; // native already
|
||||||
//cache
|
//cache
|
||||||
bool wasOpen = file.isOpen();
|
bool wasOpen = file.isOpen();
|
||||||
qint64 old_off = 0;
|
qint64 old_off = 0;
|
||||||
if(wasOpen)
|
if (wasOpen)
|
||||||
old_off = file.pos();
|
old_off = file.pos();
|
||||||
else if (!file.open(QIODevice::ReadOnly))
|
else if (!file.open(QIODevice::ReadOnly))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -913,7 +913,7 @@ QTemporaryFile *QTemporaryFile::createNativeFile(QFile &file)
|
|||||||
ret = nullptr;
|
ret = nullptr;
|
||||||
}
|
}
|
||||||
//restore
|
//restore
|
||||||
if(wasOpen)
|
if (wasOpen)
|
||||||
file.seek(old_off);
|
file.seek(old_off);
|
||||||
else
|
else
|
||||||
file.close();
|
file.close();
|
||||||
|
@ -2297,7 +2297,7 @@ QString QCoreApplication::applicationFilePath()
|
|||||||
return *QCoreApplicationPrivate::cachedApplicationFilePath;
|
return *QCoreApplicationPrivate::cachedApplicationFilePath;
|
||||||
#elif defined(Q_OS_MAC)
|
#elif defined(Q_OS_MAC)
|
||||||
QString qAppFileName_str = qAppFileName();
|
QString qAppFileName_str = qAppFileName();
|
||||||
if(!qAppFileName_str.isEmpty()) {
|
if (!qAppFileName_str.isEmpty()) {
|
||||||
QFileInfo fi(qAppFileName_str);
|
QFileInfo fi(qAppFileName_str);
|
||||||
if (fi.exists()) {
|
if (fi.exists()) {
|
||||||
QCoreApplicationPrivate::setApplicationFilePath(fi.canonicalFilePath());
|
QCoreApplicationPrivate::setApplicationFilePath(fi.canonicalFilePath());
|
||||||
|
@ -510,7 +510,7 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
|
|||||||
if (!(flags & QEventLoop::ExcludeUserInputEvents) && !d->queuedUserInputEvents.isEmpty()) {
|
if (!(flags & QEventLoop::ExcludeUserInputEvents) && !d->queuedUserInputEvents.isEmpty()) {
|
||||||
// process queued user input events
|
// process queued user input events
|
||||||
msg = d->queuedUserInputEvents.takeFirst();
|
msg = d->queuedUserInputEvents.takeFirst();
|
||||||
} else if(!(flags & QEventLoop::ExcludeSocketNotifiers) && !d->queuedSocketEvents.isEmpty()) {
|
} else if (!(flags & QEventLoop::ExcludeSocketNotifiers) && !d->queuedSocketEvents.isEmpty()) {
|
||||||
// process queued socket events
|
// process queued socket events
|
||||||
msg = d->queuedSocketEvents.takeFirst();
|
msg = d->queuedSocketEvents.takeFirst();
|
||||||
} else if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) {
|
} else if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) {
|
||||||
|
@ -3109,7 +3109,7 @@ bool QObject::disconnect(const QObject *sender, const QMetaMethod &signal,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (signal.mobj) {
|
if (signal.mobj) {
|
||||||
if(signal.methodType() != QMetaMethod::Signal) {
|
if (signal.methodType() != QMetaMethod::Signal) {
|
||||||
qCWarning(lcConnect, "QObject::%s: Attempt to %s non-signal %s::%s",
|
qCWarning(lcConnect, "QObject::%s: Attempt to %s non-signal %s::%s",
|
||||||
"disconnect","unbind",
|
"disconnect","unbind",
|
||||||
sender->metaObject()->className(), signal.methodSignature().constData());
|
sender->metaObject()->className(), signal.methodSignature().constData());
|
||||||
|
@ -801,7 +801,7 @@ void QLibraryPrivate::updatePluginState()
|
|||||||
.arg(qt_version&0xff)
|
.arg(qt_version&0xff)
|
||||||
.arg(debug ? QLatin1String("debug") : QLatin1String("release"));
|
.arg(debug ? QLatin1String("debug") : QLatin1String("release"));
|
||||||
#ifndef QT_NO_DEBUG_PLUGIN_CHECK
|
#ifndef QT_NO_DEBUG_PLUGIN_CHECK
|
||||||
} else if(debug != QLIBRARY_AS_DEBUG) {
|
} else if (debug != QLIBRARY_AS_DEBUG) {
|
||||||
//don't issue a qWarning since we will hopefully find a non-debug? --Sam
|
//don't issue a qWarning since we will hopefully find a non-debug? --Sam
|
||||||
errorString = QLibrary::tr("The plugin '%1' uses incompatible Qt library."
|
errorString = QLibrary::tr("The plugin '%1' uses incompatible Qt library."
|
||||||
" (Cannot mix debug and release libraries.)").arg(fileName);
|
" (Cannot mix debug and release libraries.)").arg(fileName);
|
||||||
|
@ -1572,7 +1572,7 @@ void QXmlStreamReaderPrivate::resolveTag()
|
|||||||
namespaceDeclaration.prefix.clear();
|
namespaceDeclaration.prefix.clear();
|
||||||
|
|
||||||
const XmlStringRef ns(dtdAttribute.defaultValue);
|
const XmlStringRef ns(dtdAttribute.defaultValue);
|
||||||
if(ns == QLatin1String("http://www.w3.org/2000/xmlns/") ||
|
if (ns == QLatin1String("http://www.w3.org/2000/xmlns/") ||
|
||||||
ns == QLatin1String("http://www.w3.org/XML/1998/namespace"))
|
ns == QLatin1String("http://www.w3.org/XML/1998/namespace"))
|
||||||
raiseWellFormedError(QXmlStream::tr("Illegal namespace declaration."));
|
raiseWellFormedError(QXmlStream::tr("Illegal namespace declaration."));
|
||||||
else
|
else
|
||||||
@ -1783,7 +1783,7 @@ void QXmlStreamReaderPrivate::startDocument()
|
|||||||
if (prefix.isEmpty() && key == QLatin1String("encoding")) {
|
if (prefix.isEmpty() && key == QLatin1String("encoding")) {
|
||||||
documentEncoding = value;
|
documentEncoding = value;
|
||||||
|
|
||||||
if(hasStandalone)
|
if (hasStandalone)
|
||||||
err = QXmlStream::tr("The standalone pseudo attribute must appear after the encoding.");
|
err = QXmlStream::tr("The standalone pseudo attribute must appear after the encoding.");
|
||||||
if (!QXmlUtils::isEncName(value))
|
if (!QXmlUtils::isEncName(value))
|
||||||
err = QXmlStream::tr("%1 is an invalid encoding name.").arg(value);
|
err = QXmlStream::tr("%1 is an invalid encoding name.").arg(value);
|
||||||
|
@ -529,7 +529,7 @@ private:
|
|||||||
*/
|
*/
|
||||||
inline void setType(const QXmlStreamReader::TokenType t)
|
inline void setType(const QXmlStreamReader::TokenType t)
|
||||||
{
|
{
|
||||||
if(type != QXmlStreamReader::Invalid)
|
if (type != QXmlStreamReader::Invalid)
|
||||||
type = t;
|
type = t;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -371,16 +371,16 @@ bool QXmlUtils::isPublicID(QStringView candidate)
|
|||||||
*/
|
*/
|
||||||
bool QXmlUtils::isNCName(QStringView ncName)
|
bool QXmlUtils::isNCName(QStringView ncName)
|
||||||
{
|
{
|
||||||
if(ncName.isEmpty())
|
if (ncName.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const QChar first(ncName.at(0));
|
const QChar first(ncName.at(0));
|
||||||
|
|
||||||
if(!QXmlUtils::isLetter(first) && first.unicode() != '_' && first.unicode() != ':')
|
if (!QXmlUtils::isLetter(first) && first.unicode() != '_' && first.unicode() != ':')
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (QChar at : ncName) {
|
for (QChar at : ncName) {
|
||||||
if(!QXmlUtils::isNameChar(at) || at == QLatin1Char(':'))
|
if (!QXmlUtils::isNameChar(at) || at == QLatin1Char(':'))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -275,7 +275,7 @@ public:
|
|||||||
|
|
||||||
inline qint64 sizeNextBlock() const
|
inline qint64 sizeNextBlock() const
|
||||||
{
|
{
|
||||||
if(buffers.isEmpty())
|
if (buffers.isEmpty())
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return buffers.first().size() - firstPos;
|
return buffers.first().size() - firstPos;
|
||||||
|
@ -4475,9 +4475,9 @@ QString QString::section(const QString &sep, qsizetype start, qsizetype end, Sec
|
|||||||
const QStringView §ion = sections.at(i);
|
const QStringView §ion = sections.at(i);
|
||||||
const bool empty = section.isEmpty();
|
const bool empty = section.isEmpty();
|
||||||
if (x >= start) {
|
if (x >= start) {
|
||||||
if(x == start)
|
if (x == start)
|
||||||
first_i = i;
|
first_i = i;
|
||||||
if(x == end)
|
if (x == end)
|
||||||
last_i = i;
|
last_i = i;
|
||||||
if (x > start && i > 0)
|
if (x > start && i > 0)
|
||||||
ret += sep;
|
ret += sep;
|
||||||
|
@ -65,7 +65,7 @@ void qtsDebug(const char *fmt, ...)
|
|||||||
va_end(va);
|
va_end(va);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
# define DEBUG_MSG if(false)qDebug
|
# define DEBUG_MSG if (false)qDebug
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static QBasicMutex destructorsMutex;
|
static QBasicMutex destructorsMutex;
|
||||||
|
@ -209,13 +209,13 @@ void QContiguousCache<T>::setCapacity(qsizetype asize)
|
|||||||
x->alloc = asize;
|
x->alloc = asize;
|
||||||
x->count = qMin(d->count, asize);
|
x->count = qMin(d->count, asize);
|
||||||
x->offset = d->offset + d->count - x->count;
|
x->offset = d->offset + d->count - x->count;
|
||||||
if(asize)
|
if (asize)
|
||||||
x->start = x->offset % x->alloc;
|
x->start = x->offset % x->alloc;
|
||||||
else
|
else
|
||||||
x->start = 0;
|
x->start = 0;
|
||||||
|
|
||||||
qsizetype oldcount = x->count;
|
qsizetype oldcount = x->count;
|
||||||
if(oldcount)
|
if (oldcount)
|
||||||
{
|
{
|
||||||
T *dest = x->array + (x->start + x->count-1) % x->alloc;
|
T *dest = x->array + (x->start + x->count-1) % x->alloc;
|
||||||
T *src = d->array + (d->start + d->count-1) % d->alloc;
|
T *src = d->array + (d->start + d->count-1) % d->alloc;
|
||||||
|
@ -260,7 +260,7 @@ void QBlittablePlatformPixmap::markRasterOverlayImpl(const QRectF &rect)
|
|||||||
if (!showRasterOverlay)
|
if (!showRasterOverlay)
|
||||||
return;
|
return;
|
||||||
QRectF transformationRect = clipAndTransformRect(rect);
|
QRectF transformationRect = clipAndTransformRect(rect);
|
||||||
if(!transformationRect.isEmpty()) {
|
if (!transformationRect.isEmpty()) {
|
||||||
QPainter p(overlay());
|
QPainter p(overlay());
|
||||||
p.setBrush(m_overlayColor);
|
p.setBrush(m_overlayColor);
|
||||||
p.setCompositionMode(QPainter::CompositionMode_Source);
|
p.setCompositionMode(QPainter::CompositionMode_Source);
|
||||||
|
@ -391,7 +391,7 @@ bool QPMCache::replace(const QPixmapCache::Key &key, const QPixmap &pixmap, int
|
|||||||
|
|
||||||
bool success = QCache<QPixmapCache::Key, QPixmapCacheEntry>::insert(cacheKey, new QPixmapCacheEntry(cacheKey, pixmap), cost);
|
bool success = QCache<QPixmapCache::Key, QPixmapCacheEntry>::insert(cacheKey, new QPixmapCacheEntry(cacheKey, pixmap), cost);
|
||||||
if (success) {
|
if (success) {
|
||||||
if(!theid) {
|
if (!theid) {
|
||||||
theid = startTimer(flush_time);
|
theid = startTimer(flush_time);
|
||||||
t = false;
|
t = false;
|
||||||
}
|
}
|
||||||
|
@ -3109,7 +3109,7 @@ QStringList QStandardItemModel::mimeTypes() const
|
|||||||
QMimeData *QStandardItemModel::mimeData(const QModelIndexList &indexes) const
|
QMimeData *QStandardItemModel::mimeData(const QModelIndexList &indexes) const
|
||||||
{
|
{
|
||||||
QMimeData *data = QAbstractItemModel::mimeData(indexes);
|
QMimeData *data = QAbstractItemModel::mimeData(indexes);
|
||||||
if(!data)
|
if (!data)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
const QString format = qStandardItemModelDataListMimeType();
|
const QString format = qStandardItemModelDataListMimeType();
|
||||||
|
@ -511,13 +511,13 @@ QAction::~QAction()
|
|||||||
void QAction::setActionGroup(QActionGroup *group)
|
void QAction::setActionGroup(QActionGroup *group)
|
||||||
{
|
{
|
||||||
Q_D(QAction);
|
Q_D(QAction);
|
||||||
if(group == d->group)
|
if (group == d->group)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(d->group)
|
if (d->group)
|
||||||
d->group->removeAction(this);
|
d->group->removeAction(this);
|
||||||
d->group = group;
|
d->group = group;
|
||||||
if(group)
|
if (group)
|
||||||
group->addAction(this);
|
group->addAction(this);
|
||||||
d->sendDataChanged();
|
d->sendDataChanged();
|
||||||
}
|
}
|
||||||
@ -652,7 +652,7 @@ QString QAction::text() const
|
|||||||
{
|
{
|
||||||
Q_D(const QAction);
|
Q_D(const QAction);
|
||||||
QString s = d->text;
|
QString s = d->text;
|
||||||
if(s.isEmpty()) {
|
if (s.isEmpty()) {
|
||||||
s = d->iconText;
|
s = d->iconText;
|
||||||
s.replace(QLatin1Char('&'), QLatin1String("&&"));
|
s.replace(QLatin1Char('&'), QLatin1String("&&"));
|
||||||
}
|
}
|
||||||
@ -1130,7 +1130,7 @@ void QAction::activate(ActionEvent event)
|
|||||||
}
|
}
|
||||||
if (!guard.isNull())
|
if (!guard.isNull())
|
||||||
emit triggered(d->checked);
|
emit triggered(d->checked);
|
||||||
} else if(event == Hover) {
|
} else if (event == Hover) {
|
||||||
emit hovered();
|
emit hovered();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -719,7 +719,7 @@ QCursorData::~QCursorData()
|
|||||||
/*! \internal */
|
/*! \internal */
|
||||||
void QCursorData::cleanup()
|
void QCursorData::cleanup()
|
||||||
{
|
{
|
||||||
if(!QCursorData::initialized)
|
if (!QCursorData::initialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (int shape = 0; shape <= Qt::LastCursor; ++shape) {
|
for (int shape = 0; shape <= Qt::LastCursor; ++shape) {
|
||||||
|
@ -1948,7 +1948,7 @@ bool QGuiApplication::notify(QObject *object, QEvent *event)
|
|||||||
*/
|
*/
|
||||||
bool QGuiApplication::event(QEvent *e)
|
bool QGuiApplication::event(QEvent *e)
|
||||||
{
|
{
|
||||||
if(e->type() == QEvent::LanguageChange) {
|
if (e->type() == QEvent::LanguageChange) {
|
||||||
setLayoutDirection(qt_detectRTLLanguage()?Qt::RightToLeft:Qt::LeftToRight);
|
setLayoutDirection(qt_detectRTLLanguage()?Qt::RightToLeft:Qt::LeftToRight);
|
||||||
for (auto *topLevelWindow : QGuiApplication::topLevelWindows()) {
|
for (auto *topLevelWindow : QGuiApplication::topLevelWindows()) {
|
||||||
if (topLevelWindow->flags() != Qt::Desktop)
|
if (topLevelWindow->flags() != Qt::Desktop)
|
||||||
|
@ -964,7 +964,7 @@ QKeySequence QKeySequence::mnemonic(const QString &text)
|
|||||||
{
|
{
|
||||||
QKeySequence ret;
|
QKeySequence ret;
|
||||||
|
|
||||||
if(qt_sequence_no_mnemonics)
|
if (qt_sequence_no_mnemonics)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
@ -1176,7 +1176,7 @@ int QKeySequencePrivate::decodeString(QString accel, QKeySequence::SequenceForma
|
|||||||
|
|
||||||
int p = accel.lastIndexOf(QLatin1Char('+'), accel.length() - 2); // -2 so that Ctrl++ works
|
int p = accel.lastIndexOf(QLatin1Char('+'), accel.length() - 2); // -2 so that Ctrl++ works
|
||||||
QStringView accelRef(accel);
|
QStringView accelRef(accel);
|
||||||
if(p > 0)
|
if (p > 0)
|
||||||
accelRef = accelRef.mid(p + 1);
|
accelRef = accelRef.mid(p + 1);
|
||||||
|
|
||||||
int fnum = 0;
|
int fnum = 0;
|
||||||
|
@ -734,8 +734,8 @@ QPalette::operator QVariant() const
|
|||||||
const QBrush &QPalette::brush(ColorGroup gr, ColorRole cr) const
|
const QBrush &QPalette::brush(ColorGroup gr, ColorRole cr) const
|
||||||
{
|
{
|
||||||
Q_ASSERT(cr < NColorRoles);
|
Q_ASSERT(cr < NColorRoles);
|
||||||
if(gr >= (int)NColorGroups) {
|
if (gr >= (int)NColorGroups) {
|
||||||
if(gr == Current) {
|
if (gr == Current) {
|
||||||
gr = currentGroup;
|
gr = currentGroup;
|
||||||
} else {
|
} else {
|
||||||
qWarning("QPalette::brush: Unknown ColorGroup: %d", (int)gr);
|
qWarning("QPalette::brush: Unknown ColorGroup: %d", (int)gr);
|
||||||
@ -832,7 +832,7 @@ void QPalette::detach()
|
|||||||
x->br[grp][role] = d->br[grp][role];
|
x->br[grp][role] = d->br[grp][role];
|
||||||
}
|
}
|
||||||
x->resolveMask = d->resolveMask;
|
x->resolveMask = d->resolveMask;
|
||||||
if(!d->ref.deref())
|
if (!d->ref.deref())
|
||||||
delete d;
|
delete d;
|
||||||
d = x;
|
d = x;
|
||||||
}
|
}
|
||||||
@ -866,7 +866,7 @@ bool QPalette::operator==(const QPalette &p) const
|
|||||||
return true;
|
return true;
|
||||||
for(int grp = 0; grp < (int)NColorGroups; grp++) {
|
for(int grp = 0; grp < (int)NColorGroups; grp++) {
|
||||||
for(int role = 0; role < (int)NColorRoles; role++) {
|
for(int role = 0; role < (int)NColorRoles; role++) {
|
||||||
if(d->br[grp][role] != p.d->br[grp][role])
|
if (d->br[grp][role] != p.d->br[grp][role])
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -881,26 +881,26 @@ bool QPalette::operator==(const QPalette &p) const
|
|||||||
*/
|
*/
|
||||||
bool QPalette::isEqual(QPalette::ColorGroup group1, QPalette::ColorGroup group2) const
|
bool QPalette::isEqual(QPalette::ColorGroup group1, QPalette::ColorGroup group2) const
|
||||||
{
|
{
|
||||||
if(group1 >= (int)NColorGroups) {
|
if (group1 >= (int)NColorGroups) {
|
||||||
if(group1 == Current) {
|
if (group1 == Current) {
|
||||||
group1 = currentGroup;
|
group1 = currentGroup;
|
||||||
} else {
|
} else {
|
||||||
qWarning("QPalette::brush: Unknown ColorGroup(1): %d", (int)group1);
|
qWarning("QPalette::brush: Unknown ColorGroup(1): %d", (int)group1);
|
||||||
group1 = Active;
|
group1 = Active;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(group2 >= (int)NColorGroups) {
|
if (group2 >= (int)NColorGroups) {
|
||||||
if(group2 == Current) {
|
if (group2 == Current) {
|
||||||
group2 = currentGroup;
|
group2 = currentGroup;
|
||||||
} else {
|
} else {
|
||||||
qWarning("QPalette::brush: Unknown ColorGroup(2): %d", (int)group2);
|
qWarning("QPalette::brush: Unknown ColorGroup(2): %d", (int)group2);
|
||||||
group2 = Active;
|
group2 = Active;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(group1 == group2)
|
if (group1 == group2)
|
||||||
return true;
|
return true;
|
||||||
for(int role = 0; role < (int)NColorRoles; role++) {
|
for(int role = 0; role < (int)NColorRoles; role++) {
|
||||||
if(d->br[group1][role] != d->br[group2][role])
|
if (d->br[group1][role] != d->br[group2][role])
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1036,7 +1036,7 @@ static void readV1ColorGroup(QDataStream &s, QPalette &pal, QPalette::ColorGroup
|
|||||||
|
|
||||||
QDataStream &operator>>(QDataStream &s, QPalette &p)
|
QDataStream &operator>>(QDataStream &s, QPalette &p)
|
||||||
{
|
{
|
||||||
if(s.version() == 1) {
|
if (s.version() == 1) {
|
||||||
p = QPalette();
|
p = QPalette();
|
||||||
readV1ColorGroup(s, p, QPalette::Active);
|
readV1ColorGroup(s, p, QPalette::Active);
|
||||||
readV1ColorGroup(s, p, QPalette::Disabled);
|
readV1ColorGroup(s, p, QPalette::Disabled);
|
||||||
|
@ -675,7 +675,7 @@ WId QWindow::winId() const
|
|||||||
{
|
{
|
||||||
Q_D(const QWindow);
|
Q_D(const QWindow);
|
||||||
|
|
||||||
if(!d->platformWindow)
|
if (!d->platformWindow)
|
||||||
const_cast<QWindow *>(this)->create();
|
const_cast<QWindow *>(this)->create();
|
||||||
|
|
||||||
return d->platformWindow->winId();
|
return d->platformWindow->winId();
|
||||||
|
@ -473,7 +473,7 @@ void QBezier::addIfClose(qreal *length, qreal error) const
|
|||||||
|
|
||||||
chord = QLineF(QPointF(x1, y1),QPointF(x4, y4)).length();
|
chord = QLineF(QPointF(x1, y1),QPointF(x4, y4)).length();
|
||||||
|
|
||||||
if((len-chord) > error) {
|
if ((len-chord) > error) {
|
||||||
const auto halves = split(); /* split in two */
|
const auto halves = split(); /* split in two */
|
||||||
halves.first.addIfClose(length, error); /* try left side */
|
halves.first.addIfClose(length, error); /* try left side */
|
||||||
halves.second.addIfClose(length, error); /* try right side */
|
halves.second.addIfClose(length, error); /* try right side */
|
||||||
|
@ -96,7 +96,7 @@ struct Blend_ARGB32_on_RGB16_SourceAlpha {
|
|||||||
const quint8 alpha = qAlpha(src);
|
const quint8 alpha = qAlpha(src);
|
||||||
if (alpha) {
|
if (alpha) {
|
||||||
quint16 s = qConvertRgb32To16(src);
|
quint16 s = qConvertRgb32To16(src);
|
||||||
if(alpha < 255)
|
if (alpha < 255)
|
||||||
s += BYTE_MUL_RGB16(*dst, 255 - alpha);
|
s += BYTE_MUL_RGB16(*dst, 255 - alpha);
|
||||||
*dst = s;
|
*dst = s;
|
||||||
}
|
}
|
||||||
@ -113,9 +113,9 @@ struct Blend_ARGB32_on_RGB16_SourceAndConstAlpha {
|
|||||||
inline void write(quint16 *dst, quint32 src) {
|
inline void write(quint16 *dst, quint32 src) {
|
||||||
src = BYTE_MUL(src, m_alpha);
|
src = BYTE_MUL(src, m_alpha);
|
||||||
const quint8 alpha = qAlpha(src);
|
const quint8 alpha = qAlpha(src);
|
||||||
if(alpha) {
|
if (alpha) {
|
||||||
quint16 s = qConvertRgb32To16(src);
|
quint16 s = qConvertRgb32To16(src);
|
||||||
if(alpha < 255)
|
if (alpha < 255)
|
||||||
s += BYTE_MUL_RGB16(*dst, 255 - alpha);
|
s += BYTE_MUL_RGB16(*dst, 255 - alpha);
|
||||||
*dst = s;
|
*dst = s;
|
||||||
}
|
}
|
||||||
|
@ -708,7 +708,7 @@ void QRasterPaintEngine::updatePen(const QPen &pen)
|
|||||||
else
|
else
|
||||||
d->basicStroker.setStrokeWidth(penWidth);
|
d->basicStroker.setStrokeWidth(penWidth);
|
||||||
|
|
||||||
if(pen_style == Qt::SolidLine) {
|
if (pen_style == Qt::SolidLine) {
|
||||||
s->stroker = &d->basicStroker;
|
s->stroker = &d->basicStroker;
|
||||||
} else if (pen_style != Qt::NoPen) {
|
} else if (pen_style != Qt::NoPen) {
|
||||||
if (!d->dashStroker)
|
if (!d->dashStroker)
|
||||||
|
@ -7269,7 +7269,7 @@ start_lengthVariant:
|
|||||||
qreal lineWidth = 0x01000000;
|
qreal lineWidth = 0x01000000;
|
||||||
if (wordwrap || (tf & Qt::TextJustificationForced))
|
if (wordwrap || (tf & Qt::TextJustificationForced))
|
||||||
lineWidth = qMax<qreal>(0, r.width());
|
lineWidth = qMax<qreal>(0, r.width());
|
||||||
if(!wordwrap)
|
if (!wordwrap)
|
||||||
tf |= Qt::TextIncludeTrailingSpaces;
|
tf |= Qt::TextIncludeTrailingSpaces;
|
||||||
textLayout.beginLayout();
|
textLayout.beginLayout();
|
||||||
|
|
||||||
|
@ -3295,7 +3295,7 @@ QPainterPath QPainterPath::subtracted(const QPainterPath &p) const
|
|||||||
*/
|
*/
|
||||||
QPainterPath QPainterPath::simplified() const
|
QPainterPath QPainterPath::simplified() const
|
||||||
{
|
{
|
||||||
if(isEmpty())
|
if (isEmpty())
|
||||||
return *this;
|
return *this;
|
||||||
QPathClipper clipper(*this, QPainterPath());
|
QPathClipper clipper(*this, QPainterPath());
|
||||||
return clipper.clip(QPathClipper::Simplify);
|
return clipper.clip(QPathClipper::Simplify);
|
||||||
|
@ -1965,7 +1965,7 @@ void clipLine(const QPointF &a, const QPointF &b, qreal t, QPainterPath &result)
|
|||||||
|
|
||||||
if (outA)
|
if (outA)
|
||||||
addLine(result, QLineF(intersectLine<edge>(a, b, t), b));
|
addLine(result, QLineF(intersectLine<edge>(a, b, t), b));
|
||||||
else if(outB)
|
else if (outB)
|
||||||
addLine(result, QLineF(a, intersectLine<edge>(a, b, t)));
|
addLine(result, QLineF(a, intersectLine<edge>(a, b, t)));
|
||||||
else
|
else
|
||||||
addLine(result, QLineF(a, b));
|
addLine(result, QLineF(a, b));
|
||||||
|
@ -858,12 +858,12 @@ void QPdfEngine::drawRects (const QRectF *rects, int rectCount)
|
|||||||
|
|
||||||
if (d->simplePen || !d->hasPen) {
|
if (d->simplePen || !d->hasPen) {
|
||||||
// draw strokes natively in this case for better output
|
// draw strokes natively in this case for better output
|
||||||
if(!d->simplePen && !d->stroker.matrix.isIdentity())
|
if (!d->simplePen && !d->stroker.matrix.isIdentity())
|
||||||
*d->currentPage << "q\n" << QPdf::generateMatrix(d->stroker.matrix);
|
*d->currentPage << "q\n" << QPdf::generateMatrix(d->stroker.matrix);
|
||||||
for (int i = 0; i < rectCount; ++i)
|
for (int i = 0; i < rectCount; ++i)
|
||||||
*d->currentPage << rects[i].x() << rects[i].y() << rects[i].width() << rects[i].height() << "re\n";
|
*d->currentPage << rects[i].x() << rects[i].y() << rects[i].width() << rects[i].height() << "re\n";
|
||||||
*d->currentPage << (d->hasPen ? (d->hasBrush ? "B\n" : "S\n") : "f\n");
|
*d->currentPage << (d->hasPen ? (d->hasBrush ? "B\n" : "S\n") : "f\n");
|
||||||
if(!d->simplePen && !d->stroker.matrix.isIdentity())
|
if (!d->simplePen && !d->stroker.matrix.isIdentity())
|
||||||
*d->currentPage << "Q\n";
|
*d->currentPage << "Q\n";
|
||||||
} else {
|
} else {
|
||||||
QPainterPath p;
|
QPainterPath p;
|
||||||
@ -1056,7 +1056,7 @@ void QPdfEngine::drawTextItem(const QPointF &p, const QTextItem &textItem)
|
|||||||
}
|
}
|
||||||
|
|
||||||
*d->currentPage << "q\n";
|
*d->currentPage << "q\n";
|
||||||
if(!d->simplePen)
|
if (!d->simplePen)
|
||||||
*d->currentPage << QPdf::generateMatrix(d->stroker.matrix);
|
*d->currentPage << QPdf::generateMatrix(d->stroker.matrix);
|
||||||
|
|
||||||
bool hp = d->hasPen;
|
bool hp = d->hasPen;
|
||||||
@ -2304,7 +2304,7 @@ int QPdfEnginePrivate::writeCompressed(QIODevice *dev)
|
|||||||
int QPdfEnginePrivate::writeCompressed(const char *src, int len)
|
int QPdfEnginePrivate::writeCompressed(const char *src, int len)
|
||||||
{
|
{
|
||||||
#ifndef QT_NO_COMPRESS
|
#ifndef QT_NO_COMPRESS
|
||||||
if(do_compress) {
|
if (do_compress) {
|
||||||
uLongf destLen = len + len/100 + 13; // zlib requirement
|
uLongf destLen = len + len/100 + 13; // zlib requirement
|
||||||
Bytef* dest = new Bytef[destLen];
|
Bytef* dest = new Bytef[destLen];
|
||||||
if (Z_OK == ::compress(dest, &destLen, (const Bytef*) src, (uLongf)len)) {
|
if (Z_OK == ::compress(dest, &destLen, (const Bytef*) src, (uLongf)len)) {
|
||||||
@ -2833,7 +2833,7 @@ int QPdfEnginePrivate::addImage(const QImage &img, bool *bitmap, bool lossless,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
int object = imageCache.value(serial_no);
|
int object = imageCache.value(serial_no);
|
||||||
if(object)
|
if (object)
|
||||||
return object;
|
return object;
|
||||||
|
|
||||||
QImage image = img;
|
QImage image = img;
|
||||||
|
@ -2033,7 +2033,7 @@ void QTransform::map(int x, int y, int *tx, int *ty) const
|
|||||||
*/
|
*/
|
||||||
QTransform::TransformationType QTransform::type() const
|
QTransform::TransformationType QTransform::type() const
|
||||||
{
|
{
|
||||||
if(m_dirty == TxNone || m_dirty < m_type)
|
if (m_dirty == TxNone || m_dirty < m_type)
|
||||||
return static_cast<TransformationType>(m_type);
|
return static_cast<TransformationType>(m_type);
|
||||||
|
|
||||||
switch (static_cast<TransformationType>(m_dirty)) {
|
switch (static_cast<TransformationType>(m_dirty)) {
|
||||||
|
@ -857,7 +857,7 @@ static BrushData parseBrushValue(const QCss::Value &v, const QPalette &pal)
|
|||||||
parser.next();
|
parser.next();
|
||||||
if (!parser.parseTerm(&color)) return BrushData();
|
if (!parser.parseTerm(&color)) return BrushData();
|
||||||
ColorData cd = parseColorValue(color);
|
ColorData cd = parseColorValue(color);
|
||||||
if(cd.type == ColorData::Role)
|
if (cd.type == ColorData::Role)
|
||||||
dependsOnThePalette = true;
|
dependsOnThePalette = true;
|
||||||
stops.append(QGradientStop(stop.variant.toReal(), colorFromData(cd, pal)));
|
stops.append(QGradientStop(stop.variant.toReal(), colorFromData(cd, pal)));
|
||||||
} else {
|
} else {
|
||||||
@ -1467,7 +1467,7 @@ QColor Declaration::colorValue(const QPalette &pal) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
ColorData color = parseColorValue(d->values.at(0));
|
ColorData color = parseColorValue(d->values.at(0));
|
||||||
if(color.type == ColorData::Role) {
|
if (color.type == ColorData::Role) {
|
||||||
d->parsed = QVariant::fromValue<int>(color.role);
|
d->parsed = QVariant::fromValue<int>(color.role);
|
||||||
return pal.color((QPalette::ColorRole)(color.role));
|
return pal.color((QPalette::ColorRole)(color.role));
|
||||||
} else {
|
} else {
|
||||||
@ -1490,7 +1490,7 @@ QBrush Declaration::brushValue(const QPalette &pal) const
|
|||||||
|
|
||||||
BrushData data = parseBrushValue(d->values.at(0), pal);
|
BrushData data = parseBrushValue(d->values.at(0), pal);
|
||||||
|
|
||||||
if(data.type == BrushData::Role) {
|
if (data.type == BrushData::Role) {
|
||||||
d->parsed = QVariant::fromValue<int>(data.role);
|
d->parsed = QVariant::fromValue<int>(data.role);
|
||||||
return pal.color((QPalette::ColorRole)(data.role));
|
return pal.color((QPalette::ColorRole)(data.role));
|
||||||
} else {
|
} else {
|
||||||
@ -1524,7 +1524,7 @@ void Declaration::brushValues(QBrush *c, const QPalette &pal) const
|
|||||||
if (!(needParse & (1<<i)))
|
if (!(needParse & (1<<i)))
|
||||||
continue;
|
continue;
|
||||||
BrushData data = parseBrushValue(d->values.at(i), pal);
|
BrushData data = parseBrushValue(d->values.at(i), pal);
|
||||||
if(data.type == BrushData::Role) {
|
if (data.type == BrushData::Role) {
|
||||||
v += QVariant::fromValue<int>(data.role);
|
v += QVariant::fromValue<int>(data.role);
|
||||||
c[i] = pal.color((QPalette::ColorRole)(data.role));
|
c[i] = pal.color((QPalette::ColorRole)(data.role));
|
||||||
} else {
|
} else {
|
||||||
@ -1648,7 +1648,7 @@ void Declaration::colorValues(QColor *c, const QPalette &pal) const
|
|||||||
QList<QVariant> v;
|
QList<QVariant> v;
|
||||||
for (i = 0; i < qMin(d->values.count(), 4); i++) {
|
for (i = 0; i < qMin(d->values.count(), 4); i++) {
|
||||||
ColorData color = parseColorValue(d->values.at(i));
|
ColorData color = parseColorValue(d->values.at(i));
|
||||||
if(color.type == ColorData::Role) {
|
if (color.type == ColorData::Role) {
|
||||||
v += QVariant::fromValue<int>(color.role);
|
v += QVariant::fromValue<int>(color.role);
|
||||||
c[i] = pal.color((QPalette::ColorRole)(color.role));
|
c[i] = pal.color((QPalette::ColorRole)(color.role));
|
||||||
} else {
|
} else {
|
||||||
@ -2104,7 +2104,7 @@ void StyleSelector::matchRule(NodePtr node, const StyleRule &rule, StyleSheetOri
|
|||||||
+ selector.specificity() *0x100
|
+ selector.specificity() *0x100
|
||||||
+ (uint(origin) + depth)*0x100000;
|
+ (uint(origin) + depth)*0x100000;
|
||||||
StyleRule newRule = rule;
|
StyleRule newRule = rule;
|
||||||
if(rule.selectors.count() > 1) {
|
if (rule.selectors.count() > 1) {
|
||||||
newRule.selectors.resize(1);
|
newRule.selectors.resize(1);
|
||||||
newRule.selectors[0] = selector;
|
newRule.selectors[0] = selector;
|
||||||
}
|
}
|
||||||
|
@ -1027,7 +1027,7 @@ static inline QFixed kerning(int left, int right, const QFontEngine::KernPair *p
|
|||||||
while (left <= right) {
|
while (left <= right) {
|
||||||
int middle = left + ( ( right - left ) >> 1 );
|
int middle = left + ( ( right - left ) >> 1 );
|
||||||
|
|
||||||
if(pairs[middle].left_right == left_right)
|
if (pairs[middle].left_right == left_right)
|
||||||
return pairs[middle].adjust;
|
return pairs[middle].adjust;
|
||||||
|
|
||||||
if (pairs[middle].left_right < left_right)
|
if (pairs[middle].left_right < left_right)
|
||||||
@ -1041,7 +1041,7 @@ static inline QFixed kerning(int left, int right, const QFontEngine::KernPair *p
|
|||||||
void QFontEngine::doKerning(QGlyphLayout *glyphs, QFontEngine::ShaperFlags flags) const
|
void QFontEngine::doKerning(QGlyphLayout *glyphs, QFontEngine::ShaperFlags flags) const
|
||||||
{
|
{
|
||||||
int numPairs = kerning_pairs.size();
|
int numPairs = kerning_pairs.size();
|
||||||
if(!numPairs)
|
if (!numPairs)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const KernPair *pairs = kerning_pairs.constData();
|
const KernPair *pairs = kerning_pairs.constData();
|
||||||
@ -1097,7 +1097,7 @@ void QFontEngine::loadKerningPairs(QFixed scalingFactor)
|
|||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
// qDebug("subtable: version=%d, coverage=%x",version, coverage);
|
// qDebug("subtable: version=%d, coverage=%x",version, coverage);
|
||||||
if(version == 0 && coverage == 0x0001) {
|
if (version == 0 && coverage == 0x0001) {
|
||||||
if (offset + length > tab.size()) {
|
if (offset + length > tab.size()) {
|
||||||
// qDebug("length ouf ot bounds");
|
// qDebug("length ouf ot bounds");
|
||||||
goto end;
|
goto end;
|
||||||
@ -1108,7 +1108,7 @@ void QFontEngine::loadKerningPairs(QFixed scalingFactor)
|
|||||||
if (!qSafeFromBigEndian(data, end, &nPairs))
|
if (!qSafeFromBigEndian(data, end, &nPairs))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
if(nPairs * 6 + 8 > length - 6) {
|
if (nPairs * 6 + 8 > length - 6) {
|
||||||
// qDebug("corrupt table!");
|
// qDebug("corrupt table!");
|
||||||
// corrupt table
|
// corrupt table
|
||||||
goto end;
|
goto end;
|
||||||
@ -1250,7 +1250,7 @@ const uchar *QFontEngine::getCMap(const uchar *table, uint tableSize, bool *isSy
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(tableToUse < 0)
|
if (tableToUse < 0)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
resolveTable:
|
resolveTable:
|
||||||
@ -1339,7 +1339,7 @@ quint32 QFontEngine::getTrueTypeGlyphIndex(const uchar *cmap, int cmapSize, uint
|
|||||||
Since 0xffff is never a valid Unicode char anyway, we just get rid of the issue
|
Since 0xffff is never a valid Unicode char anyway, we just get rid of the issue
|
||||||
by returning 0 for 0xffff
|
by returning 0 for 0xffff
|
||||||
*/
|
*/
|
||||||
if(unicode >= 0xffff)
|
if (unicode >= 0xffff)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
quint16 segCountX2;
|
quint16 segCountX2;
|
||||||
@ -1433,7 +1433,7 @@ quint32 QFontEngine::getTrueTypeGlyphIndex(const uchar *cmap, int cmapSize, uint
|
|||||||
if (!qSafeFromBigEndian(cmap + 12 * middle, end, &startCharCode))
|
if (!qSafeFromBigEndian(cmap + 12 * middle, end, &startCharCode))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if(unicode < startCharCode)
|
if (unicode < startCharCode)
|
||||||
right = middle - 1;
|
right = middle - 1;
|
||||||
else {
|
else {
|
||||||
quint32 endCharCode;
|
quint32 endCharCode;
|
||||||
|
@ -2185,7 +2185,7 @@ QTextTable *QTextCursor::insertTable(int rows, int cols)
|
|||||||
*/
|
*/
|
||||||
QTextTable *QTextCursor::insertTable(int rows, int cols, const QTextTableFormat &format)
|
QTextTable *QTextCursor::insertTable(int rows, int cols, const QTextTableFormat &format)
|
||||||
{
|
{
|
||||||
if(!d || !d->priv || rows == 0 || cols == 0)
|
if (!d || !d->priv || rows == 0 || cols == 0)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
int pos = d->position;
|
int pos = d->position;
|
||||||
@ -2205,7 +2205,7 @@ QTextTable *QTextCursor::insertTable(int rows, int cols, const QTextTableFormat
|
|||||||
*/
|
*/
|
||||||
QTextTable *QTextCursor::currentTable() const
|
QTextTable *QTextCursor::currentTable() const
|
||||||
{
|
{
|
||||||
if(!d || !d->priv)
|
if (!d || !d->priv)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
QTextFrame *frame = d->priv->frameAt(d->position);
|
QTextFrame *frame = d->priv->frameAt(d->position);
|
||||||
@ -2242,7 +2242,7 @@ QTextFrame *QTextCursor::insertFrame(const QTextFrameFormat &format)
|
|||||||
*/
|
*/
|
||||||
QTextFrame *QTextCursor::currentFrame() const
|
QTextFrame *QTextCursor::currentFrame() const
|
||||||
{
|
{
|
||||||
if(!d || !d->priv)
|
if (!d || !d->priv)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
return d->priv->frameAt(d->position);
|
return d->priv->frameAt(d->position);
|
||||||
|
@ -561,7 +561,7 @@ bool QTextHtmlImporter::appendNodeText()
|
|||||||
const int initialCursorPosition = cursor.position();
|
const int initialCursorPosition = cursor.position();
|
||||||
QTextCharFormat format = currentNode->charFormat;
|
QTextCharFormat format = currentNode->charFormat;
|
||||||
|
|
||||||
if(wsm == QTextHtmlParserNode::WhiteSpacePre || wsm == QTextHtmlParserNode::WhiteSpacePreWrap)
|
if (wsm == QTextHtmlParserNode::WhiteSpacePre || wsm == QTextHtmlParserNode::WhiteSpacePreWrap)
|
||||||
compressNextWhitespace = PreserveWhiteSpace;
|
compressNextWhitespace = PreserveWhiteSpace;
|
||||||
|
|
||||||
QString text = currentNode->text;
|
QString text = currentNode->text;
|
||||||
@ -581,7 +581,7 @@ bool QTextHtmlImporter::appendNodeText()
|
|||||||
|
|
||||||
if (compressNextWhitespace == CollapseWhiteSpace)
|
if (compressNextWhitespace == CollapseWhiteSpace)
|
||||||
compressNextWhitespace = RemoveWhiteSpace; // allow this one, and remove the ones coming next.
|
compressNextWhitespace = RemoveWhiteSpace; // allow this one, and remove the ones coming next.
|
||||||
else if(compressNextWhitespace == RemoveWhiteSpace)
|
else if (compressNextWhitespace == RemoveWhiteSpace)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (wsm == QTextHtmlParserNode::WhiteSpacePre
|
if (wsm == QTextHtmlParserNode::WhiteSpacePre
|
||||||
|
@ -3719,7 +3719,7 @@ void QTextDocumentLayout::draw(QPainter *painter, const PaintContext &context)
|
|||||||
QTextFrame *frame = d->document->rootFrame();
|
QTextFrame *frame = d->document->rootFrame();
|
||||||
QTextFrameData *fd = data(frame);
|
QTextFrameData *fd = data(frame);
|
||||||
|
|
||||||
if(fd->sizeDirty)
|
if (fd->sizeDirty)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (context.clip.isValid()) {
|
if (context.clip.isValid()) {
|
||||||
@ -3850,7 +3850,7 @@ QRectF QTextDocumentLayout::doLayout(int from, int oldLength, int length)
|
|||||||
QRectF updateRect;
|
QRectF updateRect;
|
||||||
|
|
||||||
QTextFrame *root = d->docPrivate->rootFrame();
|
QTextFrame *root = d->docPrivate->rootFrame();
|
||||||
if(data(root)->sizeDirty)
|
if (data(root)->sizeDirty)
|
||||||
updateRect = d->layoutFrame(root, from, from + length);
|
updateRect = d->layoutFrame(root, from, from + length);
|
||||||
data(root)->layoutDirty = false;
|
data(root)->layoutDirty = false;
|
||||||
|
|
||||||
|
@ -86,9 +86,9 @@ public:
|
|||||||
{
|
{
|
||||||
if (caps == QFont::SmallCaps)
|
if (caps == QFont::SmallCaps)
|
||||||
generateScriptItemsSmallCaps(reinterpret_cast<const ushort *>(m_string.unicode()), start, length);
|
generateScriptItemsSmallCaps(reinterpret_cast<const ushort *>(m_string.unicode()), start, length);
|
||||||
else if(caps == QFont::Capitalize)
|
else if (caps == QFont::Capitalize)
|
||||||
generateScriptItemsCapitalize(start, length);
|
generateScriptItemsCapitalize(start, length);
|
||||||
else if(caps != QFont::MixedCase) {
|
else if (caps != QFont::MixedCase) {
|
||||||
generateScriptItemsAndChangeCase(start, length,
|
generateScriptItemsAndChangeCase(start, length,
|
||||||
caps == QFont::AllLowercase ? QScriptAnalysis::Lowercase : QScriptAnalysis::Uppercase);
|
caps == QFont::AllLowercase ? QScriptAnalysis::Lowercase : QScriptAnalysis::Uppercase);
|
||||||
}
|
}
|
||||||
@ -1192,7 +1192,7 @@ void QTextEngine::bidiReorder(int numItems, const quint8 *levels, int *visualOrd
|
|||||||
// reverse any contiguous sequence of characters that are at that level or higher.
|
// reverse any contiguous sequence of characters that are at that level or higher.
|
||||||
|
|
||||||
// reversing is only done up to the lowest odd level
|
// reversing is only done up to the lowest odd level
|
||||||
if(!(levelLow%2)) levelLow++;
|
if (!(levelLow%2)) levelLow++;
|
||||||
|
|
||||||
BIDI_DEBUG() << "reorderLine: lineLow = " << (uint)levelLow << ", lineHigh = " << (uint)levelHigh;
|
BIDI_DEBUG() << "reorderLine: lineLow = " << (uint)levelLow << ", lineHigh = " << (uint)levelHigh;
|
||||||
|
|
||||||
@ -1208,7 +1208,7 @@ void QTextEngine::bidiReorder(int numItems, const quint8 *levels, int *visualOrd
|
|||||||
while(i <= count && levels[i] >= levelHigh) i++;
|
while(i <= count && levels[i] >= levelHigh) i++;
|
||||||
int end = i-1;
|
int end = i-1;
|
||||||
|
|
||||||
if(start != end) {
|
if (start != end) {
|
||||||
//qDebug() << "reversing from " << start << " to " << end;
|
//qDebug() << "reversing from " << start << " to " << end;
|
||||||
for(int j = 0; j < (end-start+1)/2; j++) {
|
for(int j = 0; j < (end-start+1)/2; j++) {
|
||||||
int tmp = visualOrder[start+j];
|
int tmp = visualOrder[start+j];
|
||||||
|
@ -474,7 +474,7 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &stream, QTextFormat &fmt)
|
|||||||
|
|
||||||
// QTextFormat's default constructor doesn't allocate the private structure, so
|
// QTextFormat's default constructor doesn't allocate the private structure, so
|
||||||
// we have to do this, in case fmt is a default constructed value.
|
// we have to do this, in case fmt is a default constructed value.
|
||||||
if(!fmt.d)
|
if (!fmt.d)
|
||||||
fmt.d = new QTextFormatPrivate();
|
fmt.d = new QTextFormatPrivate();
|
||||||
|
|
||||||
for (QMap<qint32, QVariant>::ConstIterator it = properties.constBegin();
|
for (QMap<qint32, QVariant>::ConstIterator it = properties.constBegin();
|
||||||
@ -2206,7 +2206,7 @@ void QTextBlockFormat::setTabPositions(const QList<QTextOption::Tab> &tabs)
|
|||||||
QList<QTextOption::Tab> QTextBlockFormat::tabPositions() const
|
QList<QTextOption::Tab> QTextBlockFormat::tabPositions() const
|
||||||
{
|
{
|
||||||
QVariant variant = property(TabPositions);
|
QVariant variant = property(TabPositions);
|
||||||
if(variant.isNull())
|
if (variant.isNull())
|
||||||
return QList<QTextOption::Tab>();
|
return QList<QTextOption::Tab>();
|
||||||
QList<QTextOption::Tab> answer;
|
QList<QTextOption::Tab> answer;
|
||||||
QList<QVariant> variantsList = qvariant_cast<QList<QVariant> >(variant);
|
QList<QVariant> variantsList = qvariant_cast<QList<QVariant> >(variant);
|
||||||
|
@ -105,7 +105,7 @@ static void resolveGetCharWidthI()
|
|||||||
|
|
||||||
QFixed QWindowsFontEngine::lineThickness() const
|
QFixed QWindowsFontEngine::lineThickness() const
|
||||||
{
|
{
|
||||||
if(lineWidth > 0)
|
if (lineWidth > 0)
|
||||||
return lineWidth;
|
return lineWidth;
|
||||||
|
|
||||||
return QFontEngine::lineThickness();
|
return QFontEngine::lineThickness();
|
||||||
@ -160,7 +160,7 @@ void QWindowsFontEngine::getCMap()
|
|||||||
symbol = symb;
|
symbol = symb;
|
||||||
designToDevice = 1;
|
designToDevice = 1;
|
||||||
_faceId.index = 0;
|
_faceId.index = 0;
|
||||||
if(cmap) {
|
if (cmap) {
|
||||||
OUTLINETEXTMETRIC *otm = getOutlineTextMetric(hdc);
|
OUTLINETEXTMETRIC *otm = getOutlineTextMetric(hdc);
|
||||||
unitsPerEm = int(otm->otmEMSquare);
|
unitsPerEm = int(otm->otmEMSquare);
|
||||||
const QFixed unitsPerEmF(unitsPerEm);
|
const QFixed unitsPerEmF(unitsPerEm);
|
||||||
@ -186,7 +186,7 @@ int QWindowsFontEngine::getGlyphIndexes(const QChar *str, int numChars, QGlyphLa
|
|||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
const uint uc = it.next();
|
const uint uc = it.next();
|
||||||
glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, cmapSize, uc);
|
glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, cmapSize, uc);
|
||||||
if(!glyphs->glyphs[glyph_pos] && uc < 0x100)
|
if (!glyphs->glyphs[glyph_pos] && uc < 0x100)
|
||||||
glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, cmapSize, uc + 0xf000);
|
glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, cmapSize, uc + 0xf000);
|
||||||
++glyph_pos;
|
++glyph_pos;
|
||||||
}
|
}
|
||||||
@ -337,7 +337,7 @@ void QWindowsFontEngine::recalcAdvances(QGlyphLayout *glyphs, QFontEngine::Shape
|
|||||||
if (ttf && (flags & DesignMetrics)) {
|
if (ttf && (flags & DesignMetrics)) {
|
||||||
for(int i = 0; i < glyphs->numGlyphs; i++) {
|
for(int i = 0; i < glyphs->numGlyphs; i++) {
|
||||||
unsigned int glyph = glyphs->glyphs[i];
|
unsigned int glyph = glyphs->glyphs[i];
|
||||||
if(int(glyph) >= designAdvancesSize) {
|
if (int(glyph) >= designAdvancesSize) {
|
||||||
const int newSize = int(glyph + 256) >> 8 << 8;
|
const int newSize = int(glyph + 256) >> 8 << 8;
|
||||||
designAdvances = reinterpret_cast<QFixed *>(realloc(designAdvances, size_t(newSize) * sizeof(QFixed)));
|
designAdvances = reinterpret_cast<QFixed *>(realloc(designAdvances, size_t(newSize) * sizeof(QFixed)));
|
||||||
Q_CHECK_PTR(designAdvances);
|
Q_CHECK_PTR(designAdvances);
|
||||||
@ -355,7 +355,7 @@ void QWindowsFontEngine::recalcAdvances(QGlyphLayout *glyphs, QFontEngine::Shape
|
|||||||
}
|
}
|
||||||
glyphs->advances[i] = designAdvances[glyph];
|
glyphs->advances[i] = designAdvances[glyph];
|
||||||
}
|
}
|
||||||
if(oldFont)
|
if (oldFont)
|
||||||
DeleteObject(SelectObject(hdc, oldFont));
|
DeleteObject(SelectObject(hdc, oldFont));
|
||||||
} else {
|
} else {
|
||||||
for(int i = 0; i < glyphs->numGlyphs; i++) {
|
for(int i = 0; i < glyphs->numGlyphs; i++) {
|
||||||
@ -546,7 +546,7 @@ QFixed QWindowsFontEngine::capHeight() const
|
|||||||
|
|
||||||
QFixed QWindowsFontEngine::xHeight() const
|
QFixed QWindowsFontEngine::xHeight() const
|
||||||
{
|
{
|
||||||
if(x_height >= 0)
|
if (x_height >= 0)
|
||||||
return x_height;
|
return x_height;
|
||||||
return QFontEngine::xHeight();
|
return QFontEngine::xHeight();
|
||||||
}
|
}
|
||||||
@ -837,7 +837,7 @@ void QWindowsFontEngine::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions
|
|||||||
void QWindowsFontEngine::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs,
|
void QWindowsFontEngine::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs,
|
||||||
QPainterPath *path, QTextItem::RenderFlags flags)
|
QPainterPath *path, QTextItem::RenderFlags flags)
|
||||||
{
|
{
|
||||||
if(tm.tmPitchAndFamily & (TMPF_TRUETYPE | TMPF_VECTOR)) {
|
if (tm.tmPitchAndFamily & (TMPF_TRUETYPE | TMPF_VECTOR)) {
|
||||||
hasOutline = true;
|
hasOutline = true;
|
||||||
QFontEngine::addOutlineToPath(x, y, glyphs, path, flags);
|
QFontEngine::addOutlineToPath(x, y, glyphs, path, flags);
|
||||||
if (hasOutline) {
|
if (hasOutline) {
|
||||||
@ -861,9 +861,9 @@ QT_END_INCLUDE_NAMESPACE
|
|||||||
|
|
||||||
int QWindowsFontEngine::synthesized() const
|
int QWindowsFontEngine::synthesized() const
|
||||||
{
|
{
|
||||||
if(synthesized_flags == -1) {
|
if (synthesized_flags == -1) {
|
||||||
synthesized_flags = 0;
|
synthesized_flags = 0;
|
||||||
if(ttf) {
|
if (ttf) {
|
||||||
const DWORD HEAD = MAKE_LITTLE_ENDIAN_TAG('h', 'e', 'a', 'd');
|
const DWORD HEAD = MAKE_LITTLE_ENDIAN_TAG('h', 'e', 'a', 'd');
|
||||||
HDC hdc = m_fontEngineData->hdc;
|
HDC hdc = m_fontEngineData->hdc;
|
||||||
SelectObject(hdc, hfont);
|
SelectObject(hdc, hfont);
|
||||||
@ -920,7 +920,7 @@ void QWindowsFontEngine::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, gly
|
|||||||
LOGFONT lf = m_logfont;
|
LOGFONT lf = m_logfont;
|
||||||
lf.lfHeight = -unitsPerEm;
|
lf.lfHeight = -unitsPerEm;
|
||||||
int flags = synthesized();
|
int flags = synthesized();
|
||||||
if(flags & SynthesizedItalic)
|
if (flags & SynthesizedItalic)
|
||||||
lf.lfItalic = false;
|
lf.lfItalic = false;
|
||||||
lf.lfWidth = 0;
|
lf.lfWidth = 0;
|
||||||
HFONT hf = CreateFontIndirect(&lf);
|
HFONT hf = CreateFontIndirect(&lf);
|
||||||
|
@ -1228,7 +1228,7 @@ QByteArray qEncodeHmacMd5(QByteArray &key, const QByteArray &message)
|
|||||||
hash.reset();
|
hash.reset();
|
||||||
// Adjust the key length to blockSize
|
// Adjust the key length to blockSize
|
||||||
|
|
||||||
if(blockSize < key.length()) {
|
if (blockSize < key.length()) {
|
||||||
hash.addData(key);
|
hash.addData(key);
|
||||||
key = hash.result(); //MD5 will always return 16 bytes length output
|
key = hash.result(); //MD5 will always return 16 bytes length output
|
||||||
}
|
}
|
||||||
@ -1280,7 +1280,7 @@ static QByteArray qCreatev2Hash(const QAuthenticatorPrivate *ctx,
|
|||||||
Q_ASSERT(phase3 != nullptr);
|
Q_ASSERT(phase3 != nullptr);
|
||||||
// since v2 Hash is need for both NTLMv2 and LMv2 it is calculated
|
// since v2 Hash is need for both NTLMv2 and LMv2 it is calculated
|
||||||
// only once and stored and reused
|
// only once and stored and reused
|
||||||
if(phase3->v2Hash.size() == 0) {
|
if (phase3->v2Hash.size() == 0) {
|
||||||
QCryptographicHash md4(QCryptographicHash::Md4);
|
QCryptographicHash md4(QCryptographicHash::Md4);
|
||||||
QByteArray passUnicode = qStringAsUcs2Le(ctx->password);
|
QByteArray passUnicode = qStringAsUcs2Le(ctx->password);
|
||||||
md4.addData(passUnicode.data(), passUnicode.size());
|
md4.addData(passUnicode.data(), passUnicode.size());
|
||||||
@ -1317,7 +1317,7 @@ static QByteArray qExtractServerTime(const QByteArray& targetInfoBuff)
|
|||||||
ds >> avId;
|
ds >> avId;
|
||||||
ds >> avLen;
|
ds >> avLen;
|
||||||
while(avId != 0) {
|
while(avId != 0) {
|
||||||
if(avId == AVTIMESTAMP) {
|
if (avId == AVTIMESTAMP) {
|
||||||
timeArray.resize(avLen);
|
timeArray.resize(avLen);
|
||||||
//avLen size of QByteArray is allocated
|
//avLen size of QByteArray is allocated
|
||||||
ds.readRawData(timeArray.data(), avLen);
|
ds.readRawData(timeArray.data(), avLen);
|
||||||
@ -1352,13 +1352,13 @@ static QByteArray qEncodeNtlmv2Response(const QAuthenticatorPrivate *ctx,
|
|||||||
quint64 time = 0;
|
quint64 time = 0;
|
||||||
QByteArray timeArray;
|
QByteArray timeArray;
|
||||||
|
|
||||||
if(ch.targetInfo.len)
|
if (ch.targetInfo.len)
|
||||||
{
|
{
|
||||||
timeArray = qExtractServerTime(ch.targetInfoBuff);
|
timeArray = qExtractServerTime(ch.targetInfoBuff);
|
||||||
}
|
}
|
||||||
|
|
||||||
//if server sends time, use it instead of current time
|
//if server sends time, use it instead of current time
|
||||||
if(timeArray.size()) {
|
if (timeArray.size()) {
|
||||||
ds.writeRawData(timeArray.constData(), timeArray.size());
|
ds.writeRawData(timeArray.constData(), timeArray.size());
|
||||||
} else {
|
} else {
|
||||||
// number of seconds between 1601 and the epoch (1970)
|
// number of seconds between 1601 and the epoch (1970)
|
||||||
|
@ -135,10 +135,10 @@ bool QLocalServerPrivate::listen(const QString &requestedServerName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// bind
|
// bind
|
||||||
if(-1 == QT_SOCKET_BIND(listenSocket, (sockaddr *)&addr, sizeof(sockaddr_un))) {
|
if (-1 == QT_SOCKET_BIND(listenSocket, (sockaddr *)&addr, sizeof(sockaddr_un))) {
|
||||||
setError(QLatin1String("QLocalServer::listen"));
|
setError(QLatin1String("QLocalServer::listen"));
|
||||||
// if address is in use already, just close the socket, but do not delete the file
|
// if address is in use already, just close the socket, but do not delete the file
|
||||||
if(errno == EADDRINUSE)
|
if (errno == EADDRINUSE)
|
||||||
QT_CLOSE(listenSocket);
|
QT_CLOSE(listenSocket);
|
||||||
// otherwise, close the socket and delete the file
|
// otherwise, close the socket and delete the file
|
||||||
else
|
else
|
||||||
@ -269,7 +269,7 @@ void QLocalServerPrivate::_q_onNewConnection()
|
|||||||
::sockaddr_un addr;
|
::sockaddr_un addr;
|
||||||
QT_SOCKLEN_T length = sizeof(sockaddr_un);
|
QT_SOCKLEN_T length = sizeof(sockaddr_un);
|
||||||
int connectedSocket = qt_safe_accept(listenSocket, (sockaddr *)&addr, &length);
|
int connectedSocket = qt_safe_accept(listenSocket, (sockaddr *)&addr, &length);
|
||||||
if(-1 == connectedSocket) {
|
if (-1 == connectedSocket) {
|
||||||
setError(QLatin1String("QLocalSocket::activated"));
|
setError(QLatin1String("QLocalSocket::activated"));
|
||||||
closeServer();
|
closeServer();
|
||||||
} else {
|
} else {
|
||||||
|
@ -972,7 +972,7 @@ void QNativeSocketEngine::close()
|
|||||||
if (d->exceptNotifier)
|
if (d->exceptNotifier)
|
||||||
d->exceptNotifier->setEnabled(false);
|
d->exceptNotifier->setEnabled(false);
|
||||||
|
|
||||||
if(d->socketDescriptor != -1) {
|
if (d->socketDescriptor != -1) {
|
||||||
d->nativeClose();
|
d->nativeClose();
|
||||||
d->socketDescriptor = -1;
|
d->socketDescriptor = -1;
|
||||||
}
|
}
|
||||||
|
@ -334,7 +334,7 @@ static bool read_jpeg_image(QImage *outImage,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If high quality not required, use fast decompression
|
// If high quality not required, use fast decompression
|
||||||
if( quality < HIGH_QUALITY_THRESHOLD ) {
|
if ( quality < HIGH_QUALITY_THRESHOLD ) {
|
||||||
info->dct_method = JDCT_IFAST;
|
info->dct_method = JDCT_IFAST;
|
||||||
info->do_fancy_upsampling = FALSE;
|
info->do_fancy_upsampling = FALSE;
|
||||||
}
|
}
|
||||||
@ -758,7 +758,7 @@ public:
|
|||||||
|
|
||||||
~QJpegHandlerPrivate()
|
~QJpegHandlerPrivate()
|
||||||
{
|
{
|
||||||
if(iod_src)
|
if (iod_src)
|
||||||
{
|
{
|
||||||
jpeg_destroy_decompress(&info);
|
jpeg_destroy_decompress(&info);
|
||||||
delete iod_src;
|
delete iod_src;
|
||||||
@ -926,7 +926,7 @@ static QImageIOHandler::Transformations exif2Qt(int exifOrientation)
|
|||||||
*/
|
*/
|
||||||
bool QJpegHandlerPrivate::readJpegHeader(QIODevice *device)
|
bool QJpegHandlerPrivate::readJpegHeader(QIODevice *device)
|
||||||
{
|
{
|
||||||
if(state == Ready)
|
if (state == Ready)
|
||||||
{
|
{
|
||||||
state = Error;
|
state = Error;
|
||||||
iod_src = new my_jpeg_source_mgr(device);
|
iod_src = new my_jpeg_source_mgr(device);
|
||||||
@ -998,17 +998,17 @@ bool QJpegHandlerPrivate::readJpegHeader(QIODevice *device)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(state == Error)
|
else if (state == Error)
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QJpegHandlerPrivate::read(QImage *image)
|
bool QJpegHandlerPrivate::read(QImage *image)
|
||||||
{
|
{
|
||||||
if(state == Ready)
|
if (state == Ready)
|
||||||
readJpegHeader(q->device());
|
readJpegHeader(q->device());
|
||||||
|
|
||||||
if(state == ReadHeader)
|
if (state == ReadHeader)
|
||||||
{
|
{
|
||||||
bool success = read_jpeg_image(image, scaledSize, scaledClipRect, clipRect, quality, rgb888ToRgb32ConverterPtr, &info, &err);
|
bool success = read_jpeg_image(image, scaledSize, scaledClipRect, clipRect, quality, rgb888ToRgb32ConverterPtr, &info, &err);
|
||||||
if (success) {
|
if (success) {
|
||||||
@ -1061,7 +1061,7 @@ QJpegHandler::~QJpegHandler()
|
|||||||
|
|
||||||
bool QJpegHandler::canRead() const
|
bool QJpegHandler::canRead() const
|
||||||
{
|
{
|
||||||
if(d->state == QJpegHandlerPrivate::Ready && !canRead(device()))
|
if (d->state == QJpegHandlerPrivate::Ready && !canRead(device()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (d->state != QJpegHandlerPrivate::Error && d->state != QJpegHandlerPrivate::ReadingEnd) {
|
if (d->state != QJpegHandlerPrivate::Error && d->state != QJpegHandlerPrivate::ReadingEnd) {
|
||||||
|
@ -248,7 +248,7 @@ void QIBusPlatformInputContext::cursorRectChanged()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
QRect r = qApp->inputMethod()->cursorRectangle().toRect();
|
QRect r = qApp->inputMethod()->cursorRectangle().toRect();
|
||||||
if(!r.isValid())
|
if (!r.isValid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QWindow *inputWindow = qApp->focusWindow();
|
QWindow *inputWindow = qApp->focusWindow();
|
||||||
|
@ -1444,7 +1444,7 @@ QString QLastResortMimes::mimeForFormat(const FORMATETC &formatetc) const
|
|||||||
#if QT_CONFIG(draganddrop)
|
#if QT_CONFIG(draganddrop)
|
||||||
if (QInternalMimeData::canReadData(clipFormat))
|
if (QInternalMimeData::canReadData(clipFormat))
|
||||||
format = clipFormat;
|
format = clipFormat;
|
||||||
else if((formatetc.cfFormat >= 0xC000)){
|
else if ((formatetc.cfFormat >= 0xC000)){
|
||||||
//create the mime as custom. not registered.
|
//create the mime as custom. not registered.
|
||||||
if (!excludeList.contains(clipFormat, Qt::CaseInsensitive)) {
|
if (!excludeList.contains(clipFormat, Qt::CaseInsensitive)) {
|
||||||
//check if this is a mime type
|
//check if this is a mime type
|
||||||
|
@ -992,7 +992,7 @@ bool QDB2Result::fetchFirst()
|
|||||||
SQL_FETCH_FIRST,
|
SQL_FETCH_FIRST,
|
||||||
0);
|
0);
|
||||||
if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO) {
|
if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO) {
|
||||||
if(r!= SQL_NO_DATA)
|
if (r!= SQL_NO_DATA)
|
||||||
setLastError(qMakeError(QCoreApplication::translate("QDB2Result", "Unable to fetch first"),
|
setLastError(qMakeError(QCoreApplication::translate("QDB2Result", "Unable to fetch first"),
|
||||||
QSqlError::StatementError, d));
|
QSqlError::StatementError, d));
|
||||||
return false;
|
return false;
|
||||||
@ -1735,7 +1735,7 @@ QVariant QDB2Driver::handle() const
|
|||||||
QString QDB2Driver::escapeIdentifier(const QString &identifier, IdentifierType) const
|
QString QDB2Driver::escapeIdentifier(const QString &identifier, IdentifierType) const
|
||||||
{
|
{
|
||||||
QString res = identifier;
|
QString res = identifier;
|
||||||
if(!identifier.isEmpty() && !identifier.startsWith(QLatin1Char('"')) && !identifier.endsWith(QLatin1Char('"')) ) {
|
if (!identifier.isEmpty() && !identifier.startsWith(QLatin1Char('"')) && !identifier.endsWith(QLatin1Char('"')) ) {
|
||||||
res.replace(QLatin1Char('"'), QLatin1String("\"\""));
|
res.replace(QLatin1Char('"'), QLatin1String("\"\""));
|
||||||
res.prepend(QLatin1Char('"')).append(QLatin1Char('"'));
|
res.prepend(QLatin1Char('"')).append(QLatin1Char('"'));
|
||||||
res.replace(QLatin1Char('.'), QLatin1String("\".\""));
|
res.replace(QLatin1Char('.'), QLatin1String("\".\""));
|
||||||
|
@ -80,7 +80,7 @@ static bool getIBaseError(QString& msg, const ISC_STATUS* status, ISC_LONG &sqlc
|
|||||||
sqlcode = isc_sqlcode(status);
|
sqlcode = isc_sqlcode(status);
|
||||||
char buf[512];
|
char buf[512];
|
||||||
while(fb_interpret(buf, 512, &status)) {
|
while(fb_interpret(buf, 512, &status)) {
|
||||||
if(!msg.isEmpty())
|
if (!msg.isEmpty())
|
||||||
msg += QLatin1String(" - ");
|
msg += QLatin1String(" - ");
|
||||||
msg += QString::fromUtf8(buf);
|
msg += QString::fromUtf8(buf);
|
||||||
}
|
}
|
||||||
@ -1358,7 +1358,7 @@ QSqlRecord QIBaseResult::record() const
|
|||||||
f.setLength(v.sqllen);
|
f.setLength(v.sqllen);
|
||||||
f.setPrecision(qAbs(v.sqlscale));
|
f.setPrecision(qAbs(v.sqlscale));
|
||||||
f.setRequiredStatus((v.sqltype & 1) == 0 ? QSqlField::Required : QSqlField::Optional);
|
f.setRequiredStatus((v.sqltype & 1) == 0 ? QSqlField::Required : QSqlField::Optional);
|
||||||
if(v.sqlscale < 0) {
|
if (v.sqlscale < 0) {
|
||||||
QSqlQuery q(driver()->createResult());
|
QSqlQuery q(driver()->createResult());
|
||||||
q.setForwardOnly(true);
|
q.setForwardOnly(true);
|
||||||
q.exec(QLatin1String("select b.RDB$FIELD_PRECISION, b.RDB$FIELD_SCALE, b.RDB$FIELD_LENGTH, a.RDB$NULL_FLAG "
|
q.exec(QLatin1String("select b.RDB$FIELD_PRECISION, b.RDB$FIELD_SCALE, b.RDB$FIELD_LENGTH, a.RDB$NULL_FLAG "
|
||||||
@ -1366,8 +1366,8 @@ QSqlRecord QIBaseResult::record() const
|
|||||||
"WHERE b.RDB$FIELD_NAME = a.RDB$FIELD_SOURCE "
|
"WHERE b.RDB$FIELD_NAME = a.RDB$FIELD_SOURCE "
|
||||||
"AND a.RDB$RELATION_NAME = '") + QString::fromLatin1(v.relname, v.relname_length) + QLatin1String("' "
|
"AND a.RDB$RELATION_NAME = '") + QString::fromLatin1(v.relname, v.relname_length) + QLatin1String("' "
|
||||||
"AND a.RDB$FIELD_NAME = '") + QString::fromLatin1(v.sqlname, v.sqlname_length) + QLatin1String("' "));
|
"AND a.RDB$FIELD_NAME = '") + QString::fromLatin1(v.sqlname, v.sqlname_length) + QLatin1String("' "));
|
||||||
if(q.first()) {
|
if (q.first()) {
|
||||||
if(v.sqlscale < 0) {
|
if (v.sqlscale < 0) {
|
||||||
f.setLength(q.value(0).toInt());
|
f.setLength(q.value(0).toInt());
|
||||||
f.setPrecision(qAbs(q.value(1).toInt()));
|
f.setPrecision(qAbs(q.value(1).toInt()));
|
||||||
} else {
|
} else {
|
||||||
@ -1642,7 +1642,7 @@ QSqlRecord QIBaseDriver::record(const QString& tablename) const
|
|||||||
int type = q.value(1).toInt();
|
int type = q.value(1).toInt();
|
||||||
bool hasScale = q.value(3).toInt() < 0;
|
bool hasScale = q.value(3).toInt() < 0;
|
||||||
QSqlField f(q.value(0).toString().simplified(), qIBaseTypeName(type, hasScale), tablename);
|
QSqlField f(q.value(0).toString().simplified(), qIBaseTypeName(type, hasScale), tablename);
|
||||||
if(hasScale) {
|
if (hasScale) {
|
||||||
f.setLength(q.value(4).toInt());
|
f.setLength(q.value(4).toInt());
|
||||||
f.setPrecision(qAbs(q.value(3).toInt()));
|
f.setPrecision(qAbs(q.value(3).toInt()));
|
||||||
} else {
|
} else {
|
||||||
@ -1883,7 +1883,7 @@ void QIBaseDriver::qHandleEventNotification(void *updatedResultBuffer)
|
|||||||
QString QIBaseDriver::escapeIdentifier(const QString &identifier, IdentifierType) const
|
QString QIBaseDriver::escapeIdentifier(const QString &identifier, IdentifierType) const
|
||||||
{
|
{
|
||||||
QString res = identifier;
|
QString res = identifier;
|
||||||
if(!identifier.isEmpty() && !identifier.startsWith(QLatin1Char('"')) && !identifier.endsWith(QLatin1Char('"')) ) {
|
if (!identifier.isEmpty() && !identifier.startsWith(QLatin1Char('"')) && !identifier.endsWith(QLatin1Char('"')) ) {
|
||||||
res.replace(QLatin1Char('"'), QLatin1String("\"\""));
|
res.replace(QLatin1Char('"'), QLatin1String("\"\""));
|
||||||
res.prepend(QLatin1Char('"')).append(QLatin1Char('"'));
|
res.prepend(QLatin1Char('"')).append(QLatin1Char('"'));
|
||||||
res.replace(QLatin1Char('.'), QLatin1String("\".\""));
|
res.replace(QLatin1Char('.'), QLatin1String("\".\""));
|
||||||
|
@ -379,7 +379,7 @@ QMYSQLResult::~QMYSQLResult()
|
|||||||
QVariant QMYSQLResult::handle() const
|
QVariant QMYSQLResult::handle() const
|
||||||
{
|
{
|
||||||
Q_D(const QMYSQLResult);
|
Q_D(const QMYSQLResult);
|
||||||
if(d->preparedQuery)
|
if (d->preparedQuery)
|
||||||
return d->meta ? QVariant::fromValue(d->meta) : QVariant::fromValue(d->stmt);
|
return d->meta ? QVariant::fromValue(d->meta) : QVariant::fromValue(d->stmt);
|
||||||
else
|
else
|
||||||
return QVariant::fromValue(d->result);
|
return QVariant::fromValue(d->result);
|
||||||
@ -600,7 +600,7 @@ QVariant QMYSQLResult::data(int field)
|
|||||||
ok = true;
|
ok = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(ok)
|
if (ok)
|
||||||
return v;
|
return v;
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
@ -1371,7 +1371,7 @@ QSqlRecord QMYSQLDriver::record(const QString& tablename) const
|
|||||||
{
|
{
|
||||||
Q_D(const QMYSQLDriver);
|
Q_D(const QMYSQLDriver);
|
||||||
QString table=tablename;
|
QString table=tablename;
|
||||||
if(isIdentifierEscaped(table, QSqlDriver::TableName))
|
if (isIdentifierEscaped(table, QSqlDriver::TableName))
|
||||||
table = stripDelimiters(table, QSqlDriver::TableName);
|
table = stripDelimiters(table, QSqlDriver::TableName);
|
||||||
|
|
||||||
QSqlRecord info;
|
QSqlRecord info;
|
||||||
@ -1481,7 +1481,7 @@ QString QMYSQLDriver::formatValue(const QSqlField &field, bool trimStrings) cons
|
|||||||
QString QMYSQLDriver::escapeIdentifier(const QString &identifier, IdentifierType) const
|
QString QMYSQLDriver::escapeIdentifier(const QString &identifier, IdentifierType) const
|
||||||
{
|
{
|
||||||
QString res = identifier;
|
QString res = identifier;
|
||||||
if(!identifier.isEmpty() && !identifier.startsWith(QLatin1Char('`')) && !identifier.endsWith(QLatin1Char('`')) ) {
|
if (!identifier.isEmpty() && !identifier.startsWith(QLatin1Char('`')) && !identifier.endsWith(QLatin1Char('`')) ) {
|
||||||
res.prepend(QLatin1Char('`')).append(QLatin1Char('`'));
|
res.prepend(QLatin1Char('`')).append(QLatin1Char('`'));
|
||||||
res.replace(QLatin1Char('.'), QLatin1String("`.`"));
|
res.replace(QLatin1Char('.'), QLatin1String("`.`"));
|
||||||
}
|
}
|
||||||
|
@ -1432,7 +1432,7 @@ bool QOCICols::execBatch(QOCIResultPrivate *d, QVariantList &boundValues, bool a
|
|||||||
col.bindAs = SQLT_STR;
|
col.bindAs = SQLT_STR;
|
||||||
for (uint j = 0; j < col.recordCount; ++j) {
|
for (uint j = 0; j < col.recordCount; ++j) {
|
||||||
uint len;
|
uint len;
|
||||||
if(d->isOutValue(i))
|
if (d->isOutValue(i))
|
||||||
len = boundValues.at(i).toList().at(j).toString().capacity() + 1;
|
len = boundValues.at(i).toList().at(j).toString().capacity() + 1;
|
||||||
else
|
else
|
||||||
len = boundValues.at(i).toList().at(j).toString().length() + 1;
|
len = boundValues.at(i).toList().at(j).toString().length() + 1;
|
||||||
@ -1807,7 +1807,7 @@ void QOCICols::getValues(QVariantList &v, int index)
|
|||||||
qint64 qll = 0;
|
qint64 qll = 0;
|
||||||
int r = OCINumberToInt(d->err, reinterpret_cast<OCINumber *>(fld.data), sizeof(qint64),
|
int r = OCINumberToInt(d->err, reinterpret_cast<OCINumber *>(fld.data), sizeof(qint64),
|
||||||
OCI_NUMBER_SIGNED, &qll);
|
OCI_NUMBER_SIGNED, &qll);
|
||||||
if(r == OCI_SUCCESS)
|
if (r == OCI_SUCCESS)
|
||||||
v[index + i] = qll;
|
v[index + i] = qll;
|
||||||
else
|
else
|
||||||
v[index + i] = QVariant();
|
v[index + i] = QVariant();
|
||||||
@ -2762,7 +2762,7 @@ QVariant QOCIDriver::handle() const
|
|||||||
QString QOCIDriver::escapeIdentifier(const QString &identifier, IdentifierType type) const
|
QString QOCIDriver::escapeIdentifier(const QString &identifier, IdentifierType type) const
|
||||||
{
|
{
|
||||||
QString res = identifier;
|
QString res = identifier;
|
||||||
if(!identifier.isEmpty() && !isIdentifierEscaped(identifier, type)) {
|
if (!identifier.isEmpty() && !isIdentifierEscaped(identifier, type)) {
|
||||||
res.replace(QLatin1Char('"'), QLatin1String("\"\""));
|
res.replace(QLatin1Char('"'), QLatin1String("\"\""));
|
||||||
res.prepend(QLatin1Char('"')).append(QLatin1Char('"'));
|
res.prepend(QLatin1Char('"')).append(QLatin1Char('"'));
|
||||||
res.replace(QLatin1Char('.'), QLatin1String("\".\""));
|
res.replace(QLatin1Char('.'), QLatin1String("\".\""));
|
||||||
|
@ -74,7 +74,7 @@ inline static QString fromSQLTCHAR(const QVarLengthArray<SQLTCHAR>& input, qsize
|
|||||||
|
|
||||||
// Remove any trailing \0 as some drivers misguidedly append one
|
// Remove any trailing \0 as some drivers misguidedly append one
|
||||||
int realsize = qMin(size, input.size());
|
int realsize = qMin(size, input.size());
|
||||||
if(realsize > 0 && input[realsize-1] == 0)
|
if (realsize > 0 && input[realsize-1] == 0)
|
||||||
realsize--;
|
realsize--;
|
||||||
switch(sizeof(SQLTCHAR)) {
|
switch(sizeof(SQLTCHAR)) {
|
||||||
case 1:
|
case 1:
|
||||||
@ -261,8 +261,8 @@ static QString qWarnODBCHandle(int handleType, SQLHANDLE handle, int *nativeCode
|
|||||||
if (nativeCode)
|
if (nativeCode)
|
||||||
*nativeCode = nativeCode_;
|
*nativeCode = nativeCode_;
|
||||||
const QString tmpstore = fromSQLTCHAR(description_, msgLen);
|
const QString tmpstore = fromSQLTCHAR(description_, msgLen);
|
||||||
if(result != tmpstore) {
|
if (result != tmpstore) {
|
||||||
if(!result.isEmpty())
|
if (!result.isEmpty())
|
||||||
result += QLatin1Char(' ');
|
result += QLatin1Char(' ');
|
||||||
result += tmpstore;
|
result += tmpstore;
|
||||||
}
|
}
|
||||||
@ -414,7 +414,7 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool uni
|
|||||||
} else {
|
} else {
|
||||||
colSize++; // make sure there is room for more than the 0 termination
|
colSize++; // make sure there is room for more than the 0 termination
|
||||||
}
|
}
|
||||||
if(unicode) {
|
if (unicode) {
|
||||||
r = SQLGetData(hStmt,
|
r = SQLGetData(hStmt,
|
||||||
column+1,
|
column+1,
|
||||||
SQL_C_TCHAR,
|
SQL_C_TCHAR,
|
||||||
@ -603,7 +603,7 @@ static QVariant qGetDoubleData(SQLHANDLE hStmt, int column)
|
|||||||
if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO) {
|
if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO) {
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
if(lengthIndicator == SQL_NULL_DATA)
|
if (lengthIndicator == SQL_NULL_DATA)
|
||||||
return QVariant(QMetaType::fromType<double>());
|
return QVariant(QMetaType::fromType<double>());
|
||||||
|
|
||||||
return (double) dblbuf;
|
return (double) dblbuf;
|
||||||
@ -1033,7 +1033,7 @@ bool QODBCResult::reset (const QString& query)
|
|||||||
|
|
||||||
SQLULEN isScrollable = 0;
|
SQLULEN isScrollable = 0;
|
||||||
r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, 0);
|
r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, 0);
|
||||||
if(r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO)
|
if (r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO)
|
||||||
setForwardOnly(isScrollable == SQL_NONSCROLLABLE);
|
setForwardOnly(isScrollable == SQL_NONSCROLLABLE);
|
||||||
|
|
||||||
SQLSMALLINT count = 0;
|
SQLSMALLINT count = 0;
|
||||||
@ -1667,7 +1667,7 @@ bool QODBCResult::exec()
|
|||||||
|
|
||||||
SQLULEN isScrollable = 0;
|
SQLULEN isScrollable = 0;
|
||||||
r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, 0);
|
r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, 0);
|
||||||
if(r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO)
|
if (r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO)
|
||||||
setForwardOnly(isScrollable == SQL_NONSCROLLABLE);
|
setForwardOnly(isScrollable == SQL_NONSCROLLABLE);
|
||||||
|
|
||||||
SQLSMALLINT count = 0;
|
SQLSMALLINT count = 0;
|
||||||
@ -2017,7 +2017,7 @@ void QODBCDriver::cleanup()
|
|||||||
Q_D(QODBCDriver);
|
Q_D(QODBCDriver);
|
||||||
SQLRETURN r;
|
SQLRETURN r;
|
||||||
|
|
||||||
if(d->hDbc) {
|
if (d->hDbc) {
|
||||||
// Open statements/descriptors handles are automatically cleaned up by SQLDisconnect
|
// Open statements/descriptors handles are automatically cleaned up by SQLDisconnect
|
||||||
if (isOpen()) {
|
if (isOpen()) {
|
||||||
r = SQLDisconnect(d->hDbc);
|
r = SQLDisconnect(d->hDbc);
|
||||||
@ -2084,12 +2084,12 @@ void QODBCDriverPrivate::checkUnicode()
|
|||||||
&hStmt);
|
&hStmt);
|
||||||
|
|
||||||
r = SQLExecDirect(hStmt, toSQLTCHAR(QLatin1String("select 'test'")).data(), SQL_NTS);
|
r = SQLExecDirect(hStmt, toSQLTCHAR(QLatin1String("select 'test'")).data(), SQL_NTS);
|
||||||
if(r == SQL_SUCCESS) {
|
if (r == SQL_SUCCESS) {
|
||||||
r = SQLFetch(hStmt);
|
r = SQLFetch(hStmt);
|
||||||
if(r == SQL_SUCCESS) {
|
if (r == SQL_SUCCESS) {
|
||||||
QVarLengthArray<SQLWCHAR> buffer(10);
|
QVarLengthArray<SQLWCHAR> buffer(10);
|
||||||
r = SQLGetData(hStmt, 1, SQL_C_WCHAR, buffer.data(), buffer.size() * sizeof(SQLWCHAR), NULL);
|
r = SQLGetData(hStmt, 1, SQL_C_WCHAR, buffer.data(), buffer.size() * sizeof(SQLWCHAR), NULL);
|
||||||
if(r == SQL_SUCCESS && fromSQLTCHAR(buffer) == QLatin1String("test")) {
|
if (r == SQL_SUCCESS && fromSQLTCHAR(buffer) == QLatin1String("test")) {
|
||||||
unicode = true;
|
unicode = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2626,7 +2626,7 @@ QString QODBCDriver::escapeIdentifier(const QString &identifier, IdentifierType)
|
|||||||
Q_D(const QODBCDriver);
|
Q_D(const QODBCDriver);
|
||||||
QChar quote = const_cast<QODBCDriverPrivate*>(d)->quoteChar();
|
QChar quote = const_cast<QODBCDriverPrivate*>(d)->quoteChar();
|
||||||
QString res = identifier;
|
QString res = identifier;
|
||||||
if(!identifier.isEmpty() && !identifier.startsWith(quote) && !identifier.endsWith(quote) ) {
|
if (!identifier.isEmpty() && !identifier.startsWith(quote) && !identifier.endsWith(quote) ) {
|
||||||
res.replace(quote, QString(quote)+QString(quote));
|
res.replace(quote, QString(quote)+QString(quote));
|
||||||
res.prepend(quote).append(quote);
|
res.prepend(quote).append(quote);
|
||||||
res.replace(QLatin1Char('.'), QString(quote)+QLatin1Char('.')+QString(quote));
|
res.replace(QLatin1Char('.'), QString(quote)+QLatin1Char('.')+QString(quote));
|
||||||
|
@ -262,7 +262,7 @@ bool QSQLiteResultPrivate::fetchNext(QSqlCachedResult::ValueCache &values, int i
|
|||||||
}
|
}
|
||||||
skipRow = initialFetch;
|
skipRow = initialFetch;
|
||||||
|
|
||||||
if(initialFetch) {
|
if (initialFetch) {
|
||||||
firstRow.clear();
|
firstRow.clear();
|
||||||
firstRow.resize(sqlite3_column_count(stmt));
|
firstRow.resize(sqlite3_column_count(stmt));
|
||||||
}
|
}
|
||||||
|
@ -976,7 +976,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QStyleOption
|
|||||||
#if QT_CONFIG(toolbutton)
|
#if QT_CONFIG(toolbutton)
|
||||||
const QStyleOptionToolButton *bt = qstyleoption_cast<const QStyleOptionToolButton *>(opt);
|
const QStyleOptionToolButton *bt = qstyleoption_cast<const QStyleOptionToolButton *>(opt);
|
||||||
// If this conversion fails then the widget was not what it claimed to be.
|
// If this conversion fails then the widget was not what it claimed to be.
|
||||||
if(bt) {
|
if (bt) {
|
||||||
if (!bt->icon.isNull()) {
|
if (!bt->icon.isNull()) {
|
||||||
QSize iconSize = bt->iconSize;
|
QSize iconSize = bt->iconSize;
|
||||||
QSize pmSize = bt->icon.actualSize(QSize(32, 32), QIcon::Normal);
|
QSize pmSize = bt->icon.actualSize(QSize(32, 32), QIcon::Normal);
|
||||||
@ -1014,7 +1014,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QStyleOption
|
|||||||
int w = -1;
|
int w = -1;
|
||||||
const QStyleOptionSlider *sld = qstyleoption_cast<const QStyleOptionSlider *>(opt);
|
const QStyleOptionSlider *sld = qstyleoption_cast<const QStyleOptionSlider *>(opt);
|
||||||
// If this conversion fails then the widget was not what it claimed to be.
|
// If this conversion fails then the widget was not what it claimed to be.
|
||||||
if(sld) {
|
if (sld) {
|
||||||
if (sz == QStyleHelper::SizeLarge) {
|
if (sz == QStyleHelper::SizeLarge) {
|
||||||
if (sld->orientation == Qt::Horizontal) {
|
if (sld->orientation == Qt::Horizontal) {
|
||||||
w = qt_mac_aqua_get_metric(HSliderHeight);
|
w = qt_mac_aqua_get_metric(HSliderHeight);
|
||||||
@ -2708,7 +2708,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
|
|||||||
break;
|
break;
|
||||||
case SH_FocusFrame_Mask: {
|
case SH_FocusFrame_Mask: {
|
||||||
ret = true;
|
ret = true;
|
||||||
if(QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(hret)) {
|
if (QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(hret)) {
|
||||||
const uchar fillR = 192, fillG = 191, fillB = 190;
|
const uchar fillR = 192, fillG = 191, fillB = 190;
|
||||||
QImage img;
|
QImage img;
|
||||||
|
|
||||||
@ -6508,7 +6508,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
|
|||||||
void QMacStyle::drawItemText(QPainter *p, const QRect &r, int flags, const QPalette &pal,
|
void QMacStyle::drawItemText(QPainter *p, const QRect &r, int flags, const QPalette &pal,
|
||||||
bool enabled, const QString &text, QPalette::ColorRole textRole) const
|
bool enabled, const QString &text, QPalette::ColorRole textRole) const
|
||||||
{
|
{
|
||||||
if(flags & Qt::TextShowMnemonic)
|
if (flags & Qt::TextShowMnemonic)
|
||||||
flags |= Qt::TextHideMnemonic;
|
flags |= Qt::TextHideMnemonic;
|
||||||
QCommonStyle::drawItemText(p, r, flags, pal, enabled, text, textRole);
|
QCommonStyle::drawItemText(p, r, flags, pal, enabled, text, textRole);
|
||||||
}
|
}
|
||||||
@ -6516,7 +6516,7 @@ void QMacStyle::drawItemText(QPainter *p, const QRect &r, int flags, const QPale
|
|||||||
bool QMacStyle::event(QEvent *e)
|
bool QMacStyle::event(QEvent *e)
|
||||||
{
|
{
|
||||||
Q_D(QMacStyle);
|
Q_D(QMacStyle);
|
||||||
if(e->type() == QEvent::FocusIn) {
|
if (e->type() == QEvent::FocusIn) {
|
||||||
QWidget *f = nullptr;
|
QWidget *f = nullptr;
|
||||||
QWidget *focusWidget = QApplication::focusWidget();
|
QWidget *focusWidget = QApplication::focusWidget();
|
||||||
#if QT_CONFIG(graphicsview)
|
#if QT_CONFIG(graphicsview)
|
||||||
@ -6539,14 +6539,14 @@ bool QMacStyle::event(QEvent *e)
|
|||||||
f = focusWidget;
|
f = focusWidget;
|
||||||
}
|
}
|
||||||
if (f) {
|
if (f) {
|
||||||
if(!d->focusWidget)
|
if (!d->focusWidget)
|
||||||
d->focusWidget = new QFocusFrame(f);
|
d->focusWidget = new QFocusFrame(f);
|
||||||
d->focusWidget->setWidget(f);
|
d->focusWidget->setWidget(f);
|
||||||
} else if(d->focusWidget) {
|
} else if (d->focusWidget) {
|
||||||
d->focusWidget->setWidget(0);
|
d->focusWidget->setWidget(0);
|
||||||
}
|
}
|
||||||
} else if(e->type() == QEvent::FocusOut) {
|
} else if (e->type() == QEvent::FocusOut) {
|
||||||
if(d->focusWidget)
|
if (d->focusWidget)
|
||||||
d->focusWidget->setWidget(0);
|
d->focusWidget->setWidget(0);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -542,7 +542,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
|
|||||||
}
|
}
|
||||||
int bgType;
|
int bgType;
|
||||||
GetThemeEnumValue(theme.handle(), partId, stateId, TMT_BGTYPE, &bgType);
|
GetThemeEnumValue(theme.handle(), partId, stateId, TMT_BGTYPE, &bgType);
|
||||||
if( bgType == BT_IMAGEFILE ) {
|
if ( bgType == BT_IMAGEFILE ) {
|
||||||
d->drawBackground(theme);
|
d->drawBackground(theme);
|
||||||
} else {
|
} else {
|
||||||
QBrush fillColor = option->palette.brush(QPalette::Base);
|
QBrush fillColor = option->palette.brush(QPalette::Base);
|
||||||
|
@ -247,14 +247,14 @@ void QWindowsXPStylePrivate::init(bool force)
|
|||||||
*/
|
*/
|
||||||
void QWindowsXPStylePrivate::cleanup(bool force)
|
void QWindowsXPStylePrivate::cleanup(bool force)
|
||||||
{
|
{
|
||||||
if(bufferBitmap) {
|
if (bufferBitmap) {
|
||||||
if (bufferDC && nullBitmap)
|
if (bufferDC && nullBitmap)
|
||||||
SelectObject(bufferDC, nullBitmap);
|
SelectObject(bufferDC, nullBitmap);
|
||||||
DeleteObject(bufferBitmap);
|
DeleteObject(bufferBitmap);
|
||||||
bufferBitmap = nullptr;
|
bufferBitmap = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(bufferDC)
|
if (bufferDC)
|
||||||
DeleteDC(bufferDC);
|
DeleteDC(bufferDC);
|
||||||
bufferDC = nullptr;
|
bufferDC = nullptr;
|
||||||
|
|
||||||
@ -1618,7 +1618,7 @@ case PE_Frame:
|
|||||||
p->drawLine(option->rect.x()+2, option->rect.y()+2, option->rect.x()+6, option->rect.y()+2);
|
p->drawLine(option->rect.x()+2, option->rect.y()+2, option->rect.x()+6, option->rect.y()+2);
|
||||||
p->drawLine(option->rect.x()+3, option->rect.y()+3, option->rect.x()+5, option->rect.y()+3);
|
p->drawLine(option->rect.x()+3, option->rect.y()+3, option->rect.x()+5, option->rect.y()+3);
|
||||||
p->drawPoint(option->rect.x()+4, option->rect.y()+4);
|
p->drawPoint(option->rect.x()+4, option->rect.y()+4);
|
||||||
} else if(header->sortIndicator & QStyleOptionHeader::SortDown) {
|
} else if (header->sortIndicator & QStyleOptionHeader::SortDown) {
|
||||||
p->drawLine(option->rect.x(), option->rect.y()+4, option->rect.x()+8, option->rect.y()+4);
|
p->drawLine(option->rect.x(), option->rect.y()+4, option->rect.x()+8, option->rect.y()+4);
|
||||||
p->drawLine(option->rect.x()+1, option->rect.y()+3, option->rect.x()+7, option->rect.y()+3);
|
p->drawLine(option->rect.x()+1, option->rect.y()+3, option->rect.x()+7, option->rect.y()+3);
|
||||||
p->drawLine(option->rect.x()+2, option->rect.y()+2, option->rect.x()+6, option->rect.y()+2);
|
p->drawLine(option->rect.x()+2, option->rect.y()+2, option->rect.x()+6, option->rect.y()+2);
|
||||||
|
@ -376,9 +376,9 @@ int QWin32PrintEngine::metric(QPaintDevice::PaintDeviceMetric m) const
|
|||||||
case QPaintDevice::PdmNumColors:
|
case QPaintDevice::PdmNumColors:
|
||||||
{
|
{
|
||||||
int bpp = GetDeviceCaps(d->hdc, BITSPIXEL);
|
int bpp = GetDeviceCaps(d->hdc, BITSPIXEL);
|
||||||
if(bpp==32)
|
if (bpp==32)
|
||||||
val = INT_MAX;
|
val = INT_MAX;
|
||||||
else if(bpp<=8)
|
else if (bpp<=8)
|
||||||
val = GetDeviceCaps(d->hdc, NUMCOLORS);
|
val = GetDeviceCaps(d->hdc, NUMCOLORS);
|
||||||
else
|
else
|
||||||
val = 1 << (bpp * GetDeviceCaps(d->hdc, PLANES));
|
val = 1 << (bpp * GetDeviceCaps(d->hdc, PLANES));
|
||||||
|
@ -257,7 +257,7 @@ bool QSqlCachedResult::cacheNext()
|
|||||||
if (d->atEnd)
|
if (d->atEnd)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(isForwardOnly()) {
|
if (isForwardOnly()) {
|
||||||
d->cache.resize(d->colCount);
|
d->cache.resize(d->colCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1446,7 +1446,7 @@ QString QSqlDatabase::connectionName() const
|
|||||||
*/
|
*/
|
||||||
void QSqlDatabase::setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy)
|
void QSqlDatabase::setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy)
|
||||||
{
|
{
|
||||||
if(driver())
|
if (driver())
|
||||||
driver()->setNumericalPrecisionPolicy(precisionPolicy);
|
driver()->setNumericalPrecisionPolicy(precisionPolicy);
|
||||||
d->precisionPolicy = precisionPolicy;
|
d->precisionPolicy = precisionPolicy;
|
||||||
}
|
}
|
||||||
@ -1461,7 +1461,7 @@ void QSqlDatabase::setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy pr
|
|||||||
*/
|
*/
|
||||||
QSql::NumericalPrecisionPolicy QSqlDatabase::numericalPrecisionPolicy() const
|
QSql::NumericalPrecisionPolicy QSqlDatabase::numericalPrecisionPolicy() const
|
||||||
{
|
{
|
||||||
if(driver())
|
if (driver())
|
||||||
return driver()->numericalPrecisionPolicy();
|
return driver()->numericalPrecisionPolicy();
|
||||||
else
|
else
|
||||||
return d->precisionPolicy;
|
return d->precisionPolicy;
|
||||||
|
@ -1281,7 +1281,7 @@ void Moc::parsePropertyAttributes(PropertyDef &propDef)
|
|||||||
if (l[0] == 'C' && l == "CONSTANT") {
|
if (l[0] == 'C' && l == "CONSTANT") {
|
||||||
propDef.constant = true;
|
propDef.constant = true;
|
||||||
continue;
|
continue;
|
||||||
} else if(l[0] == 'F' && l == "FINAL") {
|
} else if (l[0] == 'F' && l == "FINAL") {
|
||||||
propDef.final = true;
|
propDef.final = true;
|
||||||
continue;
|
continue;
|
||||||
} else if (l[0] == 'N' && l == "NAME") {
|
} else if (l[0] == 'N' && l == "NAME") {
|
||||||
@ -1752,7 +1752,7 @@ bool Moc::until(Token target) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(target == COMMA && angleCount != 0 && possible != -1) {
|
if (target == COMMA && angleCount != 0 && possible != -1) {
|
||||||
index = possible;
|
index = possible;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1868,11 +1868,11 @@ void Moc::checkProperties(ClassDef *cdef)
|
|||||||
p.gspec = spec;
|
p.gspec = spec;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(!p.notify.isEmpty()) {
|
if (!p.notify.isEmpty()) {
|
||||||
int notifyId = -1;
|
int notifyId = -1;
|
||||||
for (int j = 0; j < cdef->signalList.count(); ++j) {
|
for (int j = 0; j < cdef->signalList.count(); ++j) {
|
||||||
const FunctionDef &f = cdef->signalList.at(j);
|
const FunctionDef &f = cdef->signalList.at(j);
|
||||||
if(f.name != p.notify) {
|
if (f.name != p.notify) {
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
notifyId = j /* Signal indexes start from 0 */;
|
notifyId = j /* Signal indexes start from 0 */;
|
||||||
|
@ -86,7 +86,7 @@ int QAccessibleMenu::childCount() const
|
|||||||
QAccessibleInterface *QAccessibleMenu::childAt(int x, int y) const
|
QAccessibleInterface *QAccessibleMenu::childAt(int x, int y) const
|
||||||
{
|
{
|
||||||
QAction *act = menu()->actionAt(menu()->mapFromGlobal(QPoint(x,y)));
|
QAction *act = menu()->actionAt(menu()->mapFromGlobal(QPoint(x,y)));
|
||||||
if(act && act->isSeparator())
|
if (act && act->isSeparator())
|
||||||
act = nullptr;
|
act = nullptr;
|
||||||
return act ? getOrCreateMenu(menu(), act) : nullptr;
|
return act ? getOrCreateMenu(menu(), act) : nullptr;
|
||||||
}
|
}
|
||||||
|
@ -460,19 +460,19 @@ void QWellArray::keyPressEvent(QKeyEvent* e)
|
|||||||
{
|
{
|
||||||
switch(e->key()) { // Look at the key code
|
switch(e->key()) { // Look at the key code
|
||||||
case Qt::Key_Left: // If 'left arrow'-key,
|
case Qt::Key_Left: // If 'left arrow'-key,
|
||||||
if(curCol > 0) // and cr't not in leftmost col
|
if (curCol > 0) // and cr't not in leftmost col
|
||||||
setCurrent(curRow, curCol - 1); // set cr't to next left column
|
setCurrent(curRow, curCol - 1); // set cr't to next left column
|
||||||
break;
|
break;
|
||||||
case Qt::Key_Right: // Correspondingly...
|
case Qt::Key_Right: // Correspondingly...
|
||||||
if(curCol < numCols()-1)
|
if (curCol < numCols()-1)
|
||||||
setCurrent(curRow, curCol + 1);
|
setCurrent(curRow, curCol + 1);
|
||||||
break;
|
break;
|
||||||
case Qt::Key_Up:
|
case Qt::Key_Up:
|
||||||
if(curRow > 0)
|
if (curRow > 0)
|
||||||
setCurrent(curRow - 1, curCol);
|
setCurrent(curRow - 1, curCol);
|
||||||
break;
|
break;
|
||||||
case Qt::Key_Down:
|
case Qt::Key_Down:
|
||||||
if(curRow < numRows()-1)
|
if (curRow < numRows()-1)
|
||||||
setCurrent(curRow + 1, curCol);
|
setCurrent(curRow + 1, curCol);
|
||||||
break;
|
break;
|
||||||
#if 0
|
#if 0
|
||||||
@ -1762,7 +1762,7 @@ void QColorDialogPrivate::initWidgets()
|
|||||||
QSize screenSize = QGuiApplication::screenAt(QCursor::pos())->availableGeometry().size();
|
QSize screenSize = QGuiApplication::screenAt(QCursor::pos())->availableGeometry().size();
|
||||||
pWidth = pHeight = qMin(screenSize.width(), screenSize.height());
|
pWidth = pHeight = qMin(screenSize.width(), screenSize.height());
|
||||||
pHeight -= 20;
|
pHeight -= 20;
|
||||||
if(screenSize.height() > screenSize.width())
|
if (screenSize.height() > screenSize.width())
|
||||||
pWidth -= 20;
|
pWidth -= 20;
|
||||||
#else
|
#else
|
||||||
pWidth = 150;
|
pWidth = 150;
|
||||||
|
@ -1007,7 +1007,7 @@ void QFontDialog::done(int result)
|
|||||||
if (result == Accepted) {
|
if (result == Accepted) {
|
||||||
// We check if this is the same font we had before, if so we emit currentFontChanged
|
// We check if this is the same font we had before, if so we emit currentFontChanged
|
||||||
QFont selectedFont = currentFont();
|
QFont selectedFont = currentFont();
|
||||||
if(selectedFont != d->selectedFont)
|
if (selectedFont != d->selectedFont)
|
||||||
emit(currentFontChanged(selectedFont));
|
emit(currentFontChanged(selectedFont));
|
||||||
d->selectedFont = selectedFont;
|
d->selectedFont = selectedFont;
|
||||||
emit fontSelected(d->selectedFont);
|
emit fontSelected(d->selectedFont);
|
||||||
|
@ -2712,7 +2712,7 @@ QString QWizard::buttonText(WizardButton which) const
|
|||||||
return d->buttonCustomTexts.value(which);
|
return d->buttonCustomTexts.value(which);
|
||||||
|
|
||||||
const QString defText = buttonDefaultText(d->wizStyle, which, d);
|
const QString defText = buttonDefaultText(d->wizStyle, which, d);
|
||||||
if(!defText.isNull())
|
if (!defText.isNull())
|
||||||
return defText;
|
return defText;
|
||||||
|
|
||||||
return d->btns[which]->text();
|
return d->btns[which]->text();
|
||||||
|
@ -61,7 +61,7 @@ int loadFileDialog()
|
|||||||
QFileDialog dialog;
|
QFileDialog dialog;
|
||||||
dialog.setSidebarUrls(urls);
|
dialog.setSidebarUrls(urls);
|
||||||
dialog.setFileMode(QFileDialog::AnyFile);
|
dialog.setFileMode(QFileDialog::AnyFile);
|
||||||
if(dialog.exec()) {
|
if (dialog.exec()) {
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
//![0]
|
//![0]
|
||||||
|
@ -353,17 +353,17 @@ static void convolute(
|
|||||||
int kernely = -kernelHeight/2;
|
int kernely = -kernelHeight/2;
|
||||||
int starty = 0;
|
int starty = 0;
|
||||||
int endy = kernelHeight;
|
int endy = kernelHeight;
|
||||||
if(yk+kernely+endy >= srcImage.height())
|
if (yk+kernely+endy >= srcImage.height())
|
||||||
endy = kernelHeight-((yk+kernely+endy)-srcImage.height())-1;
|
endy = kernelHeight-((yk+kernely+endy)-srcImage.height())-1;
|
||||||
if(yk+kernely < 0)
|
if (yk+kernely < 0)
|
||||||
starty = -(yk+kernely);
|
starty = -(yk+kernely);
|
||||||
|
|
||||||
int kernelx = -kernelWidth/2;
|
int kernelx = -kernelWidth/2;
|
||||||
int startx = 0;
|
int startx = 0;
|
||||||
int endx = kernelWidth;
|
int endx = kernelWidth;
|
||||||
if(xk+kernelx+endx >= srcImage.width())
|
if (xk+kernelx+endx >= srcImage.width())
|
||||||
endx = kernelWidth-((xk+kernelx+endx)-srcImage.width())-1;
|
endx = kernelWidth-((xk+kernelx+endx)-srcImage.width())-1;
|
||||||
if(xk+kernelx < 0)
|
if (xk+kernelx < 0)
|
||||||
startx = -(xk+kernelx);
|
startx = -(xk+kernelx);
|
||||||
|
|
||||||
for (int ys = starty; ys < endy; ys ++) {
|
for (int ys = starty; ys < endy; ys ++) {
|
||||||
@ -385,7 +385,7 @@ static void convolute(
|
|||||||
b = qBound((int)0, b >> 16, (int)255);
|
b = qBound((int)0, b >> 16, (int)255);
|
||||||
a = qBound((int)0, a >> 16, (int)255);
|
a = qBound((int)0, a >> 16, (int)255);
|
||||||
// composition mode checking could be moved outside of loop
|
// composition mode checking could be moved outside of loop
|
||||||
if(mode == QPainter::CompositionMode_Source) {
|
if (mode == QPainter::CompositionMode_Source) {
|
||||||
uint color = (a<<24)+(r<<16)+(g<<8)+b;
|
uint color = (a<<24)+(r<<16)+(g<<8)+b;
|
||||||
*output++ = color;
|
*output++ = color;
|
||||||
} else {
|
} else {
|
||||||
@ -416,7 +416,7 @@ void QPixmapConvolutionFilter::draw(QPainter *painter, const QPointF &p, const Q
|
|||||||
if (!painter->isActive())
|
if (!painter->isActive())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(d->kernelWidth<=0 || d->kernelHeight <= 0)
|
if (d->kernelWidth<=0 || d->kernelHeight <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (src.isNull())
|
if (src.isNull())
|
||||||
|
@ -70,7 +70,7 @@ class QGraphicsWidget;
|
|||||||
inline bool qt_graphicsLayoutDebug()
|
inline bool qt_graphicsLayoutDebug()
|
||||||
{
|
{
|
||||||
static int checked_env = -1;
|
static int checked_env = -1;
|
||||||
if(checked_env == -1)
|
if (checked_env == -1)
|
||||||
checked_env = !!qEnvironmentVariableIntValue("QT_GRAPHICSLAYOUT_DEBUG");
|
checked_env = !!qEnvironmentVariableIntValue("QT_GRAPHICSLAYOUT_DEBUG");
|
||||||
return checked_env;
|
return checked_env;
|
||||||
}
|
}
|
||||||
|
@ -1754,7 +1754,7 @@ void QGraphicsView::setScene(QGraphicsScene *scene)
|
|||||||
QEvent windowDeactivate(QEvent::WindowDeactivate);
|
QEvent windowDeactivate(QEvent::WindowDeactivate);
|
||||||
QCoreApplication::sendEvent(d->scene, &windowDeactivate);
|
QCoreApplication::sendEvent(d->scene, &windowDeactivate);
|
||||||
}
|
}
|
||||||
if(hasFocus())
|
if (hasFocus())
|
||||||
d->scene->clearFocus();
|
d->scene->clearFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2727,7 +2727,7 @@ void QAbstractItemView::updateEditorData()
|
|||||||
void QAbstractItemView::updateEditorGeometries()
|
void QAbstractItemView::updateEditorGeometries()
|
||||||
{
|
{
|
||||||
Q_D(QAbstractItemView);
|
Q_D(QAbstractItemView);
|
||||||
if(d->editorIndexHash.isEmpty())
|
if (d->editorIndexHash.isEmpty())
|
||||||
return;
|
return;
|
||||||
if (d->delayedPendingLayout) {
|
if (d->delayedPendingLayout) {
|
||||||
// doItemsLayout() will end up calling this function again
|
// doItemsLayout() will end up calling this function again
|
||||||
|
@ -79,7 +79,7 @@ void QSpanCollection::addSpan(QSpanCollection::Span *span)
|
|||||||
const SubIndex previousList = it_y.value();
|
const SubIndex previousList = it_y.value();
|
||||||
for (Span *s : previousList) {
|
for (Span *s : previousList) {
|
||||||
//If a subspans intersect the row, we need to split it into subspans
|
//If a subspans intersect the row, we need to split it into subspans
|
||||||
if(s->bottom() >= span->top())
|
if (s->bottom() >= span->top())
|
||||||
sub_index.insert(-s->left(), s);
|
sub_index.insert(-s->left(), s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -90,7 +90,7 @@ void QSpanCollection::addSpan(QSpanCollection::Span *span)
|
|||||||
//insert the span as supspan in all the lists that intesects the span
|
//insert the span as supspan in all the lists that intesects the span
|
||||||
while(-it_y.key() <= span->bottom()) {
|
while(-it_y.key() <= span->bottom()) {
|
||||||
(*it_y).insert(-span->left(), span);
|
(*it_y).insert(-span->left(), span);
|
||||||
if(it_y == index.begin())
|
if (it_y == index.begin())
|
||||||
break;
|
break;
|
||||||
--it_y;
|
--it_y;
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ void QSpanCollection::updateSpan(QSpanCollection::Span *span, int old_height)
|
|||||||
Q_ASSERT(it_y != index.end()); //it_y must exist since the span is in the list
|
Q_ASSERT(it_y != index.end()); //it_y must exist since the span is in the list
|
||||||
while (-it_y.key() <= span->bottom()) {
|
while (-it_y.key() <= span->bottom()) {
|
||||||
(*it_y).insert(-span->left(), span);
|
(*it_y).insert(-span->left(), span);
|
||||||
if(it_y == index.begin())
|
if (it_y == index.begin())
|
||||||
break;
|
break;
|
||||||
--it_y;
|
--it_y;
|
||||||
}
|
}
|
||||||
@ -129,7 +129,7 @@ void QSpanCollection::updateSpan(QSpanCollection::Span *span, int old_height)
|
|||||||
it_y = index.erase(it_y);
|
it_y = index.erase(it_y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(it_y == index.begin())
|
if (it_y == index.begin())
|
||||||
break;
|
break;
|
||||||
--it_y;
|
--it_y;
|
||||||
}
|
}
|
||||||
@ -177,7 +177,7 @@ QSet<QSpanCollection::Span *> QSpanCollection::spansInRect(int x, int y, int w,
|
|||||||
{
|
{
|
||||||
QSet<Span *> list;
|
QSet<Span *> list;
|
||||||
Index::const_iterator it_y = index.lowerBound(-y);
|
Index::const_iterator it_y = index.lowerBound(-y);
|
||||||
if(it_y == index.end())
|
if (it_y == index.end())
|
||||||
--it_y;
|
--it_y;
|
||||||
while(-it_y.key() <= y + h) {
|
while(-it_y.key() <= y + h) {
|
||||||
SubIndex::const_iterator it_x = (*it_y).lowerBound(-x);
|
SubIndex::const_iterator it_x = (*it_y).lowerBound(-x);
|
||||||
@ -191,7 +191,7 @@ QSet<QSpanCollection::Span *> QSpanCollection::spansInRect(int x, int y, int w,
|
|||||||
break;
|
break;
|
||||||
--it_x;
|
--it_x;
|
||||||
}
|
}
|
||||||
if(it_y == index.begin())
|
if (it_y == index.begin())
|
||||||
break;
|
break;
|
||||||
--it_y;
|
--it_y;
|
||||||
}
|
}
|
||||||
|
@ -616,7 +616,7 @@ void QTreeView::setRowHidden(int row, const QModelIndex &parent, bool hide)
|
|||||||
|
|
||||||
if (hide) {
|
if (hide) {
|
||||||
d->hiddenIndexes.insert(index);
|
d->hiddenIndexes.insert(index);
|
||||||
} else if(d->isPersistent(index)) { //if the index is not persistent, it cannot be in the set
|
} else if (d->isPersistent(index)) { //if the index is not persistent, it cannot be in the set
|
||||||
d->hiddenIndexes.remove(index);
|
d->hiddenIndexes.remove(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -421,7 +421,7 @@ void QApplicationPrivate::process_cmdline()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(j < argc) {
|
if (j < argc) {
|
||||||
argv[j] = nullptr;
|
argv[j] = nullptr;
|
||||||
argc = j;
|
argc = j;
|
||||||
}
|
}
|
||||||
@ -1512,7 +1512,7 @@ void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason)
|
|||||||
QWidget *prev = focus_widget;
|
QWidget *prev = focus_widget;
|
||||||
focus_widget = focus;
|
focus_widget = focus;
|
||||||
|
|
||||||
if(focus_widget)
|
if (focus_widget)
|
||||||
focus_widget->d_func()->setFocus_sys();
|
focus_widget->d_func()->setFocus_sys();
|
||||||
|
|
||||||
if (reason != Qt::NoFocusReason) {
|
if (reason != Qt::NoFocusReason) {
|
||||||
@ -1531,7 +1531,7 @@ void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason)
|
|||||||
if (that)
|
if (that)
|
||||||
QCoreApplication::sendEvent(that->style(), &out);
|
QCoreApplication::sendEvent(that->style(), &out);
|
||||||
}
|
}
|
||||||
if(focus && QApplicationPrivate::focus_widget == focus) {
|
if (focus && QApplicationPrivate::focus_widget == focus) {
|
||||||
QFocusEvent in(QEvent::FocusIn, reason);
|
QFocusEvent in(QEvent::FocusIn, reason);
|
||||||
QPointer<QWidget> that = focus;
|
QPointer<QWidget> that = focus;
|
||||||
QCoreApplication::sendEvent(focus, &in);
|
QCoreApplication::sendEvent(focus, &in);
|
||||||
|
@ -481,7 +481,7 @@ void QGestureManager::cancelGesturesForChildren(QGesture *original)
|
|||||||
void QGestureManager::cleanupGesturesForRemovedRecognizer(QGesture *gesture)
|
void QGestureManager::cleanupGesturesForRemovedRecognizer(QGesture *gesture)
|
||||||
{
|
{
|
||||||
QGestureRecognizer *recognizer = m_deletedRecognizers.value(gesture);
|
QGestureRecognizer *recognizer = m_deletedRecognizers.value(gesture);
|
||||||
if(!recognizer) //The Gesture is removed while in the even loop, so the recognizers for this gestures was removed
|
if (!recognizer) //The Gesture is removed while in the even loop, so the recognizers for this gestures was removed
|
||||||
return;
|
return;
|
||||||
m_deletedRecognizers.remove(gesture);
|
m_deletedRecognizers.remove(gesture);
|
||||||
if (m_deletedRecognizers.keys(recognizer).isEmpty()) {
|
if (m_deletedRecognizers.keys(recognizer).isEmpty()) {
|
||||||
|
@ -744,7 +744,7 @@ bool QLayout::adoptLayout(QLayout *layout)
|
|||||||
static bool layoutDebug()
|
static bool layoutDebug()
|
||||||
{
|
{
|
||||||
static int checked_env = -1;
|
static int checked_env = -1;
|
||||||
if(checked_env == -1)
|
if (checked_env == -1)
|
||||||
checked_env = !!qEnvironmentVariableIntValue("QT_LAYOUT_DEBUG");
|
checked_env = !!qEnvironmentVariableIntValue("QT_LAYOUT_DEBUG");
|
||||||
|
|
||||||
return checked_env;
|
return checked_env;
|
||||||
|
@ -1559,7 +1559,7 @@ void QWidgetPrivate::setWinId(WId id) // set widget identifier
|
|||||||
mapper->insert(data.winid, q);
|
mapper->insert(data.winid, q);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(oldWinId != id) {
|
if (oldWinId != id) {
|
||||||
QEvent e(QEvent::WinIdChange);
|
QEvent e(QEvent::WinIdChange);
|
||||||
QCoreApplication::sendEvent(q, &e);
|
QCoreApplication::sendEvent(q, &e);
|
||||||
}
|
}
|
||||||
@ -1906,8 +1906,8 @@ QRegion QWidgetPrivate::clipRegion() const
|
|||||||
while(w->d_func()->children.at(i++) != static_cast<const QObject *>(ignoreUpTo))
|
while(w->d_func()->children.at(i++) != static_cast<const QObject *>(ignoreUpTo))
|
||||||
;
|
;
|
||||||
for ( ; i < w->d_func()->children.size(); ++i) {
|
for ( ; i < w->d_func()->children.size(); ++i) {
|
||||||
if(QWidget *sibling = qobject_cast<QWidget *>(w->d_func()->children.at(i))) {
|
if (QWidget *sibling = qobject_cast<QWidget *>(w->d_func()->children.at(i))) {
|
||||||
if(sibling->isVisible() && !sibling->isWindow()) {
|
if (sibling->isVisible() && !sibling->isWindow()) {
|
||||||
QRect siblingRect(ox+sibling->x(), oy+sibling->y(),
|
QRect siblingRect(ox+sibling->x(), oy+sibling->y(),
|
||||||
sibling->width(), sibling->height());
|
sibling->width(), sibling->height());
|
||||||
if (qRectIntersects(siblingRect, q->rect()))
|
if (qRectIntersects(siblingRect, q->rect()))
|
||||||
@ -3119,7 +3119,7 @@ void QWidget::insertAction(QAction *before, QAction *action)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Q_D(QWidget);
|
Q_D(QWidget);
|
||||||
if(d->actions.contains(action))
|
if (d->actions.contains(action))
|
||||||
removeAction(action);
|
removeAction(action);
|
||||||
|
|
||||||
int pos = d->actions.indexOf(before);
|
int pos = d->actions.indexOf(before);
|
||||||
@ -6680,7 +6680,7 @@ QWidget *QWidget::previousInFocusChain() const
|
|||||||
bool QWidget::isActiveWindow() const
|
bool QWidget::isActiveWindow() const
|
||||||
{
|
{
|
||||||
QWidget *tlw = window();
|
QWidget *tlw = window();
|
||||||
if(tlw == QApplication::activeWindow() || (isVisible() && (tlw->windowType() == Qt::Popup)))
|
if (tlw == QApplication::activeWindow() || (isVisible() && (tlw->windowType() == Qt::Popup)))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
#if QT_CONFIG(graphicsview)
|
#if QT_CONFIG(graphicsview)
|
||||||
@ -6691,7 +6691,7 @@ bool QWidget::isActiveWindow() const
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (style()->styleHint(QStyle::SH_Widget_ShareActivation, nullptr, this)) {
|
if (style()->styleHint(QStyle::SH_Widget_ShareActivation, nullptr, this)) {
|
||||||
if(tlw->windowType() == Qt::Tool &&
|
if (tlw->windowType() == Qt::Tool &&
|
||||||
!tlw->isModal() &&
|
!tlw->isModal() &&
|
||||||
(!tlw->parentWidget() || tlw->parentWidget()->isActiveWindow()))
|
(!tlw->parentWidget() || tlw->parentWidget()->isActiveWindow()))
|
||||||
return true;
|
return true;
|
||||||
@ -6699,7 +6699,7 @@ bool QWidget::isActiveWindow() const
|
|||||||
while(w && tlw->windowType() == Qt::Tool &&
|
while(w && tlw->windowType() == Qt::Tool &&
|
||||||
!w->isModal() && w->parentWidget()) {
|
!w->isModal() && w->parentWidget()) {
|
||||||
w = w->parentWidget()->window();
|
w = w->parentWidget()->window();
|
||||||
if(w == tlw)
|
if (w == tlw)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6842,7 +6842,7 @@ void QWidgetPrivate::reparentFocusWidgets(QWidget * oldtlw)
|
|||||||
if (oldtlw == q->window())
|
if (oldtlw == q->window())
|
||||||
return; // nothing to do
|
return; // nothing to do
|
||||||
|
|
||||||
if(focus_child)
|
if (focus_child)
|
||||||
focus_child->clearFocus();
|
focus_child->clearFocus();
|
||||||
|
|
||||||
// separate the focus chain into new (children of myself) and old (the rest)
|
// separate the focus chain into new (children of myself) and old (the rest)
|
||||||
@ -9879,7 +9879,7 @@ void QWidget::ensurePolished() const
|
|||||||
QList<QObject*> children = d->children;
|
QList<QObject*> children = d->children;
|
||||||
for (int i = 0; i < children.size(); ++i) {
|
for (int i = 0; i < children.size(); ++i) {
|
||||||
QObject *o = children.at(i);
|
QObject *o = children.at(i);
|
||||||
if(!o->isWidgetType())
|
if (!o->isWidgetType())
|
||||||
continue;
|
continue;
|
||||||
if (QWidget *w = qobject_cast<QWidget *>(o))
|
if (QWidget *w = qobject_cast<QWidget *>(o))
|
||||||
w->ensurePolished();
|
w->ensurePolished();
|
||||||
|
@ -626,7 +626,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
|
|||||||
QWidget *receiver = activePopupWidget;
|
QWidget *receiver = activePopupWidget;
|
||||||
if (qt_button_down)
|
if (qt_button_down)
|
||||||
receiver = qt_button_down;
|
receiver = qt_button_down;
|
||||||
else if(popupChild)
|
else if (popupChild)
|
||||||
receiver = popupChild;
|
receiver = popupChild;
|
||||||
QContextMenuEvent e(QContextMenuEvent::Mouse, mapped, event->globalPosition().toPoint(), event->modifiers());
|
QContextMenuEvent e(QContextMenuEvent::Mouse, mapped, event->globalPosition().toPoint(), event->modifiers());
|
||||||
QApplication::forwardEvent(receiver, &e, event);
|
QApplication::forwardEvent(receiver, &e, event);
|
||||||
|
@ -1824,22 +1824,22 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
|
|||||||
switch (tab->shape) {
|
switch (tab->shape) {
|
||||||
case QTabBar::TriangularNorth:
|
case QTabBar::TriangularNorth:
|
||||||
rect.adjust(0, 0, 0, -tabOverlap);
|
rect.adjust(0, 0, 0, -tabOverlap);
|
||||||
if(!selected)
|
if (!selected)
|
||||||
rect.adjust(1, 1, -1, 0);
|
rect.adjust(1, 1, -1, 0);
|
||||||
break;
|
break;
|
||||||
case QTabBar::TriangularSouth:
|
case QTabBar::TriangularSouth:
|
||||||
rect.adjust(0, tabOverlap, 0, 0);
|
rect.adjust(0, tabOverlap, 0, 0);
|
||||||
if(!selected)
|
if (!selected)
|
||||||
rect.adjust(1, 0, -1, -1);
|
rect.adjust(1, 0, -1, -1);
|
||||||
break;
|
break;
|
||||||
case QTabBar::TriangularEast:
|
case QTabBar::TriangularEast:
|
||||||
rect.adjust(tabOverlap, 0, 0, 0);
|
rect.adjust(tabOverlap, 0, 0, 0);
|
||||||
if(!selected)
|
if (!selected)
|
||||||
rect.adjust(0, 1, -1, -1);
|
rect.adjust(0, 1, -1, -1);
|
||||||
break;
|
break;
|
||||||
case QTabBar::TriangularWest:
|
case QTabBar::TriangularWest:
|
||||||
rect.adjust(0, 0, -tabOverlap, 0);
|
rect.adjust(0, 0, -tabOverlap, 0);
|
||||||
if(!selected)
|
if (!selected)
|
||||||
rect.adjust(1, 1, 0, -1);
|
rect.adjust(1, 1, 0, -1);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -4699,7 +4699,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
|
|||||||
|| tb->shape == QTabBar::RoundedWest || tb->shape == QTabBar::RoundedEast))
|
|| tb->shape == QTabBar::RoundedWest || tb->shape == QTabBar::RoundedEast))
|
||||||
ret = 8;
|
ret = 8;
|
||||||
else
|
else
|
||||||
if(tb && (tb->shape == QTabBar::TriangularWest || tb->shape == QTabBar::TriangularEast))
|
if (tb && (tb->shape == QTabBar::TriangularWest || tb->shape == QTabBar::TriangularEast))
|
||||||
ret = 3;
|
ret = 3;
|
||||||
else
|
else
|
||||||
ret = 2;
|
ret = 2;
|
||||||
@ -5191,7 +5191,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
|
|||||||
case SH_FocusFrame_Mask:
|
case SH_FocusFrame_Mask:
|
||||||
ret = 1;
|
ret = 1;
|
||||||
if (widget) {
|
if (widget) {
|
||||||
if(QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(hret)) {
|
if (QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(hret)) {
|
||||||
mask->region = widget->rect();
|
mask->region = widget->rect();
|
||||||
const int vmargin = proxy()->pixelMetric(QStyle::PM_FocusFrameVMargin, opt);
|
const int vmargin = proxy()->pixelMetric(QStyle::PM_FocusFrameVMargin, opt);
|
||||||
const int hmargin = proxy()->pixelMetric(QStyle::PM_FocusFrameHMargin, opt);
|
const int hmargin = proxy()->pixelMetric(QStyle::PM_FocusFrameHMargin, opt);
|
||||||
@ -5205,7 +5205,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
if (rbOpt->shape == QRubberBand::Rectangle) {
|
if (rbOpt->shape == QRubberBand::Rectangle) {
|
||||||
ret = true;
|
ret = true;
|
||||||
if(QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(hret)) {
|
if (QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(hret)) {
|
||||||
mask->region = opt->rect;
|
mask->region = opt->rect;
|
||||||
const int margin = proxy()->pixelMetric(PM_DefaultFrameWidth, opt) * 2;
|
const int margin = proxy()->pixelMetric(PM_DefaultFrameWidth, opt) * 2;
|
||||||
mask->region -= opt->rect.adjusted(margin, margin, -margin, -margin);
|
mask->region -= opt->rect.adjusted(margin, margin, -margin, -margin);
|
||||||
|
@ -109,7 +109,7 @@ QStyle *QStyleFactory::create(const QString& key)
|
|||||||
{ } // Keep these here - they make the #ifdefery above work
|
{ } // Keep these here - they make the #ifdefery above work
|
||||||
if (!ret)
|
if (!ret)
|
||||||
ret = qLoadPlugin<QStyle, QStylePlugin>(loader(), style);
|
ret = qLoadPlugin<QStyle, QStylePlugin>(loader(), style);
|
||||||
if(ret)
|
if (ret)
|
||||||
ret->setObjectName(style);
|
ret->setObjectName(style);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -385,7 +385,7 @@ void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rec
|
|||||||
QRect(left, 0, size.width() -right - left, top));
|
QRect(left, 0, size.width() -right - left, top));
|
||||||
|
|
||||||
//top-left
|
//top-left
|
||||||
if(left > 0)
|
if (left > 0)
|
||||||
painter->drawPixmap(QRect(rect.left(), rect.top(), left, top), pixmap,
|
painter->drawPixmap(QRect(rect.left(), rect.top(), left, top), pixmap,
|
||||||
QRect(0, 0, left, top));
|
QRect(0, 0, left, top));
|
||||||
|
|
||||||
|
@ -3922,7 +3922,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
|
|||||||
ParentStyle::drawControl(ce, opt, p, w);
|
ParentStyle::drawControl(ce, opt, p, w);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(hasStyleRule(w, PseudoElement_HeaderViewSection)) {
|
if (hasStyleRule(w, PseudoElement_HeaderViewSection)) {
|
||||||
QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection);
|
QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection);
|
||||||
if (!subRule.hasNativeBorder() || !subRule.baseStyleCanDraw()
|
if (!subRule.hasNativeBorder() || !subRule.baseStyleCanDraw()
|
||||||
|| subRule.hasBackground() || subRule.hasPalette() || subRule.hasFont || subRule.hasBorder()) {
|
|| subRule.hasBackground() || subRule.hasPalette() || subRule.hasFont || subRule.hasBorder()) {
|
||||||
@ -4490,7 +4490,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op
|
|||||||
Q_FALLTHROUGH();
|
Q_FALLTHROUGH();
|
||||||
case PE_PanelMenu:
|
case PE_PanelMenu:
|
||||||
case PE_PanelStatusBar:
|
case PE_PanelStatusBar:
|
||||||
if(rule.hasDrawable()) {
|
if (rule.hasDrawable()) {
|
||||||
rule.drawRule(p, opt->rect);
|
rule.drawRule(p, opt->rect);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4891,7 +4891,7 @@ int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case PM_ScrollView_ScrollBarSpacing:
|
case PM_ScrollView_ScrollBarSpacing:
|
||||||
if(!rule.hasNativeBorder() || rule.hasBox())
|
if (!rule.hasNativeBorder() || rule.hasBox())
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
#endif // QT_CONFIG(scrollbar)
|
#endif // QT_CONFIG(scrollbar)
|
||||||
@ -5058,7 +5058,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op
|
|||||||
case CT_ComboBox:
|
case CT_ComboBox:
|
||||||
case CT_PushButton:
|
case CT_PushButton:
|
||||||
if (rule.hasBox() || !rule.hasNativeBorder()) {
|
if (rule.hasBox() || !rule.hasNativeBorder()) {
|
||||||
if(ct == CT_ComboBox) {
|
if (ct == CT_ComboBox) {
|
||||||
//add some space for the drop down.
|
//add some space for the drop down.
|
||||||
QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown);
|
QRenderRule subRule = renderRule(w, opt, PseudoElement_ComboBoxDropDown);
|
||||||
QRect comboRect = positionRect(w, rule, subRule, PseudoElement_ComboBoxDropDown, opt->rect, opt->direction);
|
QRect comboRect = positionRect(w, rule, subRule, PseudoElement_ComboBoxDropDown, opt->rect, opt->direction);
|
||||||
|
@ -267,7 +267,7 @@ void QWindowsStyle::polish(QApplication *app)
|
|||||||
d->inactiveCaptionText = palette.window().color();
|
d->inactiveCaptionText = palette.window().color();
|
||||||
|
|
||||||
#if defined(Q_OS_WIN) //fetch native title bar colors
|
#if defined(Q_OS_WIN) //fetch native title bar colors
|
||||||
if(app->desktopSettingsAware()){
|
if (app->desktopSettingsAware()){
|
||||||
DWORD activeCaption = GetSysColor(COLOR_ACTIVECAPTION);
|
DWORD activeCaption = GetSysColor(COLOR_ACTIVECAPTION);
|
||||||
DWORD gradientActiveCaption = GetSysColor(COLOR_GRADIENTACTIVECAPTION);
|
DWORD gradientActiveCaption = GetSysColor(COLOR_GRADIENTACTIVECAPTION);
|
||||||
DWORD inactiveCaption = GetSysColor(COLOR_INACTIVECAPTION);
|
DWORD inactiveCaption = GetSysColor(COLOR_INACTIVECAPTION);
|
||||||
@ -630,7 +630,7 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
if (rbOpt->shape == QRubberBand::Rectangle) {
|
if (rbOpt->shape == QRubberBand::Rectangle) {
|
||||||
ret = true;
|
ret = true;
|
||||||
if(QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(returnData)) {
|
if (QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(returnData)) {
|
||||||
mask->region = opt->rect;
|
mask->region = opt->rect;
|
||||||
int size = 1;
|
int size = 1;
|
||||||
if (widget && widget->isWindow())
|
if (widget && widget->isWindow())
|
||||||
@ -673,7 +673,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt,
|
|||||||
QRect rect = opt->rect;
|
QRect rect = opt->rect;
|
||||||
const int margin = 2;
|
const int margin = 2;
|
||||||
QPen oldPen = p->pen();
|
QPen oldPen = p->pen();
|
||||||
if(opt->state & State_Horizontal){
|
if (opt->state & State_Horizontal){
|
||||||
const int offset = rect.width()/2;
|
const int offset = rect.width()/2;
|
||||||
p->setPen(QPen(opt->palette.dark().color()));
|
p->setPen(QPen(opt->palette.dark().color()));
|
||||||
p->drawLine(rect.bottomLeft().x() + offset,
|
p->drawLine(rect.bottomLeft().x() + offset,
|
||||||
@ -758,7 +758,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt,
|
|||||||
|
|
||||||
if (opt->state & (State_Raised | State_Sunken | State_On)) {
|
if (opt->state & (State_Raised | State_Sunken | State_On)) {
|
||||||
if (opt->state & State_AutoRaise) {
|
if (opt->state & State_AutoRaise) {
|
||||||
if(opt->state & (State_Enabled | State_Sunken | State_On)){
|
if (opt->state & (State_Enabled | State_Sunken | State_On)){
|
||||||
if (panel)
|
if (panel)
|
||||||
qDrawShadePanel(p, opt->rect, opt->palette,
|
qDrawShadePanel(p, opt->rect, opt->palette,
|
||||||
opt->state & (State_Sunken | State_On), 1, &fill);
|
opt->state & (State_Sunken | State_On), 1, &fill);
|
||||||
@ -1618,7 +1618,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(opt->direction == Qt::RightToLeft){ //reverse layout changes the order of Beginning/end
|
if (opt->direction == Qt::RightToLeft){ //reverse layout changes the order of Beginning/end
|
||||||
bool tmp = paintLeftBorder;
|
bool tmp = paintLeftBorder;
|
||||||
paintRightBorder=paintLeftBorder;
|
paintRightBorder=paintLeftBorder;
|
||||||
paintLeftBorder=tmp;
|
paintLeftBorder=tmp;
|
||||||
@ -1733,7 +1733,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
|
|||||||
int myHeight = pbBits.rect.height();
|
int myHeight = pbBits.rect.height();
|
||||||
int chunksToDraw = chunksInRow;
|
int chunksToDraw = chunksInRow;
|
||||||
|
|
||||||
if(step > chunkCount - 5)chunksToDraw = (chunkCount - step);
|
if (step > chunkCount - 5)chunksToDraw = (chunkCount - step);
|
||||||
p->save();
|
p->save();
|
||||||
p->setClipRect(m.mapRect(QRectF(rect)).toRect());
|
p->setClipRect(m.mapRect(QRectF(rect)).toRect());
|
||||||
|
|
||||||
@ -1747,7 +1747,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
|
|||||||
x += reverse ? -unit_width : unit_width;
|
x += reverse ? -unit_width : unit_width;
|
||||||
}
|
}
|
||||||
//Draw wrap-around chunks
|
//Draw wrap-around chunks
|
||||||
if( step > chunkCount-5){
|
if ( step > chunkCount-5){
|
||||||
x0 = reverse ? rect.left() + rect.width() - unit_width : rect.left() ;
|
x0 = reverse ? rect.left() + rect.width() - unit_width : rect.left() ;
|
||||||
x = 0;
|
x = 0;
|
||||||
int chunksToDraw = step - (chunkCount - chunksInRow);
|
int chunksToDraw = step - (chunkCount - chunksInRow);
|
||||||
|
@ -690,7 +690,7 @@ void QBalloonTip::balloon(const QPoint& pos, int msecs, bool showArrow)
|
|||||||
void QBalloonTip::mousePressEvent(QMouseEvent *e)
|
void QBalloonTip::mousePressEvent(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
if(e->button() == Qt::LeftButton)
|
if (e->button() == Qt::LeftButton)
|
||||||
emit trayIcon->messageClicked();
|
emit trayIcon->messageClicked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1048,8 +1048,8 @@ void QAbstractSpinBox::keyPressEvent(QKeyEvent *event)
|
|||||||
}
|
}
|
||||||
if (d->spinClickTimerId == -1)
|
if (d->spinClickTimerId == -1)
|
||||||
stepBy(steps);
|
stepBy(steps);
|
||||||
if(event->isAutoRepeat() && !isPgUpOrDown) {
|
if (event->isAutoRepeat() && !isPgUpOrDown) {
|
||||||
if(d->spinClickThresholdTimerId == -1 && d->spinClickTimerId == -1) {
|
if (d->spinClickThresholdTimerId == -1 && d->spinClickTimerId == -1) {
|
||||||
d->updateState(up, true);
|
d->updateState(up, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1142,7 +1142,7 @@ QTextCharFormat QCalendarModel::formatForCell(int row, int col) const
|
|||||||
if (!header) {
|
if (!header) {
|
||||||
QDate date = dateForCell(row, col);
|
QDate date = dateForCell(row, col);
|
||||||
format.merge(m_dateFormats.value(date));
|
format.merge(m_dateFormats.value(date));
|
||||||
if(date < m_minimumDate || date > m_maximumDate)
|
if (date < m_minimumDate || date > m_maximumDate)
|
||||||
format.setBackground(pal.brush(cg, QPalette::Window));
|
format.setBackground(pal.brush(cg, QPalette::Window));
|
||||||
if (m_shownMonth != date.month(m_calendar))
|
if (m_shownMonth != date.month(m_calendar))
|
||||||
format.setForeground(pal.brush(QPalette::Disabled, QPalette::Text));
|
format.setForeground(pal.brush(QPalette::Disabled, QPalette::Text));
|
||||||
@ -1158,7 +1158,7 @@ QVariant QCalendarModel::data(const QModelIndex &index, int role) const
|
|||||||
int row = index.row();
|
int row = index.row();
|
||||||
int column = index.column();
|
int column = index.column();
|
||||||
|
|
||||||
if(role == Qt::DisplayRole) {
|
if (role == Qt::DisplayRole) {
|
||||||
if (m_weekNumbersShown && column == HeaderColumn
|
if (m_weekNumbersShown && column == HeaderColumn
|
||||||
&& row >= m_firstRow && row < m_firstRow + RowCount) {
|
&& row >= m_firstRow && row < m_firstRow + RowCount) {
|
||||||
QDate date = dateForCell(row, columnForDayOfWeek(Qt::Monday));
|
QDate date = dateForCell(row, columnForDayOfWeek(Qt::Monday));
|
||||||
@ -3165,7 +3165,7 @@ void QCalendarWidget::resizeEvent(QResizeEvent * event)
|
|||||||
// XXX Should really use a QWidgetStack for yearEdit and yearButton,
|
// XXX Should really use a QWidgetStack for yearEdit and yearButton,
|
||||||
// XXX here we hide the year edit when the layout is likely to break
|
// XXX here we hide the year edit when the layout is likely to break
|
||||||
// XXX the manual positioning of the yearEdit over the yearButton.
|
// XXX the manual positioning of the yearEdit over the yearButton.
|
||||||
if(d->yearEdit->isVisible() && event->size().width() != event->oldSize().width())
|
if (d->yearEdit->isVisible() && event->size().width() != event->oldSize().width())
|
||||||
d->_q_yearEditingFinished();
|
d->_q_yearEditingFinished();
|
||||||
|
|
||||||
QWidget::resizeEvent(event);
|
QWidget::resizeEvent(event);
|
||||||
|
@ -95,7 +95,7 @@ void QFocusFramePrivate::updateSize()
|
|||||||
pos = widget->parentWidget()->mapTo(q->parentWidget(), pos);
|
pos = widget->parentWidget()->mapTo(q->parentWidget(), pos);
|
||||||
QRect geom(pos.x()-hmargin, pos.y()-vmargin,
|
QRect geom(pos.x()-hmargin, pos.y()-vmargin,
|
||||||
widget->width()+(hmargin*2), widget->height()+(vmargin*2));
|
widget->width()+(hmargin*2), widget->height()+(vmargin*2));
|
||||||
if(q->geometry() == geom)
|
if (q->geometry() == geom)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
q->setGeometry(geom);
|
q->setGeometry(geom);
|
||||||
@ -279,7 +279,7 @@ bool
|
|||||||
QFocusFrame::eventFilter(QObject *o, QEvent *e)
|
QFocusFrame::eventFilter(QObject *o, QEvent *e)
|
||||||
{
|
{
|
||||||
Q_D(QFocusFrame);
|
Q_D(QFocusFrame);
|
||||||
if(o == d->widget) {
|
if (o == d->widget) {
|
||||||
switch(e->type()) {
|
switch(e->type()) {
|
||||||
case QEvent::Move:
|
case QEvent::Move:
|
||||||
case QEvent::Resize:
|
case QEvent::Resize:
|
||||||
|
@ -591,7 +591,7 @@ void QLabel::setMargin(int margin)
|
|||||||
QSize QLabelPrivate::sizeForWidth(int w) const
|
QSize QLabelPrivate::sizeForWidth(int w) const
|
||||||
{
|
{
|
||||||
Q_Q(const QLabel);
|
Q_Q(const QLabel);
|
||||||
if(q->minimumWidth() > 0)
|
if (q->minimumWidth() > 0)
|
||||||
w = qMax(w, q->minimumWidth());
|
w = qMax(w, q->minimumWidth());
|
||||||
QSize contentsMargin(leftmargin + rightmargin, topmargin + bottommargin);
|
QSize contentsMargin(leftmargin + rightmargin, topmargin + bottommargin);
|
||||||
|
|
||||||
@ -1429,7 +1429,7 @@ void QLabel::setTextFormat(Qt::TextFormat format)
|
|||||||
void QLabel::changeEvent(QEvent *ev)
|
void QLabel::changeEvent(QEvent *ev)
|
||||||
{
|
{
|
||||||
Q_D(QLabel);
|
Q_D(QLabel);
|
||||||
if(ev->type() == QEvent::FontChange || ev->type() == QEvent::ApplicationFontChange) {
|
if (ev->type() == QEvent::FontChange || ev->type() == QEvent::ApplicationFontChange) {
|
||||||
if (d->isTextLabel) {
|
if (d->isTextLabel) {
|
||||||
if (d->control)
|
if (d->control)
|
||||||
d->control->document()->setDefaultFont(font());
|
d->control->document()->setDefaultFont(font());
|
||||||
|
@ -1901,7 +1901,7 @@ void QLineEdit::focusInEvent(QFocusEvent *e)
|
|||||||
d->control->setBlinkingCursorEnabled(true);
|
d->control->setBlinkingCursorEnabled(true);
|
||||||
QStyleOptionFrame opt;
|
QStyleOptionFrame opt;
|
||||||
initStyleOption(&opt);
|
initStyleOption(&opt);
|
||||||
if((!hasSelectedText() && d->control->preeditAreaText().isEmpty())
|
if ((!hasSelectedText() && d->control->preeditAreaText().isEmpty())
|
||||||
|| style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, this))
|
|| style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, this))
|
||||||
d->setCursorVisible(true);
|
d->setCursorVisible(true);
|
||||||
#ifdef QT_KEYPAD_NAVIGATION
|
#ifdef QT_KEYPAD_NAVIGATION
|
||||||
|
@ -761,7 +761,7 @@ void QMainWindow::addToolBar(Qt::ToolBarArea area, QToolBar *toolbar)
|
|||||||
disconnect(this, SIGNAL(toolButtonStyleChanged(Qt::ToolButtonStyle)),
|
disconnect(this, SIGNAL(toolButtonStyleChanged(Qt::ToolButtonStyle)),
|
||||||
toolbar, SLOT(_q_updateToolButtonStyle(Qt::ToolButtonStyle)));
|
toolbar, SLOT(_q_updateToolButtonStyle(Qt::ToolButtonStyle)));
|
||||||
|
|
||||||
if(toolbar->d_func()->state && toolbar->d_func()->state->dragging) {
|
if (toolbar->d_func()->state && toolbar->d_func()->state->dragging) {
|
||||||
//removing a toolbar which is dragging will cause crash
|
//removing a toolbar which is dragging will cause crash
|
||||||
#if QT_CONFIG(dockwidget)
|
#if QT_CONFIG(dockwidget)
|
||||||
bool animated = isAnimated();
|
bool animated = isAnimated();
|
||||||
|
@ -723,7 +723,7 @@ void QMdiAreaPrivate::_q_deactivateAllWindows(QMdiSubWindow *aboutToActivate)
|
|||||||
continue;
|
continue;
|
||||||
// We don't want to handle signals caused by child->showNormal().
|
// We don't want to handle signals caused by child->showNormal().
|
||||||
ignoreWindowStateChange = true;
|
ignoreWindowStateChange = true;
|
||||||
if(!(options & QMdiArea::DontMaximizeSubWindowOnActivation) && !showActiveWindowMaximized)
|
if (!(options & QMdiArea::DontMaximizeSubWindowOnActivation) && !showActiveWindowMaximized)
|
||||||
showActiveWindowMaximized = child->isMaximized() && child->isVisible();
|
showActiveWindowMaximized = child->isMaximized() && child->isVisible();
|
||||||
if (showActiveWindowMaximized && child->isMaximized()) {
|
if (showActiveWindowMaximized && child->isMaximized()) {
|
||||||
if (q->updatesEnabled()) {
|
if (q->updatesEnabled()) {
|
||||||
|
@ -154,7 +154,7 @@ public:
|
|||||||
void syncWithMenu(QMenu *menu, QActionEvent *act)
|
void syncWithMenu(QMenu *menu, QActionEvent *act)
|
||||||
{
|
{
|
||||||
Q_D(QTornOffMenu);
|
Q_D(QTornOffMenu);
|
||||||
if(menu != d->causedMenu)
|
if (menu != d->causedMenu)
|
||||||
return;
|
return;
|
||||||
auto action = static_cast<QAction *>(act->action());
|
auto action = static_cast<QAction *>(act->action());
|
||||||
if (act->type() == QEvent::ActionAdded) {
|
if (act->type() == QEvent::ActionAdded) {
|
||||||
@ -648,7 +648,7 @@ void QMenuPrivate::setSyncAction()
|
|||||||
{
|
{
|
||||||
Q_Q(QMenu);
|
Q_Q(QMenu);
|
||||||
QAction *current = currentAction;
|
QAction *current = currentAction;
|
||||||
if(current && (!current->isEnabled() || current->menu() || current->isSeparator()))
|
if (current && (!current->isEnabled() || current->menu() || current->isSeparator()))
|
||||||
current = nullptr;
|
current = nullptr;
|
||||||
for(QWidget *caused = q; caused;) {
|
for(QWidget *caused = q; caused;) {
|
||||||
if (QMenu *m = qobject_cast<QMenu*>(caused)) {
|
if (QMenu *m = qobject_cast<QMenu*>(caused)) {
|
||||||
@ -1122,7 +1122,7 @@ void QMenuPrivate::scrollMenu(QAction *action, QMenuScroller::ScrollLocation loc
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(newOffset)
|
if (newOffset)
|
||||||
newOffset -= fw * 2;
|
newOffset -= fw * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1158,9 +1158,9 @@ void QMenuPrivate::scrollMenu(QAction *action, QMenuScroller::ScrollLocation loc
|
|||||||
QRect geom = q->geometry();
|
QRect geom = q->geometry();
|
||||||
if (newOffset > scroll->scrollOffset && (scroll->scrollFlags & newScrollFlags & QMenuScroller::ScrollUp)) { //scroll up
|
if (newOffset > scroll->scrollOffset && (scroll->scrollFlags & newScrollFlags & QMenuScroller::ScrollUp)) { //scroll up
|
||||||
const int newHeight = geom.height()-(newOffset-scroll->scrollOffset);
|
const int newHeight = geom.height()-(newOffset-scroll->scrollOffset);
|
||||||
if(newHeight > geom.height())
|
if (newHeight > geom.height())
|
||||||
geom.setHeight(newHeight);
|
geom.setHeight(newHeight);
|
||||||
} else if(scroll->scrollFlags & newScrollFlags & QMenuScroller::ScrollDown) {
|
} else if (scroll->scrollFlags & newScrollFlags & QMenuScroller::ScrollDown) {
|
||||||
int newTop = geom.top() + (newOffset-scroll->scrollOffset);
|
int newTop = geom.top() + (newOffset-scroll->scrollOffset);
|
||||||
if (newTop < desktopFrame+screen.top())
|
if (newTop < desktopFrame+screen.top())
|
||||||
newTop = desktopFrame+screen.top();
|
newTop = desktopFrame+screen.top();
|
||||||
@ -1209,7 +1209,7 @@ void QMenuPrivate::scrollMenu(QMenuScroller::ScrollLocation location, bool activ
|
|||||||
{
|
{
|
||||||
Q_Q(QMenu);
|
Q_Q(QMenu);
|
||||||
updateActionRects();
|
updateActionRects();
|
||||||
if(location == QMenuScroller::ScrollBottom) {
|
if (location == QMenuScroller::ScrollBottom) {
|
||||||
for(int i = actions.size()-1; i >= 0; --i) {
|
for(int i = actions.size()-1; i >= 0; --i) {
|
||||||
QAction *act = actions.at(i);
|
QAction *act = actions.at(i);
|
||||||
if (actionRects.at(i).isNull())
|
if (actionRects.at(i).isNull())
|
||||||
@ -1217,14 +1217,14 @@ void QMenuPrivate::scrollMenu(QMenuScroller::ScrollLocation location, bool activ
|
|||||||
if (!act->isSeparator() &&
|
if (!act->isSeparator() &&
|
||||||
(q->style()->styleHint(QStyle::SH_Menu_AllowActiveAndDisabled, nullptr, q)
|
(q->style()->styleHint(QStyle::SH_Menu_AllowActiveAndDisabled, nullptr, q)
|
||||||
|| act->isEnabled())) {
|
|| act->isEnabled())) {
|
||||||
if(scroll->scrollFlags & QMenuPrivate::QMenuScroller::ScrollDown)
|
if (scroll->scrollFlags & QMenuPrivate::QMenuScroller::ScrollDown)
|
||||||
scrollMenu(act, QMenuPrivate::QMenuScroller::ScrollBottom, active);
|
scrollMenu(act, QMenuPrivate::QMenuScroller::ScrollBottom, active);
|
||||||
else if(active)
|
else if (active)
|
||||||
setCurrentAction(act, /*popup*/-1, QMenuPrivate::SelectedFromKeyboard);
|
setCurrentAction(act, /*popup*/-1, QMenuPrivate::SelectedFromKeyboard);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if(location == QMenuScroller::ScrollTop) {
|
} else if (location == QMenuScroller::ScrollTop) {
|
||||||
for(int i = 0; i < actions.size(); ++i) {
|
for(int i = 0; i < actions.size(); ++i) {
|
||||||
QAction *act = actions.at(i);
|
QAction *act = actions.at(i);
|
||||||
if (actionRects.at(i).isNull())
|
if (actionRects.at(i).isNull())
|
||||||
@ -1232,9 +1232,9 @@ void QMenuPrivate::scrollMenu(QMenuScroller::ScrollLocation location, bool activ
|
|||||||
if (!act->isSeparator() &&
|
if (!act->isSeparator() &&
|
||||||
(q->style()->styleHint(QStyle::SH_Menu_AllowActiveAndDisabled, nullptr, q)
|
(q->style()->styleHint(QStyle::SH_Menu_AllowActiveAndDisabled, nullptr, q)
|
||||||
|| act->isEnabled())) {
|
|| act->isEnabled())) {
|
||||||
if(scroll->scrollFlags & QMenuPrivate::QMenuScroller::ScrollUp)
|
if (scroll->scrollFlags & QMenuPrivate::QMenuScroller::ScrollUp)
|
||||||
scrollMenu(act, QMenuPrivate::QMenuScroller::ScrollTop, active);
|
scrollMenu(act, QMenuPrivate::QMenuScroller::ScrollTop, active);
|
||||||
else if(active)
|
else if (active)
|
||||||
setCurrentAction(act, /*popup*/-1, QMenuPrivate::SelectedFromKeyboard);
|
setCurrentAction(act, /*popup*/-1, QMenuPrivate::SelectedFromKeyboard);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1281,7 +1281,7 @@ void QMenuPrivate::scrollMenu(QMenuScroller::ScrollDirection direction, bool pag
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!scrolled) {
|
if (!scrolled) {
|
||||||
scroll->scrollFlags &= ~QMenuScroller::ScrollDown;
|
scroll->scrollFlags &= ~QMenuScroller::ScrollDown;
|
||||||
q->update();
|
q->update();
|
||||||
}
|
}
|
||||||
@ -1382,7 +1382,7 @@ void QMenuPrivate::activateCausedStack(const QList<QPointer<QWidget>> &causedSta
|
|||||||
QAction::ActionEvent action_e, bool self)
|
QAction::ActionEvent action_e, bool self)
|
||||||
{
|
{
|
||||||
QBoolBlocker guard(activationRecursionGuard);
|
QBoolBlocker guard(activationRecursionGuard);
|
||||||
if(self)
|
if (self)
|
||||||
action->activate(action_e);
|
action->activate(action_e);
|
||||||
|
|
||||||
for(int i = 0; i < causedStack.size(); ++i) {
|
for(int i = 0; i < causedStack.size(); ++i) {
|
||||||
@ -1439,7 +1439,7 @@ void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e
|
|||||||
} else {
|
} else {
|
||||||
for(QWidget *widget = QApplication::activePopupWidget(); widget; ) {
|
for(QWidget *widget = QApplication::activePopupWidget(); widget; ) {
|
||||||
if (QMenu *qmenu = qobject_cast<QMenu*>(widget)) {
|
if (QMenu *qmenu = qobject_cast<QMenu*>(widget)) {
|
||||||
if(qmenu == q)
|
if (qmenu == q)
|
||||||
hideUpToMenuBar();
|
hideUpToMenuBar();
|
||||||
widget = qmenu->d_func()->causedPopup.widget;
|
widget = qmenu->d_func()->causedPopup.widget;
|
||||||
} else {
|
} else {
|
||||||
@ -2518,7 +2518,7 @@ void QMenuPrivate::popup(const QPoint &p, QAction *atAction, PositionFunction po
|
|||||||
pos.setX(screen.left() + desktopFrame);
|
pos.setX(screen.left() + desktopFrame);
|
||||||
}
|
}
|
||||||
if (pos.y() + size.height() - 1 > screen.bottom() - desktopFrame) {
|
if (pos.y() + size.height() - 1 > screen.bottom() - desktopFrame) {
|
||||||
if(snapToMouse)
|
if (snapToMouse)
|
||||||
pos.setY(qMin(mouse.y() - (size.height() + desktopFrame), screen.bottom()-desktopFrame-size.height()+1));
|
pos.setY(qMin(mouse.y() - (size.height() + desktopFrame), screen.bottom()-desktopFrame-size.height()+1));
|
||||||
else
|
else
|
||||||
pos.setY(qMax(p.y() - (size.height() + desktopFrame), screen.bottom()-desktopFrame-size.height()+1));
|
pos.setY(qMax(p.y() - (size.height() + desktopFrame), screen.bottom()-desktopFrame-size.height()+1));
|
||||||
@ -3133,7 +3133,7 @@ void QMenu::keyPressEvent(QKeyEvent *e)
|
|||||||
case Qt::Key_PageUp:
|
case Qt::Key_PageUp:
|
||||||
key_consumed = true;
|
key_consumed = true;
|
||||||
if (d->currentAction && d->scroll) {
|
if (d->currentAction && d->scroll) {
|
||||||
if(d->scroll->scrollFlags & QMenuPrivate::QMenuScroller::ScrollUp)
|
if (d->scroll->scrollFlags & QMenuPrivate::QMenuScroller::ScrollUp)
|
||||||
d->scrollMenu(QMenuPrivate::QMenuScroller::ScrollUp, true, true);
|
d->scrollMenu(QMenuPrivate::QMenuScroller::ScrollUp, true, true);
|
||||||
else
|
else
|
||||||
d->scrollMenu(QMenuPrivate::QMenuScroller::ScrollTop, true);
|
d->scrollMenu(QMenuPrivate::QMenuScroller::ScrollTop, true);
|
||||||
@ -3142,7 +3142,7 @@ void QMenu::keyPressEvent(QKeyEvent *e)
|
|||||||
case Qt::Key_PageDown:
|
case Qt::Key_PageDown:
|
||||||
key_consumed = true;
|
key_consumed = true;
|
||||||
if (d->currentAction && d->scroll) {
|
if (d->currentAction && d->scroll) {
|
||||||
if(d->scroll->scrollFlags & QMenuPrivate::QMenuScroller::ScrollDown)
|
if (d->scroll->scrollFlags & QMenuPrivate::QMenuScroller::ScrollDown)
|
||||||
d->scrollMenu(QMenuPrivate::QMenuScroller::ScrollDown, true, true);
|
d->scrollMenu(QMenuPrivate::QMenuScroller::ScrollDown, true, true);
|
||||||
else
|
else
|
||||||
d->scrollMenu(QMenuPrivate::QMenuScroller::ScrollBottom, true);
|
d->scrollMenu(QMenuPrivate::QMenuScroller::ScrollBottom, true);
|
||||||
@ -3154,7 +3154,7 @@ void QMenu::keyPressEvent(QKeyEvent *e)
|
|||||||
QAction *nextAction = nullptr;
|
QAction *nextAction = nullptr;
|
||||||
QMenuPrivate::QMenuScroller::ScrollLocation scroll_loc = QMenuPrivate::QMenuScroller::ScrollStay;
|
QMenuPrivate::QMenuScroller::ScrollLocation scroll_loc = QMenuPrivate::QMenuScroller::ScrollStay;
|
||||||
if (!d->currentAction) {
|
if (!d->currentAction) {
|
||||||
if(key == Qt::Key_Down) {
|
if (key == Qt::Key_Down) {
|
||||||
for(int i = 0; i < d->actions.count(); ++i) {
|
for(int i = 0; i < d->actions.count(); ++i) {
|
||||||
QAction *act = d->actions.at(i);
|
QAction *act = d->actions.at(i);
|
||||||
if (d->actionRects.at(i).isNull())
|
if (d->actionRects.at(i).isNull())
|
||||||
@ -3387,10 +3387,10 @@ void QMenu::keyPressEvent(QKeyEvent *e)
|
|||||||
QAction *act = d->actions.at(i);
|
QAction *act = d->actions.at(i);
|
||||||
const QString act_text = act->text();
|
const QString act_text = act->text();
|
||||||
for(int c = 0; c < d->searchBuffer.size(); ++c) {
|
for(int c = 0; c < d->searchBuffer.size(); ++c) {
|
||||||
if(act_text.indexOf(d->searchBuffer.at(c), 0, Qt::CaseInsensitive) != -1)
|
if (act_text.indexOf(d->searchBuffer.at(c), 0, Qt::CaseInsensitive) != -1)
|
||||||
++match_count;
|
++match_count;
|
||||||
}
|
}
|
||||||
if(match_count > best_match_count) {
|
if (match_count > best_match_count) {
|
||||||
best_match_count = match_count;
|
best_match_count = match_count;
|
||||||
nextAction = act;
|
nextAction = act;
|
||||||
}
|
}
|
||||||
@ -3429,7 +3429,7 @@ void QMenu::keyPressEvent(QKeyEvent *e)
|
|||||||
#endif
|
#endif
|
||||||
if (nextAction) {
|
if (nextAction) {
|
||||||
key_consumed = true;
|
key_consumed = true;
|
||||||
if(d->scroll)
|
if (d->scroll)
|
||||||
d->scrollMenu(nextAction, QMenuPrivate::QMenuScroller::ScrollCenter, false);
|
d->scrollMenu(nextAction, QMenuPrivate::QMenuScroller::ScrollCenter, false);
|
||||||
d->setCurrentAction(nextAction, 0, QMenuPrivate::SelectedFromElsewhere, true);
|
d->setCurrentAction(nextAction, 0, QMenuPrivate::SelectedFromElsewhere, true);
|
||||||
if (!nextAction->menu() && activateAction) {
|
if (!nextAction->menu() && activateAction) {
|
||||||
@ -3540,7 +3540,7 @@ QMenu::timerEvent(QTimerEvent *e)
|
|||||||
internalDelayedPopup();
|
internalDelayedPopup();
|
||||||
} else if (d->sloppyState.isTimerId(e->timerId())) {
|
} else if (d->sloppyState.isTimerId(e->timerId())) {
|
||||||
d->sloppyState.timeout();
|
d->sloppyState.timeout();
|
||||||
} else if(d->searchBufferTimer.timerId() == e->timerId()) {
|
} else if (d->searchBufferTimer.timerId() == e->timerId()) {
|
||||||
d->searchBuffer.clear();
|
d->searchBuffer.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ QSize QMenuBarExtension::sizeHint() const
|
|||||||
QAction *QMenuBarPrivate::actionAt(QPoint p) const
|
QAction *QMenuBarPrivate::actionAt(QPoint p) const
|
||||||
{
|
{
|
||||||
for(int i = 0; i < actions.size(); ++i) {
|
for(int i = 0; i < actions.size(); ++i) {
|
||||||
if(actionRect(actions.at(i)).contains(p))
|
if (actionRect(actions.at(i)).contains(p))
|
||||||
return actions.at(i);
|
return actions.at(i);
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -163,11 +163,11 @@ bool QMenuBarPrivate::isVisible(QAction *action)
|
|||||||
void QMenuBarPrivate::updateGeometries()
|
void QMenuBarPrivate::updateGeometries()
|
||||||
{
|
{
|
||||||
Q_Q(QMenuBar);
|
Q_Q(QMenuBar);
|
||||||
if(!itemsDirty)
|
if (!itemsDirty)
|
||||||
return;
|
return;
|
||||||
int q_width = q->width()-(q->style()->pixelMetric(QStyle::PM_MenuBarPanelWidth, nullptr, q)*2);
|
int q_width = q->width()-(q->style()->pixelMetric(QStyle::PM_MenuBarPanelWidth, nullptr, q)*2);
|
||||||
int q_start = -1;
|
int q_start = -1;
|
||||||
if(leftWidget || rightWidget) {
|
if (leftWidget || rightWidget) {
|
||||||
int vmargin = q->style()->pixelMetric(QStyle::PM_MenuBarVMargin, nullptr, q)
|
int vmargin = q->style()->pixelMetric(QStyle::PM_MenuBarVMargin, nullptr, q)
|
||||||
+ q->style()->pixelMetric(QStyle::PM_MenuBarPanelWidth, nullptr, q);
|
+ q->style()->pixelMetric(QStyle::PM_MenuBarPanelWidth, nullptr, q);
|
||||||
int hmargin = q->style()->pixelMetric(QStyle::PM_MenuBarHMargin, nullptr, q)
|
int hmargin = q->style()->pixelMetric(QStyle::PM_MenuBarHMargin, nullptr, q)
|
||||||
@ -190,7 +190,7 @@ void QMenuBarPrivate::updateGeometries()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
if(q->isNativeMenuBar()) {//nothing to see here folks, move along..
|
if (q->isNativeMenuBar()) {//nothing to see here folks, move along..
|
||||||
itemsDirty = false;
|
itemsDirty = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -198,7 +198,7 @@ void QMenuBarPrivate::updateGeometries()
|
|||||||
calcActionRects(q_width, q_start);
|
calcActionRects(q_width, q_start);
|
||||||
currentAction = nullptr;
|
currentAction = nullptr;
|
||||||
#ifndef QT_NO_SHORTCUT
|
#ifndef QT_NO_SHORTCUT
|
||||||
if(itemsDirty) {
|
if (itemsDirty) {
|
||||||
for(int j = 0; j < shortcutIndexMap.size(); ++j)
|
for(int j = 0; j < shortcutIndexMap.size(); ++j)
|
||||||
q->releaseShortcut(shortcutIndexMap.value(j));
|
q->releaseShortcut(shortcutIndexMap.value(j));
|
||||||
shortcutIndexMap.clear();
|
shortcutIndexMap.clear();
|
||||||
@ -271,7 +271,7 @@ QRect QMenuBarPrivate::actionRect(QAction *act) const
|
|||||||
|
|
||||||
void QMenuBarPrivate::focusFirstAction()
|
void QMenuBarPrivate::focusFirstAction()
|
||||||
{
|
{
|
||||||
if(!currentAction) {
|
if (!currentAction) {
|
||||||
updateGeometries();
|
updateGeometries();
|
||||||
int index = 0;
|
int index = 0;
|
||||||
while (index < actions.count() && actionRects.at(index).isNull()) ++index;
|
while (index < actions.count() && actionRects.at(index).isNull()) ++index;
|
||||||
@ -288,16 +288,16 @@ void QMenuBarPrivate::setKeyboardMode(bool b)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
keyboardState = b;
|
keyboardState = b;
|
||||||
if(b) {
|
if (b) {
|
||||||
QWidget *fw = QApplication::focusWidget();
|
QWidget *fw = QApplication::focusWidget();
|
||||||
if (fw && fw != q && fw->window() != QApplication::activePopupWidget())
|
if (fw && fw != q && fw->window() != QApplication::activePopupWidget())
|
||||||
keyboardFocusWidget = fw;
|
keyboardFocusWidget = fw;
|
||||||
focusFirstAction();
|
focusFirstAction();
|
||||||
q->setFocus(Qt::MenuBarFocusReason);
|
q->setFocus(Qt::MenuBarFocusReason);
|
||||||
} else {
|
} else {
|
||||||
if(!popupState)
|
if (!popupState)
|
||||||
setCurrentAction(nullptr);
|
setCurrentAction(nullptr);
|
||||||
if(keyboardFocusWidget) {
|
if (keyboardFocusWidget) {
|
||||||
if (QApplication::focusWidget() == q)
|
if (QApplication::focusWidget() == q)
|
||||||
keyboardFocusWidget->setFocus(Qt::MenuBarFocusReason);
|
keyboardFocusWidget->setFocus(Qt::MenuBarFocusReason);
|
||||||
keyboardFocusWidget = nullptr;
|
keyboardFocusWidget = nullptr;
|
||||||
@ -309,7 +309,7 @@ void QMenuBarPrivate::setKeyboardMode(bool b)
|
|||||||
void QMenuBarPrivate::popupAction(QAction *action, bool activateFirst)
|
void QMenuBarPrivate::popupAction(QAction *action, bool activateFirst)
|
||||||
{
|
{
|
||||||
Q_Q(QMenuBar);
|
Q_Q(QMenuBar);
|
||||||
if(!action || !action->menu() || closePopupMode)
|
if (!action || !action->menu() || closePopupMode)
|
||||||
return;
|
return;
|
||||||
popupState = true;
|
popupState = true;
|
||||||
if (action->isEnabled() && action->menu()->isEnabled()) {
|
if (action->isEnabled() && action->menu()->isEnabled()) {
|
||||||
@ -351,11 +351,11 @@ void QMenuBarPrivate::popupAction(QAction *action, bool activateFirst)
|
|||||||
pos.rx() += actionWidth;
|
pos.rx() += actionWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!defaultPopDown || (fitUp && !fitDown))
|
if (!defaultPopDown || (fitUp && !fitDown))
|
||||||
pos.setY(qMax(screenRect.y(), q->mapToGlobal(QPoint(0, adjustedActionRect.top()-popup_size.height())).y()));
|
pos.setY(qMax(screenRect.y(), q->mapToGlobal(QPoint(0, adjustedActionRect.top()-popup_size.height())).y()));
|
||||||
QMenuPrivate::get(activeMenu)->topData()->initialScreen = popupScreen;
|
QMenuPrivate::get(activeMenu)->topData()->initialScreen = popupScreen;
|
||||||
activeMenu->popup(pos);
|
activeMenu->popup(pos);
|
||||||
if(activateFirst)
|
if (activateFirst)
|
||||||
activeMenu->d_func()->setFirstActionActive();
|
activeMenu->d_func()->setFirstActionActive();
|
||||||
}
|
}
|
||||||
q->update(actionRect(action));
|
q->update(actionRect(action));
|
||||||
@ -363,7 +363,7 @@ void QMenuBarPrivate::popupAction(QAction *action, bool activateFirst)
|
|||||||
|
|
||||||
void QMenuBarPrivate::setCurrentAction(QAction *action, bool popup, bool activateFirst)
|
void QMenuBarPrivate::setCurrentAction(QAction *action, bool popup, bool activateFirst)
|
||||||
{
|
{
|
||||||
if(currentAction == action && popup == popupState)
|
if (currentAction == action && popup == popupState)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
autoReleaseTimer.stop();
|
autoReleaseTimer.stop();
|
||||||
@ -371,7 +371,7 @@ void QMenuBarPrivate::setCurrentAction(QAction *action, bool popup, bool activat
|
|||||||
doChildEffects = (popup && !activeMenu);
|
doChildEffects = (popup && !activeMenu);
|
||||||
Q_Q(QMenuBar);
|
Q_Q(QMenuBar);
|
||||||
QWidget *fw = nullptr;
|
QWidget *fw = nullptr;
|
||||||
if(QMenu *menu = activeMenu) {
|
if (QMenu *menu = activeMenu) {
|
||||||
activeMenu = nullptr;
|
activeMenu = nullptr;
|
||||||
if (popup) {
|
if (popup) {
|
||||||
fw = q->window()->focusWidget();
|
fw = q->window()->focusWidget();
|
||||||
@ -380,7 +380,7 @@ void QMenuBarPrivate::setCurrentAction(QAction *action, bool popup, bool activat
|
|||||||
menu->hide();
|
menu->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(currentAction)
|
if (currentAction)
|
||||||
q->update(actionRect(currentAction));
|
q->update(actionRect(currentAction));
|
||||||
|
|
||||||
popupState = popup;
|
popupState = popup;
|
||||||
@ -390,7 +390,7 @@ void QMenuBarPrivate::setCurrentAction(QAction *action, bool popup, bool activat
|
|||||||
currentAction = action;
|
currentAction = action;
|
||||||
if (action && action->isEnabled()) {
|
if (action && action->isEnabled()) {
|
||||||
activateAction(action, QAction::Hover);
|
activateAction(action, QAction::Hover);
|
||||||
if(popup)
|
if (popup)
|
||||||
popupAction(action, activateFirst);
|
popupAction(action, activateFirst);
|
||||||
q->update(actionRect(action));
|
q->update(actionRect(action));
|
||||||
#if QT_CONFIG(statustip)
|
#if QT_CONFIG(statustip)
|
||||||
@ -408,7 +408,7 @@ void QMenuBarPrivate::calcActionRects(int max_width, int start) const
|
|||||||
{
|
{
|
||||||
Q_Q(const QMenuBar);
|
Q_Q(const QMenuBar);
|
||||||
|
|
||||||
if(!itemsDirty)
|
if (!itemsDirty)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//let's reinitialize the buffer
|
//let's reinitialize the buffer
|
||||||
@ -427,13 +427,13 @@ void QMenuBarPrivate::calcActionRects(int max_width, int start) const
|
|||||||
icone = style->pixelMetric(QStyle::PM_SmallIconSize, nullptr, q);
|
icone = style->pixelMetric(QStyle::PM_SmallIconSize, nullptr, q);
|
||||||
for(int i = 0; i < actions.count(); i++) {
|
for(int i = 0; i < actions.count(); i++) {
|
||||||
QAction *action = actions.at(i);
|
QAction *action = actions.at(i);
|
||||||
if(!action->isVisible())
|
if (!action->isVisible())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
QSize sz;
|
QSize sz;
|
||||||
|
|
||||||
//calc what I think the size is..
|
//calc what I think the size is..
|
||||||
if(action->isSeparator()) {
|
if (action->isSeparator()) {
|
||||||
if (style->styleHint(QStyle::SH_DrawMenuBarSeparator, nullptr, q))
|
if (style->styleHint(QStyle::SH_DrawMenuBarSeparator, nullptr, q))
|
||||||
separator = i;
|
separator = i;
|
||||||
continue; //we don't really position these!
|
continue; //we don't really position these!
|
||||||
@ -452,10 +452,10 @@ void QMenuBarPrivate::calcActionRects(int max_width, int start) const
|
|||||||
q->initStyleOption(&opt, action);
|
q->initStyleOption(&opt, action);
|
||||||
sz = q->style()->sizeFromContents(QStyle::CT_MenuBarItem, &opt, sz, q);
|
sz = q->style()->sizeFromContents(QStyle::CT_MenuBarItem, &opt, sz, q);
|
||||||
|
|
||||||
if(!sz.isEmpty()) {
|
if (!sz.isEmpty()) {
|
||||||
{ //update the separator state
|
{ //update the separator state
|
||||||
int iWidth = sz.width() + itemSpacing;
|
int iWidth = sz.width() + itemSpacing;
|
||||||
if(separator == -1)
|
if (separator == -1)
|
||||||
separator_start += iWidth;
|
separator_start += iWidth;
|
||||||
else
|
else
|
||||||
separator_len += iWidth;
|
separator_len += iWidth;
|
||||||
@ -480,9 +480,9 @@ void QMenuBarPrivate::calcActionRects(int max_width, int start) const
|
|||||||
rect.setHeight(max_item_height);
|
rect.setHeight(max_item_height);
|
||||||
|
|
||||||
//move
|
//move
|
||||||
if(separator != -1 && i >= separator) { //after the separator
|
if (separator != -1 && i >= separator) { //after the separator
|
||||||
int left = (max_width - separator_len - hmargin - itemSpacing) + (x - separator_start - hmargin);
|
int left = (max_width - separator_len - hmargin - itemSpacing) + (x - separator_start - hmargin);
|
||||||
if(left < separator_start) { //wrap
|
if (left < separator_start) { //wrap
|
||||||
separator_start = x = hmargin;
|
separator_start = x = hmargin;
|
||||||
y += max_item_height;
|
y += max_item_height;
|
||||||
}
|
}
|
||||||
@ -509,9 +509,9 @@ void QMenuBarPrivate::activateAction(QAction *action, QAction::ActionEvent actio
|
|||||||
if (action_e == QAction::Hover)
|
if (action_e == QAction::Hover)
|
||||||
action->showStatusText(q);
|
action->showStatusText(q);
|
||||||
|
|
||||||
// if(action_e == QAction::Trigger)
|
// if (action_e == QAction::Trigger)
|
||||||
// emit q->activated(action);
|
// emit q->activated(action);
|
||||||
// else if(action_e == QAction::Hover)
|
// else if (action_e == QAction::Hover)
|
||||||
// emit q->highlighted(action);
|
// emit q->highlighted(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -989,7 +989,7 @@ void QMenuBar::paintEvent(QPaintEvent *e)
|
|||||||
QRect adjustedActionRect = d->actionRect(action);
|
QRect adjustedActionRect = d->actionRect(action);
|
||||||
if (adjustedActionRect.isEmpty() || !d->isVisible(action))
|
if (adjustedActionRect.isEmpty() || !d->isVisible(action))
|
||||||
continue;
|
continue;
|
||||||
if(!e->rect().intersects(adjustedActionRect))
|
if (!e->rect().intersects(adjustedActionRect))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
emptyArea -= adjustedActionRect;
|
emptyArea -= adjustedActionRect;
|
||||||
@ -1046,7 +1046,7 @@ void QMenuBar::setVisible(bool visible)
|
|||||||
void QMenuBar::mousePressEvent(QMouseEvent *e)
|
void QMenuBar::mousePressEvent(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
Q_D(QMenuBar);
|
Q_D(QMenuBar);
|
||||||
if(e->button() != Qt::LeftButton)
|
if (e->button() != Qt::LeftButton)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
d->mouseDown = true;
|
d->mouseDown = true;
|
||||||
@ -1061,8 +1061,8 @@ void QMenuBar::mousePressEvent(QMouseEvent *e)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(d->currentAction == action && d->popupState) {
|
if (d->currentAction == action && d->popupState) {
|
||||||
if(QMenu *menu = d->activeMenu) {
|
if (QMenu *menu = d->activeMenu) {
|
||||||
d->activeMenu = nullptr;
|
d->activeMenu = nullptr;
|
||||||
menu->setAttribute(Qt::WA_NoMouseReplay);
|
menu->setAttribute(Qt::WA_NoMouseReplay);
|
||||||
menu->hide();
|
menu->hide();
|
||||||
@ -1078,7 +1078,7 @@ void QMenuBar::mousePressEvent(QMouseEvent *e)
|
|||||||
void QMenuBar::mouseReleaseEvent(QMouseEvent *e)
|
void QMenuBar::mouseReleaseEvent(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
Q_D(QMenuBar);
|
Q_D(QMenuBar);
|
||||||
if(e->button() != Qt::LeftButton || !d->mouseDown)
|
if (e->button() != Qt::LeftButton || !d->mouseDown)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
d->mouseDown = false;
|
d->mouseDown = false;
|
||||||
@ -1087,11 +1087,11 @@ void QMenuBar::mouseReleaseEvent(QMouseEvent *e)
|
|||||||
// do noting if the action is hidden
|
// do noting if the action is hidden
|
||||||
if (!d->isVisible(action))
|
if (!d->isVisible(action))
|
||||||
return;
|
return;
|
||||||
if((d->closePopupMode && action == d->currentAction) || !action || !action->menu()) {
|
if ((d->closePopupMode && action == d->currentAction) || !action || !action->menu()) {
|
||||||
//we set the current action before activating
|
//we set the current action before activating
|
||||||
//so that we let the leave event set the current back to 0
|
//so that we let the leave event set the current back to 0
|
||||||
d->setCurrentAction(action, false);
|
d->setCurrentAction(action, false);
|
||||||
if(action)
|
if (action)
|
||||||
d->activateAction(action, QAction::Trigger);
|
d->activateAction(action, QAction::Trigger);
|
||||||
}
|
}
|
||||||
d->closePopupMode = 0;
|
d->closePopupMode = 0;
|
||||||
@ -1105,15 +1105,15 @@ void QMenuBar::keyPressEvent(QKeyEvent *e)
|
|||||||
Q_D(QMenuBar);
|
Q_D(QMenuBar);
|
||||||
d->updateGeometries();
|
d->updateGeometries();
|
||||||
int key = e->key();
|
int key = e->key();
|
||||||
if(isRightToLeft()) { // in reverse mode open/close key for submenues are reversed
|
if (isRightToLeft()) { // in reverse mode open/close key for submenues are reversed
|
||||||
if(key == Qt::Key_Left)
|
if (key == Qt::Key_Left)
|
||||||
key = Qt::Key_Right;
|
key = Qt::Key_Right;
|
||||||
else if(key == Qt::Key_Right)
|
else if (key == Qt::Key_Right)
|
||||||
key = Qt::Key_Left;
|
key = Qt::Key_Left;
|
||||||
}
|
}
|
||||||
if(key == Qt::Key_Tab) //means right
|
if (key == Qt::Key_Tab) //means right
|
||||||
key = Qt::Key_Right;
|
key = Qt::Key_Right;
|
||||||
else if(key == Qt::Key_Backtab) //means left
|
else if (key == Qt::Key_Backtab) //means left
|
||||||
key = Qt::Key_Left;
|
key = Qt::Key_Left;
|
||||||
|
|
||||||
bool key_consumed = false;
|
bool key_consumed = false;
|
||||||
@ -1125,9 +1125,9 @@ void QMenuBar::keyPressEvent(QKeyEvent *e)
|
|||||||
case Qt::Key_Return: {
|
case Qt::Key_Return: {
|
||||||
if (!style()->styleHint(QStyle::SH_MenuBar_AltKeyNavigation, nullptr, this) || !d->currentAction)
|
if (!style()->styleHint(QStyle::SH_MenuBar_AltKeyNavigation, nullptr, this) || !d->currentAction)
|
||||||
break;
|
break;
|
||||||
if(d->currentAction->menu()) {
|
if (d->currentAction->menu()) {
|
||||||
d->popupAction(d->currentAction, true);
|
d->popupAction(d->currentAction, true);
|
||||||
} else if(key == Qt::Key_Enter || key == Qt::Key_Return || key == Qt::Key_Space) {
|
} else if (key == Qt::Key_Enter || key == Qt::Key_Return || key == Qt::Key_Space) {
|
||||||
d->activateAction(d->currentAction, QAction::Trigger);
|
d->activateAction(d->currentAction, QAction::Trigger);
|
||||||
d->setCurrentAction(d->currentAction, false);
|
d->setCurrentAction(d->currentAction, false);
|
||||||
d->setKeyboardMode(false);
|
d->setKeyboardMode(false);
|
||||||
@ -1137,7 +1137,7 @@ void QMenuBar::keyPressEvent(QKeyEvent *e)
|
|||||||
|
|
||||||
case Qt::Key_Right:
|
case Qt::Key_Right:
|
||||||
case Qt::Key_Left: {
|
case Qt::Key_Left: {
|
||||||
if(d->currentAction) {
|
if (d->currentAction) {
|
||||||
int index = d->actions.indexOf(d->currentAction);
|
int index = d->actions.indexOf(d->currentAction);
|
||||||
if (QAction *nextAction = d->getNextAction(index, key == Qt::Key_Left ? -1 : +1)) {
|
if (QAction *nextAction = d->getNextAction(index, key == Qt::Key_Left ? -1 : +1)) {
|
||||||
d->setCurrentAction(nextAction, d->popupState, true);
|
d->setCurrentAction(nextAction, d->popupState, true);
|
||||||
@ -1158,7 +1158,7 @@ void QMenuBar::keyPressEvent(QKeyEvent *e)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(!key_consumed &&
|
if (!key_consumed &&
|
||||||
(!e->modifiers() ||
|
(!e->modifiers() ||
|
||||||
(e->modifiers()&(Qt::MetaModifier|Qt::AltModifier))) && e->text().length()==1 && !d->popupState) {
|
(e->modifiers()&(Qt::MetaModifier|Qt::AltModifier))) && e->text().length()==1 && !d->popupState) {
|
||||||
int clashCount = 0;
|
int clashCount = 0;
|
||||||
@ -1170,14 +1170,14 @@ void QMenuBar::keyPressEvent(QKeyEvent *e)
|
|||||||
continue;
|
continue;
|
||||||
QAction *act = d->actions.at(i);
|
QAction *act = d->actions.at(i);
|
||||||
QString s = act->text();
|
QString s = act->text();
|
||||||
if(!s.isEmpty()) {
|
if (!s.isEmpty()) {
|
||||||
int ampersand = s.indexOf(QLatin1Char('&'));
|
int ampersand = s.indexOf(QLatin1Char('&'));
|
||||||
if(ampersand >= 0) {
|
if (ampersand >= 0) {
|
||||||
if(s[ampersand+1].toUpper() == c) {
|
if (s[ampersand+1].toUpper() == c) {
|
||||||
clashCount++;
|
clashCount++;
|
||||||
if(!first)
|
if (!first)
|
||||||
first = act;
|
first = act;
|
||||||
if(act == d->currentAction)
|
if (act == d->currentAction)
|
||||||
currentSelected = act;
|
currentSelected = act;
|
||||||
else if (!firstAfterCurrent && currentSelected)
|
else if (!firstAfterCurrent && currentSelected)
|
||||||
firstAfterCurrent = act;
|
firstAfterCurrent = act;
|
||||||
@ -1187,18 +1187,18 @@ void QMenuBar::keyPressEvent(QKeyEvent *e)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
QAction *next_action = nullptr;
|
QAction *next_action = nullptr;
|
||||||
if(clashCount >= 1) {
|
if (clashCount >= 1) {
|
||||||
if(clashCount == 1 || !d->currentAction || (currentSelected && !firstAfterCurrent))
|
if (clashCount == 1 || !d->currentAction || (currentSelected && !firstAfterCurrent))
|
||||||
next_action = first;
|
next_action = first;
|
||||||
else
|
else
|
||||||
next_action = firstAfterCurrent;
|
next_action = firstAfterCurrent;
|
||||||
}
|
}
|
||||||
if(next_action) {
|
if (next_action) {
|
||||||
key_consumed = true;
|
key_consumed = true;
|
||||||
d->setCurrentAction(next_action, true, true);
|
d->setCurrentAction(next_action, true, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(key_consumed)
|
if (key_consumed)
|
||||||
e->accept();
|
e->accept();
|
||||||
else
|
else
|
||||||
e->ignore();
|
e->ignore();
|
||||||
@ -1231,7 +1231,7 @@ void QMenuBar::mouseMoveEvent(QMouseEvent *e)
|
|||||||
void QMenuBar::leaveEvent(QEvent *)
|
void QMenuBar::leaveEvent(QEvent *)
|
||||||
{
|
{
|
||||||
Q_D(QMenuBar);
|
Q_D(QMenuBar);
|
||||||
if((!hasFocus() && !d->popupState) ||
|
if ((!hasFocus() && !d->popupState) ||
|
||||||
(d->currentAction && d->currentAction->menu() == nullptr))
|
(d->currentAction && d->currentAction->menu() == nullptr))
|
||||||
d->setCurrentAction(nullptr);
|
d->setCurrentAction(nullptr);
|
||||||
}
|
}
|
||||||
@ -1322,10 +1322,10 @@ void QMenuBar::actionEvent(QActionEvent *e)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(e->type() == QEvent::ActionAdded) {
|
if (e->type() == QEvent::ActionAdded) {
|
||||||
connect(e->action(), SIGNAL(triggered()), this, SLOT(_q_actionTriggered()));
|
connect(e->action(), SIGNAL(triggered()), this, SLOT(_q_actionTriggered()));
|
||||||
connect(e->action(), SIGNAL(hovered()), this, SLOT(_q_actionHovered()));
|
connect(e->action(), SIGNAL(hovered()), this, SLOT(_q_actionHovered()));
|
||||||
} else if(e->type() == QEvent::ActionRemoved) {
|
} else if (e->type() == QEvent::ActionRemoved) {
|
||||||
e->action()->disconnect(this);
|
e->action()->disconnect(this);
|
||||||
}
|
}
|
||||||
// updateGeometries() is also needed for native menu bars because
|
// updateGeometries() is also needed for native menu bars because
|
||||||
@ -1342,7 +1342,7 @@ void QMenuBar::actionEvent(QActionEvent *e)
|
|||||||
void QMenuBar::focusInEvent(QFocusEvent *)
|
void QMenuBar::focusInEvent(QFocusEvent *)
|
||||||
{
|
{
|
||||||
Q_D(QMenuBar);
|
Q_D(QMenuBar);
|
||||||
if(d->keyboardState)
|
if (d->keyboardState)
|
||||||
d->focusFirstAction();
|
d->focusFirstAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1352,7 +1352,7 @@ void QMenuBar::focusInEvent(QFocusEvent *)
|
|||||||
void QMenuBar::focusOutEvent(QFocusEvent *)
|
void QMenuBar::focusOutEvent(QFocusEvent *)
|
||||||
{
|
{
|
||||||
Q_D(QMenuBar);
|
Q_D(QMenuBar);
|
||||||
if(!d->popupState) {
|
if (!d->popupState) {
|
||||||
d->setCurrentAction(nullptr);
|
d->setCurrentAction(nullptr);
|
||||||
d->setKeyboardMode(false);
|
d->setKeyboardMode(false);
|
||||||
}
|
}
|
||||||
@ -1431,10 +1431,10 @@ void QMenuBarPrivate::handleReparent()
|
|||||||
void QMenuBar::changeEvent(QEvent *e)
|
void QMenuBar::changeEvent(QEvent *e)
|
||||||
{
|
{
|
||||||
Q_D(QMenuBar);
|
Q_D(QMenuBar);
|
||||||
if(e->type() == QEvent::StyleChange) {
|
if (e->type() == QEvent::StyleChange) {
|
||||||
d->itemsDirty = true;
|
d->itemsDirty = true;
|
||||||
setMouseTracking(style()->styleHint(QStyle::SH_MenuBar_MouseTracking, nullptr, this));
|
setMouseTracking(style()->styleHint(QStyle::SH_MenuBar_MouseTracking, nullptr, this));
|
||||||
if(parentWidget())
|
if (parentWidget())
|
||||||
resize(parentWidget()->width(), heightForWidth(parentWidget()->width()));
|
resize(parentWidget()->width(), heightForWidth(parentWidget()->width()));
|
||||||
d->updateGeometries();
|
d->updateGeometries();
|
||||||
} else if (e->type() == QEvent::ParentChange) {
|
} else if (e->type() == QEvent::ParentChange) {
|
||||||
@ -1458,12 +1458,12 @@ bool QMenuBar::event(QEvent *e)
|
|||||||
case QEvent::KeyPress: {
|
case QEvent::KeyPress: {
|
||||||
QKeyEvent *ke = (QKeyEvent*)e;
|
QKeyEvent *ke = (QKeyEvent*)e;
|
||||||
#if 0
|
#if 0
|
||||||
if(!d->keyboardState) { //all keypresses..
|
if (!d->keyboardState) { //all keypresses..
|
||||||
d->setCurrentAction(0);
|
d->setCurrentAction(0);
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if(ke->key() == Qt::Key_Tab || ke->key() == Qt::Key_Backtab) {
|
if (ke->key() == Qt::Key_Tab || ke->key() == Qt::Key_Backtab) {
|
||||||
keyPressEvent(ke);
|
keyPressEvent(ke);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1622,7 +1622,7 @@ QSize QMenuBar::minimumSizeHint() const
|
|||||||
const int vmargin = style()->pixelMetric(QStyle::PM_MenuBarVMargin, nullptr, this);
|
const int vmargin = style()->pixelMetric(QStyle::PM_MenuBarVMargin, nullptr, this);
|
||||||
int fw = style()->pixelMetric(QStyle::PM_MenuBarPanelWidth, nullptr, this);
|
int fw = style()->pixelMetric(QStyle::PM_MenuBarPanelWidth, nullptr, this);
|
||||||
int spaceBelowMenuBar = style()->styleHint(QStyle::SH_MainWindow_SpaceBelowMenuBar, nullptr, this);
|
int spaceBelowMenuBar = style()->styleHint(QStyle::SH_MainWindow_SpaceBelowMenuBar, nullptr, this);
|
||||||
if(as_gui_menubar) {
|
if (as_gui_menubar) {
|
||||||
int w = parentWidget() ? parentWidget()->width() : QGuiApplication::primaryScreen()->virtualGeometry().width();
|
int w = parentWidget() ? parentWidget()->width() : QGuiApplication::primaryScreen()->virtualGeometry().width();
|
||||||
d->calcActionRects(w - (2 * fw), 0);
|
d->calcActionRects(w - (2 * fw), 0);
|
||||||
for (int i = 0; ret.isNull() && i < d->actions.count(); ++i)
|
for (int i = 0; ret.isNull() && i < d->actions.count(); ++i)
|
||||||
@ -1632,19 +1632,19 @@ QSize QMenuBar::minimumSizeHint() const
|
|||||||
ret += QSize(2*fw + hmargin, 2*fw + vmargin);
|
ret += QSize(2*fw + hmargin, 2*fw + vmargin);
|
||||||
}
|
}
|
||||||
int margin = 2*vmargin + 2*fw + spaceBelowMenuBar;
|
int margin = 2*vmargin + 2*fw + spaceBelowMenuBar;
|
||||||
if(d->leftWidget) {
|
if (d->leftWidget) {
|
||||||
QSize sz = d->leftWidget->minimumSizeHint();
|
QSize sz = d->leftWidget->minimumSizeHint();
|
||||||
ret.setWidth(ret.width() + sz.width());
|
ret.setWidth(ret.width() + sz.width());
|
||||||
if(sz.height() + margin > ret.height())
|
if (sz.height() + margin > ret.height())
|
||||||
ret.setHeight(sz.height() + margin);
|
ret.setHeight(sz.height() + margin);
|
||||||
}
|
}
|
||||||
if(d->rightWidget) {
|
if (d->rightWidget) {
|
||||||
QSize sz = d->rightWidget->minimumSizeHint();
|
QSize sz = d->rightWidget->minimumSizeHint();
|
||||||
ret.setWidth(ret.width() + sz.width());
|
ret.setWidth(ret.width() + sz.width());
|
||||||
if(sz.height() + margin > ret.height())
|
if (sz.height() + margin > ret.height())
|
||||||
ret.setHeight(sz.height() + margin);
|
ret.setHeight(sz.height() + margin);
|
||||||
}
|
}
|
||||||
if(as_gui_menubar) {
|
if (as_gui_menubar) {
|
||||||
QStyleOptionMenuItem opt;
|
QStyleOptionMenuItem opt;
|
||||||
opt.rect = rect();
|
opt.rect = rect();
|
||||||
opt.menuRect = rect();
|
opt.menuRect = rect();
|
||||||
@ -1672,7 +1672,7 @@ QSize QMenuBar::sizeHint() const
|
|||||||
const int vmargin = style()->pixelMetric(QStyle::PM_MenuBarVMargin, nullptr, this);
|
const int vmargin = style()->pixelMetric(QStyle::PM_MenuBarVMargin, nullptr, this);
|
||||||
int fw = style()->pixelMetric(QStyle::PM_MenuBarPanelWidth, nullptr, this);
|
int fw = style()->pixelMetric(QStyle::PM_MenuBarPanelWidth, nullptr, this);
|
||||||
int spaceBelowMenuBar = style()->styleHint(QStyle::SH_MainWindow_SpaceBelowMenuBar, nullptr, this);
|
int spaceBelowMenuBar = style()->styleHint(QStyle::SH_MainWindow_SpaceBelowMenuBar, nullptr, this);
|
||||||
if(as_gui_menubar) {
|
if (as_gui_menubar) {
|
||||||
const int w = parentWidget() ? parentWidget()->width() : QGuiApplication::primaryScreen()->virtualGeometry().width();
|
const int w = parentWidget() ? parentWidget()->width() : QGuiApplication::primaryScreen()->virtualGeometry().width();
|
||||||
d->calcActionRects(w - (2 * fw), 0);
|
d->calcActionRects(w - (2 * fw), 0);
|
||||||
for (int i = 0; i < d->actionRects.count(); ++i) {
|
for (int i = 0; i < d->actionRects.count(); ++i) {
|
||||||
@ -1684,18 +1684,18 @@ QSize QMenuBar::sizeHint() const
|
|||||||
ret += QSize(fw + hmargin, fw + vmargin);
|
ret += QSize(fw + hmargin, fw + vmargin);
|
||||||
}
|
}
|
||||||
int margin = 2*vmargin + 2*fw + spaceBelowMenuBar;
|
int margin = 2*vmargin + 2*fw + spaceBelowMenuBar;
|
||||||
if(d->leftWidget) {
|
if (d->leftWidget) {
|
||||||
QSize sz = d->leftWidget->sizeHint();
|
QSize sz = d->leftWidget->sizeHint();
|
||||||
sz.rheight() += margin;
|
sz.rheight() += margin;
|
||||||
ret = ret.expandedTo(sz);
|
ret = ret.expandedTo(sz);
|
||||||
}
|
}
|
||||||
if(d->rightWidget) {
|
if (d->rightWidget) {
|
||||||
QSize sz = d->rightWidget->sizeHint();
|
QSize sz = d->rightWidget->sizeHint();
|
||||||
ret.setWidth(ret.width() + sz.width());
|
ret.setWidth(ret.width() + sz.width());
|
||||||
if(sz.height() + margin > ret.height())
|
if (sz.height() + margin > ret.height())
|
||||||
ret.setHeight(sz.height() + margin);
|
ret.setHeight(sz.height() + margin);
|
||||||
}
|
}
|
||||||
if(as_gui_menubar) {
|
if (as_gui_menubar) {
|
||||||
QStyleOptionMenuItem opt;
|
QStyleOptionMenuItem opt;
|
||||||
opt.rect = rect();
|
opt.rect = rect();
|
||||||
opt.menuRect = rect();
|
opt.menuRect = rect();
|
||||||
@ -1721,7 +1721,7 @@ int QMenuBar::heightForWidth(int) const
|
|||||||
const int vmargin = style()->pixelMetric(QStyle::PM_MenuBarVMargin, nullptr, this);
|
const int vmargin = style()->pixelMetric(QStyle::PM_MenuBarVMargin, nullptr, this);
|
||||||
int fw = style()->pixelMetric(QStyle::PM_MenuBarPanelWidth, nullptr, this);
|
int fw = style()->pixelMetric(QStyle::PM_MenuBarPanelWidth, nullptr, this);
|
||||||
int spaceBelowMenuBar = style()->styleHint(QStyle::SH_MainWindow_SpaceBelowMenuBar, nullptr, this);
|
int spaceBelowMenuBar = style()->styleHint(QStyle::SH_MainWindow_SpaceBelowMenuBar, nullptr, this);
|
||||||
if(as_gui_menubar) {
|
if (as_gui_menubar) {
|
||||||
for (int i = 0; i < d->actionRects.count(); ++i)
|
for (int i = 0; i < d->actionRects.count(); ++i)
|
||||||
height = qMax(height, d->actionRects.at(i).height());
|
height = qMax(height, d->actionRects.at(i).height());
|
||||||
if (height) //there is at least one non-null item
|
if (height) //there is at least one non-null item
|
||||||
@ -1730,11 +1730,11 @@ int QMenuBar::heightForWidth(int) const
|
|||||||
height += 2*vmargin;
|
height += 2*vmargin;
|
||||||
}
|
}
|
||||||
int margin = 2*vmargin + 2*fw + spaceBelowMenuBar;
|
int margin = 2*vmargin + 2*fw + spaceBelowMenuBar;
|
||||||
if(d->leftWidget)
|
if (d->leftWidget)
|
||||||
height = qMax(d->leftWidget->sizeHint().height() + margin, height);
|
height = qMax(d->leftWidget->sizeHint().height() + margin, height);
|
||||||
if(d->rightWidget)
|
if (d->rightWidget)
|
||||||
height = qMax(d->rightWidget->sizeHint().height() + margin, height);
|
height = qMax(d->rightWidget->sizeHint().height() + margin, height);
|
||||||
if(as_gui_menubar) {
|
if (as_gui_menubar) {
|
||||||
QStyleOptionMenuItem opt;
|
QStyleOptionMenuItem opt;
|
||||||
opt.initFrom(this);
|
opt.initFrom(this);
|
||||||
opt.menuRect = rect();
|
opt.menuRect = rect();
|
||||||
|
@ -2317,7 +2317,7 @@ void QPlainTextEdit::changeEvent(QEvent *e)
|
|||||||
if (e->type() == QEvent::ApplicationFontChange
|
if (e->type() == QEvent::ApplicationFontChange
|
||||||
|| e->type() == QEvent::FontChange) {
|
|| e->type() == QEvent::FontChange) {
|
||||||
d->control->document()->setDefaultFont(font());
|
d->control->document()->setDefaultFont(font());
|
||||||
} else if(e->type() == QEvent::ActivationChange) {
|
} else if (e->type() == QEvent::ActivationChange) {
|
||||||
if (!isActiveWindow())
|
if (!isActiveWindow())
|
||||||
d->autoScrollTimer.stop();
|
d->autoScrollTimer.stop();
|
||||||
} else if (e->type() == QEvent::EnabledChange) {
|
} else if (e->type() == QEvent::EnabledChange) {
|
||||||
|
@ -352,7 +352,7 @@ void QPushButton::setAutoDefault(bool enable)
|
|||||||
bool QPushButton::autoDefault() const
|
bool QPushButton::autoDefault() const
|
||||||
{
|
{
|
||||||
Q_D(const QPushButton);
|
Q_D(const QPushButton);
|
||||||
if(d->autoDefault == QPushButtonPrivate::Auto)
|
if (d->autoDefault == QPushButtonPrivate::Auto)
|
||||||
return ( d->dialogParent() != nullptr );
|
return ( d->dialogParent() != nullptr );
|
||||||
return d->autoDefault;
|
return d->autoDefault;
|
||||||
}
|
}
|
||||||
@ -418,9 +418,9 @@ QSize QPushButton::sizeHint() const
|
|||||||
s = QStringLiteral("XXXX");
|
s = QStringLiteral("XXXX");
|
||||||
QFontMetrics fm = fontMetrics();
|
QFontMetrics fm = fontMetrics();
|
||||||
QSize sz = fm.size(Qt::TextShowMnemonic, s);
|
QSize sz = fm.size(Qt::TextShowMnemonic, s);
|
||||||
if(!empty || !w)
|
if (!empty || !w)
|
||||||
w += sz.width();
|
w += sz.width();
|
||||||
if(!empty || !h)
|
if (!empty || !h)
|
||||||
h = qMax(h, sz.height());
|
h = qMax(h, sz.height());
|
||||||
opt.rect.setSize(QSize(w, h)); // PM_MenuButtonIndicator depends on the height
|
opt.rect.setSize(QSize(w, h)); // PM_MenuButtonIndicator depends on the height
|
||||||
#if QT_CONFIG(menu)
|
#if QT_CONFIG(menu)
|
||||||
|
@ -1652,7 +1652,7 @@ void QSplitter::setHandleWidth(int width)
|
|||||||
void QSplitter::changeEvent(QEvent *ev)
|
void QSplitter::changeEvent(QEvent *ev)
|
||||||
{
|
{
|
||||||
Q_D(QSplitter);
|
Q_D(QSplitter);
|
||||||
if(ev->type() == QEvent::StyleChange)
|
if (ev->type() == QEvent::StyleChange)
|
||||||
d->updateHandles();
|
d->updateHandles();
|
||||||
QFrame::changeEvent(ev);
|
QFrame::changeEvent(ev);
|
||||||
}
|
}
|
||||||
|
@ -2274,7 +2274,7 @@ void QTabBarPrivate::moveTabFinished(int index)
|
|||||||
}
|
}
|
||||||
#endif // animation
|
#endif // animation
|
||||||
if (allAnimationsFinished && cleanup) {
|
if (allAnimationsFinished && cleanup) {
|
||||||
if(movingTab)
|
if (movingTab)
|
||||||
movingTab->setVisible(false); // We might not get a mouse release
|
movingTab->setVisible(false); // We might not get a mouse release
|
||||||
for (auto tab : qAsConst(tabList)) {
|
for (auto tab : qAsConst(tabList)) {
|
||||||
tab->dragOffset = 0;
|
tab->dragOffset = 0;
|
||||||
|
@ -469,7 +469,7 @@ int QTabWidget::insertTab(int index, QWidget *w, const QString &label)
|
|||||||
int QTabWidget::insertTab(int index, QWidget *w, const QIcon& icon, const QString &label)
|
int QTabWidget::insertTab(int index, QWidget *w, const QIcon& icon, const QString &label)
|
||||||
{
|
{
|
||||||
Q_D(QTabWidget);
|
Q_D(QTabWidget);
|
||||||
if(!w)
|
if (!w)
|
||||||
return -1;
|
return -1;
|
||||||
index = d->stack->insertWidget(index, w);
|
index = d->stack->insertWidget(index, w);
|
||||||
d->tabs->insertTab(index, icon, label);
|
d->tabs->insertTab(index, icon, label);
|
||||||
@ -878,7 +878,7 @@ QSize QTabWidget::sizeHint() const
|
|||||||
|
|
||||||
if (d->leftCornerWidget)
|
if (d->leftCornerWidget)
|
||||||
lc = d->leftCornerWidget->sizeHint();
|
lc = d->leftCornerWidget->sizeHint();
|
||||||
if(d->rightCornerWidget)
|
if (d->rightCornerWidget)
|
||||||
rc = d->rightCornerWidget->sizeHint();
|
rc = d->rightCornerWidget->sizeHint();
|
||||||
if (!d->dirty) {
|
if (!d->dirty) {
|
||||||
QTabWidget *that = const_cast<QTabWidget*>(this);
|
QTabWidget *that = const_cast<QTabWidget*>(this);
|
||||||
@ -916,9 +916,9 @@ QSize QTabWidget::minimumSizeHint() const
|
|||||||
Q_D(const QTabWidget);
|
Q_D(const QTabWidget);
|
||||||
QSize lc(0, 0), rc(0, 0);
|
QSize lc(0, 0), rc(0, 0);
|
||||||
|
|
||||||
if(d->leftCornerWidget)
|
if (d->leftCornerWidget)
|
||||||
lc = d->leftCornerWidget->minimumSizeHint();
|
lc = d->leftCornerWidget->minimumSizeHint();
|
||||||
if(d->rightCornerWidget)
|
if (d->rightCornerWidget)
|
||||||
rc = d->rightCornerWidget->minimumSizeHint();
|
rc = d->rightCornerWidget->minimumSizeHint();
|
||||||
if (!d->dirty) {
|
if (!d->dirty) {
|
||||||
QTabWidget *that = const_cast<QTabWidget*>(this);
|
QTabWidget *that = const_cast<QTabWidget*>(this);
|
||||||
@ -954,7 +954,7 @@ int QTabWidget::heightForWidth(int width) const
|
|||||||
QSize lc(0, 0), rc(0, 0);
|
QSize lc(0, 0), rc(0, 0);
|
||||||
if (d->leftCornerWidget)
|
if (d->leftCornerWidget)
|
||||||
lc = d->leftCornerWidget->sizeHint();
|
lc = d->leftCornerWidget->sizeHint();
|
||||||
if(d->rightCornerWidget)
|
if (d->rightCornerWidget)
|
||||||
rc = d->rightCornerWidget->sizeHint();
|
rc = d->rightCornerWidget->sizeHint();
|
||||||
if (!d->dirty) {
|
if (!d->dirty) {
|
||||||
QTabWidget *that = const_cast<QTabWidget*>(this);
|
QTabWidget *that = const_cast<QTabWidget*>(this);
|
||||||
|
@ -502,7 +502,7 @@ void QTextBrowserPrivate::keypadMove(bool next)
|
|||||||
// up e.g. 110%
|
// up e.g. 110%
|
||||||
// Obviously if a link is entirely visible, we still
|
// Obviously if a link is entirely visible, we still
|
||||||
// focus it.
|
// focus it.
|
||||||
if(bothViewRects.contains(desiredRect)
|
if (bothViewRects.contains(desiredRect)
|
||||||
|| bothViewRects.adjusted(0, visibleLinkAmount, 0, -visibleLinkAmount).intersects(desiredRect)) {
|
|| bothViewRects.adjusted(0, visibleLinkAmount, 0, -visibleLinkAmount).intersects(desiredRect)) {
|
||||||
focusIt = true;
|
focusIt = true;
|
||||||
|
|
||||||
@ -531,7 +531,7 @@ void QTextBrowserPrivate::keypadMove(bool next)
|
|||||||
if (!focusIt && prevFocus.hasSelection()) {
|
if (!focusIt && prevFocus.hasSelection()) {
|
||||||
QRectF desiredRect = control->selectionRect(prevFocus);
|
QRectF desiredRect = control->selectionRect(prevFocus);
|
||||||
// XXX this may be better off also using the visibleLinkAmount value
|
// XXX this may be better off also using the visibleLinkAmount value
|
||||||
if(newViewRect.intersects(desiredRect)) {
|
if (newViewRect.intersects(desiredRect)) {
|
||||||
focusedPos = scrollYOffset;
|
focusedPos = scrollYOffset;
|
||||||
focusIt = true;
|
focusIt = true;
|
||||||
anchorToFocus = prevFocus;
|
anchorToFocus = prevFocus;
|
||||||
|
@ -1915,7 +1915,7 @@ void QTextEdit::changeEvent(QEvent *e)
|
|||||||
if (e->type() == QEvent::ApplicationFontChange
|
if (e->type() == QEvent::ApplicationFontChange
|
||||||
|| e->type() == QEvent::FontChange) {
|
|| e->type() == QEvent::FontChange) {
|
||||||
d->control->document()->setDefaultFont(font());
|
d->control->document()->setDefaultFont(font());
|
||||||
} else if(e->type() == QEvent::ActivationChange) {
|
} else if (e->type() == QEvent::ActivationChange) {
|
||||||
if (!isActiveWindow())
|
if (!isActiveWindow())
|
||||||
d->autoScrollTimer.stop();
|
d->autoScrollTimer.stop();
|
||||||
} else if (e->type() == QEvent::EnabledChange) {
|
} else if (e->type() == QEvent::EnabledChange) {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user