<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <tt>Thanks for the response, Tony.<br>
      <br>
      I added an explicit setting of the page size:<br>
    </tt>
    <blockquote><tt>...</tt><br>
      <tt>QTextDocument td;</tt><br>
      <tt>QSizeF size(2000, 2000);</tt><br>
      <tt>td.setPageSize(size);</tt><br>
      <tt>td.drawContents(&painter);</tt><br>
      <tt>...</tt><br>
    </blockquote>
    <tt>Unfortunately, I still get the same clipping region as before.<br>
      <br>
    </tt><br>
    <div class="moz-cite-prefix">On 1/23/2019 8:49 PM, Tony Rietwyk
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:8afc4740-03c0-f7c9-b44a-25738cf505a0@rightsoft.com.au">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <p>Hi Bob, <br>
      </p>
      <p>I think you'll need to increase the size of the document -
        maybe the paintContext is being clipped to the document size? <br>
      </p>
      <p>Hope that helps, <br>
      </p>
      <p>Tony</p>
      <p><br>
      </p>
      <div class="moz-cite-prefix">On 24/01/2019 2:18 pm, Bob Hood
        wrote:<br>
      </div>
      <blockquote type="cite"
        cite="mid:9f10c5f4-fe44-5fe1-0ceb-ff0f3d03f9c9@comcast.net">
        <meta http-equiv="content-type" content="text/html;
          charset=UTF-8">
        <tt>I'm trying to render rotated rich text, and it just keeps
          clipping on me.  I can't seem to find the magic combination
          that will expand the clipping region.<br>
          <br>
          The simplest paintEvent():<br>
        </tt>
        <blockquote><tt>void VerticalLabel::paintEvent(QPaintEvent*)</tt><br>
          <tt>{</tt><br>
          <tt>    QPainter painter(this);</tt><br>
          <br>
          <tt>    painter.rotate(-20);</tt><br>
          <br>
          <tt>    QTextDocument td;</tt><br>
          <tt>    td.setHtml(text());</tt><br>
          <tt>    td.drawContents(&painter);</tt><br>
          <tt>}</tt><br>
        </blockquote>
        <tt>Slightly more involved paintEvent():<br>
        </tt>
        <blockquote><tt>void VerticalLabel::paintEvent(QPaintEvent*)</tt><br>
          <tt>{</tt><br>
          <tt>    QPainter painter(this);</tt><br>
          <br>
          <tt>    painter.rotate(-20);</tt><br>
          <br>
          <tt>    QTextDocument td;</tt><br>
          <tt>    td.setHtml(text());</tt><br>
          <tt>    QAbstractTextDocumentLayout::PaintContext ctx;</tt><br>
          <tt>    ctx.clip = QRectF(0, 0, 100, 400);</tt><br>
          <tt>    td.documentLayout()->draw(&painter, ctx);</tt><br>
          <tt>}</tt><br>
        </blockquote>
        <tt>In both cases, I'm going from this without the rotation:<br>
          <br>
          <img moz-do-not-send="false"
            src="cid:part1.B41E07E5.332DBDCF@comcast.net" alt=""
            class="" width="663" height="77"><br>
          <br>
          to this with it:<br>
          <br>
          <img moz-do-not-send="false"
            src="cid:part2.C6BE122A.7BE6B7B7@comcast.net" alt=""
            class="" width="623" height="78"><br>
          <br>
          <br>
          Question:  How do I alter this clipping so the text is visible
          when it is vertical?  Setting the PaintContext.clip doesn't
          appear to have any impact no matter what values I put in it,
          and Google doesn't have any answers, as far as I could find.<br>
          <br>
        </tt> <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <pre class="moz-quote-pre" wrap="">_______________________________________________
Interest mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Interest@qt-project.org" moz-do-not-send="true">Interest@qt-project.org</a>
<a class="moz-txt-link-freetext" href="https://lists.qt-project.org/listinfo/interest" moz-do-not-send="true">https://lists.qt-project.org/listinfo/interest</a>
</pre>
      </blockquote>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Interest mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Interest@qt-project.org">Interest@qt-project.org</a>
<a class="moz-txt-link-freetext" href="https://lists.qt-project.org/listinfo/interest">https://lists.qt-project.org/listinfo/interest</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>