Results 1 to 7 of 7

Thread: Qt and CGI routines

  1. #1
    Join Date
    Jan 2006
    Posts
    73
    Thanks
    16
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt and CGI routines

    Hello,
    Is Qt of any help to write a C++ CGI aplication? Or maybe there is something better inside Qt to write routines that can interact with web pages?
    Thank you

  2. #2
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt and CGI routines

    Quote Originally Posted by jcr View Post
    Hello,
    Is Qt of any help to write a C++ CGI aplication? Or maybe there is something better inside Qt to write routines that can interact with web pages?
    Thank you
    Last week i have end to write a QT4.2 CMS + Ecommerce manager to handle web page....
    CMS is install local on window & Mac .... or static on a usb stick...

    QT can hande so good xml file & html ....
    on sqlite i have put category & page on web server php5 maintain a qtsitemap to load structure on xml....

    qt write xml file & upload to server on PUT method
    the full application contain tidylibs xsltlibs now i have append a unzip lib to import openoffice file.... & direct transform to html + image extract & convert to jpg....

    On server php5 must only transform xml file to xhtml page or PDF file and put a mysqlbasket to order item, one xml file 200Kb can write moore as 1000 webpage on xslt document method....
    http://www.w3schools.com/xsl/func_document.asp

    I suppose to write all on CGI aplication same as console application ... is a lot of work.... but possibel....

  3. #3
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt and CGI routines

    Yes, it's possible to write CGI program with C++ (and Qt). I wrote one for my last job. CGI programming is essentially string processing, so QString will make the job easier.

  4. #4
    Join Date
    Jan 2006
    Posts
    73
    Thanks
    16
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt and CGI routines

    Thanks for sharing the experience. Did you use special CGI libraries? For instance, to handle GET and POST data, to output html, or to manage cookies...?

  5. #5
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt and CGI routines

    Quote Originally Posted by jcr View Post
    Thanks for sharing the experience. Did you use special CGI libraries? For instance, to handle GET and POST data, to output html, or to manage cookies...?
    QHttp make all on network only coffe cant not make.... search "cookie" on this forum... or POST GET or QHttpResponseHeader

  6. #6
    Join Date
    Jan 2006
    Posts
    73
    Thanks
    16
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt and CGI routines

    Maybe I don't understand things here but I was under the impression that QHttp handles only the client side of the Http protocol and not the server side. To write a CGI app, I need for instance routines to parse the QUERY_STRING and I don't think it exists in QHttp. As Brandybuck suggested, QString comes in handy at that point but it looks like Qt does not have something specifically tailored for cgi programs.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt and CGI routines

    Parsing query_string is quite easy if you have QString around. Just split the string around & and then around "=". You can then even construct a QMap that will keep all the arguments.

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.