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] About QCoreApplication::flush ()
QtWS25 Last Chance

[Solved] About QCoreApplication::flush ()

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 2.6k 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.
  • CAD_codingC Offline
    CAD_codingC Offline
    CAD_coding
    wrote on last edited by
    #1

    Hi,
    I wanted to know what QCoreApplication::flush () does?
    When is it used & why?
    An example would be really helpful to understand.
    I am using a GUI QApplication, so is that of any help to me?
    Thank You,

    1 Reply Last reply
    0
    • B Offline
      B Offline
      b1gsnak3
      wrote on last edited by
      #2

      Why didn't you read the documentation for "flush":http://qt-project.org/doc/qt-4.8/qcoreapplication.html#flush ?

      1 Reply Last reply
      0
      • CAD_codingC Offline
        CAD_codingC Offline
        CAD_coding
        wrote on last edited by
        #3

        I read, but I could not understand what was written.
        That is why asked.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          b1gsnak3
          wrote on last edited by
          #4

          It is used when you want to flush a queue of events to be called immediately. Splash screen is the best example.

          1 Reply Last reply
          0
          • CAD_codingC Offline
            CAD_codingC Offline
            CAD_coding
            wrote on last edited by
            #5

            What exactly do you mean by "flush"?
            From what I can understand it is something similar to processEvents() right?
            If yes then what is the difference?

            1 Reply Last reply
            0
            • B Offline
              B Offline
              b1gsnak3
              wrote on last edited by
              #6

              Yes. Only that flush does this for all pending events at once while processEvents handles them one by one

              1 Reply Last reply
              0
              • CAD_codingC Offline
                CAD_codingC Offline
                CAD_coding
                wrote on last edited by
                #7

                ok. Thanks for the answer.

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  gatis_paeglis
                  wrote on last edited by
                  #8

                  What it really does is, it calls qApp->sendPostedEvents(), see https://bugreports.qt.io/browse/QTBUG-33489

                  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