Results 1 to 7 of 7

Thread: QT 4.4: CLI apps?

  1. #1
    Join Date
    May 2008
    Posts
    10
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QT 4.4: CLI apps?

    QT 4.4 has become modular as far as I can see. Does that mean we can create pure CLI apps with QT, only using QRegExp for example? QTGui is a "module", too.

    This is probably possible in < QT 4.4, but does that mean we can link such programs without any X11 libraries, if we only use non-gui modules?

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT 4.4: CLI apps?

    All modules depend on QtCore, which implements all base functionality and classes.
    I assume you could marshall a Qt module to a managed application just as you do with a normal library...

  3. #3
    Join Date
    May 2008
    Posts
    10
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QT 4.4: CLI apps?

    So, does QtCore depend on X11 libraries?

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QT 4.4: CLI apps?

    Nope, QtCore doesn't depend on X11.
    J-P Nurmi

  5. #5
    Join Date
    May 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QT 4.4: CLI apps?

    I'm currently writing a CLI application using Qt4, and it works fine.
    You just have to put "QT -= gui" in your .pro file and use QCoreApplication instead of QApplication.

  6. #6
    Join Date
    May 2008
    Posts
    10
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QT 4.4: CLI apps?

    Does this already work with QT 4.3?

  7. #7
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QT 4.4: CLI apps?

    Yes, it works since Qt 4.0. QtCore and QtGui modules are enabled by default. To change included modules, change contents of the QT variable (notice: "QT", not "Qt") in the .pro file. There are different ways to change the variable, for example:
    Qt Code:
    1. QT -= gui # remove gui which is turned on by default
    To copy to clipboard, switch view to plain text mode 
    or
    Qt Code:
    1. QT = core network # set modules to core and network
    To copy to clipboard, switch view to plain text mode 
    For more details, take a look at qmake manual.
    J-P Nurmi

Similar Threads

  1. How to ship Qt apps?
    By Morea in forum Installation and Deployment
    Replies: 2
    Last Post: 22nd June 2008, 12:22
  2. very slowly apps
    By swiety in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2008, 11:05
  3. Replies: 3
    Last Post: 14th April 2007, 12:04
  4. signals and slots between 2 Apps?
    By nupul in forum Qt Programming
    Replies: 9
    Last Post: 12th April 2006, 11:38
  5. Console apps in Kde Qt
    By peedarp in forum Qt Programming
    Replies: 5
    Last Post: 1st February 2006, 10:43

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.