Results 1 to 6 of 6

Thread: new project

  1. #1
    Join Date
    Jan 2010
    Posts
    28
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default new project

    hi,
    i used getsavefiledialog and getopenfiledialog toopen and save the project , Is there getnewfiledialog in Qt?
    i want the following requirement:
    1. when i click new project menu, a dialog window should open to write filename and specify path.
    2. After creating the project , whatever changes we did in that must save(with same filename).

    Is this possible in Qt? is there any example in qt manual?

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: new project

    doesn't QFileDialog::getSaveFileName do that?
    "This is a convenience static function that will return a file name selected by the user. The file does not have to exist."
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Jan 2010
    Posts
    28
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: new project

    Quote Originally Posted by spirit View Post
    doesn't QFileDialog::getSaveFileName do that?
    "This is a convenience static function that will return a file name selected by the user. The file does not have to exist."

    But, in savefileName dialog it is asking filename once again , but i already mentioned in new project window,.
    Best example is creating a new Qt application . Same requirement i need . Is it possible in Qt.

    Please help me it is very urgent to me.

  4. #4
    Join Date
    May 2009
    Posts
    94
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Post Re: new project

    You need to create a dialog.on clicking the newproject the dialog will open.Enter two text box and Browse button, Ok/Finish button.
    1. Project Name
    2. Project path , browse button, on clicking brose button the browse dialog box will open and you can select your path.
    3. On clicking Finish button your prject name should saved in the project path.

    You problem solved.

  5. #5
    Join Date
    Jan 2010
    Posts
    28
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: new project

    Quote Originally Posted by bismitapadhy View Post
    You need to create a dialog.on clicking the newproject the dialog will open.Enter two text box and Browse button, Ok/Finish button.
    1. Project Name
    2. Project path , browse button, on clicking brose button the browse dialog box will open and you can select your path.
    3. On clicking Finish button your prject name should saved in the project path.

    You problem solved.
    Thank you for replying.

    Exactly i did the same , but i am not getting how to cancatenate the projectname and projectpath to save the project. (Just like \Desktop\savenewproject.xml) Here savenew project is projectname and desktop/ is project path.


    I wrote like this:

    newproject::newproject(QWidget *parent)
    : QDialog(parent)
    {
    ui.setupUi(this);
    connect(ui.okButton,SIGNAL(clicked()),this,SLOT(on _okButton_clicked()));
    connect(ui.cancelButton,SIGNAL(clicked()),this,SLO T(close()));

    connect(ui.pushButton,SIGNAL(clicked()),this, SLOT(setLastDir()));

    }

    newproject::~newproject()
    {
    //delete ui;
    }

    void newproject::setLastDir()
    {

    ui.lineEdit_2->setText(QFileDialog::getExistingDirectory(this, msg_head_lastDirDialog,
    "/home", QFileDialog::ShowDirsOnly | QFileDialog:ontResolveSymlinks) + "/");
    Projectname=ui.lineEdit->text();
    Projectpath=ui.lineEdit2->Text();


    }

    void newproject:n_okButton_clicked()
    {

    }

    Here i have to combine the projectname with projectpath.

  6. #6
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: new project

    Quote Originally Posted by rk0747 View Post
    Projectpath=ui.lineEdit2->Text();
    has to be
    Qt Code:
    1. Projectpath=ui.lineEdit2->text();
    To copy to clipboard, switch view to plain text mode 

    EDIT: It has to be
    Qt Code:
    1. Projectpath=ui.lineEdit_2->text();
    To copy to clipboard, switch view to plain text mode 
    ! Oh man, get better names for your elements...
    Last edited by Lykurg; 17th February 2010 at 09:58.

Similar Threads

  1. Replies: 1
    Last Post: 4th December 2009, 00:34
  2. Bug in my project
    By phast in forum Qt Programming
    Replies: 1
    Last Post: 21st December 2008, 08:10
  3. Qt Project How to ?
    By sunil.thaha in forum Qt Programming
    Replies: 4
    Last Post: 9th August 2007, 11:56
  4. QT Project compilation with Dev-Cpp
    By manojmka in forum Qt Programming
    Replies: 0
    Last Post: 7th May 2007, 12:07
  5. Project generation on linux from QT Project
    By darpan in forum Qt Programming
    Replies: 6
    Last Post: 11th December 2006, 10:43

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.