PDA

View Full Version : QTimer and QProcess



LENYME
15th September 2013, 22:37
Please can anyone help me with the following questions .l'm struggling to get them right.

ChrisW67
15th September 2013, 23:14
Question 1

Create a simple GUI that allows the user to enter a student number, module code, and mark.
These should then be output to the console in any format.
Include error checking so that information will be correctly entered.
• The student number is a 4-digit number.
• The module code is made up of 3 uppercase alphabetic characters, followed by a 1, 2, or 3
(for the year), and then a further 2 digits. The final character could be any character
(alphabetic or digit).
• The mark should be an integer between 0 and 100.
This program will be used in the next question as a separate process used to gather data from
the user.


Question 2

Create a simple GUI application (that you will extend in the next question) that, when a button is
clicked, the program that you created in Question 1 is started as a separate process. When the user clicks the add button in this process, the data should be displayed on the GUI.
Hints:

• Have a look at the QProcess class documentation, specifically at the readyReadStandardOutput() signal.
• You will need to then read this output, and display it in the window.
• Remember to move the .exe file from Question 1’s Debug folder to Question 2’s Debug
Folder.

You are kidding, right? It is your course work... you will not learn anything if we do it for you.

Members here are fairly generous but you have to demonstrate that you've made an effort. If you want help with a specific element of your solution then demonstrate what you have done, what you are expecting to see/get, what you are actually seeing/getting, and what you have tried/investigated to try and make it work.

anda_skoa
15th September 2013, 23:22
That looks like a school or university assigment, which are usually intended to help the student to learn by practising.

Providing a student with any code without any effort from the student would deprive the student from the actual knowledge gain.

Cheers,
_

high_flyer
16th September 2013, 11:36
l'm struggling to get them right.
Struggling?? hows that?
You didn't even take the time to copy&paste it here...

LENYME
21st September 2013, 22:10
Hi guys

I have attached Question1 and Question2 source codes.Question 1 is fine ,but the problem is with Question2 when l click Add Module button
it must show Quesion1 form and if you enter the information it must output it on the Question2's TextEdit thats according to the Question2 but nothing is happening.PLEASE USE THE QUESTIONS I POSTED LAST WEEK.

ChrisW67
21st September 2013, 22:41
I am assuming "p" is a QProcess member variable.

What are the possible reasons you can think of that might cause the child process to do nothing?
What ways does QProcess have to report the status of the child process (signals, return values, member functions)?
Have you checked any of these?