I need to solve the problem with sharing some data between my classes
I thought it would be good idea to check out how QSharedData works, so I cut out the data which used to be encapsulated and shared via static object and made my class public of QSharedData
but I think I misunderstood something because real sharing is not what I received...
what I need to have are classes with mutual access to the list of columns, list of tables (both lists contains cols,tabs from db as strings) which are not modified and there are three variables which can be modified in runtime...
I read the documentation and I think that it is achievable, therefore there must be something I've done wrong
class with data looks like below
public:
QueryHandlerData(){
//appending columns and tables here
}
int lastInsertedId; //can be redundant,QSqlDatabase has the feature which allows to obtain it anywhere
};
class QueryHandlerData : public QSharedData{
public:
QueryHandlerData(){
codec = QTextCodec::codecForName("Windows-1250");
//appending columns and tables here
}
QString connectionName;
QString cStatus;
int lastInsertedId; //can be redundant,QSqlDatabase has the feature which allows to obtain it anywhere
QStringList columns;
QStringList tables;
QTextCodec *codec;
};
To copy to clipboard, switch view to plain text mode
but I saw on forum, that it should implement detach() method, is it a problem here ?
Another problem can be that I can not fully understand the meaning of Implicit and Explicit sharing 
Does the implicit means that shared data is like-hidden, because I that's what I found in the dictionary
Bookmarks