Results 1 to 4 of 4

Thread: Console application questions

  1. #1
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Console application questions

    Hi.
    I'm trying to create a small console application that should be a tcpserver. I'm a little interested in how a minimal main.cpp file should look.
    Any small short informative example would be nice

    I'm thinking of creating a class "main", and then create an object that is the actuall "program". Is this alright?
    The "main" class should be a tcpserver, so I guess I should subclass from the QTcpServer?

    A question: how do I quit from my program?
    Let's say it calls one of it's own methods "giveUp()" that disconnects all connections and then quits, how should I quit?

  2. #2
    Join Date
    Jul 2006
    Location
    Atlanta, GA
    Posts
    86
    Thanks
    26
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Console application questions

    http://doc.trolltech.com/4.4/index.html is the best place to start
    fnmblot
    --------------------------------------
    Gee Ricky, I'm sorry your mom blew up.

  3. #3
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Console application questions

    Hmm, the docs are a little sparse sometimes when it comes to how to structure your programs.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Console application questions

    Quote Originally Posted by Morea View Post
    Let's say it calls one of it's own methods "giveUp()" that disconnects all connections and then quits, how should I quit?
    The same way as in GUI application. Make QCoreApplication::exec() return by calling quit().

Similar Threads

  1. Replies: 8
    Last Post: 28th January 2015, 09:45
  2. about console application
    By jirach_gag in forum Qt Programming
    Replies: 2
    Last Post: 5th January 2012, 11:39
  3. Console application suspense
    By TheGrimace in forum Newbie
    Replies: 6
    Last Post: 1st October 2007, 14:52
  4. build a gui ontop of a console application
    By aegis in forum Qt Programming
    Replies: 3
    Last Post: 25th March 2007, 12:16
  5. application design questions
    By nikita in forum Qt Programming
    Replies: 6
    Last Post: 28th August 2006, 00:35

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
  •  
Qt is a trademark of The Qt Company.