Results 1 to 3 of 3

Thread: Doubts about STL libraries

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Doubts about STL libraries

    I'm learning c++ and I have a great confusion about standar libraries.

    Why QT creator does not provide help about it ? (It is not neccesary to answer to this...)

    I dont understand why I must to use std::----- . What is std ? is there more 'workspaces' ( I dont know how to name it) ?

    I have found a good reference here, http://www.cplusplus.com/reference/string/, anybody knows other ? A way to get help for inline help into QT Creator ?

    Thanks
    Moved to general
    Last edited by tonnot; 22nd September 2010 at 10:39. Reason: ups, this is not the appropiate forum... sorry

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Doubts about STL libraries

    Qt Creator doesn't come with STL documentation because Qt has some "replacement" for the STL's containers, iterators and algorithm.
    Like you can use (and it's recommended to use) QString instead std::string or std::wstring.

    std is the name of the namespace which contains the standard library so that if you have your own class named <for example> string, you don't need to change your class name, because it won't conflict with the standard library std::string (unless you are using namespace std; //thats way it is not recommended to use the std namespace )

    I think that knowing STL will help you better understand Qt (especially containers-iterator-algorithm), but it is not necessary to know STL for Qt development;
    if you learned STL in Qt you can do one confusion which i did a lot: QList is not a linkedlist like std::list, qt has QLinkedList

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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: Doubts about STL libraries

    Quote Originally Posted by tonnot View Post
    Why QT creator does not provide help about it ? (It is not neccesary to answer to this...)
    As you said yourself STL is a standard library, it's not part of Qt. If you deploy help for STL in Creator, it will use it and give you proper reference.

    I dont understand why I must to use std::----- . What is std ? is there more 'workspaces' ( I dont know how to name it) ?
    These are so called "namespaces". Thanks to that if there is a std::string class, it doesn't conflict with a string class from some other library. You don't have to use std:: prefix, you can declare that you are "using namespace std;" and all symbols from the std namespace will be made available in the default namespace. But then you might get some naming conflicts if you use other libraries.

    A way to get help for inline help into QT Creator ?
    This has already been answered somewhere on this forum.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Doubts about QT Architechture
    By sudheer168 in forum Qt Programming
    Replies: 5
    Last Post: 28th July 2010, 08:53
  2. Yet another bunch of doubts!
    By Nishant in forum Newbie
    Replies: 2
    Last Post: 23rd December 2009, 15:49
  3. doubts regarding QT
    By sudheer168 in forum Qt Programming
    Replies: 1
    Last Post: 23rd September 2009, 09:02
  4. some doubts qtablewidget
    By mmm286 in forum Qt Programming
    Replies: 1
    Last Post: 2nd August 2009, 20:36
  5. Basic C++ doubts
    By munna in forum General Programming
    Replies: 3
    Last Post: 6th April 2006, 16:23

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.