[Qgis-developer] Need help with LayerTreeModel (legend node)

Sandro Santilli strk at keybit.net
Mon Dec 22 06:21:31 PST 2014

On Sun, Dec 21, 2014 at 08:46:01PM +0700, Martin Dobias wrote:
> On Fri, Dec 19, 2014 at 10:58 PM, Sandro Santilli <strk at keybit.net> wrote:
> >
> >
> > Confirmed. I've added a QTreeView and it has the same issue.
> > Unfortunately, the model tester did not catch any issue, beside the
> > already-reported one which I fixed in master already.
> >
> AFAIK model tester is not meant to discover this kind of issues. It is
> mainly used to confirm that model implements the virtual methods like
> index(), parent() according to the expectations of views. Your problem just
> seems to be related to a missing dataChanged() signal when there should be
> one...

I've actually just got a report from the ModelTester in master, which seems
related to rows insertion notification:

#0  0x00007fdce1855bb9 in __GI_raise (sig=sig at entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007fdce1858fc8 in __GI_abort () at abort.c:89
#2  0x000000000057bb47 in qgisCrash (signal=-1) at /usr/src/qgis/qgis-master/src/app/main.cpp:306
#3  0x000000000057bd0a in myMessageOutput (type=QtFatalMsg, msg=0x5b8fd68 "ASSERT: \"QTest::testLogger\" in file qtestlog.cpp, line 266")
    at /usr/src/qgis/qgis-master/src/app/main.cpp:359
#4  0x00007fdce48e7bb1 in qt_message_output(QtMsgType, char const*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#5  0x00007fdce48e7ff9 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#6  0x00007fdce48e8804 in qFatal(char const*, ...) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#7  0x00007fdcdd166ef0 in QTestLog::addFail(char const*, char const*, int) () from /usr/lib/x86_64-linux-gnu/libQtTest.so.4
#8  0x00007fdcdd168170 in QTestResult::addFailure(char const*, char const*, int) () from /usr/lib/x86_64-linux-gnu/libQtTest.so.4
#9  0x00007fdcdd168394 in ?? () from /usr/lib/x86_64-linux-gnu/libQtTest.so.4
#10 0x00007fdcdd168485 in QTestResult::verify(bool, char const*, char const*, char const*, int) () from /usr/lib/x86_64-linux-gnu/libQtTest.so.4
#11 0x00007fdce61c9d0c in ModelTest::rowsInserted (this=0x30574e0, parent=..., start=0, end=0)
    at /usr/src/qgis/qgis-master/tests/qt_modeltest/modeltest.cpp:530
#12 0x00007fdce61d0269 in ModelTest::qt_static_metacall (_o=0x30574e0, _c=QMetaObject::InvokeMetaMethod, _id=11, _a=0x7fff1c3fb4d0)
    at /usr/src/qgis/build/master/src/core/__/__/tests/qt_modeltest/moc_modeltest.cxx:80
#13 0x00007fdce4a0887a in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#14 0x00007fdce4a52664 in QAbstractItemModel::rowsInserted(QModelIndex const&, int, int) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#15 0x00007fdce49ee5ce in QAbstractItemModel::endInsertRows() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4

The test (modeltest.cpp:530) is about:

    Confirm that what was said was going to happen actually did

A problem with rows (inserted/deleted) seems actually likely in that
as I mentioned the _data_ is really rendered correctly, with proper size,
but the next row is not moved enough to allow for the row with new content
to be shown, like if the view did not know about a row being inserted.


  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html

More information about the Qgis-developer mailing list