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

QFileDialog restoreState doesn't resize ListView and TreeView correctly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.4.0
    • 4.7.3
    • None
    • Windows and Linux
    • d8b45a360f99149c42863067e3b40c619a892cd2

    Description

      Within the standard QFileDialog there is a splitter which allows you to resize ListView and TreeView. When one of them becomes invisible (resized to 0) it is very difficult to see this has happened.
      This situation is saved to QSettings and also restored. Please look at the attached picture and find the treeView

      I think the QFileDialog restoreState method contains code to prevent one of the widgets to have size 0 at line 448 of QFileDialog.cpp

          QList<int> list = d->qFileDialogUi->splitter->sizes();
          if (list.count() >= 2 && list.at(0) == 0 && list.at(1) == 0) {
              for (int i = 0; i < list.count(); ++i)
                  list[i] = d->qFileDialogUi->splitter->widget(i)->sizeHint().width();
              d->qFileDialogUi->splitter->setSizes(list);
          }
      

      Should be

      if (list.count() >= 2 && (list.at(0) == 0 || list.at(1) == 0) ){
      

      because only one of the 2 widgets in the splitter has size 0 and not both of them

      Attachments

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

        Activity

          People

            peppe Giuseppe D'Angelo
            willem@hdlworks.com Willem Gruter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes