Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-89722

QTextBlockFormat: vertical alignment doesn't work

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15.1
    • GUI: Text handling
    • None
    • Windows

    Description

       

      QTextFrameFormat frameFormat;
       frameFormat.setHeight(400);
       frameFormat.setBorder(2.0);
       frameFormat.setBorderBrush(Qt::black);
      QTextFrame* frame = cursor.insertFrame(frameFormat);
      QTextBlockFormat blockFormat;
       blockFormat.setAlignment(Qt::AlignCenter); // doesn't work
       cursor.setBlockFormat(blockFormat);
      QTextCharFormat charFormat;
       charFormat.setFontPointSize(30);
       cursor.insertText("text", charFormat);
      

      The text alignment inside the block doesn't seem to work correctly. The text is centered horizontally, but remains on the top of the block instead of vertical center

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            prostoden prostoden
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes