Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    [SOLVED] purpose of qApp

    General and Desktop
    2
    5
    2392
    Loading More Posts
    • 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
      xeroblast last edited by

      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 Reply Quote 0
      • M
        mlong last edited by

        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 Reply Quote 0
        • X
          xeroblast last edited by

          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 Reply Quote 0
          • M
            mlong last edited by

            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 Reply Quote 0
            • X
              xeroblast last edited by

              ok.. thanx..

              1 Reply Last reply Reply Quote 0
              • First post
                Last post