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. Stack overflow error with signal & slots
Forum Updated to NodeBB v4.3 + New Features

Stack overflow error with signal & slots

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 2.3k 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.
  • C Offline
    C Offline
    c0d3r
    wrote on last edited by
    #1

    I am not sure why this is blowing the stack, how can I correct this code?

    http://pastebin.com/gxaGHmbB

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by VRonin
      #2

      Use textEdited()signal instead of textChanged()

      The explanation of why you are having this is that when you call setText() a new textChanged() signal is emitted and so on to infinity (or up to the limit of the size of the stack that then goes overflow)

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      C 1 Reply Last reply
      2
      • VRoninV VRonin

        Use textEdited()signal instead of textChanged()

        The explanation of why you are having this is that when you call setText() a new textChanged() signal is emitted and so on to infinity (or up to the limit of the size of the stack that then goes overflow)

        C Offline
        C Offline
        c0d3r
        wrote on last edited by
        #3

        @VRonin awesome, I realized I now why I was causing a new event to get fired, thanks!

        1 Reply Last reply
        0
        • ? Guest
          C Offline
          C Offline
          c0d3r
          wrote on last edited by
          #4

          @mrjj I didn't know about this handy debug helper, thanks for pointing it out :)

          mrjjM 1 Reply Last reply
          0
          • C c0d3r

            @mrjj I didn't know about this handy debug helper, thanks for pointing it out :)

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @c0d3r
            yes qDebug() is super
            most Qt classes have overloaded << for it

            so
            qDebug() << "info:" << someqtobject ;
            works really well :)
            Even lists etc.

            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