[PySide] DataMapper issues

Srini Kommoori vasure at gmail.com
Mon Feb 18 16:30:51 CET 2013


Try this documentation to understand the event loop. If you are familiar
with other gui frameworks, they have something similar. For eg: objective c
- NSApplication. Gtk - gtk_init

http://qt-project.org/doc/qt-5.0/qtwidgets/qapplication.html
and
http://qt-project.org/doc/qt-5.0/qtcore/qcoreapplication.html




On Sun, Feb 17, 2013 at 7:55 PM, Adrian Klaver <adrian.klaver at gmail.com>wrote:

> On 02/17/2013 07:28 PM, Srini Kommoori wrote:
>
>> For any Qt App, QtGui.QApplication is a main event loop. Every gui app
>> needs one QtGui.QApplication.
>>
>> There could be muliple View/UI elements depending on developers wish.
>> 1. QWidget/QMainWindow
>> 2. QWebkit
>> 3. QGraphicsView
>> 4. QDeclarativeView
>>
>> You can keep changing the views depending on the app requirements.
>>
>> Hope that helps.
>>
>
> Yes, but what I do not understand is in the following sequence;
>
> if __name__ == '__main__':
>
>     import sys
>
>     app = QtGui.QApplication(sys.argv)
>     if not connection.createConnection():
>         sys.exit(1)
>
>     model = QtSql.QSqlTableModel()
>
>     initializeModel(model)
>
>     view1 = createView("Table Model (View 1)", model)
>     view2 = createView("Table Model (View 2)", model)
>
>     view1.show()
>     view2.move(view1.x() + view1.width() + 20, view1.y())
>     view2.show()
>
>     sys.exit(app.exec_())
>
>
> Once app is instantiated how are view1 and view2 hooked into it without
> there being an explicit link?
>
>
>> -Srini
>>
>>
> --
> Adrian Klaver
> adrian.klaver at gmail.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20130218/1bf12173/attachment.html>


More information about the PySide mailing list