Personal tools
You are here: Home Developer Resources Knowledgebase What does the STL option in the configuration options do?
Document Actions

What does the STL option in the configuration options do?

Entry number: 580 - What does the STL option in the configuration options do?

Answer:

The STL option will make it possible for you to use STL code in your Qt code. In addition the Qt template classes will support APIs that make it easy to convert from and to STL types. In Qt 3.x . QValueList for example feature a constructor that takes a std::list:

http://doc.trolltech.com/3.3/qvaluelist.html#QValueList-3

and QString also provides APIs to support std::string:

http://doc.trolltech.com/3.3/qstring.html#QString-7

http://doc.trolltech.com/3.3/qstring.html#operator-std::string

In Qt 4, QList for example has functions that converts from STL to Qt, e.g

http://doc.trolltech.com/4.0/qlist.html#fromStdList

and QString also provides an API to support std::string, see:

http://doc.trolltech.com/4.0/qstring.html#fromStdString

If you want to use stl in a non Qt sentence, then you don't need to enable this option, but it would be wise to do CONFIG+=stl in your .profile as this turns it on in the compiler if necessary. Visual C++ needs stl to be turned on in your .pro file for example, otherwise it will issue a lot of warnings that mention the -GX option.

 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: