In. to mm bug in Print Preview

Continuing the discussion from Margins not responding for layout:

I have looked into this now, & discovered a bug. When setting-up the print in Inches, the margins are still processed in mm! MissMargins As you can see in the picture, what the Page Setup dialog clearly shows as inches, the actual Print Preview (behind it) shows as mm! (& prints accordingly.)

The 0.39in marks are auto-generated from the default 10.00mm, the 5.00in is me proving the issue. This was tested with the 6/2020 appimage in Ubuntu 18, but had been occurring previously as well.

:unicorn:

1 Like

Would you add this as an issue in Github?

2 Likes

After digging through the various QPrinter classes, found the source of this bug… instead of using the current pattern units., RT hardcoded the margins to mm, which become the current printer margin units. Furthermore it appears that if you try to use “pixel” units, they will get converted to mm. Which is not a problem if the pattern units are mm…, but here to it should convert to the current pattern units.

It should also be noted that when I first looked at this issue way back, the posted Page Setup image was throwing me off… the Windows version I see does not include the units drop down like previously attached image.

setup

Oh… and if I recall, the margins are hardcoded to 10mm somewhere, again instead of saving the last used margins (and units) in the prefs. I’m assuming that if printing another pattern, and it’s units differ from the margin units previously saved, then they need to be converted, and saved back to the prefs.

At any rate I should have this fixed soon.

2 Likes

No wonder!!! OK that explains a lot.

1 Like

As usual may take more effort to unravel this one… there’s this whole interaction between QPrinter, QPrinterInfo, QPrinterLayout, QPrinterPreview, QPrinterDialog and the margins going on.

1 Like