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. QFileDialog get IFileDialog interface on Windows?
Forum Updated to NodeBB v4.3 + New Features

QFileDialog get IFileDialog interface on Windows?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 771 Views 2 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.
  • D Offline
    D Offline
    Dan203
    wrote on last edited by
    #1

    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
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      It's not possible.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

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

        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
        1
        • SGaistS SGaist

          Hi,

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

          D Offline
          D Offline
          Dan203
          wrote on last edited by
          #4

          @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)

          jsulmJ 1 Reply Last reply
          0
          • D Dan203

            @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)

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @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
            1
            • jsulmJ jsulm

              @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
              
              D Offline
              D Offline
              Dan203
              wrote on last edited by
              #6

              @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
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                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
                2

                • Login

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