Results 1 to 5 of 5

Thread: can not crreate a qwidget when no gui is being used

  1. #1
    Join Date
    Mar 2009
    Location
    Gansu,China
    Posts
    188
    Qt products
    Qt4
    Platforms
    Windows

    Default can not crreate a qwidget when no gui is being used

    I create a .pro file through " Qt->create Basic .pro File ..." in the qt-plugin for vs2005,when I use lupdate -vrebosse my.pro,the error ocurr:
    can not crreate a qwidget when no gui is being used?
    why?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: can not crreate a qwidget when no gui is being used

    Because you are using QCoreApplication and not QApplication.
    If you are not making a GUI application it makes no sense to create a QWidget which is a GUI component.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Mar 2009
    Location
    Gansu,China
    Posts
    188
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: can not crreate a qwidget when no gui is being used

    thk u for your answer.
    In my main function,I use

    QAppliction a(argc,argv)

    not

    QCoreApplication a(argc,argv)

    but problem still exists.

  4. #4
    Join Date
    Jan 2008
    Location
    Bengaluru
    Posts
    144
    Thanks
    8
    Thanked 7 Times in 7 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: can not crreate a qwidget when no gui is being used

    Are you not getting any compilation errors?.Post those. It would be helpful to see the scenario.

  5. #5
    Join Date
    Sep 2008
    Location
    Munich
    Posts
    32
    Thanked 8 Times in 6 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: can not crreate a qwidget when no gui is being used

    Can you post your my.pro file. Seems to have a strange setup.

Similar Threads

  1. Promoting the parent QWidget of a QWidget form
    By extrakun in forum Qt Tools
    Replies: 6
    Last Post: 16th April 2010, 14:19
  2. Replies: 1
    Last Post: 12th April 2010, 12:55
  3. Replies: 3
    Last Post: 1st April 2010, 23:56
  4. QWidget::exec() and QWidget::show()
    By MarkoSan in forum Qt Programming
    Replies: 6
    Last Post: 18th October 2007, 21:39
  5. Replies: 1
    Last Post: 2nd May 2006, 21:11

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.