diff --git a/src/YUVviewer.cpp b/src/YUVviewer.cpp index f5c8599..7431531 100644 --- a/src/YUVviewer.cpp +++ b/src/YUVviewer.cpp @@ -66,14 +66,15 @@ YUVviewer::YUVviewer(QWidget *parent) : QRect size = this->geometry(); this->move((screen.width() - size.width()) / 2, (screen.height() - size.height()) / 2); + ui->frameSizeType_ComboBox->setStyleSheet("combobox-popup: 0;"); + ui->YUVFormat_ComboBox->setStyleSheet("combobox-popup: 0;"); + ui->frameRate_ComboBox->setStyleSheet("combobox-popup: 0;"); + QList>::const_iterator config_it = frameSizeTypeDict.begin(); while (config_it != frameSizeTypeDict.end()) { ui->frameSizeType_ComboBox->insertItem(ui->frameSizeType_ComboBox->count(),config_it->first); config_it++; } - ui->frameSizeType_ComboBox->setStyleSheet("combobox-popup: 0;"); - ui->YUVFormat_ComboBox->setStyleSheet("combobox-popup: 0;"); - ui->frameRate_ComboBox->setStyleSheet("combobox-popup: 0;"); YUVviewerConfigFile = new ConfigFile(QCoreApplication::applicationDirPath()+"/YUVViewer.ini"); if(YUVviewerConfigFile->config_dict.frameSizeType == "Other") @@ -519,9 +520,14 @@ void YUVviewer::closeEvent(QCloseEvent *event) int main(int argc, char *argv[]) { - QApplication a(argc, argv); - YUVviewer w; - w.show(); - - return a.exec(); + QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QApplication application(argc, argv); + QFont font = application.font(); + font.setFamily(font.defaultFamily()); + font.setPixelSize(13); + application.setFont(font); + YUVviewer window; + window.show(); + + return application.exec(); } diff --git a/src/YUVviewer.py b/src/YUVviewer.py index c0a12ff..d6cbbf4 100644 --- a/src/YUVviewer.py +++ b/src/YUVviewer.py @@ -331,7 +331,12 @@ def exit(self): self.close() if __name__ == '__main__': - app = QtWidgets.QApplication(sys.argv) - show = YUVviewer() - show.show() - sys.exit(app.exec_()) + QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling); + application = QtWidgets.QApplication(sys.argv) + font = application.font() + font.setFamily(font.defaultFamily()) + font.setPixelSize(13) + application.setFont(font) + window = YUVviewer() + window.show() + sys.exit(application.exec_())