Results 1 to 5 of 5

Thread: Qt modules in plain C++ project

  1. #1
    Join Date
    Nov 2015
    Posts
    41
    Thanks
    5
    Thanked 3 Times in 3 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Qt modules in plain C++ project

    Hi,

    Whether can I use some modules of Qt in plain c++ project?
    For example I would like to use the Xml and Network modules.

    It is possible?
    It can generate problems?

    Regards,

  2. #2
    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: Qt modules in plain C++ project

    The Qt XML module is marked as obsolete, so you should not use it in new projects. If you want plain old C++ support for XML, then you would be better off using xerces-c from the Apache project.. The new support for XML is in Qt Core, so you can't get around linking to that.

    The Qt Network classes are for the most part derived from QObject, so you are tied to Qt Core there as well. Since they use signals and slots to communicate data and status, you'll need an event loop, which implies a QApplication class, so you end up with a Qt-based project, not a plain C++ one.

  3. #3
    Join Date
    Nov 2015
    Posts
    41
    Thanks
    5
    Thanked 3 Times in 3 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt modules in plain C++ project

    The Qt XML module is marked as obsolete, so you should not use it in new projects. If you want plain old C++ support for XML, then you would be better off using xerces-c from the Apache project.. The new support for XML is in Qt Core, so you can't get around linking to that.
    Yes, it is marked obsolete but I find that reason why xml module is marked as obsolete is that "already work" see http://lists.qt-project.org/pipermai...st/008193.html

    The Qt Network classes are for the most part derived from QObject, so you are tied to Qt Core there as well. Since they use signals and slots to communicate data and status, you'll need an event loop, which implies a QApplication class, so you end up with a Qt-based project, not a plain C++ one.
    So, if I understand correctly Qt libraries can not be using with plain C++ project?

  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: Qt modules in plain C++ project

    No, it is not marked obsolete because it "already works". It is marked obsolete because it has been replaced by QXmlStreamReader / Writer and it will no longer be maintained. This means that whatever bugs it has will not be fixed, and at some point it could be archived and removed from the Qt distribution.. The mailing list item you pointed to is irrelevant.

    Qt *is* C++, of course. But like any library, you cannot use parts of it without linking to the library and distributing the DLLs with your application. Any part of Qt that uses QObject will require at least the QtCore library and usually more.

    There are non-Qt options for XML (as I pointed out) and I am sure there are network packages as well, but in every case you will have to either build and link to a static library or distribute a shared library (DLL) with your app.

  5. #5
    Join Date
    Nov 2015
    Posts
    41
    Thanks
    5
    Thanked 3 Times in 3 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt modules in plain C++ project

    I know that when I use some xml classes from Qt then I must add at minimum core and xml dll but this is not a problem.

    I want use Qt classes for xml because I already use them in another Qt project and I like them. Now I write plain C++ project and I want to use them.


    What I found:
    http://stackoverflow.com/questions/2...mple-operation

    http://ubuntuforums.org/showthread.p...73#post9112973

    It looks like we can use xml classes from Qt in plain c++ project without any problems.

    Thanks,
    Regards,

Similar Threads

  1. How to install Qt5 add-on modules
    By mentalmushroom in forum Installation and Deployment
    Replies: 1
    Last Post: 17th March 2014, 15:44
  2. Qt modules on Win
    By Maluko_Da_Tola in forum Newbie
    Replies: 3
    Last Post: 25th July 2010, 12:24
  3. QWidget and Qt Modules
    By sandros in forum Qt Programming
    Replies: 7
    Last Post: 21st August 2007, 22:56
  4. Qt modules
    By ber_44 in forum Qt Programming
    Replies: 3
    Last Post: 30th May 2007, 22:10
  5. Qt and Apache modules
    By Matt Smith in forum Qt Programming
    Replies: 2
    Last Post: 22nd February 2006, 11:56

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.