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. Newbie Question, Main Function?
Forum Updated to NodeBB v4.3 + New Features

Newbie Question, Main Function?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 2.7k 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.
  • M Offline
    M Offline
    MrVirtualCoder
    wrote on last edited by
    #1

    I'm aware that the main function (main()) is the first to get executed.

    I've written a function which is to check whether a process is running or not, but I want it to be the first thing to execute BEFORE the construction of my GUI -- getting loaded into memory.
    Calling several GUI objects within the main function, obviously, doesn't work since they are declared after the main function.

    Where am I supposed to call my function, so that it executes firstly?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      shoyeb
      wrote on last edited by
      #2

      where u have written ur function, can u please provide some code, so that i can know where is ur problem....

      There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MrVirtualCoder
        wrote on last edited by
        #3

        [quote author="shoyeb" date="1329668336"]where u have written ur function, can u please provide some code, so that i can know where is ur problem....[/quote]

        [pre-]Declared within my header ("mainwindow.h") and also within my GUI deceleration file ("mainwindow.cpp).

        1 Reply Last reply
        0
        • JeroentjehomeJ Offline
          JeroentjehomeJ Offline
          Jeroentjehome
          wrote on last edited by
          #4

          Well, if you used designer, I would suggest checking the process before the SetupUi(this) stuff. Or maybe in the main() before the creation of your MainWindow class.
          greetz

          Greetz, Jeroen

          1 Reply Last reply
          0
          • M Offline
            M Offline
            MrVirtualCoder
            wrote on last edited by
            #5

            [quote author="Jeroentje@home" date="1329670097"]Well, if you used designer, I would suggest checking the process before the SetupUi(this) stuff. Or maybe in the main() before the creation of your MainWindow class.
            greetz[/quote]
            I can't believe I didn't see that--thanks for the help!

            Got it working now :D

            1 Reply Last reply
            0
            • S Offline
              S Offline
              shoyeb
              wrote on last edited by
              #6

              please mark your thread as solved...

              There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code.

              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