2020-06-30 04:36 PM
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.
2020-07-05 01:05 PM
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);
}