Qt Library Issues



  • Hi, I just started to work with Qt, and is so frustrating I gotta say.. Have so many issues (Installing and trying to run a program). I installed the QtCreator with MinGW Pack. SORRY IF MY ERRORS ARE STUPID.

    I just wanted to create a GUI Application from zero, but I have some errors. I watch a video on YouTube and I just typed everything from the video, but didn't work. The video start a blank project, then he was adding the files I got.

    Here's an image, so you can check my main errors. "Qt Issue":http://imgur.com/vR4OqjX
    I have to say that when I type #include <Q.....> a list drops me some Lib's I could use, but QVBoxLayout dosn't appear.

    I Dont know if the .pro File is the problem, but Ill show you the code of this File.

    @HEADERS +=
    MainWindow.h

    SOURCES +=
    MainWindow.cpp
    Main.cpp
    @

    Please, the problems I'm having with QT are the libraries, I'm just a beginner here, I searched for like 3 or 4 hours about this and didn't find anything yet.

    Thank you for your time.



  • Hello and welcome to devnet,

    if you want to start Qt from zero, I suggest to use one of the creator examples supplied with Qt 5.2 and have a look at the includes, then start modifiying the sample.


  • Moderators

    Hi vitaR,

    The YouTube video is probably old, and talks about Qt 4.

    In Qt 5, the widgets are not in <QtGui> any more. They are in <QtWidgets>.

    To solve the problem, change your headers:
    @
    // DON'T write this:
    #include <QtGui/QApplication>
    #include <QtGui/QVBoxLayout>

    // Write this:
    #include <QApplication>
    #include <QVBoxLayout>
    @

    Anyway, if you want an up-to-date tutorial, follow the official one: http://doc-snapshot.qt-project.org/qt5-stable/gettingstartedqt.html



  • [quote author="clochydd" date="1394268055"]Hello and welcome to devnet, ................................. [/quote]

    Hi, and thank you, now that I fix my errors, gonna try what you said. Thanks you for the reply.

    [quote author="JKSH" date="1394279951"]Hi vitaR,

    The YouTube video.........................................[/quote]

    Thank you so much, this fixed my errors. And gonna check the link you sent me. Thanks for Reply, I'm Pretty new on this, so forgive me for those simple errors. Have a nice day.


  • Moderators

    You're welcome. :) Please don't apologize; this is a normal part of learning!

    Good luck. If you have any more questions, please ask. We would be happy to help you.


Log in to reply
 

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