<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[PrintPreviewDialog issue on 4K monitor]]></title><description><![CDATA[<p dir="auto">Hello!</p>
<p dir="auto">I have added the print preview feature to my program. The problem is, it displays the preview document not well on the screen resolutions above the <code>1920x1080</code>.</p>
<p dir="auto"><strong>Example:</strong><br />
<img src="https://ddgobkiprc33d.cloudfront.net/c94545eb-01ba-4f70-8c76-dfc72b79ad87.png" alt="2021-02-14_235401.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><strong>Code:</strong></p>
<pre><code>QFont docFont;
docFont.setPointSize(14);
QTextDocument *textDoc = new QTextDocument(this);
textDoc-&gt;setDefaultFont(docFont);
textDoc-&gt;setPlainText(getHardwareData());
</code></pre>
<p dir="auto">Is there any hint/font to make it look well on all screens resolutions on <code>Windows</code>? Thank you.</p>
]]></description><link>https://forum.qt.io/topic/123806/printpreviewdialog-issue-on-4k-monitor</link><generator>RSS for Node</generator><lastBuildDate>Thu, 19 Nov 2026 05:02:42 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/123806.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 14 Feb 2021 22:01:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to PrintPreviewDialog issue on 4K monitor on Sun, 28 Feb 2021 15:31:04 GMT]]></title><description><![CDATA[<p dir="auto">I have found some hack to get the toolbar actions from a print preview dialog. By adding some additional logic it fixed the issue.</p>
<pre><code>    QList&lt;QToolBar*&gt; toolbarList = printPreviewDlg-&gt;findChildren&lt;QToolBar*&gt;();

    if (!toolbarList.isEmpty()) {
        if (screenSize.width() &gt; 1920 &amp;&amp; screenSize.height() &gt; 1080) {
            toolbarList.first()-&gt;actions().at(0)-&gt;activate(QAction::Trigger);
        } else {
            toolbarList.first()-&gt;actions().at(1)-&gt;activate(QAction::Trigger);
        }
    }
</code></pre>
<p dir="auto">To detect the screen size I use the native <code>Win API</code> methods. Now, it automatically triggers the <code>Fit to width</code> toolbar option and sets a better preview on <code>4K</code> monitor. It works depending on the screen size. The issue is resolved.</p>
]]></description><link>https://forum.qt.io/post/646867</link><guid isPermaLink="true">https://forum.qt.io/post/646867</guid><dc:creator><![CDATA[Cobra91151]]></dc:creator><pubDate>Sun, 28 Feb 2021 15:31:04 GMT</pubDate></item><item><title><![CDATA[Reply to PrintPreviewDialog issue on 4K monitor on Fri, 19 Feb 2021 13:15:31 GMT]]></title><description><![CDATA[<p dir="auto">I have fixed the <code>QWindowsMultiFontEngine::loadEngine: CreateFontFromLOGFONT failed for "Courier"</code> issue. The problem was caused by a Unicode character in Peripheral data. Now, the only thing left is to make it look better on <code>4K</code>.</p>
]]></description><link>https://forum.qt.io/post/645417</link><guid isPermaLink="true">https://forum.qt.io/post/645417</guid><dc:creator><![CDATA[Cobra91151]]></dc:creator><pubDate>Fri, 19 Feb 2021 13:15:31 GMT</pubDate></item><item><title><![CDATA[Reply to PrintPreviewDialog issue on 4K monitor on Thu, 18 Feb 2021 12:17:53 GMT]]></title><description><![CDATA[<p dir="auto">During a debugging process I have found the following issues:</p>
<pre><code>QWindowsMultiFontEngine::loadEngine: CreateFontFromLOGFONT failed for "Courier": error 0x88985002 : Indicates the specified font does not exist.
QWindowsMultiFontEngine::loadEngine: CreateFontFromLOGFONT failed for "Courier": error 0x88985002 : Indicates the specified font does not exist.
</code></pre>
]]></description><link>https://forum.qt.io/post/645208</link><guid isPermaLink="true">https://forum.qt.io/post/645208</guid><dc:creator><![CDATA[Cobra91151]]></dc:creator><pubDate>Thu, 18 Feb 2021 12:17:53 GMT</pubDate></item></channel></rss>