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

Error in QLayout after setFont

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.6.0
    • Widgets: Layout
    • None
    • Android

    Description

       

      Widget::Widget(QWidget *parent)
          : QWidget(parent)
          , ui(new Ui::Widget)
      {
          ui->setupUi(this);
          //Android,create 10 buttons,click any button, change the size of the font.
          auto hb = new QHBoxLayout(this);
          for(auto i=9;i<19;i++){
              auto pb = new QPushButton(QString(u8"%1").arg(i),this);
              hb->addWidget(pb);
              connect(pb,&QPushButton::clicked,[&,i]{
                  qApp->setFont(QFont(qApp->font().family(),i));
                  //setFont(QFont(qApp->font().family(),i));
                  //Both QApplication::setFont and QWidget::setFont will have the exception.
              });
          }
      }

      The UI has 10 buttons, click any button, change the size of the font.

      when setFont is called,the exception occurs in layout.

      Both QApplication::setFont and QWidget::setFont will have the exception.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            298218699 298218699
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes