cancel
Showing results for 
Search instead for 
Did you mean: 

Different font size between Ubuntu PC and STM32MP157C-DK2

CDias.1
Associate

I made a simple widget example with label but the font size in STM32MP157C-DK2 is biggest than Ubuntu PC. How can I fix this?

Thank you for any help.

1 REPLY 1
CDias.1
Associate

I found one way to fix it but I don't know if is the best.

Does anyone knows how to config the pixel size on Qt?

Thank you for any help!

Follow the solution I used:

#define ADJUST_PIXEL_SIZE_FOR_STM32MP1 1.4
 
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
 
    QFont font;
 
    font = ui->label->font();
    font.setPixelSize(font.pointSize() * ADJUST_PIXEL_SIZE_FOR_STM32MP1);
    ui->label->setFont(font);
 
    font = ui->label_2->font();
    font.setPixelSize(font.pointSize() * ADJUST_PIXEL_SIZE_FOR_STM32MP1);
    ui->label_2->setFont(font);
 
    font = ui->pushButton->font();
    font.setPixelSize(font.pointSize() * ADJUST_PIXEL_SIZE_FOR_STM32MP1);
    ui->pushButton->setFont(font);
}

0693W000001sAV1QAM.jpg0693W000001sAUwQAM.png