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] getting notified that the app has started
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] getting notified that the app has started

Scheduled Pinned Locked Moved General and Desktop
10 Posts 4 Posters 3.2k 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.
  • R Offline
    R Offline
    ryadav
    wrote on last edited by
    #1

    what is the simplest way to get notified the application has started running and the message loop is getting processed?

    so if i want to be notified in one of my windows, like a QWidget or QMainWindow, how can i do this?

    Kind Regards,
    Rajinder Yadav

    SafetyNet Test Driven Development
    http://safetynet.devmentor.org

    1 Reply Last reply
    0
    • A Offline
      A Offline
      amban
      wrote on last edited by
      #2

      Hi,
      If you are using Qt Creator to develop your program then you can spot the "3. Application Output" button in the bottom-most row called Locator in the GUI. If you're not using the IDE then you could insert this line to test
      @
      qDebug() << "Application Started" ;
      @

      Hope this helps.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        ryadav
        wrote on last edited by
        #3

        one other question, where do i find a list of of ALL events a qt widget gets sent? i don't see this in the API docs???

        Kind Regards,
        Rajinder Yadav

        SafetyNet Test Driven Development
        http://safetynet.devmentor.org

        1 Reply Last reply
        0
        • R Offline
          R Offline
          ryadav
          wrote on last edited by
          #4

          amban i don't understand your answer.

          1. i want to be notified when my window object gets initialized for the 1st time, how do i do this?

          2. the app object, does it send off an event to say it's started that i can hook/listen too?

          Kind Regards,
          Rajinder Yadav

          SafetyNet Test Driven Development
          http://safetynet.devmentor.org

          1 Reply Last reply
          0
          • C Offline
            C Offline
            cincirin
            wrote on last edited by
            #5

            Maybe "QWidget::showEvent":http://doc.qt.nokia.com/latest/qwidget.html#showEvent is what are you looking for.

            1 Reply Last reply
            0
            • R Offline
              R Offline
              ryadav
              wrote on last edited by
              #6

              i was thinking about showEvent, but that gets called every time a show happen correct?

              what i want is something that is called once during initialization, i was hoping there was something like an oninit message or event

              Kind Regards,
              Rajinder Yadav

              SafetyNet Test Driven Development
              http://safetynet.devmentor.org

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mlong
                wrote on last edited by
                #7

                You could always set up a "QTimer::singleShot()":http://doc.qt.nokia.com/4.7/qtimer.html#singleShot call with a timeout of 0 before you start your main loop. It will then get processed early on as the eventloop starts up.

                Software Engineer
                My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  ryadav
                  wrote on last edited by
                  #8

                  mlong that's the solution we went with after a search, thanks!

                  Q: so that i understand this correctly, a timer event is posted to the message queue and then QApplication starts up and process the timer queued message.

                  Kind Regards,
                  Rajinder Yadav

                  SafetyNet Test Driven Development
                  http://safetynet.devmentor.org

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    mlong
                    wrote on last edited by
                    #9

                    [quote author="ryadav" date="1311363814"]
                    Q: so that i understand this correctly, a timer event is posted to the message queue and then QApplication starts up and process the timer queued message.[/quote]

                    Exactly!

                    Software Engineer
                    My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                    1 Reply Last reply
                    0
                    • R Offline
                      R Offline
                      ryadav
                      wrote on last edited by
                      #10

                      Got it mlong, thanks!

                      Kind Regards,
                      Rajinder Yadav

                      SafetyNet Test Driven Development
                      http://safetynet.devmentor.org

                      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