Results 1 to 6 of 6

Thread: STL or Qt

  1. #1
    Join Date
    Nov 2006
    Location
    Reading, Berkshire, UK
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default STL or Qt

    Hi all,

    Just got Qt and I see that there are loads of classes like QString and QFile. I only need a GUI to read a file created by a console application written in C++ with STL. The GUI calls the executable with a system("query_db.exe") and then reads the file and shows it contents in a spreadsheet.

    Would I be better off to learn the QString and QFile classes or to stick with the STL ones I am familiar with?

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

    Default Re: STL or Qt

    It really depends on what you like. Qt is STL compatible, but you might want to get rid of STL dependency in favour of using Qt classes which in many cases are much faster than their STL counterparts.

    BTW. You might want to replace the "system()" call with QProcess. Using system() will cause your GUI to be irresponsive during the life of that child process. Using QProcess you can avoid that.

  3. #3
    Join Date
    Nov 2006
    Location
    Reading, Berkshire, UK
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: STL or Qt

    I think you are right and learning the Qt framework and mindset makes sense. No point in fighting against your own toolkit when you chose it because its nice ;-)

    Thanks for the performance tip as well.

  4. #4
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Thanks
    76
    Thanked 37 Times in 32 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: STL or Qt

    in many cases are much faster than their STL counterparts.
    Such as. or Could you point me to some links, where is it mentioned ?
    We can't solve problems by using the same kind of thinking we used when we created them

  5. #5
    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: STL or Qt

    Generic Containers
    These container classes are designed to be lighter, safer, and easier to use than the STL containers. If you are unfamiliar with the STL, or prefer to do things the "Qt way", you can use these classes instead of the STL classes.

    The container classes are implicitly shared, they are reentrant, and they are optimized for speed, low memory consumption, and minimal inline code expansion, resulting in smaller executables.
    J-P Nurmi

  6. The following user says thank you to jpn for this useful post:

    sunil.thaha (17th November 2006)

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

  8. The following user says thank you to wysota for this useful post:

    sunil.thaha (17th November 2006)

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.