Newbie Question, Main Function?



  • 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?



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



  • [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).



  • 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 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



  • please mark your thread as solved...


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.