Source

Target

Commits (5)
Showing with 20 additions and 7 deletions
......@@ -305,8 +305,10 @@ configure.
#endif
/* Define to 1 if you have the <sys/timeb.h> header file. */
#ifndef _CL_HAVE_SYS_TIMEB_H
#define _CL_HAVE_SYS_TIMEB_H 1
#if !defined(__OpenBSD__)
# ifndef _CL_HAVE_SYS_TIMEB_H
# define _CL_HAVE_SYS_TIMEB_H 1
# endif
#endif
/* Define to 1 if you have the <sys/types.h> header file. */
......
......@@ -53,7 +53,7 @@ static QWidget *decorationFromWidget(QWidget *w)
QLabel *label = new QLabel(0, Qt::ToolTip);
QPixmap pm = w->grab(QRect(0, 0, -1, -1));
label->setPixmap(pm);
label->resize(pm.size());
label->resize((QSizeF(pm.size()) / pm.devicePixelRatio()).toSize());
return label;
}
......
......@@ -137,6 +137,7 @@ QDesignerMimeData::QDesignerMimeData(const QDesignerDnDItems &items, QDrag *drag
const QPixmap widgetPixmap = deco->grab(QRect(0, 0, -1, -1));
#ifdef TRANSPARENT_DRAG_PIXMAP
QImage image(widgetPixmap.size(), QImage::Format_ARGB32);
image.setDevicePixelRatio(widgetPixmap.devicePixelRatio());
image.fill(QColor(Qt::transparent).rgba());
QPainter painter(&image);
painter.drawPixmap(QPoint(0, 0), widgetPixmap);
......@@ -153,13 +154,17 @@ QDesignerMimeData::QDesignerMimeData(const QDesignerDnDItems &items, QDrag *drag
const QDesignerDnDItems::const_iterator cend = m_items.constEnd();
QDesignerDnDItems::const_iterator it =m_items.constBegin();
QRect unitedGeometry = (*it)->decoration()->geometry();
const qreal devicePixelRatio = (*it)->decoration()->devicePixelRatioF();
for (++it; it != cend; ++it )
unitedGeometry = unitedGeometry .united((*it)->decoration()->geometry());
// paint with offset. At the same time, create a mask bitmap, containing widget rectangles.
QImage image(unitedGeometry.size(), QImage::Format_ARGB32);
const QSize imageSize = (QSizeF(unitedGeometry.size()) * devicePixelRatio).toSize();
QImage image(imageSize, QImage::Format_ARGB32);
image.setDevicePixelRatio(devicePixelRatio);
image.fill(QColor(Qt::transparent).rgba());
QBitmap mask(unitedGeometry.size());
QBitmap mask(imageSize);
mask.setDevicePixelRatio(devicePixelRatio);
mask.clear();
// paint with offset, determine action
QPainter painter(&image);
......@@ -170,7 +175,7 @@ QDesignerMimeData::QDesignerMimeData(const QDesignerDnDItems &items, QDrag *drag
const QPixmap wp = w->grab(QRect(0, 0, -1, -1));
const QPoint pos = w->pos() - decorationTopLeft;
painter.drawPixmap(pos, wp);
maskPainter.fillRect(QRect(pos, wp.size()), Qt::color1);
maskPainter.fillRect(QRect(pos, w->size()), Qt::color1);
}
painter.end();
maskPainter.end();
......
......@@ -176,8 +176,9 @@ OtoolInfo findDependencyInfo(const QString &binaryPath)
otool.start("otool", QStringList() << "-L" << binaryPath);
otool.waitForFinished();
if (otool.exitCode() != 0) {
if (otool.exitStatus() != QProcess::NormalExit || otool.exitCode() != 0) {
LogError() << otool.readAllStandardError();
return info;
}
static const QRegularExpression regexp(QStringLiteral(
......@@ -186,6 +187,11 @@ OtoolInfo findDependencyInfo(const QString &binaryPath)
QString output = otool.readAllStandardOutput();
QStringList outputLines = output.split("\n", QString::SkipEmptyParts);
if (outputLines.size() < 2) {
LogError() << "Could not parse otool output:" << output;
return info;
}
outputLines.removeFirst(); // remove line containing the binary path
if (binaryPath.contains(".framework/") || binaryPath.endsWith(".dylib")) {
const auto match = regexp.match(outputLines.first());
......