so for instance if the user is able to select an icon for the TableWidget item and then enter the text for the item you would technically need settings to say save...
WindowSettings.setValue("itemOneText", windowGUI->tableWidget->item(0,0)->text());
WindowSettings.setValue("itemOneIcon", windowGUI->tableWidget->item(0,0)->icon());
WindowSettings.setValue("itemTwoText", windowGUI->tableWidget->item(1,0)->text());
WindowSettings.setValue("itemTwoIcon", windowGUI->tableWidget->item(1,0)->icon());
WindowSettings.setValue("itemOneText", windowGUI->tableWidget->item(0,0)->text());
WindowSettings.setValue("itemOneIcon", windowGUI->tableWidget->item(0,0)->icon());
WindowSettings.setValue("itemTwoText", windowGUI->tableWidget->item(1,0)->text());
WindowSettings.setValue("itemTwoIcon", windowGUI->tableWidget->item(1,0)->icon());
To copy to clipboard, switch view to plain text mode
etc...
I haven't had time to really mess around with converting from QVariant back to say string or image such as the standard .toString() but I would imagine the load would be something like...
windowGui->tableWidget->item(0,0)->setText(WindowSettings.value("itemOneText")).toString();
windowGui->tableWidget->item(0,0)->setText(WindowSettings.value("itemOneText")).toString();
To copy to clipboard, switch view to plain text mode
I'm sure the above code is definitely not syntactically correct I'm just throwing ideas down before hand on a break between my classes!
then again if what I understand of what your saying from encapsulate then I'm able to just save the TableWidget index location or item as an object itself which the object itself say the item at index(0,0) will be saved with both the text, icon per say it would potentially save the actually index location box of the tablewidget no matter if an item was inserted into that location or not, if any short simple examples could demonstrate that then it would be awesome as it would say a ton of time and less code, maybe that might work, any ideas from anyone?
Bookmarks