Unsolved Regarding the CPU Usage in arm board for an example of QTableView while scrolling
-
Can you give a link to the device description ?
-
The link is here , here is the link for the specifications of the device
-
Ok, so you have have a single core 1GHz processor with 512MB of RAM.
What size is your model ?
-
The size is 320 , 240.
-
I meant the data model
-
can u brief me up regarding the data model. what is it.?.
-
@Pradeep-Kumar From your first post: "i have used QStandardItemModel as a model" - so I guess the question is how big is this model (how many elements does it contain)?
-
The standard item model data was having 3 columns and the rows values depends on DB values. it will increase as per the db values.
-
Then what is the usual size of your database ?
-
Without Db also i tried the same, again i have observed the CPU % gradually increases to 100%. i didnt understand the behaviour. please guide me.
-
Without any test case to run, it's pretty much impossible to help you get further. There's also no information about what else is running on your target or what your application does that might or might not be influenced by what happens in your GUI.
-
Their was some daemon process running, when i checked the application.
-
Use top to see which is the processor hog: Likely your application but you have to verify to be sure.
After that confirmation, it would also be useful if you could describe precisely how you trigger that CPU load.
On a side note: which version of Qt are you using ? With which plugin ?
-
I will check the process bu using command top.
I am using Qt version 5.7.<After that confirmation, it would also be useful if you could describe precisely how you trigger that CPU load.>
I didnt get the above statement.
-
After you confirmed that the CPU hog is indeed your application. It would be useful that you describe precisely what you do that makes the CPU go wild.
You didn't wrote which plugin you were using for your application. xcb ? wayland ? eglfs ?
-
Sorry about that missed to inform the plugin, I am using .xcb plugin.
-
Here is link of the screenshot of the cpu usage of the application
Application name is TableViewExample -
Which one of the QTableView example ? This one ?
-
Yes I have used QTableView , the example , and for the model i have used QStandardItemModel.
I will post the code.m_pushButton = new QPushButton("Click To Get Data"); m_standardModel = new QStandardItemModel; m_standardModel->setColumnCount(2); m_standardModel->setRowCount(2000); m_standardModel->setHorizontalHeaderItem(0,new QStandardItem("First Column")); m_standardModel->setHorizontalHeaderItem(1,new QStandardItem("Second Column")); m_tableview = new QTableView; m_tableview->setVisible(false);
connect(m_pushButton,SIGNAL(clicked()),this,SLOT(getData()));
I have created Object in constructor Above lines of code.
And when i click the PushButton, i will be calling getData();void getData()
{
int column_Count = 0;
int row_Count = 0;QStandardItem *item,*item2; for(row_Count=0;row_Count<=2000;row_Count++) { item = new QStandardItem("Qt"); m_standardModel->setItem(row_Count,column_Count,item); item2 = new QStandardItem("Company"); m_standardModel->setItem(row_Count,column_Count+1,item2); } m_tableview->setModel(m_standardModel); m_tableview->setVisible(true);
}
-
Did you check at which number of rows the CPU starts to go under heavy load ?