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:
commit
d140f2f614
@ -209,6 +209,7 @@ sub classNames {
|
|||||||
$$clean = 1;
|
$$clean = 1;
|
||||||
$$requires = "";
|
$$requires = "";
|
||||||
|
|
||||||
|
my $suspended = 0;
|
||||||
my $ihdrbase = basename($iheader);
|
my $ihdrbase = basename($iheader);
|
||||||
|
|
||||||
my $parsable = "";
|
my $parsable = "";
|
||||||
@ -221,9 +222,11 @@ sub classNames {
|
|||||||
$$clean = 0 if ($line =~ m/^#pragma qt_sync_skip_header_check/);
|
$$clean = 0 if ($line =~ m/^#pragma qt_sync_skip_header_check/);
|
||||||
return @ret if($line =~ m/^#pragma qt_sync_stop_processing/);
|
return @ret if($line =~ m/^#pragma qt_sync_stop_processing/);
|
||||||
push(@ret, $1) if($line =~ m/^#pragma qt_class\(([^)]*)\)[\r\n]*$/);
|
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;
|
$line = 0;
|
||||||
}
|
}
|
||||||
if($line) {
|
if ($line && !$suspended) {
|
||||||
$line =~ s,//.*$,,; #remove c++ comments
|
$line =~ s,//.*$,,; #remove c++ comments
|
||||||
$line .= ";" if($line =~ m/^Q_[A-Z_0-9]*\(.*\)[\r\n]*$/); #qt macro
|
$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
|
$line .= ";" if($line =~ m/^QT_(BEGIN|END)_HEADER[\r\n]*$/); #qt macro
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QMenuBar>
|
#include <QMenuBar>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QCloseEvent>
|
||||||
|
|
||||||
//! [0]
|
//! [0]
|
||||||
MainWindow::MainWindow(QWidget *parent)
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
|
@ -5,6 +5,7 @@ QMAKE_OBJCXXFLAGS_PRECOMPILE = -x objective-c++-header -c ${QMAKE_PCH_INPUT}
|
|||||||
QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
|
QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
|
||||||
|
|
||||||
QMAKE_XCODE_GCC_VERSION = com.apple.compilers.llvm.clang.1_0
|
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_CXXFLAGS += -stdlib=libc++
|
||||||
QMAKE_LFLAGS += -stdlib=libc++
|
QMAKE_LFLAGS += -stdlib=libc++
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
static:no-static-ltcg {
|
static:no-static-ltcg {
|
||||||
# Static library but no-static-ltcg enabled: skip LTCG
|
# Static library but no-static-ltcg enabled: skip LTCG
|
||||||
} else: CONFIG(release, debug|release) {
|
} 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
|
# 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
|
# 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
|
# in the first place. On others, we have special ar and nm to create the symbol
|
||||||
|
@ -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
|
The \c QtProject/qtlogging.ini file is looked up in all directories returned
|
||||||
by QStandardPaths::GenericConfigLocation.
|
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.
|
rules are loaded from.
|
||||||
|
|
||||||
\section2 Installing a Custom Filter
|
\section2 Installing a Custom Filter
|
||||||
|
@ -853,7 +853,14 @@ private:
|
|||||||
qint64 m_numericId;
|
qint64 m_numericId;
|
||||||
};
|
};
|
||||||
Q_DECLARE_TYPEINFO(QPointingDeviceUniqueId, Q_MOVABLE_TYPE);
|
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
|
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;
|
Q_GUI_EXPORT bool operator==(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) noexcept;
|
||||||
inline bool operator!=(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) noexcept
|
inline bool operator!=(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) noexcept
|
||||||
|
@ -113,16 +113,16 @@ void QLibInputTouch::processTouchMotion(libinput_event_touch *e)
|
|||||||
DeviceState *state = deviceState(e);
|
DeviceState *state = deviceState(e);
|
||||||
QWindowSystemInterface::TouchPoint *tp = state->point(slot);
|
QWindowSystemInterface::TouchPoint *tp = state->point(slot);
|
||||||
if (tp) {
|
if (tp) {
|
||||||
|
Qt::TouchPointState tmpState = Qt::TouchPointMoved;
|
||||||
const QPointF p = getPos(e);
|
const QPointF p = getPos(e);
|
||||||
if (tp->area.center() != p) {
|
if (tp->area.center() == p)
|
||||||
|
tmpState = Qt::TouchPointStationary;
|
||||||
|
else
|
||||||
tp->area.moveCenter(p);
|
tp->area.moveCenter(p);
|
||||||
// 'down' may be followed by 'motion' within the same "frame".
|
// 'down' may be followed by 'motion' within the same "frame".
|
||||||
// Handle this by compressing and keeping the Pressed state until the 'frame'.
|
// Handle this by compressing and keeping the Pressed state until the 'frame'.
|
||||||
if (tp->state != Qt::TouchPointPressed)
|
if (tp->state != Qt::TouchPointPressed && tp->state != Qt::TouchPointReleased)
|
||||||
tp->state = Qt::TouchPointMoved;
|
tp->state = tmpState;
|
||||||
} else {
|
|
||||||
tp->state = Qt::TouchPointStationary;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
qWarning("Inconsistent touch state (got 'motion' without 'down')");
|
qWarning("Inconsistent touch state (got 'motion' without 'down')");
|
||||||
}
|
}
|
||||||
|
@ -628,17 +628,13 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(130000)
|
|
||||||
- (void)addInteraction:(id<UIInteraction>)interaction
|
- (void)addInteraction:(id<UIInteraction>)interaction
|
||||||
{
|
{
|
||||||
if (__builtin_available(iOS 13.0, *)) {
|
if ([NSStringFromClass(interaction.class) isEqualToString:@"UITextInteraction"])
|
||||||
if ([interaction isKindOfClass:UITextInteraction.class])
|
return;
|
||||||
return; // Prevent iOS from adding UITextInteraction
|
|
||||||
}
|
|
||||||
|
|
||||||
[super addInteraction:interaction];
|
[super addInteraction:interaction];
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -274,6 +274,8 @@ struct QWindowsContextPrivate {
|
|||||||
const HRESULT m_oleInitializeResult;
|
const HRESULT m_oleInitializeResult;
|
||||||
QWindow *m_lastActiveWindow = nullptr;
|
QWindow *m_lastActiveWindow = nullptr;
|
||||||
bool m_asyncExpose = false;
|
bool m_asyncExpose = false;
|
||||||
|
HPOWERNOTIFY m_powerNotification = nullptr;
|
||||||
|
HWND m_powerDummyWindow = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
QWindowsContextPrivate::QWindowsContextPrivate()
|
QWindowsContextPrivate::QWindowsContextPrivate()
|
||||||
@ -314,6 +316,13 @@ QWindowsContext::~QWindowsContext()
|
|||||||
#if QT_CONFIG(tabletevent)
|
#if QT_CONFIG(tabletevent)
|
||||||
d->m_tabletSupport.reset(); // Destroy internal window before unregistering classes.
|
d->m_tabletSupport.reset(); // Destroy internal window before unregistering classes.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (d->m_powerNotification)
|
||||||
|
UnregisterPowerSettingNotification(d->m_powerNotification);
|
||||||
|
|
||||||
|
if (d->m_powerDummyWindow)
|
||||||
|
DestroyWindow(d->m_powerDummyWindow);
|
||||||
|
|
||||||
unregisterWindowClasses();
|
unregisterWindowClasses();
|
||||||
if (d->m_oleInitializeResult == S_OK || d->m_oleInitializeResult == S_FALSE)
|
if (d->m_oleInitializeResult == S_OK || d->m_oleInitializeResult == S_FALSE)
|
||||||
OleUninitialize();
|
OleUninitialize();
|
||||||
@ -381,6 +390,55 @@ bool QWindowsContext::initPointer(unsigned integrationOptions)
|
|||||||
return true;
|
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)
|
void QWindowsContext::setTabletAbsoluteRange(int a)
|
||||||
{
|
{
|
||||||
#if QT_CONFIG(tabletevent)
|
#if QT_CONFIG(tabletevent)
|
||||||
|
@ -176,6 +176,8 @@ public:
|
|||||||
bool initTablet(unsigned integrationOptions);
|
bool initTablet(unsigned integrationOptions);
|
||||||
bool initPointer(unsigned integrationOptions);
|
bool initPointer(unsigned integrationOptions);
|
||||||
|
|
||||||
|
bool initPowerNotificationHandler();
|
||||||
|
|
||||||
int defaultDPI() const;
|
int defaultDPI() const;
|
||||||
|
|
||||||
QString registerWindowClass(const QWindow *w);
|
QString registerWindowClass(const QWindow *w);
|
||||||
|
@ -258,6 +258,8 @@ QWindowsIntegrationPrivate::QWindowsIntegrationPrivate(const QStringList ¶mL
|
|||||||
|
|
||||||
m_context.initTouch(m_options);
|
m_context.initTouch(m_options);
|
||||||
QPlatformCursor::setCapability(QPlatformCursor::OverrideCursor);
|
QPlatformCursor::setCapability(QPlatformCursor::OverrideCursor);
|
||||||
|
|
||||||
|
m_context.initPowerNotificationHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
QWindowsIntegrationPrivate::~QWindowsIntegrationPrivate()
|
QWindowsIntegrationPrivate::~QWindowsIntegrationPrivate()
|
||||||
|
@ -277,7 +277,8 @@ HRESULT QWindowsUiaMainProvider::GetPatternProvider(PATTERNID idPattern, IUnknow
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case UIA_ValuePatternId:
|
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());
|
*pRetVal = new QWindowsUiaValueProvider(id());
|
||||||
break;
|
break;
|
||||||
case UIA_RangeValuePatternId:
|
case UIA_RangeValuePatternId:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user