我正在使用QT在Android平台上开发一个应用程序。当我使用应用程序的FileDialog在手机上打开文件时,我发现字体太小,我的手指无法选择文件夹。如何使字体更大?
我尝试了以下代码,但字体大小没有变化。
this->setStyleSheet("QTreeView {font: 40pt \"Arial\";}");
QString dir = QFileDialog::getExistingDirectory(NULL,"","/mnt/sdcard/test/");
我的代码最终更改为此,但字体仍未更改:
void MainWindow::on_pushButton_clicked()
{
QFileDialog *fdiag = new QFileDialog;
fdiag->setStyleSheet("QTreeView {font: 40pt \"Arial\";}"); // QFileDialog
// QString dir = QFileDialog::getExistingDirectory(this,"","/mnt/sdcard/test/",QFileDialog::DontUseNativeDialog);
QString dir = fdiag->getExistingDirectory(this,QString(),"/mnt/sdcard/test/",QFileDialog::DontUseNativeDialog);
model = new QFileSystemModel();
filesPath = dir;
model->setRootPath(dir);