Results 1 to 11 of 11

Thread: code for new project

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

    Default code for new project

    hi,


    Can anybody know what is the code to create a new project in Qt.( using filename and path) .

  2. #2
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: code for new project

    what kind of project u want to create?

    be specific in, what you are asking.

  3. #3
    Join Date
    Jan 2008
    Posts
    6
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: code for new project

    qmake -project

  4. #4
    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: code for new project

    Create the path, create a standard main.cpp, and add a pro where you put in whatever you want. You could also have a look at the sources of Qt Creator to see how they implement their "new project dialog".

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

    Default Re: code for new project

    when we create a new project in Qt. it will ask filename and path , when you click on finish button a Qt project is created in a folder with newproject.pro, main, mainwindow.cpp, mainwindow.h window will displaying in a Qt window.
    What is code written in the Finish button.

    In the Same way when i click on finish button in my project(not Qt project ) an xmlfile should be created with zero element, when i make changes in the project the value(element) must be save in the xml file.

  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: code for new project

    Quote Originally Posted by rk0747 View Post
    when we create a new project in Qt. it will ask filename and path , when you click on finish button a Qt project is created in a folder with newproject.pro, main, mainwindow.cpp, mainwindow.h window will displaying in a Qt window.
    What is code written in the Finish button.

    In the Same way when i click on finish button in my project(not Qt project ) an xmlfile should be created with zero element, when i make changes in the project the value(element) must be save in the xml file.
    Fine, so do it. Where is the problem? I don't get your point.

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

    Default Re: code for new project

    i am not getting an idea what to write in Finish button.

    And, Is it possible to create a project only with xmlfile?

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

    Default code for new project

    pLZ GO THROUGH THE UI FILE WHICH I ATTACHED FILE, AND GO THROUGH THE BELOW CODE

    // WRITE FILE NAME IN lineEdit as (kk.xml) and choose path in (lineEdit_2) and then click on OK button than the kk.xml have to create // in particular location........

    Qt Code:
    1. newproject::newproject(QWidget *parent)
    2. : QDialog(parent)
    3. {
    4. ui.setupUi(this);
    5. connect(ui.okButton,SIGNAL(clicked()),this,SLOT(on_okButton_clicked()));
    6. connect(ui.cancelButton,SIGNAL(clicked()),this,SLOT(close()));
    7. //createNewMenu();
    8. connect(ui.pushButton,SIGNAL(clicked()),this, SLOT(setLastDir()));
    9. // eclogic=new ECLogic();
    10. }
    11.  
    12. newproject::~newproject()
    13. {
    14. //delete ui;
    15. }
    16.  
    17. void newproject::setLastDir()
    18. {
    19. //! set last directory to ImportExport class
    20.  
    21. ui.lineEdit_2->setText(QFileDialog::getExistingDirectory(this, msg_head_lastDirDialog,
    22. "/home", QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks) + "/");
    23. }
    24.  
    25. void newproject::on_okButton_clicked()
    26. {
    27. HOW TO WRITE THIS CODE ,...................
    28.  
    29. }
    To copy to clipboard, switch view to plain text mode 


    Please go through the attached file and code ,and plz reply me how to write the code ........

    thanks
    Attached Files Attached Files

  9. #9
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: code for new project

    HOW TO WRITE THIS CODE ,...................
    How can we tell ? Are you not sure what your program will do ?

  10. #10
    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: code for new project

    Quote Originally Posted by rk0747 View Post
    pLZ GO THROUGH THE UI FILE WHICH I ATTACHED FILE, AND GO THROUGH THE BELOW CODE
    Hey, YOU want that programm, not me! And till now it's a miracle to me what you really want. If you don't know how to work with XML read the docs about QDomDocument, QDomElement and the examples about XML.
    If you then have a specific question, come back.

  11. #11
    Join Date
    Jan 2010
    Posts
    73
    Thanks
    6
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: code for new project

    Take a look at some of these classes in this order:
    1. http://qt.nokia.com/doc/4.6/qtextstream.html
    2. http://qt.nokia.com/doc/4.6/qfile.html
    3. http://qt.nokia.com/doc/4.6/qdatastream.html

    This contains examples for creating and writing files. Your code demonstrates that you already understand how to access the controls.

Similar Threads

  1. QT Project source code
    By darpan in forum Qt Programming
    Replies: 3
    Last Post: 27th December 2012, 17:16
  2. Replies: 1
    Last Post: 4th December 2009, 00:34
  3. Replies: 0
    Last Post: 30th July 2009, 22:56
  4. Pasting code from code tag in emacs
    By Gopala Krishna in forum General Discussion
    Replies: 0
    Last Post: 16th February 2007, 06:47
  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.