Results 1 to 19 of 19

Thread: How modern is C++ language used in Qt's API?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,370
    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: How modern is C++ language used in Qt's API?

    Quote Originally Posted by piotr.dobrogost View Post
    1. What about using plain pointers in API?
    What's wrong with that? Nobody prevents you from wrapping them in some smart pointer classes provided you know what you are doing.

    2. What about not using exceptions to communicate errors?
    C++ exceptions suck.

    3. What does Qt do to support standard containers?
    If by "standard" you mean std::vector and family then Qt containers have conversion methods to and from STL counterparts.

    Can I use standard container in every place I can use qt container?
    No, because there are platforms without STL implementations (or with broken ones) so in those situations you have to use Qt containers. Apart from that Qt containers and STL containers are API compatible. Qt containers tend to be faster, though. And of course they have some methods STL ones don't, i.e. QString::split().

    If the answer is not does qt provide adapters at least?
    I guess I already answered that.

    (Bear in mind a string is a container, too.)
    QString::fromStdString(), QString::toStdString(), QString::fromStdWString(), QString::toStdWString(). Enough? Bear in mind std::string is not Unicode compatible so you might experience loss of functionality.

    4. What does Qt do to make it easy to use its containers with the rest of the Standard
    Library?
    You can use Qt containers with STL algorithms.

    Does Qt provide adapters so that I could use qt container in every place I can use a
    standard one?
    No, because they are compatible. No adapters are required.

    These are the things that come to mind when one uses any C++ library.
    I guess that's settled then.

    5. Has anyone from Qt checked how much of moc could be implemented with features
    found in current standard?
    Oh, this has already been argued - "use templates instead of moc". I can redirect you to the documentation, that's a big topic. Bottom line is moc gives you some benefits that wouldn't be possible with templates and you don't have to use moc if you don't want to - use Boost signals.

    Has this been tried with features from upcomming standard?
    This I have no chance of knowing but I guess the word "upcoming" says it all. I think once all supported platforms have compilers supporting C++1x (there is no way it's going to be called 0x, it's already 2009) we might return to the topic but now this is only academic talk bearing the fact C++1x is still fluctuating.

    6. Is there any official document stating what's Trolltech/Nokia position with regard to
    using new language features?
    I'm not aware of such document. If you're interested in it, I think contacting Matthias Ettrich would be the best way of answering your question.

    I'm sure I'll have more questions in the course of learning and using Qt.
    Please ask them, we'll try our best to answer them.

    Edit: by the way, C++1x (or 0x, whatever you want to call it) will not be any revolution compared to C++03. It will just make some things easier for developers but there will be no sense in rewriting code that is already written unless you have situations where the new standard will yield an execution performance boost. Again, nobody prevents you from using a C++0x compiler with Qt even now.
    Last edited by wysota; 30th May 2009 at 14:22.
    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. Qt language of choice
    By alecs1 in forum Qt Programming
    Replies: 4
    Last Post: 26th April 2009, 20:13
  2. Replies: 4
    Last Post: 6th February 2009, 11:21
  3. Replies: 8
    Last Post: 15th May 2007, 09:21
  4. Discovery correct Language on all OS
    By patrik08 in forum Qt Programming
    Replies: 5
    Last Post: 25th February 2007, 19:27
  5. How can I add any other language
    By ethos0714 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 22nd February 2006, 02:51

Tags for this Thread

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.