[Development] MSVC not inlining QRect inline functions (anymore?)

Thiago Macieira thiago.macieira at intel.com
Mon Jun 8 00:02:57 CEST 2026


On Sunday, 7 June 2026 08:48:33 Pacific Daylight Time Christian Ehrlicher via 
Development wrote:
> I recently found out that none of the QRect inline functions are inlined
> by msvc no matter what compiler options I pass. Tested with recent cl
> (19.51.36244) but also saw this with older msvc2022 compilers.
> Is this known and should/can we do something against this?

Get a better compiler.

MSVC is well-known for *not* inlining functions that are dllimported, if they 
are anything except the most trivial.

In Qt 7, a solution is to remove the import/export macro, inline the currently 
mostly trivial .cpp content, and only import the complex functions. Or rewrite 
it to QRect2, with the behavioural fixes in KWin's KRect (see the kde-devel 
mailing list, where I asked them to submit to Qt for consideration, but they 
haven't).

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCG - Platform & Sys. Eng.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5176 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20260607/15bdf9f3/attachment.bin>


More information about the Development mailing list