Merge remote-tracking branch 'origin/5.12.3' into 5.12
Change-Id: Id60d508c0f25fd5e67be07daafd2d4c56ae73934
This commit is contained in:
commit
01a269593d
@ -260,25 +260,31 @@ static int installFile(const QString &source, const QString &target, bool exe =
|
||||
return 3;
|
||||
}
|
||||
|
||||
QFileDevice::Permissions targetPermissions = QFileDevice::ReadOwner | QFileDevice::WriteOwner
|
||||
| QFileDevice::ReadUser | QFileDevice::WriteUser
|
||||
| QFileDevice::ReadGroup | QFileDevice::ReadOther;
|
||||
if (exe) {
|
||||
targetPermissions |= QFileDevice::ExeOwner | QFileDevice::ExeUser |
|
||||
QFileDevice::ExeGroup | QFileDevice::ExeOther;
|
||||
}
|
||||
if (!targetFile.setPermissions(targetPermissions)) {
|
||||
fprintf(stderr, "Error setting permissions on %s: %s\n",
|
||||
qPrintable(target), qPrintable(targetFile.errorString()));
|
||||
return 3;
|
||||
if (!targetFile.setPermissions(sourceFile.permissions() | QFileDevice::ExeOwner | QFileDevice::ExeUser |
|
||||
QFileDevice::ExeGroup | QFileDevice::ExeOther)) {
|
||||
fprintf(stderr, "Error setting execute permissions on %s: %s\n",
|
||||
qPrintable(target), qPrintable(targetFile.errorString()));
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
// Copy file times
|
||||
QString error;
|
||||
#ifdef Q_OS_WIN
|
||||
const QFile::Permissions permissions = targetFile.permissions();
|
||||
const bool readOnly = !(permissions & QFile::WriteUser);
|
||||
if (readOnly)
|
||||
targetFile.setPermissions(permissions | QFile::WriteUser);
|
||||
#endif
|
||||
if (!IoUtils::touchFile(target, sourceFile.fileName(), &error)) {
|
||||
fprintf(stderr, "%s", qPrintable(error));
|
||||
return 3;
|
||||
}
|
||||
#ifdef Q_OS_WIN
|
||||
if (readOnly)
|
||||
targetFile.setPermissions(permissions);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
2
src/3rdparty/wintab/LICENSE.txt
vendored
Normal file
2
src/3rdparty/wintab/LICENSE.txt
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
The text and information contained in this file may be freely used,
|
||||
copied, or distributed without compensation or licensing restrictions.
|
6
src/3rdparty/wintab/qt_attribution.json
vendored
6
src/3rdparty/wintab/qt_attribution.json
vendored
@ -5,9 +5,9 @@
|
||||
"QtUsage": "Used in the Qt platform plugin for Windows. Configure with -no-feature-tabletevent to avoid.",
|
||||
|
||||
"Description": "Wintab is a de facto API for pointing devices on Windows.",
|
||||
"Version": "Upstream no longer offers updates; treat as final",
|
||||
"Homepage": "http://www.pointing.com/Wintab.html",
|
||||
"License": "Public Domain",
|
||||
"PackageComment": "Upstream http://www.pointing.com/Wintab.html no longer offers updates; treat as final",
|
||||
"License": "Custom License",
|
||||
"LicenseFile": "LICENSE.txt",
|
||||
"LicenseId": "NONE",
|
||||
"Copyright": "Copyright 1991-1998 by LCS/Telegraphics."
|
||||
}
|
||||
|
@ -764,7 +764,8 @@
|
||||
},
|
||||
"headers": [ "xkbcommon/xkbcommon.h" ],
|
||||
"sources": [
|
||||
{ "type": "pkgConfig", "args": "xkbcommon >= 0.5.0" }
|
||||
{ "type": "pkgConfig", "args": "xkbcommon >= 0.5.0" },
|
||||
"-lxkbcommon"
|
||||
]
|
||||
},
|
||||
"xkbcommon_x11": {
|
||||
@ -774,7 +775,8 @@
|
||||
},
|
||||
"headers": [ "xkbcommon/xkbcommon-x11.h" ],
|
||||
"sources": [
|
||||
{ "type": "pkgConfig", "args": "xkbcommon-x11" }
|
||||
{ "type": "pkgConfig", "args": "xkbcommon-x11" },
|
||||
"-lxkbcommon -lxkbcommon-x11"
|
||||
]
|
||||
},
|
||||
"xrender": {
|
||||
|
@ -878,8 +878,6 @@ void QWidgetWindow::handleDragEnterEvent(QDragEnterEvent *event, QWidget *widget
|
||||
const QPoint mapped = widget->mapFromGlobal(m_widget->mapToGlobal(event->pos()));
|
||||
QDragEnterEvent translated(mapped, event->possibleActions(), event->mimeData(),
|
||||
event->mouseButtons(), event->keyboardModifiers());
|
||||
translated.setDropAction(event->dropAction());
|
||||
translated.setAccepted(event->isAccepted());
|
||||
QGuiApplication::forwardEvent(m_dragTarget, &translated, event);
|
||||
event->setAccepted(translated.isAccepted());
|
||||
event->setDropAction(translated.dropAction());
|
||||
|
@ -46,6 +46,9 @@
|
||||
#include <private/qwindow_p.h>
|
||||
#include <private/qguiapplication_p.h>
|
||||
#include <qpa/qplatformintegration.h>
|
||||
#include <qpa/qwindowsysteminterface.h>
|
||||
#include <qpa/qplatformdrag.h>
|
||||
#include <private/qhighdpiscaling_p.h>
|
||||
|
||||
#include <QtTest/private/qtesthelpers_p.h>
|
||||
|
||||
@ -87,6 +90,7 @@ private slots:
|
||||
#if QT_CONFIG(draganddrop)
|
||||
void tst_dnd();
|
||||
void tst_dnd_events();
|
||||
void tst_dnd_propagation();
|
||||
#endif
|
||||
|
||||
void tst_qtbug35600();
|
||||
@ -744,6 +748,77 @@ void tst_QWidget_window::tst_dnd_events()
|
||||
|
||||
QCOMPARE(dndWidget._dndEvents, expectedDndEvents);
|
||||
}
|
||||
|
||||
class DropTarget : public QWidget
|
||||
{
|
||||
public:
|
||||
explicit DropTarget()
|
||||
{
|
||||
setAcceptDrops(true);
|
||||
|
||||
const QRect availableGeometry = QGuiApplication::primaryScreen()->availableGeometry();
|
||||
auto width = availableGeometry.width() / 6;
|
||||
auto height = availableGeometry.height() / 4;
|
||||
|
||||
setGeometry(availableGeometry.x() + 200, availableGeometry.y() + 200, width, height);
|
||||
|
||||
QLabel *label = new QLabel(QStringLiteral("Test"), this);
|
||||
label->setGeometry(40, 40, 60, 60);
|
||||
label->setAcceptDrops(true);
|
||||
}
|
||||
|
||||
void dragEnterEvent(QDragEnterEvent *event) override
|
||||
{
|
||||
event->accept();
|
||||
mDndEvents.append("enter ");
|
||||
}
|
||||
|
||||
void dragMoveEvent(QDragMoveEvent *event) override
|
||||
{
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
|
||||
void dragLeaveEvent(QDragLeaveEvent *) override
|
||||
{
|
||||
mDndEvents.append("leave ");
|
||||
}
|
||||
|
||||
void dropEvent(QDropEvent *event) override
|
||||
{
|
||||
event->accept();
|
||||
mDndEvents.append("drop ");
|
||||
}
|
||||
|
||||
QString mDndEvents;
|
||||
};
|
||||
|
||||
void tst_QWidget_window::tst_dnd_propagation()
|
||||
{
|
||||
QMimeData mimeData;
|
||||
mimeData.setText(QLatin1String("testmimetext"));
|
||||
|
||||
DropTarget target;
|
||||
target.show();
|
||||
QVERIFY(QTest::qWaitForWindowActive(&target));
|
||||
|
||||
Qt::DropActions supportedActions = Qt::DropAction::CopyAction;
|
||||
QWindow *window = target.windowHandle();
|
||||
|
||||
auto posInsideDropTarget = QHighDpi::toNativePixels(QPoint(20, 20), window->screen());
|
||||
auto posInsideLabel = QHighDpi::toNativePixels(QPoint(60, 60), window->screen());
|
||||
|
||||
// Enter DropTarget.
|
||||
QWindowSystemInterface::handleDrag(window, &mimeData, posInsideDropTarget, supportedActions, 0, 0);
|
||||
// Enter QLabel. This will propagate because default QLabel does
|
||||
// not accept the drop event in dragEnterEvent().
|
||||
QWindowSystemInterface::handleDrag(window, &mimeData, posInsideLabel, supportedActions, 0, 0);
|
||||
// Drop on QLabel. DropTarget will get dropEvent(), because it accepted the event.
|
||||
QWindowSystemInterface::handleDrop(window, &mimeData, posInsideLabel, supportedActions, 0, 0);
|
||||
|
||||
QGuiApplication::processEvents();
|
||||
|
||||
QCOMPARE(target.mDndEvents, "enter leave enter drop ");
|
||||
}
|
||||
#endif
|
||||
|
||||
void tst_QWidget_window::tst_qtbug35600()
|
||||
|
Loading…
x
Reference in New Issue
Block a user