Reimplemented QAbstractTableModel::setData
if(role!=Qt::EditRole||
         index.row()&lt;0||
         index.row()&gt;=this-&gt;m_ueJsonData.isArray()?this-&gt;m_ueJsonData.array().size():this-&gt;m_ueJsonData.isObject()?this-&gt;m_ueJsonData.object().size():0||
         index.column()&lt;0||
         index.column()&gt;=this-&gt;m_ueJsonData.isArray()?this-&gt;m_ueJsonData.array().size():this-&gt;m_ueJsonData.isObject()?this-&gt;m_ueJsonData.object().size()&gt;0?this-&gt;m_ueJsonData.object().size():0:0)
{


Stop. Regardless of what you're doing here, you should not be doing so many things in one condition. This looks like you need to write a new function instead.

Talking about functions, they'd greatly improve the readability and maintainability of your code. Now you got everything in one big bool. Your while could use it's own function. The data changing, inserting and replacing could probably use a wrapper as well. If you give those functions meaningful names, the readability will increase big time!

Imagine the following:


  You haven't touched this code in 6 months. Now you want to add a feature. To add this feature, you try to understand how this code works and why you wrote it like this. Since it has been a while, you can't rely on your memory. How long would it take you to grasp the workings of this function?


Exactly. Way longer than necessary. Now imagine you share this code. Like you did here. How long does it take someone not familiar with your program to figure it out? Way longer than necessary.

For the sake of your future self, improve the readability of the code by splitting things up.