Results 1 to 6 of 6

Thread: #include <QtGui/QDesktopWidget> no such file or directory

  1. #1
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default #include <QtGui/QDesktopWidget> no such file or directory

    i am running a qt 4.7 embedded widget program in qt 5.
    i get the following errors with headers:

    #include <QtGui/QDesktopWidget>
    #include <QtGui/QAbstractButton>

    how can i solve it?

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

    Default Re: #include <QtGui/QDesktopWidget> no such file or directory

    "I am running a qt 4.7 embedded widget program in qt 5."
    I don't understand.

    i get the following errors with headers:

    #include <QtGui/QDesktopWidget>
    #include <QtGui/QAbstractButton>
    What errors?

    Do you mean you have some code written using qt4.7 and now you want to compile it with qt5? If so, google "porting qt4 to qt5".
    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. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: #include <QtGui/QDesktopWidget> no such file or directory

    In short:

    remove the module name from the includes
    Qt Code:
    1. #include <QDesktopWidget>
    To copy to clipboard, switch view to plain text mode 

    add
    Qt Code:
    1. QT += widgets
    To copy to clipboard, switch view to plain text mode 
    to the .pro file

    You can make the second change depend on the version of Qt you are building with, the first change works for both Qt4 and Qt5

    Cheers,
    _

  4. #4
    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: #include <QtGui/QDesktopWidget> no such file or directory

    #include <QtGui/QDesktopWidget>
    #include <QtGui/QAbstractButton>

    how can i solve it?
    @saman_artorious: Did you bother to read the almost identical reply to the almost identical question you asked two days ago? The solution you need is posted in both places. Next time you get a similar compilation error, think about how similar it might be to these two cases before posting the same question a third time.

  5. #5
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: #include <QtGui/QDesktopWidget> no such file or directory

    Quote Originally Posted by d_stranz View Post
    @saman_artorious: Did you bother to read the almost identical reply to the almost identical question you asked two days ago? The solution you need is posted in both places. Next time you get a similar compilation error, think about how similar it might be to these two cases before posting the same question a third time.
    you are right d_stranz. I was pretty confused yesterday, was away from this community n qt programming for a while n ended up with installing qt 5 n getting some bugs.
    anyway, it is nice to see your profile image after a few months.

  6. #6
    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: #include <QtGui/QDesktopWidget> no such file or directory

    #include <QtGui/QDesktopWidget>
    #include <QtGui/QAbstractButton>
    I guess I never see this problem, because I have never used the "QtGui/" qualifier. I always simply do this:

    #include <QDesktopWidget>
    #include <QAbstractButton>
    and adjust the include paths in the project settings.

Similar Threads

  1. QtGui/QAbstractButton no such file or directory
    By saman_artorious in forum Qt Programming
    Replies: 6
    Last Post: 22nd February 2013, 14:15
  2. QtGui/QApplication: No such file or directory
    By codeslicer in forum Qt Programming
    Replies: 4
    Last Post: 9th December 2011, 16:29
  3. Replies: 1
    Last Post: 23rd May 2011, 05:53
  4. Replies: 4
    Last Post: 9th May 2010, 17:18
  5. Replies: 3
    Last Post: 6th October 2009, 09:38

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.