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. How to implement the browse button functionality as show in the image
Forum Updated to NodeBB v4.3 + New Features

How to implement the browse button functionality as show in the image

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 3 Posters 2.5k 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.
  • Q Offline
    Q Offline
    Qt Enthusiast
    wrote on 1 Nov 2018, 12:00 last edited by
    #1

    0_1541073615265_Image1.png

    Is there any standard we can select the path and same can we shown in project location

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 1 Nov 2018, 12:32 last edited by
      #2

      Hi
      something like. ( note linux path. :)

      QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"),
      "/home",
      QFileDialog::ShowDirsOnly| QFileDialog::DontResolveSymlinks);
      
      Q 1 Reply Last reply 2 Nov 2018, 11:09
      9
      • M mrjj
        1 Nov 2018, 12:32

        Hi
        something like. ( note linux path. :)

        QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"),
        "/home",
        QFileDialog::ShowDirsOnly| QFileDialog::DontResolveSymlinks);
        
        Q Offline
        Q Offline
        Qt Enthusiast
        wrote on 2 Nov 2018, 11:09 last edited by
        #3

        @mrjj
        how to display the directory selected in the entry widget of QFileDialog

        M 1 Reply Last reply 2 Nov 2018, 11:11
        0
        • Q Qt Enthusiast
          2 Nov 2018, 11:09

          @mrjj
          how to display the directory selected in the entry widget of QFileDialog

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 2 Nov 2018, 11:11 last edited by
          #4

          @Qt-Enthusiast
          its just
          ui->LineEditName->setText(dir);

          Q 1 Reply Last reply 5 Nov 2018, 20:01
          3
          • Q Offline
            Q Offline
            Qt Enthusiast
            wrote on 5 Nov 2018, 14:55 last edited by Qt Enthusiast 11 Jun 2018, 22:03
            #5
            This post is deleted!
            M 1 Reply Last reply 5 Nov 2018, 14:57
            0
            • Q Qt Enthusiast
              5 Nov 2018, 14:55

              This post is deleted!

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 5 Nov 2018, 14:57 last edited by
              #6

              @Qt-Enthusiast
              You cant.
              you have to make your own QDialog then.
              The QFileDialog cannot be altered.

              1 Reply Last reply
              1
              • Q Offline
                Q Offline
                Qt Enthusiast
                wrote on 5 Nov 2018, 15:05 last edited by
                #7

                Any inputs will help . or if we have similar code that will help

                M 1 Reply Last reply 5 Nov 2018, 15:08
                0
                • Q Qt Enthusiast
                  5 Nov 2018, 15:05

                  Any inputs will help . or if we have similar code that will help

                  M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 5 Nov 2018, 15:08 last edited by
                  #8

                  @Qt-Enthusiast
                  Sorry, i have no samples of such dialog as most of us uses
                  the QFileDialog to look like the platform.

                  1 Reply Last reply
                  1
                  • M mrjj
                    2 Nov 2018, 11:11

                    @Qt-Enthusiast
                    its just
                    ui->LineEditName->setText(dir);

                    Q Offline
                    Q Offline
                    Qt Enthusiast
                    wrote on 5 Nov 2018, 20:01 last edited by Qt Enthusiast 11 Jun 2018, 22:03
                    #9
                    This post is deleted!
                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      Daniel Ste.
                      wrote on 6 Nov 2018, 07:30 last edited by
                      #10

                      Define a custom QDialog, add a QTreeView, set a QFileSystemModel, handle QTreeView selection events to update Directory LineEdit.

                      For the combobox with recent directory selection you need to save history to disk. You could use QSettings to save this list of Directories. Use a QVector <QString> to store the strings because it is easier to prepend strings at top of the list.

                      Populate the recent ComboBox with the saved strings.

                      When you select a directory, make sure it is not in the recent list yet before saving, otherwise just move the existing directory to the first position of the Vector.

                      I thing this is pretty easy to achieve. Do you have a specific question or problem?

                      1 Reply Last reply
                      1

                      8/10

                      5 Nov 2018, 15:08

                      • Login

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