LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   QT custom constructer (https://www.linuxquestions.org/questions/programming-9/qt-custom-constructer-107564/)

Gizard 10-23-2003 09:34 AM

QT custom constructer
 
Hi I am building an applications that is split into sections.

My Main application is a timetable register program that works quite well. I have made a new application (getter) that will search for timetables (xml files) and list them. I need to get the getter application to return a values but I can't because the constructor will not allow a return value. The return value is the a QString that holds the Path to the timetable (xml file) that needs to be opened.
How do I ceate my module to return a value.

I am new to QT but I thought I could create modules indepentanlt (but share the basic app libs). Then tie the apps together. I have done this with one of my modules but a return value was not needed.

void Regit::classCreator() {
Creator* nCreator;
nCreator = new Creator();
nCreator->show();
}

I need something like this:


void Regit::openTimeTable() {
QString filetoopen;
nCreator = new Getter();
nCreator->show();
//nCreator exits and returns a value
filetoopen = nCreator.exits();

// open the new file
timetable.openTimeTable( filetoopen );
}

The code for the basic release is @
sourceforge.net/projects/regit/
and
regit.sourceforge.net

I am currently looking for developers to lend a hand? hint hint

Gizard :D

nhs 10-23-2003 04:45 PM

In the code you have there the constructor doesn't need to return a value, it is the exits() function which must return the value. You will just need to redefine exits() in your class with your own code and write the function to return a value.

Gizard 02-06-2004 02:39 AM

Thank NHS, The main point of the question is that when the module closes, it need to pass back a value (maybe in the deconstructor).
Would I need to get the closing module to call a method (passing data) within the main module then close.
It's really hard to explain what I mean without showing you. I have decided to go for a redesign. keep your eye out. <a href="http://regit.sourceforge.net target="_blank">Regit.sourceforge.net, timetable register</a>
Regit Schools colleges timetable register solution

Gizard 02-06-2004 02:41 AM

Regit schools colleges timetable


All times are GMT -5. The time now is 02:02 AM.