Results 1 to 6 of 6

Thread: QTimer and QProcess

  1. #1
    Join Date
    Sep 2013
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Question QTimer and QProcess

    Please can anyone help me with the following questions .l'm struggling to get them right.
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QTimer and QProcess

    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.

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTimer and QProcess

    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,
    _

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QTimer and QProcess

    l'm struggling to get them right.
    Struggling?? hows that?
    You didn't even take the time to copy&paste it here...
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Sep 2013
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTimer and QProcess

    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.
    Attached Files Attached Files

  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QTimer and QProcess

    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?

Similar Threads

  1. Replies: 1
    Last Post: 3rd June 2013, 13:11
  2. Replies: 0
    Last Post: 23rd March 2013, 19:23
  3. Replies: 1
    Last Post: 25th October 2012, 19:47
  4. Replies: 15
    Last Post: 4th August 2012, 19:11
  5. Replies: 0
    Last Post: 26th August 2010, 10:44

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.