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. Asking user for folder creation in qt through dialog box .
Forum Updated to NodeBB v4.3 + New Features

Asking user for folder creation in qt through dialog box .

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 2.3k 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.
  • B Offline
    B Offline
    BibekKumar
    wrote on last edited by
    #1

    How can i ask one user to create a folder through one dialog box in qt .

    So that whatever the name the user has given in the dialog box ( in a specific location,

    for eg. c:/user/...) the folder will be created in that location and if the folder is

    alreday present with the specific name in that location then replacement shall be done .

    1 Reply Last reply
    0
    • V Offline
      V Offline
      veeraps
      wrote on last edited by
      #2

      Have you looked into this one in Qt "QFileDialog":http://qt-project.org/doc/qt-4.8/QFileDialog.html?

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vivekmalik2466
        wrote on last edited by
        #3

        #include <QFileDialog>
        QString fileName = QFileDialog::getOpenFileName(this, "Load Video",QString(),"Video (*.avi *.asf *.mpg *.wmv)");

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tucnak
          wrote on last edited by
          #4

          If you talk about QFileDialog, you can do it like this:
          @
          QString dirPath = QFileDialog::getExistingDirectory(this, .....);
          @

          or:

          If you talk about code, you can do it like this:
          @
          MyDialog dial(this);
          if(dial.exec()) {
          QDir dir( somedir );
          dir.mkdir( dial.dirNameWhichIgot() );
          }
          @

          This code will create dir (in somedir) with name got from MyDialog::dirNameWhichIgot() if execution of dialog was successful.

          1 Reply Last reply
          0
          • B Offline
            B Offline
            BibekKumar
            wrote on last edited by
            #5

            Thankx to all . i got the ans .. i have to use QFiledialog::getexistingdirectory()..

            1 Reply Last reply
            0
            • V Offline
              V Offline
              veeraps
              wrote on last edited by
              #6

              Now that, I appreciate you if you could prefix [SOLVED] to the topic so that others know that this issue is closed.

              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