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. So, the exec( ) should be abandoned ?
QtWS25 Last Chance

So, the exec( ) should be abandoned ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 5 Posters 347 Views
  • 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.
  • cyberpunkerC Offline
    cyberpunkerC Offline
    cyberpunker
    wrote on last edited by
    #1

    I thind most of Qter know these three articles:

    • Unpredictable exec()
    • QtQuarterly30 : New Ways of Using Dialogs
    • How to crash (almost) every Qt/KDE Application and how to fix it

    It is seems that the exec() to be a little evil . So , If we overloading of QDialog, we should avoiding using the exec() ?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Please post links to these articles, I do not know them.

      Without reading them, I'd say exec() is OK, especially for small and simple things (like getting a save file name, displaying a popup message etc.), as long as you remember that main event loop will be spinning in the background.

      (Z(:^

      1 Reply Last reply
      6
      • cyberpunkerC cyberpunker

        I thind most of Qter know these three articles:

        • Unpredictable exec()
        • QtQuarterly30 : New Ways of Using Dialogs
        • How to crash (almost) every Qt/KDE Application and how to fix it

        It is seems that the exec() to be a little evil . So , If we overloading of QDialog, we should avoiding using the exec() ?

        [Locked as duplicate of https://forum.qt.io/topic/110180/so-the-exec-should-be-abandoned ~kshegunov]

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by kshegunov
        #3

        @cyberpunker
        I have read various articles on this. Meanwhile I have used exec() just as you would expect happily for years, and found no ill effects. So up to you, but especially as I think you are learning I would use QDialog::exec() where appropriate and not worry about it :)

        [Moved in from a duplicate topic ~kshegunov]

        1 Reply Last reply
        4
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi
          if exec( ) should be abandoned i will surely burn in hell as my main Qt project is
          mainly QDialogs using exec(). :)

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            If you are heavily processing custom events or using threading, you may have unexpected behavior because it's not the same event loop that will be processing these events while exec is running hence the recommendation of using open and a slot for the result handling.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            3

            • Login

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