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

Qt for WebAssembly - QFileDialog doesn't show files in the MEMFS until we type the file name

    XMLWordPrintable

Details

    • WebAssembly
    • 3f86c62a81 (qt/qtbase/dev) 3f86c62a81 (qt/tqtc-qtbase/dev)

    Description

      Attached the Qt project to quickly build/test the bug

      qtproject_formdesigner.zip

      At first thanks for porting Qt to the WebAssembly platform, the ability to run our Qt desktop/mobile applications as web applications without modification is a great addition to the Qt framework.

      I am using the Ring programming language & RingQt to develop my Qt projects

      Ring is a dynamic programming language (similar to Python) that uses Qt as it's standard GUI library and support any platform supported by Qt (including WebAssembly)

      In little time I ported some of our samples/applications to Qt for WebAssembly like

      Hello World : http://ring-lang.sourceforge.net/web/helloworld/project.html

      Matching Game : http://ring-lang.sourceforge.net/web/matching/project.html

      Othello Game : http://ring-lang.sourceforge.net/web/othello/project.html 

      Game of Life : http://ring-lang.sourceforge.net/web/gameoflife/project.html

      Pairs Game : http://ring-lang.sourceforge.net/web/pairs/project.html

      Word Game : http://ring-lang.sourceforge.net/web/wordgame/project.html 

      In the last week I worked on porting some larger application (The Form Designer - Around 10,000 lines of code)

      Form Designer URL : http://ring-lang.sourceforge.net/web/test/formdesigner/project.html 

      I did some changes to the code to be usable on the WebAssembly platform like

      (1) Avoiding exec() in Color Dialogs, Font Dialogs & File Dialogs

      (2) Adding Upload/Download features to escape from the sandbox (using QFileDialog special API for WebAssembly)

      After finishing this work, I discovered the next little bugs

      (1) When I create new forms and save these forms in the memory file system (MEMFS) - then the QFileDialog can't see these new files until I type the file name. When I type it, the dialog can see it and add it to the list view.

      If I save many files (for example : form1.rform, form2.rform, etc) - I can't see any of them (to open them later in the same session - I know that the data will be lost after page reload or closing the browser, But I can reuse the files saved in memory in the same session, which is good but since the QFileDialog doesn't display these file - I have to remember the name of each file!)

      What I need is a method to refresh the QFileDialog and force it to display all files - maybe something like rereadDir() in old Qt versions ?

      (2) From the Menu bar - select a any menu like (File - Edit - View - Help) the menu will appears, move the mouse on the first item , click the item but keep clicking and move the mouse, The menu will be moved with you!! ---> Is this a feature ? - I think it's a bug.

      (3) I tried to change the Window icon and I added it to the resource file, but I still see Qt icon, is this a bug? or the WebAssembly port doesn't support changing the icon? or there is a limitation in the icon file extension? I am using a png file and I access it through qrc file like the other images used in the application.

      Number (2) and (3) are little issues, Number (1) can be avoided  using only download/upload features, but it will be nice if this problem is solved. So in the future I can use (Download/Upload) with zip files that contains many forms files, then I extract these files to the MEMFS where I can use the project files and switch quickly between them.

      Thanks again for the WebAssembly port

       

       

       

       

      Attachments

        1. FILEMENU.png
          FILEMENU.png
          109 kB
        2. FILEMENU2.png
          FILEMENU2.png
          120 kB
        3. formdesigner.png
          formdesigner.png
          104 kB
        4. qtproject_formdesigner.zip
          1.31 MB
        5. shot1.png
          shot1.png
          116 kB
        6. shot2.png
          shot2.png
          116 kB

        Issue Links

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

          Activity

            People

              mikolaj.boc Mikołaj Boc (Inactive)
              mahmoudsamirfayed mahmoudsamirfayed
              Veli-Pekka Heinonen Veli-Pekka Heinonen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes