Question: use QT C++ Question 3 [9 marks] The following code fragment should implement a model-view approach to managing and viewing data. 1. QStringListModel model =

 use QT C++ Question 3 [9 marks] The following code fragment

use QT C++

Question 3 [9 marks] The following code fragment should implement a model-view approach to managing and viewing data. 1. QStringListModel model = new QStringListModel () ; 2. // use an appropriate view class 3. // link the model and view 4. QString data ("Data to be added"); 5. int row = model rowcount () ; 6. model->insertRow (row) ; 7. QModelindex index =// find the required index 8. I/ update the model 9. connect (model, SIGNAL (/*signal emitted when model is changed*/), this, SLOT (updateModel())) ; 3.1 Complete the code by replacing the comments with the necessary statements. You need only write down the line numbers and the replaced code. (6) 3.2 What does gModel Index represent in the code above? 3.3 How would QListwidget, a convenience class, differ from QStringListmodel in terms of a model-view approach

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!