Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved QFileDialog get IFileDialog interface on Windows?

    General and Desktop
    4
    7
    221
    Loading More Posts
    • 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.
    • D
      Dan203 last edited by

      Is there a way to get the IFileDialog interface from the QFileDialog widget on windows? We current use MFC and the CFileDialog but we grab the IFileDialog interface to add a couple of custom controls and add some application specific favorites to the tree.

      If not I guess I could use the IFileDialog interface directly, but the convenience functions of the QFileDialog are easier to use so I'd rather use that.

      1 Reply Last reply Reply Quote 0
      • Christian Ehrlicher
        Christian Ehrlicher Lifetime Qt Champion last edited by

        It's not possible.

        Qt has to stay free or it will die.

        1 Reply Last reply Reply Quote 2
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          Hi,

          Depending on what you are doing maybe setSidebarUrls might do the trick.

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

          D 1 Reply Last reply Reply Quote 1
          • D
            Dan203 @SGaist last edited by

            @SGaist Yeah I don't like that universal dialog. I was looking for a way to modify the native Windows dialog like this...

            43546d3d-5e82-4c7b-aeee-b5509766c6a1-image.png

            See how we have custom favorites under the program name on the left? And the "Recent Folders" drop down at the bottom next to Open?

            On Windows you do that by getting access to the IFileDialog interface. With MFC you can get that from the CFileDialog wrapper. But apparently not possible with QFileDialog. Oh well, guess I'll use IFileDialog directly.

            I assume there is any easy way to have code that runs on one platform only? (I'm still really new to Qt, so just figuring this stuff out)

            jsulm 1 Reply Last reply Reply Quote 0
            • jsulm
              jsulm Lifetime Qt Champion @Dan203 last edited by

              @Dan203 said in QFileDialog get IFileDialog interface on Windows?:

              I assume there is any easy way to have code that runs on one platform only?

              See https://doc.qt.io/qt-5/qmake-language.html#scopes : using scopes you can compile platform specific source files for the specific platform. Using scopes you can also set a define which you can check in C++ code:

              win32:DEFINES += USE_MY_STUFF
              

              then in C++

              #ifdef USE_MY_STUFF
                  // This will only be compiled if USE_MY_STUFF is set
              #endif
              

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              D 1 Reply Last reply Reply Quote 1
              • D
                Dan203 @jsulm last edited by

                @jsulm said in QFileDialog get IFileDialog interface on Windows?:

                @Dan203 said in QFileDialog get IFileDialog interface on Windows?:

                I assume there is any easy way to have code that runs on one platform only?

                See https://doc.qt.io/qt-5/qmake-language.html#scopes : using scopes you can compile platform specific source files for the specific platform. Using scopes you can also set a define which you can check in C++ code:

                win32:DEFINES += USE_MY_STUFF
                

                then in C++

                #ifdef USE_MY_STUFF
                    // This will only be compiled if USE_MY_STUFF is set
                #endif
                

                Thanks!

                1 Reply Last reply Reply Quote 0
                • SGaist
                  SGaist Lifetime Qt Champion last edited by

                  You can also use Qt's platform defines: #ifdef Q_OS_WIN so no need for more custom defines.

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

                  1 Reply Last reply Reply Quote 2
                  • First post
                    Last post