I'm trying to understand why some icons are displayed correctly and some other not on a HiDPI display

Qt 5.15.2
KDE Plasma 5.23.90
2880 x 1800 display

Qt Code:
  1. #include "mainwindow.hpp"
  2. #include <QApplication>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. QApplication a(argc, argv);
  7. MainWindow w;
  8. w.setWindowTitle("HiDPI test");
  9. w.show();
  10. return a.exec();
  11. }
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. #ifndef MAINWINDOW_HPP
  2. #define MAINWINDOW_HPP
  3.  
  4. #include <QFileDialog>
  5. #include <QMainWindow>
  6. #include <QStandardPaths>
  7. #include <QStatusBar>
  8. #include <QToolBar>
  9. #include <QVBoxLayout>
  10.  
  11. class MainWindow : public QMainWindow
  12. {
  13. Q_OBJECT
  14.  
  15. public:
  16. MainWindow(QWidget *parent = nullptr);
  17.  
  18. private Q_SLOTS:
  19. void settings();
  20.  
  21. private:
  22. QToolBar *tool_bar_;
  23. QAction *add_media_;
  24. QAction *remove_media_;
  25. QAction *get_info_;
  26. QAction *download_medias_;
  27. QAction *settings_action_;
  28. QStatusBar *status_bar_;
  29. };
  30.  
  31. #endif
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. #include "mainwindow.hpp"
  2.  
  3. MainWindow::MainWindow(QWidget *parent)
  4. : QMainWindow(parent)
  5. {
  6. QWidget *central_widget = new QWidget(this);
  7. QVBoxLayout *layout = new QVBoxLayout;
  8. central_widget->setLayout(layout);
  9. setCentralWidget((central_widget));
  10.  
  11. status_bar_ = new QStatusBar;
  12. tool_bar_ = new QToolBar;
  13. add_media_ = new QAction(QIcon::fromTheme("list-add"), "Add", this);
  14. remove_media_ = new QAction(QIcon::fromTheme("list-remove"), "Remove", this);
  15. get_info_ = new QAction(QIcon::fromTheme("documentinfo"), "Information", this);
  16. download_medias_ = new QAction(QIcon::fromTheme("download"), "Download", this);
  17. settings_action_ = new QAction(QIcon::fromTheme("settings-configure"), "Settings", this);
  18. connect(settings_action_, &QAction::triggered, this, &MainWindow::settings);
  19.  
  20. tool_bar_->addAction(add_media_);
  21. tool_bar_->addAction(remove_media_);
  22. tool_bar_->addSeparator();
  23. tool_bar_->addAction(get_info_);
  24. tool_bar_->addSeparator();
  25. tool_bar_->addAction(download_medias_);
  26. tool_bar_->addSeparator();
  27. tool_bar_->addAction(settings_action_);
  28.  
  29. layout->addWidget(tool_bar_);
  30. layout->addWidget(status_bar_);
  31. }
  32.  
  33. void MainWindow::settings()
  34. {
  35. QFileDialog *file_dialog(new QFileDialog);
  36. file_dialog->setFileMode(QFileDialog::DirectoryOnly);
  37. QStringList download_location(QStandardPaths::standardLocations(QStandardPaths::DownloadLocation));
  38. file_dialog->exec();
  39. }
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. cmake_minimum_required(VERSION 3.5)
  2. project(hidpi_test)
  3. add_compile_options(-Wall -Wextra)
  4. set(CMAKE_CXX_STANDARD 14)
  5. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  6.  
  7. ## Find Qt5
  8. set(CMAKE_AUTOMOC ON)
  9. find_package(Qt5Widgets REQUIRED)
  10.  
  11. add_executable(
  12. ${PROJECT_NAME}
  13. mainwindow.hpp
  14. mainwindow.cpp
  15. main.cpp
  16. )
  17. target_link_libraries(
  18. ${PROJECT_NAME}
  19. Qt5::Widgets
  20. )
To copy to clipboard, switch view to plain text mode 

The + (list-add) and - (list-remove) icons are perfect but the others are pixelated. When opening a QFileDialog the buttons icons (New directory, Ok, Cancel) are pixelated too.

Screenshot_20220205_135455.jpgScreenshot_20220205_135322.png

How can I get all the icons right?