Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-131352

XDG portal QFileDialog is shown multiple times when calling show() after hide()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.3, 6.7.3, 6.8.0
    • None
    • openSUSE Tumbleweed with Plasma 6 Wayland
    • Linux/Wayland

    Description

      After calling hide() and then show() on QFileDialog backed by XDG desktop portal, two file chooser windows can be seen,

      Here is sample code:

      #include <QApplication>
      #include <QFileDialog>
      #include <QTimer>
      
      using namespace std::chrono_literals;
      
      int main(int argc, char *argv[]) {
        qputenv("QT_QPA_PLATFORMTHEME", "xdgdesktopportal");
      
        QApplication a(argc, argv);
      
        QTimer::singleShot(0, [] {
          auto *dialog = new QFileDialog();
          dialog->setAttribute(Qt::WA_DeleteOnClose);
          dialog->setFileMode(QFileDialog::ExistingFile);
          dialog->show();
      
          QTimer::singleShot(1s, dialog, [=] {
            dialog->hide();
      
            QTimer::singleShot(1s, dialog, [=] { dialog->show(); });
          });
        });
      
        return a.exec();
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            equeim Alexey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes