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] purpose of qApp

[SOLVED] purpose of qApp

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.7k 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.
  • X Offline
    X Offline
    xeroblast
    wrote on last edited by
    #1

    on my "last post":http://developer.qt.nokia.com/forums/viewthread/4524, i look on how to print documents and on the middle of tracing the code sample. i came across a qApp and it bugs me cause i dont know how and what is its use. it is in the constructor and the printDocument function of the cpp file of the Font Sampler.

    can anyone or anybody tell me what is it?

    thanks...

    [EDIT: fixed link, Volker]

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

      See "here...":http://doc.qt.nokia.com/4.7-snapshot/qapplication.html#qApp

      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
      • X Offline
        X Offline
        xeroblast
        wrote on last edited by
        #3

        ok. i get it now but i have another question.

        how does qApp detect the name of the "Cancel" button when the progress dialog appear?

        in the constructor, there is a connect() to cancel the process. how does the Font Sampler knew that the "quitAction" is the name of the "Cancel" button?

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

          I assume you're talking about the mainwindow.cpp file in the fontsampler demo (some detail in your question would help.)

          You're mixing up a couple of things. The connect (at line 58) doesn't have anything to do with canceling the progress dialog. quitAction's triggered() slot is connected to the QApplication::quit() slot, which exits the application. quitAction is defined in mainwindowbase.ui. It knows about that connection because of the connect.

          The cancellation of the progress dialog is handled down at line 293, where the status of the progress dialog is specifically checked to see if it was canceled.

          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
          • X Offline
            X Offline
            xeroblast
            wrote on last edited by
            #5

            ok.. thanx..

            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