Please Help A Complete Newcomer To Qt :)



  • As the thread title says, I'm a complete newcomer to Qt, and as a consequence, I thought I'd introduce myself, deliver some salient information, and ask a few questions before committing myself to downloading and installing the Qt system.

    First, background. Which encompasses everything from C and assembler back in the 1980s (including some quick and dirty game coding that I'd prefer not to be reminded about!), through SQL, much hilarity with Visual Basic, and a spot of PHP. So I'm not a complete newcomer to programming, just to Qt.

    Second, the installer. Before I commit myself to this, and find out that there are some less than delightful features awaiting the unwary, what I want to know is this.

    [1] Does the installer auto-detect whether or not my machine uses a 32-bit or 64-bit CPU, and whether or not it uses multiple cores? Does it download appropriate code for each of these disparate hardware platforms?

    [2] Since I'm running Windows 7 64-bit on a dual core laptop, are there any restrictions on my choice of installation directory, or can I tidily install everything to the directory:

    C:\Program Files\Qt

    Only I'd like to keep everything tidy, and not have extraneous folders in the root directory if I can help it. I had a few headaches with PHP in this regard, and I'd prefer not to repeat those if I can.

    [3] Will the installer install all the files I need nice and transparently, or are there any post-installation tweaks I need to be aware of? If the latter, what files do I need to be aware of, where can I find them, and where are they to be copied to? I found out the hard way that the free version of Visual Studio doesn't install a 64-bit compiler by default, and had to go looking for one when I tried upgrading from VB6, so I thought I'd make sure there are no unpleasant surprises of this sort waiting for me if I install Qt.

    [4] I realise there's a lot to learn with modern IDE's before you write a single line of code, but be nice to me, I'm used to being able to dive in and code, and worry about development tool quirks and features later. Which, it has to be said, are practically nonexistent with old school assembly development! Will my wrestling with VB6 be of even minor use with regard to getittng to grips with a new IDE?

    [5] One of the reasons I've developed an interest in Qt, is the prospect of being able to develop code on my current platform (Win7), and have the resulting project work with little or no modification on a different platform. Which, according to various sources of information I've looked at, is a real possibility (and one I'll be enjoying for the very first time if it comes to pass!). Does the Community Edition support this sort of flexibility, or is this reserved for the commercial versions? I'll make do with having code work on Win7 if the Community Edition doesn't support hassle-free portability, but if it does, I'll be extremely delighted!

    Right, I think I've asked enough reasonable questions to show I'm not a complete klutz, but I'll probably think of more once I get going. But first, I'll wait for answers to this lot, and then see if diving into Qt will be a pleasure rather than a pain, not least because some employers are now asking specifically for Qt development experience here in the UK, and I thought it would be a good idea to research this, just in case it offers me a career upgrade in the future!



  • Can someone remove the spam and just answer my questions?


  • Moderators

    Hi, and welcome to the Qt Dev Net!

    Your CPU architecture doesn't matter here. The package you need to download depends on your OS and which compiler you have (or which compiler you plan to get). The packages are labelled clearly -- Go to the "downloads page":http://www.qt.io/download-open-source/ and click "View All Downloads" to see a list of all available packages. Note that a 64-bit OS can happily build and run a 32-bit application.

    The sole restriction is that your installation path cannot contain any spaces, so "C:\Program Files" is off-limits. (I know it's not the answer you were hoping to hear, sorry!) The reason is that many tools out there don't handle spaces well, so the Qt installer enforces the no-spaces rule to prevent headaches.

    There are no post-installation tweaks required, but you must install your own compiler. Note that Qt is a library, and libraries don't usually come with a compiler. (There is one exception: If you choose the MinGW package, the installer can also provide the MinGW compiler)

    That depends on the individual user, I think. Nonetheless, once you've finished installing everything, you can simply open the Qt Creator IDE, create a new project, and click "build and run" to run a bare-bones application.

    Yes, the community version of Qt is cross-platform too. Assuming that you don't use any platform-specific features, you can take code that you wrote in Windows and compile it on Linux/OS X, and even mobile phones. See the "this page":http://www.qt.io/download/ for a comparison of licenses.

    Other things you might want to know:

    • Not all Qt features are available on all platforms. See the "All Modules":http://doc.qt.io/qt-5/qtmodules.html page for details.
    • For Windows, most Qt packages depend on OpenGL 2.0 or higher. However, there are two Visual Studio 2013 packages which can use DirectX instead of OpenGL.
      ** This detail is only important if you want to create "QML applications":http://doc.qt.io/qt-5/qmlapplications.html
    • Qt is the library, Qt Creator is the IDE. The library installer includes the IDE.


  • First of all, many thanks for a rapid reply, and the elimination of the spam!

    Ok, reading the above, your advice suggests to me that as I don't have a C++ compiler currently installed on this machine (and the Visual C++ compiler from my old XP box probably won't work anyway), the way forward would be to go for the MinGW package and use the compiler that comes with that. I take it the Qt installer handles this in a suitably fuss-free manner? :)

    According to the application that controls the graphics drivers on my machine, I have OpenGL version 6.14.10.10834. I take it this is more than sufficient for Qt's needs?

    One piece of documentation I've just seen says I can integrate JavaScript with QML. Now this is a feature I like a LOT, given that I've used JavaScript fairly frequently in the past. I'm tempted to ask at this juncture, does this include integration of some of the now-popular (and in some workplaces, in demand) JavaScript libraries such as JQuery and Angular.js? Only if these can be integrated with QML code, that would provide another box tick on the CV, so to speak. :)



  • I made the jump from VB6 to Qt a few years ago (although I had good C++ foundations from my time as a student). I wouldn't say it was a breeze, but suddenly my tools stopped doing random, inexplicable things every time I changed anything about my projects, not to speak of random crashes. For VB6, I actually wrote a batch compiler that would automatically re-compile a project if VB6 crashed when attempting to compile it, which happened all the time.

    If you use the C++ parts of Qt, a good foundation in Object-oriented programming is strongly suggested. And VB6 is not an Object-oriented language.


  • Moderators

    You're most welcome!

    [quote author="Calilasseia" date="1423321329"]Ok, reading the above, your advice suggests to me that as I don't have a C++ compiler currently installed on this machine (and the Visual C++ compiler from my old XP box probably won't work anyway), the way forward would be to go for the MinGW package and use the compiler that comes with that. I take it the Qt installer handles this in a suitably fuss-free manner? :)
    [/quote]Yep, I'd recommend the MinGW package. The only thing you need to do is tick the box that asks the installer to install MinGW too.

    [quote author="Calilasseia" date="1423321329"]According to the application that controls the graphics drivers on my machine, I have OpenGL version 6.14.10.10834. I take it this is more than sufficient for Qt's needs?[/quote]That looks like an AMD/ATI driver version rather than an OpenGL version. But if you do indeed have an AMD/ATI graphics card, then it will be more than sufficient. (Even if it's not, most parts of Qt don't require OpenGL)

    [quote author="Calilasseia" date="1423321329"]One piece of documentation I've just seen says I can integrate JavaScript with QML. Now this is a feature I like a LOT, given that I've used JavaScript fairly frequently in the past. I'm tempted to ask at this juncture, does this include integration of some of the now-popular (and in some workplaces, in demand) JavaScript libraries such as JQuery and Angular.js? Only if these can be integrated with QML code, that would provide another box tick on the CV, so to speak. :)[/quote]QML is a superset of JavaScript, so to speak. It has a declarative component that's similar to CSS and JSON for laying out your GUI, and it has a imperative component that is JavaScript for simple logic.

    I've never integrated 3rd-party JS libraries into my own projects so I don't know how feasible it is to integrate JQuery and Angular.js into QML. You could try. Have a look at "QChart.js":http://jwintz.me/blog/2014/02/15/qchart-dot-js-qml-binding-for-chart-dot-js/ to see how they did it.



  • Installation now complete.

    Wow. There's so much of it ...

    This is going to take a LOT of studying ...


  • Moderators

    Yes, there's lots of learning, but you don't need to learn all of it at once (I've been using Qt for about 5 years, but I still haven't used all of its features).

    Start off with this "getting started" tutorial: http://doc.qt.io/qt-5/gettingstartedqt.html

    Happy coding!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.