Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Native QFileDialog in OSX with multi filters not updated

Native QFileDialog in OSX with multi filters not updated

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mpergand
    wrote on last edited by
    #1

    Hi all,

    The file list is not updated when a filter is selected via the popup menu, so the selectable items stay grayed, and the very weird thing is that dispite there are grayed there are selectable !
    Very disturbing user experience ...

    You can see this behavior in QtCreator itself with " Open File With" in the File menu.
    Any workaround to force the items list to redraw ?

    I'm on OSX 10.9, Qt 5.6

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mpergand
      wrote on last edited by
      #5

      After further investigations, it turns out it's a bug of Mavericks itself !
      NSOpenPanel bug
      My bad, sorry.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        Can you provide a minimal compilable example that reproduces that behavior ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        M 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Can you provide a minimal compilable example that reproduces that behavior ?

          M Offline
          M Offline
          mpergand
          wrote on last edited by
          #3

          @SGaist said in Native QFileDialog in OSX with multi filters not updated:

          Hi,

          Can you provide a minimal compilable example that reproduces that behavior ?

          Very simple:

          #include <QApplication>
          #include <QFileDialog>
          #include <QString>
          
          int main(int argc, char *argv[])
          {
              QApplication app(argc, argv);
              const QString filters = "*.png;;*.jpg";
              QString filepath=QFileDialog::getOpenFileName(0, 0, 0, filters);
          
              return 0;
          }
          

          I'm using OSX 10.9 Mavericks, Qt 5.6.1 and 5.7.1
          This bug exists in all Qt apps, for example VirtualBox.
          In QtCreator main menu, select File->Open File With
          and change the type of file with the popup menu button, the file list is not updated.
          This bug doesn't occur on Ubuntu.

          1 Reply Last reply
          0
          • R Offline
            R Offline
            Rondog
            wrote on last edited by Rondog
            #4

            I tried this on my system and it worked. Qt 5.6.0 OSX 10.10.5. I did have Mavericks on my laptop a few years ago and don't notice any problem. I don't have 5.6.1 or 5.7.1 so I can't test this.

            I noticed a difference between your filters and ones I use (placement of the semi-colons). This is an example of a filter that I just tested with. When I change the selection of the filter it does update the file list (black for items that match the filter, grey for items that don't match the selected filter):

            QString LCompFiles::LoadFileFilters(void) const
            {
            	QString				file_filters;
            	
            	file_filters = QStringLiteral("All Compensation Maps (*.bin *.res *.dat *.cmp *.asc *.enc *.prg *.cfg *.smp *.asc Y* *.map "\
            						"*.vo2 *.txt *.gec *.gecs *.3pg *.xdx *.ydy *.zdz *.ecd *.v3d *.nob)");
            	file_filters += QStringLiteral(";;Apogee Maps (*.res)");
            	file_filters += QStringLiteral(";;Automation Software Maps (*.dat)");
            	file_filters += QStringLiteral(";;Brown and Sharpe Maps (*.cmp *.asc *.dat *.enc)");
            	file_filters += QStringLiteral(";;Capps Maps (*.bin *.dat)");
            	file_filters += QStringLiteral(";;Chorus Maps (*.dat)");
            	file_filters += QStringLiteral(";;CMM Manager Maps (*.map *.txt)");
            	file_filters += QStringLiteral(";;DEA Maps (*.dat)");
            	file_filters += QStringLiteral(";;DEVA Maps (*.xdx *.ydy *.zdz *.txt *.nob)");
            	file_filters += QStringLiteral(";;Leitz Maps (*.txt)");
            	file_filters += QStringLiteral(";;LK Maps (*.prg)");
            	file_filters += QStringLiteral(";;Metrolog Maps (*.res)");
            	file_filters += QStringLiteral(";;OpenDMIS Maps (*.ecd)");
            	file_filters += QStringLiteral(";;Renishaw Compensation Maps (*.gec *.gecs *.3pg)");
            	file_filters += QStringLiteral(";;Sheffield Maps (*.cfg *.smp)");
            	file_filters += QStringLiteral(";;Verisurf Compensation Maps (*.v3d)");
            	file_filters += QStringLiteral(";;Virtual DMIS Maps (*.txt)");
            	file_filters += QStringLiteral(";;Wenzel Maps (*.vo2)");
            	file_filters += QStringLiteral(";;Zeiss Maps (*.dat Y*)");
            
            	return file_filters;
            }
            

            I also tried the filters with VirtualBox. It all looks good.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mpergand
              wrote on last edited by
              #5

              After further investigations, it turns out it's a bug of Mavericks itself !
              NSOpenPanel bug
              My bad, sorry.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved