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

QFileDialog: unable to completely ignore default QIconProvider

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.3.2
    • Widgets: Itemviews
    • None
    • Windows 7, x64

    Description

      One of our clients have broken 3rd party software installed, which fails (crashes) when tries to provide filesystem icons when queried by SHGetFileInfo(). Large icons are OK, while small icons requested by Qt apps ends with crash in this 3rd-party DLL.

      Replacing the problematic software is not an option in our case, so we tried to do not use system-provided icons at al. In most cases it is easy (just provide own QFileIconProvider to all filesystem models), but with one exclusion, the QFIleDialog:

      1) If we use QFileDialog::setIconProvider before
      QFileDialog::setOptions(QFileDialog::ShowDirsOnly | QFileDialog::DontUseCustomDirectoryIcons | QFileDialog::DontUseNativeDialog)
      Our icon provider is silently ignored.

      2) If we call setOptions first, this results in QFileDialogPrivate::createWidgets(), which calls QTreeView::setModel(), which calls model's sort() call, which, in turn, populates QFileSystemModel 1'st level nodes and fetches default system-provided icons, which results in crash.

      The thing we need is to setIconProvider() works before setOptions()

      Attachments

        Issue Links

          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
              alextutubalin Alex Tutubalin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes