LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-23-2003, 09:34 AM   #1
Gizard
LQ Newbie
 
Registered: Oct 2003
Posts: 5

Rep: Reputation: 0
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:penTimeTable() {
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
 
Old 10-23-2003, 04:45 PM   #2
nhs
Member
 
Registered: Aug 2003
Location: Edinburgh, Scotland
Distribution: Gentoo
Posts: 246

Rep: Reputation: 30
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.
 
Old 02-06-2004, 02:39 AM   #3
Gizard
LQ Newbie
 
Registered: Oct 2003
Posts: 5

Original Poster
Rep: Reputation: 0
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
 
Old 02-06-2004, 02:41 AM   #4
Gizard
LQ Newbie
 
Registered: Oct 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Regit schools colleges timetable
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
custom install cd base-config custom mithereal Debian 6 09-11-2005 03:48 PM
Custom scripts Minnie000 Linspire/Freespire 1 04-24-2005 03:30 PM
custom geforce video card--custom module? bandofmercy Linux - Hardware 3 10-14-2004 06:52 PM
Custom Kernal atllinux Linux - Newbie 0 08-20-2003 10:17 PM
Custom modeline mrsolo Linux - Laptop and Netbook 2 08-16-2003 01:53 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration