2010/5/9 Mark Summerfield <[email protected]>: > On 2010-05-08, Vadym Honcharuk wrote: >> Hi to All, >> >> I need three tables with master-detail relationship one to other. I >> made QTableView Model from Mark book and three vertical frame on one >> page for it. How possible connect these tables with master-detail >> relationship? Examples are really welcome if possible... > > Hi Vadym, > > My book shows how to do master-detail in the context of a SQL database > (e.g. pp. 463), but the same technique can be applied to any pair of > table models. > > One approach is to connect the master table's selectionModel()'s > currentRowChanged(QModelIndex,QModelIndex) signal to a custom slot. > Then, in the custom slot you handle the populating of the detail table, > for example, by filtering (which you can do with a sort/filter proxy > model). > > > -- > Mark Summerfield, Qtrac Ltd, www.qtrac.eu > C++, Python, Qt, PyQt - training and consultancy > "C++ GUI Programming with Qt 4" - ISBN 0132354160 >
Thank you, Mark! One more question in this issue is how to save data from these three tables with different models in one file by QDataStream module. The point of problem in that save method calling from their models itself and if I have three models - every will try open same file and save data in series? But seems this is not too correct desicion... With best rgards, -vadym _______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
