Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The plan is to search the whole record of all rainfall data for a particular station's data, and then present this data on the client
The plan is to search the whole record of all rainfall data for a particular station's data, and then present this data on the client screen. This search should be done in a thread. Consider the class implementation stub below (where stn is the station's data that is required). StationThread::StationThread(/*all data*/, Qstring stn) : record {/all data*/\}, station { stn } \{\} void Stationthread: : dosearch () f foreach(/*rain record in the data*/) f //get the station, date, and mm as strings if (/*this station in the data*/ == station) \} \} 3.1 Write the class definition for the stationthread class, remembering that it should be run as a thread. (8) 2 Consider the code below that is run when data for a particular rain station is found by the code running in the thread, where QTablewidget tablewidget and int row have already been declared and appropriately initialised. Assume the following code in Client. QThread *t\{new QThread }; StationThread *st\{new stationThread(/*passing parameters*/)\}; Write the code that would follow these declarations to get the thread running with the stationthread object, ensuring that the data is received from the running thread and passed on to the handleFound () function. 3 Would you agree that the QTablewidget used in 3.2 is the best approach that can be used for displaying a station's rainfall data on the client window? Give reasons for your answer. Note that marks are only allocated to your reasoning. (2)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started