Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.13' into 5.14
Browse files Browse the repository at this point in the history
 Conflicts:
	examples/widgets/widgets/scribble/mainwindow.cpp
		This amends cb54c16.

Change-Id: Iaae60a893330524b2973917e23b31f9d51f8bd38
  • Loading branch information
liangqi committed Nov 13, 2019
2 parents bf131e8 + 8ffb200 commit d140f2f
Show file tree
Hide file tree
Showing 12 changed files with 95 additions and 18 deletions.
5 changes: 4 additions & 1 deletion bin/syncqt.pl
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ sub classNames {
$$clean = 1;
$$requires = "";

my $suspended = 0;
my $ihdrbase = basename($iheader);

my $parsable = "";
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions examples/widgets/widgets/scribble/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#include <QInputDialog>
#include <QMenuBar>
#include <QMessageBox>
#include <QCloseEvent>

//! [0]
MainWindow::MainWindow(QWidget *parent)
Expand Down
1 change: 1 addition & 0 deletions mkspecs/common/clang-mac.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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++
Expand Down
6 changes: 6 additions & 0 deletions mkspecs/features/ltcg.prf
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/corelib/io/qloggingcategory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/gui/kernel/qevent.h
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,14 @@ class Q_GUI_EXPORT QPointingDeviceUniqueId
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
Expand Down
16 changes: 8 additions & 8 deletions src/platformsupport/input/libinput/qlibinputtouch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
// '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::TouchPointReleased)
tp->state = tmpState;
} else {
qWarning("Inconsistent touch state (got 'motion' without 'down')");
}
Expand Down
8 changes: 2 additions & 6 deletions src/plugins/platforms/ios/quiview.mm
Original file line number Diff line number Diff line change
Expand Up @@ -628,17 +628,13 @@ - (id)forwardingTargetForSelector:(SEL)selector
#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

Expand Down
58 changes: 58 additions & 0 deletions src/plugins/platforms/windows/qwindowscontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/platforms/windows/qwindowscontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ class QWindowsContext
bool initTablet(unsigned integrationOptions);
bool initPointer(unsigned integrationOptions);

bool initPowerNotificationHandler();

int defaultDPI() const;

QString registerWindowClass(const QWindow *w);
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/platforms/windows/qwindowsintegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ QWindowsIntegrationPrivate::QWindowsIntegrationPrivate(const QStringList &paramL

m_context.initTouch(m_options);
QPlatformCursor::setCapability(QPlatformCursor::OverrideCursor);

m_context.initPowerNotificationHandler();
}

QWindowsIntegrationPrivate::~QWindowsIntegrationPrivate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,9 @@ HRESULT QWindowsUiaMainProvider::GetPatternProvider(PATTERNID idPattern, IUnknow
}
break;
case UIA_ValuePatternId:
// All accessible controls return text(QAccessible::Value) (which may be empty).
*pRetVal = new QWindowsUiaValueProvider(id());
// All non-static controls support the Value pattern.
if (accessible->role() != QAccessible::StaticText)
*pRetVal = new QWindowsUiaValueProvider(id());
break;
case UIA_RangeValuePatternId:
// Controls providing a numeric value within a range (e.g., sliders, scroll bars, dials).
Expand Down

0 comments on commit d140f2f

Please sign in to comment.