struct ConData { QString name; QString driver; QString dbName; QString host; QString user; QString password; int port; QString charset; int charsetIdx;};
QList<ConData> connectionList;
ConnectionDlg *dialog = new ConnectionDlg(this);ConData co1 = connectionList.at(curCon); //curCon - это номер строки в массивеConData co = dialog->showThis(co1);
connectionList.replace(curCon,co);
connectionList[curCon].host = co.host;...и так все поля.
connectionList[curCon]=co;
inline bool QBasicAtomicInt::ref(){ unsigned char ret; asm volatile("lock\n" "incl %0\n" "setne %1" : "=m" (_q_value), "=qm" (ret) : "m" (_q_value) : "memory"); return ret != 0;}
ConData *co1 = &(connectionList[curCon]);ConData co = *dialog->showThis(co1);connectionList[curCon] = co;
C++ (Qt)#include <iostream> using namespace std; struct SubStruct{public: SubStruct() { cout<<"in substruct constructor\n"; } SubStruct(const SubStruct&) { cout<<"in substruct copy constructor\n"; } const SubStruct& operator=(const SubStruct&) { cout<<"in substruct operator=\n"; return *this; }}; struct MyStruct{public: SubStruct ss;}; int main(int , char *[]){ cout<<"Creation:\n"; MyStruct s1, s2; cout<<"Assigning:\n"; s2=s1; cout<<"Copyconstructing=)\n"; MyStruct s3(s1); return 0;}