kde-playground/kdepim/examples/etm_usage
Ivailo Monev a9b00154bc generic: replace forward class declarations with header inclusions
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
2019-07-31 18:05:48 +00:00
..
categorizedentitymodel.h import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
checkable2.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
checkable2.h generic: replace forward class declarations with header inclusions 2019-07-31 18:05:48 +00:00
CMakeLists.txt kdepim: cleanup 2015-09-23 11:27:31 +00:00
collectionmonitoredwidget.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
collectionmonitoredwidget.h generic: replace forward class declarations with header inclusions 2019-07-31 18:05:48 +00:00
desctab.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
desctab.h generic: replace forward class declarations with header inclusions 2019-07-31 18:05:48 +00:00
entityfindingwidget.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
entityfindingwidget.h generic: replace forward class declarations with header inclusions 2019-07-31 18:05:48 +00:00
entitytreemodelfactory.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
entitytreemodelfactory.h import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
entitytreewidget.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
entitytreewidget.h generic: replace forward class declarations with header inclusions 2019-07-31 18:05:48 +00:00
itemviewerwidget.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
itemviewerwidget.h generic: replace forward class declarations with header inclusions 2019-07-31 18:05:48 +00:00
mailmodel.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
mailmodel.h import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
main.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
mainwindow.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
mainwindow.h import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
mixedtreemodel.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
mixedtreemodel.h import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
noteviewer.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
noteviewer.h generic: replace forward class declarations with header inclusions 2019-07-31 18:05:48 +00:00
README import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
recursiveitemlistwidget.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
recursiveitemlistwidget.h generic: replace forward class declarations with header inclusions 2019-07-31 18:05:48 +00:00
tab1widget.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
tab1widget.h import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
tab2_5widget.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
tab2_5widget.h generic: replace forward class declarations with header inclusions 2019-07-31 18:05:48 +00:00
tab2widget.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
tab2widget.h generic: replace forward class declarations with header inclusions 2019-07-31 18:05:48 +00:00
tab3widget.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
tab3widget.h generic: replace forward class declarations with header inclusions 2019-07-31 18:05:48 +00:00
tab4widget.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
tab4widget.h generic: replace forward class declarations with header inclusions 2019-07-31 18:05:48 +00:00
tab5widget.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
tab5widget.h generic: replace forward class declarations with header inclusions 2019-07-31 18:05:48 +00:00
tab6widget.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
tab6widget.h generic: replace forward class declarations with header inclusions 2019-07-31 18:05:48 +00:00
tab7widget.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
tab7widget.h generic: replace forward class declarations with header inclusions 2019-07-31 18:05:48 +00:00
unreadmailsincollectionswidget.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
unreadmailsincollectionswidget.h generic: replace forward class declarations with header inclusions 2019-07-31 18:05:48 +00:00
unreadmailswidget.cpp import working copies of kdepim and kdepimlibs 2015-04-14 21:49:29 +00:00
unreadmailswidget.h generic: replace forward class declarations with header inclusions 2019-07-31 18:05:48 +00:00

This example application shows various ways of using the EntityTreeModel.

Each tab shows a different widget which might form part of an application. You will need to
read the code to understand how things work. Generally, things are clicked together by
creating specific proxy models to achieve a particular goal. To make collections checkable, for example,
the CheckableItemProxyModel is used. See tab6widget and checkable2.

Most tabs use an EntityTreeWidget. This widget is purely for code sharing between the widgets,
and for providing UI to users to configure the EntityTreeModel wrapped inside it. The EntityTreeWidget
has an init method which is called after construction and which calls virtual methods. Each tab has a
subclass of it for specialization, which practically means creating and configuring proxy models on
a tab specific basis. Read the code for more.

It is important to note that the EntityTreeWidget enables code sharing and test orientated ui such as
changing the fetched mimetypes. It is not something that should be used in applications though. It might
reduce clarity about how things fit together until you read the code of it. tab6widget and checkable2 do the
same thing, but checkable2 does not use the EntityTreeWidget. checkable2 is more readable if you want to see
how to connect the multiple proxies together with setSourceModel. Read the code and compare them to figure out
how to use the ideas implemented in the other widgets.

Note also that a proxy might not normally be visible but can be put into a view at any time to see its
contents. A debugging technique is to create a QTreeView on the heap without a parent and show it. It
will then be a 'toplevel' window showing the contents.

QTreeView *debugView = new QTreeView(); // No parent!
debugView->setModel(modelIWanToSee);
debugView->show();

This technique can be used to debug any kde pim application.

Anyone who wants an excuse to read and understand this stuff is encouraged to rename the files from
tab<number>widget to something more descriptive.