Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Qt containers memory handling
Forum Updated to NodeBB v4.3 + New Features

[Solved] Qt containers memory handling

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 594 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    moravas
    wrote on last edited by
    #1

    Hi folks,

    during our project we faced that we must know whether was the last operation on the given container successfull or not? I tried to found some article whitout any result.
    Is there any official way to check the result of the:

    • adding of element
    • resize
    • ...etc

    Regards,
    Norbert

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi,

      I think it's safe to assume that those functions will only fail if you run out of memory, which will give you a std::bad_alloc exception. You can catch that exception.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • Chris KawaC Offline
        Chris KawaC Offline
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by
        #3

        That's not a safe bet in an exception populated program. Although Qt is itself exception neutral its exception handling in user code is lacking to some degree. It "works" in most cases if you're careful enough though.
        The topic is described in some details "here":http://qt-project.org/doc/qt-5/exceptionsafety.html

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved