Merge remote-tracking branch 'origin/5.13' into 5.14

Conflicts:
	examples/widgets/widgets/scribble/mainwindow.cpp
		This amends cb54c16584cf3be746a1a536c1e37cb3022a2f1b.

Change-Id: Iaae60a893330524b2973917e23b31f9d51f8bd38
This commit is contained in:
Liang Qi 2019-11-13 07:20:23 +01:00
commit d140f2f614
12 changed files with 95 additions and 18 deletions

View File

@ -209,6 +209,7 @@ sub classNames {
$$clean = 1;
$$requires = "";
my $suspended = 0;
my $ihdrbase = basename($iheader);
my $parsable = "";
@ -221,9 +222,11 @@ sub classNames {
$$clean = 0 if ($line =~ m/^#pragma qt_sync_skip_header_check/);
return @ret if($line =~ m/^#pragma qt_sync_stop_processing/);
push(@ret, $1) if($line =~ m/^#pragma qt_class\(([^)]*)\)[\r\n]*$/);
$suspended = 1 if ($line =~ m/^#pragma qt_sync_suspend_processing/);
$suspended = 0 if ($line =~ m/^#pragma qt_sync_resume_processing/);
$line = 0;
}
if($line) {
if ($line && !$suspended) {
$line =~ s,//.*$,,; #remove c++ comments
$line .= ";" if($line =~ m/^Q_[A-Z_0-9]*\(.*\)[\r\n]*$/); #qt macro
$line .= ";" if($line =~ m/^QT_(BEGIN|END)_HEADER[\r\n]*$/); #qt macro

View File

@ -58,6 +58,7 @@
#include <QInputDialog>
#include <QMenuBar>
#include <QMessageBox>
#include <QCloseEvent>
//! [0]
MainWindow::MainWindow(QWidget *parent)

View File

@ -5,6 +5,7 @@ QMAKE_OBJCXXFLAGS_PRECOMPILE = -x objective-c++-header -c ${QMAKE_PCH_INPUT}
QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_XCODE_GCC_VERSION = com.apple.compilers.llvm.clang.1_0
QMAKE_LFLAGS_LTCG_SEPARATE_DEBUG_INFO = -Wl,-object_path_lto,${OBJECTS_DIR}/${TARGET}_lto.o
QMAKE_CXXFLAGS += -stdlib=libc++
QMAKE_LFLAGS += -stdlib=libc++

View File

@ -1,6 +1,12 @@
static:no-static-ltcg {
# Static library but no-static-ltcg enabled: skip LTCG
} else: CONFIG(release, debug|release) {
separate_debug_info {
# Evaluate single-$ variable references that have no valid value at mkspec loading time
QMAKE_LFLAGS_LTCG_SEPARATE_DEBUG_INFO ~= s/\\$\\{/\$\$\{/
eval(QMAKE_LFLAGS_LTCG += $$QMAKE_LFLAGS_LTCG_SEPARATE_DEBUG_INFO)
}
# We need fat object files when creating static libraries on some platforms
# so the linker will know to load a particular object from the library
# in the first place. On others, we have special ar and nm to create the symbol

View File

@ -179,7 +179,7 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift)
The \c QtProject/qtlogging.ini file is looked up in all directories returned
by QStandardPaths::GenericConfigLocation.
Set the \c QT_LOGGING_DEBUG environment variable to find out where you logging
Set the \c QT_LOGGING_DEBUG environment variable to find out where your logging
rules are loaded from.
\section2 Installing a Custom Filter

View File

@ -853,7 +853,14 @@ private:
qint64 m_numericId;
};
Q_DECLARE_TYPEINFO(QPointingDeviceUniqueId, Q_MOVABLE_TYPE);
#if 0
#pragma qt_sync_suspend_processing
#endif
template <> class QList<QPointingDeviceUniqueId> {}; // to prevent instantiation: use QVector instead
#if 0
#pragma qt_sync_resume_processing
#endif
Q_GUI_EXPORT bool operator==(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) noexcept;
inline bool operator!=(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) noexcept

View File

@ -113,16 +113,16 @@ void QLibInputTouch::processTouchMotion(libinput_event_touch *e)
DeviceState *state = deviceState(e);
QWindowSystemInterface::TouchPoint *tp = state->point(slot);
if (tp) {
Qt::TouchPointState tmpState = Qt::TouchPointMoved;
const QPointF p = getPos(e);
if (tp->area.center() != p) {
if (tp->area.center() == p)
tmpState = Qt::TouchPointStationary;
else
tp->area.moveCenter(p);
// 'down' may be followed by 'motion' within the same "frame".
// Handle this by compressing and keeping the Pressed state until the 'frame'.
if (tp->state != Qt::TouchPointPressed)
tp->state = Qt::TouchPointMoved;
} else {
tp->state = Qt::TouchPointStationary;
}
if (tp->state != Qt::TouchPointPressed && tp->state != Qt::TouchPointReleased)
tp->state = tmpState;
} else {
qWarning("Inconsistent touch state (got 'motion' without 'down')");
}

View File

@ -628,17 +628,13 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
#endif
}
#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(130000)
- (void)addInteraction:(id<UIInteraction>)interaction
{
if (__builtin_available(iOS 13.0, *)) {
if ([interaction isKindOfClass:UITextInteraction.class])
return; // Prevent iOS from adding UITextInteraction
}
if ([NSStringFromClass(interaction.class) isEqualToString:@"UITextInteraction"])
return;
[super addInteraction:interaction];
}
#endif
@end

View File

@ -274,6 +274,8 @@ struct QWindowsContextPrivate {
const HRESULT m_oleInitializeResult;
QWindow *m_lastActiveWindow = nullptr;
bool m_asyncExpose = false;
HPOWERNOTIFY m_powerNotification = nullptr;
HWND m_powerDummyWindow = nullptr;
};
QWindowsContextPrivate::QWindowsContextPrivate()
@ -314,6 +316,13 @@ QWindowsContext::~QWindowsContext()
#if QT_CONFIG(tabletevent)
d->m_tabletSupport.reset(); // Destroy internal window before unregistering classes.
#endif
if (d->m_powerNotification)
UnregisterPowerSettingNotification(d->m_powerNotification);
if (d->m_powerDummyWindow)
DestroyWindow(d->m_powerDummyWindow);
unregisterWindowClasses();
if (d->m_oleInitializeResult == S_OK || d->m_oleInitializeResult == S_FALSE)
OleUninitialize();
@ -381,6 +390,55 @@ bool QWindowsContext::initPointer(unsigned integrationOptions)
return true;
}
extern "C" LRESULT QT_WIN_CALLBACK qWindowsPowerWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if (message != WM_POWERBROADCAST || wParam != PBT_POWERSETTINGCHANGE)
return DefWindowProc(hwnd, message, wParam, lParam);
static bool initialized = false; // ignore the initial change
if (!initialized) {
initialized = true;
return DefWindowProc(hwnd, message, wParam, lParam);
}
auto setting = reinterpret_cast<const POWERBROADCAST_SETTING *>(lParam);
if (setting) {
auto data = reinterpret_cast<const DWORD *>(&setting->Data);
if (*data == 1) {
// Repaint the windows when returning from sleeping display mode.
const auto tlw = QGuiApplication::topLevelWindows();
for (auto w : tlw) {
if (w->isVisible() && w->windowState() != Qt::WindowMinimized) {
if (auto tw = QWindowsWindow::windowsWindowOf(w)) {
if (HWND hwnd = tw->handle()) {
InvalidateRect(hwnd, nullptr, false);
}
}
}
}
}
}
return DefWindowProc(hwnd, message, wParam, lParam);
}
bool QWindowsContext::initPowerNotificationHandler()
{
if (d->m_powerNotification)
return false;
d->m_powerDummyWindow = createDummyWindow(QStringLiteral("QtPowerDummyWindow"), L"QtPowerDummyWindow", qWindowsPowerWindowProc);
if (!d->m_powerDummyWindow)
return false;
d->m_powerNotification = RegisterPowerSettingNotification(d->m_powerDummyWindow, &GUID_MONITOR_POWER_ON, DEVICE_NOTIFY_WINDOW_HANDLE);
if (!d->m_powerNotification) {
DestroyWindow(d->m_powerDummyWindow);
d->m_powerDummyWindow = nullptr;
return false;
}
return true;
}
void QWindowsContext::setTabletAbsoluteRange(int a)
{
#if QT_CONFIG(tabletevent)

View File

@ -176,6 +176,8 @@ public:
bool initTablet(unsigned integrationOptions);
bool initPointer(unsigned integrationOptions);
bool initPowerNotificationHandler();
int defaultDPI() const;
QString registerWindowClass(const QWindow *w);

View File

@ -258,6 +258,8 @@ QWindowsIntegrationPrivate::QWindowsIntegrationPrivate(const QStringList &paramL
m_context.initTouch(m_options);
QPlatformCursor::setCapability(QPlatformCursor::OverrideCursor);
m_context.initPowerNotificationHandler();
}
QWindowsIntegrationPrivate::~QWindowsIntegrationPrivate()

View File

@ -277,7 +277,8 @@ HRESULT QWindowsUiaMainProvider::GetPatternProvider(PATTERNID idPattern, IUnknow
}
break;
case UIA_ValuePatternId:
// All accessible controls return text(QAccessible::Value) (which may be empty).
// All non-static controls support the Value pattern.
if (accessible->role() != QAccessible::StaticText)
*pRetVal = new QWindowsUiaValueProvider(id());
break;
case UIA_RangeValuePatternId: