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

It should be better documented that the file dialog opened on Linux is not necessarily native if the static functions are called

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • None
    • 4.8.5, 5.2.0
    • Documentation
    • None
    • 45f264b682e0b2ad7a162bd75b702837fe04c06a

    Description

      There seems to be implementation for the file dialog style for Linux in the qgtkstyle.cpp (for both Qt 4.8 and Qt 5), but even when testing with the 'standarddialogs' example and running it with the gtk style:
      ./standarddialogs -style gtk

      the dialog shown is not purely native looking on Ubuntu 12.04 (Unity desktop).

      From QFileDialog::getOpenFileName() (Qt 4.8) e.g.:
      "On Windows, and Mac OS X, this static function will use the native file dialog and not a QFileDialog."

      Qt 5.2 documentation states:
      "The easiest way to create a QFileDialog is to use the static functions. On Windows, Mac OS X, KDE and GNOME, these static functions will call the native file dialog when possible.

      fileName = QFileDialog::getOpenFileName(this,
      tr("Open Image"), "/home/jana", tr("Image Files (*.png *.jpg *.bmp)"));"

      If it really shows the native dialog in some occasions, could the "when possible" be elaborated a bit more thoroughly?

      Note! It is not very clearly stated in the QFileDialog documentation as a whole that you need to use the static functions e.g. getOpenFileName() show the native file dialog. And the non-static ones shows Qt's QFileDialog widget. Is it possible to rephrase this sentence to make it more clear: "The easiest way to create a QFileDialog is to use the static functions. On Windows, Mac OS X, KDE and GNOME, these static functions will call the native file dialog when possible."

      Attachments

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

        Activity

          People

            srutledg Shawn Rutledge
            qtcomsupport Qt Support
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes