Results 1 to 4 of 4

Thread: Problem with "C++ GUI Programming with Qt4, 2nd Edition"

  1. #1

    Default Problem with "C++ GUI Programming with Qt4, 2nd Edition"

    Hey, folks.

    So i'm trying to go over Qt with this book "C++ GUI Programming with Qt4, 2nd Edition". Two first exercises worked well with my Qt Creator 4.5.1 and mingw32 but then i got into first "big" program. Qt went apeshit with like 40 errors or something. What am i doing wrong? I guess it's version compatibility problem.

    That's example from the book.

    find.pro
    finddialog.cpp
    finddialog.h
    main.cpp

  2. #2
    Join Date
    Aug 2015
    Posts
    20
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Problem with "C++ GUI Programming with Qt4, 2nd Edition"

    this book was written for with Qt4 and you use Qt5
    therefore you have to add to your finddialog.cpp file
    the include statements:

    #include <QLabel>
    #include <QLineEdit>
    #include <QCheckBox>
    #include <QPushButton>
    #include <QHBoxLayout>
    #include <QVBoxLayout>

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Problem with "C++ GUI Programming with Qt4, 2nd Edition"

    You will likely also have to edit (slightly) code that creates QMainWindow instances to use Qt::WindowFlags instead of whatever was used in Qt 4. That was so long ago I've forgotten.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  4. #4
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem with "C++ GUI Programming with Qt4, 2nd Edition"

    Read this article.

  5. The following user says thank you to Lesiok for this useful post:

    d_stranz (20th May 2018)

Similar Threads

  1. Replies: 1
    Last Post: 20th November 2015, 10:02
  2. Replies: 3
    Last Post: 16th March 2015, 07:31
  3. Replies: 3
    Last Post: 8th February 2015, 22:49
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 15:58

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.