Gui: make QtGui unity buildable on windows

* add consistent declarations for qt_pixelMultiplier / qt_regionToPath
* exclude qwindowsfontdatabasebase.cpp due to duplicate OS2Table

Pick-to: 6.10
Change-Id: Ica7e7143838241f0b7a0d6dca6b65fefbffec6d0
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
Tim Blechmann 2025-07-04 15:21:17 +08:00
parent b6bcec27a6
commit b32b70a8b9
8 changed files with 10 additions and 10 deletions

View File

@ -335,8 +335,8 @@ if(QT_FEATURE_pdf)
)
endif()
if(WIN32 OR (UNIX AND NOT APPLE))
set_target_properties(Gui PROPERTIES UNITY_BUILD OFF) # X11 define clashes/Windows oddities.
if(UNIX AND NOT APPLE)
set_target_properties(Gui PROPERTIES UNITY_BUILD OFF) # X11 define clashes.
endif()
qt_internal_add_resource(Gui "gui_shaders"
@ -491,6 +491,8 @@ qt_internal_extend_target(Gui CONDITION WIN32
dxgi
dxguid
d3d12
NO_UNITY_BUILD_SOURCES
text/windows/qwindowsfontdatabasebase.cpp # duplicate struct OS2Table
ATTRIBUTION_FILE_DIR_PATHS
../3rdparty/D3D12MemoryAllocator
)

View File

@ -37,7 +37,7 @@ Q_GUI_EXPORT qreal qt_pointMultiplier(QPageLayout::Unit unit)
}
// Multiplier for converting pixels to points.
extern qreal qt_pixelMultiplier(int resolution);
Q_GUI_EXPORT extern qreal qt_pixelMultiplier(int resolution);
Q_GUI_EXPORT QMarginsF qt_convertMargins(const QMarginsF &margins, QPageLayout::Unit fromUnits, QPageLayout::Unit toUnits)
{

View File

@ -2588,7 +2588,7 @@ QRegion QPainter::clipRegion() const
return region;
}
extern QPainterPath qt_regionToPath(const QRegion &region);
Q_GUI_EXPORT extern QPainterPath qt_regionToPath(const QRegion &region);
/*!
Returns the current clip path in logical coordinates.

View File

@ -1215,8 +1215,6 @@ void QPdfEngine::setupGraphicsState(QPaintEngine::DirtyFlags flags)
setPen();
}
extern QPainterPath qt_regionToPath(const QRegion &region);
void QPdfEngine::updateClipPath(const QPainterPath &p, Qt::ClipOperation op)
{
Q_D(QPdfEngine);

View File

@ -1325,7 +1325,7 @@ QPolygon QTransform::map(const QPolygon &a) const
\sa QTransform::map()
*/
extern QPainterPath qt_regionToPath(const QRegion &region);
Q_GUI_EXPORT extern QPainterPath qt_regionToPath(const QRegion &region);
/*!
\fn QRegion QTransform::map(const QRegion &region) const

View File

@ -39,7 +39,7 @@ using namespace Qt::StringLiterals;
return retValue; \
}
extern qreal qt_pixelMultiplier(int resolution);
Q_GUI_EXPORT extern qreal qt_pixelMultiplier(int resolution);
extern QMarginsF qt_convertMargins(const QMarginsF &margins, QPageLayout::Unit fromUnits, QPageLayout::Unit toUnits);
QPrinterInfo QPrinterPrivate::findValidPrinter(const QPrinterInfo &printer)

View File

@ -9313,7 +9313,7 @@ QVariant QGraphicsLineItem::extension(const QVariant &variant) const
QPixmap::createHeuristicMask(). The performance and memory consumption
is similar to MaskShape.
*/
extern QPainterPath qt_regionToPath(const QRegion &region);
Q_GUI_EXPORT extern QPainterPath qt_regionToPath(const QRegion &region);
class QGraphicsPixmapItemPrivate : public QGraphicsItemPrivate
{

View File

@ -1115,7 +1115,7 @@ void QGraphicsViewPrivate::freeStyleOptionsArray(QStyleOptionGraphicsItem *array
delete [] array;
}
extern QPainterPath qt_regionToPath(const QRegion &region);
Q_GUI_EXPORT extern QPainterPath qt_regionToPath(const QRegion &region);
/*!
### Adjustments in findItems: mapToScene(QRect) forces us to adjust the