How to design the code for dynamic created the tablewidgetitems?
-
The project has a feature to acomplish that created the tablewidgettiems dynamically.
I use the code like thiswhen init the tablewidgettiems by using the code like this
for(int size_count;size_count<size_target;size_count++) TableWidgetItems.create() ... codewhen update the tablewidgettiems like this
update size_count; delelte TableWidgetItems; for(int size_count;size_count<size_target;size_count++) TableWidgetItems.create() ... codeand the code seemed so ugly and unusefully ,so anyone could show me an useful way to design the code?
-
The project has a feature to acomplish that created the tablewidgettiems dynamically.
I use the code like thiswhen init the tablewidgettiems by using the code like this
for(int size_count;size_count<size_target;size_count++) TableWidgetItems.create() ... codewhen update the tablewidgettiems like this
update size_count; delelte TableWidgetItems; for(int size_count;size_count<size_target;size_count++) TableWidgetItems.create() ... codeand the code seemed so ugly and unusefully ,so anyone could show me an useful way to design the code?
@nicker-player Sorry, I don't understand the problem.
And you only posted some pseudo-code, so how can anybody know what you mean by "ugly and unusefully"?
Please post your real code and explain what you do not like about it. -
In fact,there are lots of files of the codes,and is hard to publish on the forum.
And I just want to learn some codes about dynamically created the tablewidgetitems based on the input content by the users.
It would be good if there's an example of what I just want to figured out. -
In fact,there are lots of files of the codes,and is hard to publish on the forum.
And I just want to learn some codes about dynamically created the tablewidgetitems based on the input content by the users.
It would be good if there's an example of what I just want to figured out.@nicker-player said in How to design the code for dynamic created the tablewidgetitems?:
In fact,there are lots of files of the codes,and is hard to publish on the forum.
Then reduce it to some minimal example of what you want --- nobody wants to look through masses of irrelevant code.
It would be good if there's an example of what I just want to figured out.
I'm afraid nobody knows what you have in mind, so nobody will know what example you are looking for.
-
In fact,there are lots of files of the codes,and is hard to publish on the forum.
And I just want to learn some codes about dynamically created the tablewidgetitems based on the input content by the users.
It would be good if there's an example of what I just want to figured out.@nicker-player said in How to design the code for dynamic created the tablewidgetitems?:
In fact,there are lots of files of the codes,and is hard to publish on the forum.
I did not ask you to post all the code you have. I asked you to post RELEVANT code which you do not like. Why is it so hard? How should anybody understand what you are asking from what you posted so far?