<table><tr><td style="">poboiko created this revision.<br />poboiko added a reviewer: dvratil.<br />poboiko requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D29045">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Removed custom code inside <tt style="background: #ebebeb; font-size: 13px;">KJotsWidget::print</tt>, which did the pagination and painting:<br />
<tt style="background: #ebebeb; font-size: 13px;">QTextDocument::print()</tt> is quite capable of it on its own.<br />
Make Qt also responsible for margins, document placement, etc.</p>

<p>Make <tt style="background: #ebebeb; font-size: 13px;">QPrintPreviewDialog</tt> actually work: it requires to connect to <tt style="background: #ebebeb; font-size: 13px;">paintRequested</tt> signal.<br />
For this purpose, made <tt style="background: #ebebeb; font-size: 13px;">KJotsWidget::print</tt> a slot.</p>

<p>Unify <tt style="background: #ebebeb; font-size: 13px;">QPrinter</tt> creation code, add a <tt style="background: #ebebeb; font-size: 13px;">setupPrinter</tt> method for this purpose.<br />
Note: <tt style="background: #ebebeb; font-size: 13px;">HighResolution</tt> property was removed, as it results in weird-looking bold fonts.</p></div></div><br /><div><strong>TEST PLAN</strong><div><ol class="remarkup-list">
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">Print Preview</tt> works again</li>
<li class="remarkup-list-item">Try to select some text and press <tt style="background: #ebebeb; font-size: 13px;">Print Preview</tt> -> it previews selection only</li>
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">Print</tt> also works (tried only virtual PDF printer though)</li>
</ol></div></div><br /><div><strong>BRANCH</strong><div><div>printing (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D29045">https://phabricator.kde.org/D29045</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/kjotswidget.cpp<br />
src/kjotswidget.h</div></div></div><br /><div><strong>To: </strong>poboiko, dvratil<br /><strong>Cc: </strong>kde-pim<br /></div>