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

inappropriate warnig "Empty filename passed to function" from QFileDialog

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.10.1
    • Fix Version/s: 5.15.1
    • Labels:
      None
    • Commits:
      99aefbb4c00ce2ad01bea186a297a3407b1da973 (qt/qtbase/dev) e84cdec53839f883343b2b7e6d8472376d4d4a82 (qt/tqtc-qtbase/5.15)

      Description

      This code, under Linux, compiled with clang++4.0,

      QDir dir(QDir::homePath());
          QFileDialog dlg(parent, caption, dir, filter);
          dlg.setAcceptMode(QFileDialog::AcceptOpen);
          dlg.setReadOnly(true);
          dlg.setProxyModel(new OpenFileProxyModel);
          dlg.setFileMode(plural ? QFileDialog::ExistingFiles : QFileDialog::ExistingFile);
          if (!dlg.exec())
              return {};
          return dlg.getFiles();

      gives me a correct dialog with a left side pane that contains two entries,

      • Computer,
      • <my home dir>,

      the latter being chosen by default. If I left-click on "Computer", a warning box pops up and says "Empty filename passed to function".

      If I run the application under gdb and terminate by ^C when the warning appears, then I get this long backtrace:

      .... [messaging trivia]
      #10 0x00007ffff63f8094 in QMessageLogger::warning(char const*, ...) const () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
      #11 0x00007ffff6581e59 in () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
      #12 0x00007ffff64f8a5a in QDir::exists() const () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
      #13 0x00007ffff754c7bd in QFileDialogPrivate::_q_pathChanged(QString const&) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #14 0x00007ffff755218d in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #15 0x00007ffff6625195 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
      #16 0x00007ffff7559492 in QFileSystemModel::rootPathChanged(QString const&) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #17 0x00007ffff755d268 in QFileSystemModel::setRootPath(QString const&) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #18 0x00007ffff7543a55 in QFileDialog::setDirectory(QString const&) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #19 0x00007ffff7546e12 in QFileDialogPrivate::_q_enterDirectory(QModelIndex const&) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #20 0x00007ffff7546fd3 in QFileDialogPrivate::_q_goToUrl(QUrl const&) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #21 0x00007ffff755233d in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #22 0x00007ffff6625195 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
      #23 0x00007ffff75562d1 in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #24 0x00007ffff7557249 in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #25 0x00007ffff6625195 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
      #26 0x00007ffff65a081a in QItemSelectionModel::currentChanged(QModelIndex const&, QModelIndex const&) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
      #27 0x00007ffff65a0b0e in QItemSelectionModel::setCurrentIndex(QModelIndex const&, QFlags<QItemSelectionModel::SelectionFlag>) ()
      at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
      #28 0x00007ffff75a341c in QAbstractItemView::mousePressEvent(QMouseEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #29 0x00007ffff7391ccf in QWidget::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #30 0x00007ffff74323de in QFrame::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #31 0x00007ffff75a851b in QAbstractItemView::viewportEvent(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #32 0x00007ffff65f561c in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
      #33 0x00007ffff73526a5 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #34 0x00007ffff735a3df in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #35 0x00007ffff65f5938 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
      #36 0x00007ffff73593b2 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
      at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #37 0x00007ffff73ac4d3 in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #38 0x00007ffff73aeb09 in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #39 0x00007ffff73526cc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #40 0x00007ffff7359e84 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #41 0x00007ffff65f5938 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
      #42 0x00007ffff6b61603 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) ()
      at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
      #43 0x00007ffff6b630d5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) ()
      at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
      #44 0x00007ffff6b3b03b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
      at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
      #45 0x00007fffefbe720b in () at /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
      #46 0x00007ffff65f3b6a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
      #47 0x00007ffff753f8b7 in QDialog::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
      #48 0x00000000005361e2 in file_dialog::queryImportFileNames(QWidget*, QString const&, QDir&, QString const&, bool) (parent=<optimized out>, caption=..., dir=..., filter=..., plural=<error reading variable: access outside bounds of object referenced via synthetic pointer>)
      at /G/Steca/gui/dialogs/file_dialog.cpp:142
      .... [my app trivia]

        Attachments

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

          Activity

            People

            Assignee:
            vhilshei Volker Hilsheimer
            Reporter:
            jwu Joachim Wuttke
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes