Results 1 to 7 of 7

Thread: A few newbie questions

  1. #1
    Join Date
    Mar 2013
    Posts
    5
    Thanks
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default A few newbie questions

    Hi I'm new to Qt and C++ and I'm rebuilding a application I originally did with AutoIt

    I have Qt creator 5.0.1 the open source version, I'm a bit confused on how to have it static

    Can you build a single exe with the needed dll's?

    How do you save a text file which has line breaks rather than the text being a single line the code I used is:
    Qt Code:
    1. void batchcreator::on_actionSave_triggered()
    2. {
    3. QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), QString(),
    4. tr("Thea Files (*.ipt.thea);;xml Files (*.xml)"));
    5.  
    6. if (!fileName.isEmpty()) {
    7. QFile file(fileName);
    8. if (!file.open(QIODevice::WriteOnly)) {
    9. // error message
    10. } else {
    11. QTextStream stream(&file);
    12. stream << ui->textEdit->toPlainText();
    13. stream.flush();
    14. file.close();
    15. }
    16. }
    To copy to clipboard, switch view to plain text mode 

    Probably a really stupid Q, feel free to take me outside and beat me lol
    Is it possible to build as Mac and Linux version of a project on a Windows machine?

    Deploy wizard, is that supposed to work?

    thanks
    Nige
    PS
    This is what I'm doing, this is the Autoit one, the Qt version will have a tab layout and a lot more tidy
    tiki-download_file.jpg
    Last edited by nigec; 8th March 2013 at 17:12.

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: A few newbie questions

    "I'm a bit confused on how to have it static. Can you build a single exe with the needed dll's?"
    If you want a single exe not dependent on Qt dlls then you need to rebuild Qt statically - google for this.

    "How do you save a text file which has line breaks rather than the text being a single line"
    add new line character if you want to write a new line.
    stream << "some stuff";
    stream << '\n'

    "Is it possible to build as Mac and Linux version of a project on a Windows machine?"
    If you can find a cross compiler - that is outside the scope of this forum.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. The following user says thank you to amleto for this useful post:

    nigec (8th March 2013)

  4. #3
    Join Date
    Mar 2013
    Posts
    5
    Thanks
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: A few newbie questions

    Trust me I've been googling lol
    I downloaded QT Creator and Library as a single download, and the file structure is different to most of the static builds examples, which build should I have?

    The text output is saving from a textedit box, I can give a link to the AutoIt version if it help see what I'm doing

    I have a Linux machine gathering dust so a I should be able to compile for Linux, I just don't have the £££££££££££ to buy a Mac for a non profit project lol

    thank for the help

  5. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: A few newbie questions

    you can't download a static build of qt - you will have to rebuild it for yourself.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  6. #5
    Join Date
    Mar 2013
    Posts
    5
    Thanks
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: A few newbie questions

    The file structure is totally different with the build that is the current download, I've yet to find tutorial that applies to the presemt build

    C:\Qt\Qt5.0.1\5.0.1\Src\qtbase is were the configure.exe is but i get:
    Qt Code:
    1. This is the Qt for Windows Open Source Edition.
    2.  
    3. You are licensed to use this software under the terms of
    4. the GNU Lesser General Public License (LGPL) version 2.1.
    5.  
    6. Type 'L' to view the Lesser GNU General Public License version 2.1 (LGPLv2.1).
    7. Type 'y' to accept this license offer.
    8. Type 'n' to decline this license offer.
    9.  
    10. Do you accept the terms of the license?
    11. y
    12. Running syncqt...
    13. <srcbase> = C:/Qt/Qt5.0.1/5.0.1/Src/qtbase
    14. <outbase> = C:/Qt/Qt5.0.1/5.0.1/Src/qtbase
    15. Creating qmake...
    16. execute: File or path is not found (mingw32-make)
    17. execute: File or path is not found (mingw32-make)
    18. Cleaning qmake failed, return code -1
    To copy to clipboard, switch view to plain text mode 

    Qt creator seems to work fine.
    The AutoIT one is only 1 meg, with all the dll's its going to be a hell of a lot bigger
    Thanks for your help,
    Last edited by nigec; 8th March 2013 at 23:17.

  7. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: A few newbie questions

    Read the docs instead of trying to find a tutorial. Qt is not AutoIt, it will never be 1MB in size because it has lots and lots of functionality. You can strip it down to whatever you need but then again you end up looking for a tutorial which you will most probably not find because it requires reading, thinking and concious decisions instead of just blindly following instructions and pictures somebody reads in some video. Programming is about using your brains and not about following instructions.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. The following user says thank you to wysota for this useful post:

    nigec (9th March 2013)

  9. #7
    Join Date
    Mar 2013
    Posts
    5
    Thanks
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: A few newbie questions

    The actual project is going well, this project has gone through various stages, the original was javascript, then Autoit, I just kept shying away from C++ because I had to think/time
    I'm a beta tester for Thea Render and its a quiet spell right now and new features are being added so I need to update the tool anyway and de clutter the ui so this is a ideal time to dip my toe into the world of C++

    I've got hung up on trying to make QT to run static and wasted to much time I guess, I'm doing ok at the job in hand apart from the textedit to file issue, I'm obviously missing something simple

    thanks for the comments, I know I really shouldn't do a crash course in programming but I tend to do better when things are in context, the actual core of this tool are fairly simple and I know the logic behind it

Similar Threads

  1. A couple of newbie QT questions
    By fishing_boat in forum Newbie
    Replies: 17
    Last Post: 8th January 2010, 20:10
  2. Newbie Questions
    By Pether in forum Newbie
    Replies: 9
    Last Post: 15th July 2009, 08:32
  3. Replies: 11
    Last Post: 13th July 2009, 16:05
  4. (probably newbie) Windows Mobile 5 questions
    By zeldaknight in forum Newbie
    Replies: 8
    Last Post: 6th May 2009, 05:12
  5. Few newbie questions
    By Salazaar in forum Qt Tools
    Replies: 9
    Last Post: 3rd May 2007, 19:13

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.