[Interest] SignalTranisition: using of signal arguments within onTriggered handler?

Marco Piccolino marco.a.piccolino at gmail.com
Wed Apr 26 13:26:51 CEST 2017


I usually do the processing in "guard" and return true.

M

---------- Messaggio inoltrato ----------
From: Jan Krause <jan.krause.no19 at gmail.com>
To: interest at qt-project.org
Cc:
Bcc:
Date: Tue, 25 Apr 2017 11:10:58 +0200
Subject: Re: [Interest] SignalTranisition: using of signal arguments within
onTriggered handler?
ok... I take scxml state machine ... with '_event.data' I have my
feature... :)

br
Jan

Am 21.04.2017 um 15:26 schrieb Jan Krause:

> Hi all,
>
> a transition of a state machine has normally the properties
> trigger/signal, guard, action... a SignalTransition (
> http://doc.qt.io/qt-5/qml-qtqml-statemachine-signaltransition.html) of
> the declarative state machine framework has signal + guard ...
>
> where is the action property?
> there is a onTriggered handler -> but how can I use the arguments of the
> trigger signal in the onTriggered handler?
>
> for example:
>
> signal triggerSignal(int myIntParam);
> SignalTransition {
>   targetState: state_2
>   signal: triggerSignal
>   guard: myIntParam < 10
>   onTriggered: console.log("myIntParam: "+myIntParam)
> }
>
> is this possible? or is there an other way to use signal arguments within
> onTriggered?
>
> thanks and cheers
> Jan


2017-04-26 11:29 GMT+02:00 <interest-request at qt-project.org>:

> Send Interest mailing list submissions to
>         interest at qt-project.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.qt-project.org/mailman/listinfo/interest
> or, via email, send a message with subject or body 'help' to
>         interest-request at qt-project.org
>
> You can reach the person managing the list at
>         interest-owner at qt-project.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Interest digest..."
>
> Today's Topics:
>
>    1. Re: Noob Stuck with QtIFW Code (Oliver Niebuhr)
>    2. Re: Noob Stuck with QtIFW Code (Oliver Niebuhr)
>    3. Re: [Qt3D] Update vertex buffer data together with increasing
>       count of vertices leads to artifacts (Oleg Evseev)
>    4. Slow touch event sample rate after 10.3.1 iOS sdk
>       (Patrick Stinson)
>    5. Qt 5.9 Beta (Igor Mironchik)
>    6. Qt 5.8 and QPainter based rendering (bunjee at omega.gg)
>    7. Re: Qt 5.8 and QPainter based rendering
>       (Kristoffersen, Even (NO14))
>    8. Re: Qt 5.9 Beta (Igor Mironchik)
>    9. Re: Crash with Qt application that use OpenGL (Till Oliver Knoll)
>   10. Re: Qt 5.9 Beta and MSVC (Igor Mironchik)
>   11. Re: SignalTranisition: using of signal arguments within
>       onTriggered handler? (Jan Krause)
>   12. Testing help needed (Jani Heikkinen)
>   13. Qt3D and QtMultimedia.Camera not working together on Android
>       (Christoph Keller)
>   14. Re: [Development] Testing help needed (Tuukka Turunen)
>   15. ListView not showing data until interacted with.
>       (Russell, Matthew)
>   16. I feel stupid: QStandardItem::insertRows: Ignoring duplicate
>       insertion of item (Frank Rueter | OHUfx)
>   17. Re: I feel stupid: QStandardItem::insertRows: Ignoring
>       duplicate insertion of item (Kevin Funk)
>
>
> ---------- Messaggio inoltrato ----------
> From: Oliver Niebuhr <googleersatz at oliverniebuhr.de>
> To: interest at qt-project.org
> Cc:
> Bcc:
> Date: Sat, 22 Apr 2017 17:04:30 +0200
> Subject: Re: [Interest] Noob Stuck with QtIFW Code
> Oh my. You really have to love those messy Documentations.
> I now added <ControlScript> to config.xml, renamed the Script File,
> removed all that is Component related and put the Script File in the
> config Folder - but still no Luck. I also changed the File Suffix from
> .qs to .js
>
> It simply does not work. I am so close to create a Bug Report. I have
> now done everything that is stated in the Documentation and also what I
> have found through the Internet.
>
> Is there a specific Mailinglist with People who have some good knowledge
> about QtIFW? Or is this the only one which "must suffice"? :)
>
> Thanks
> Oliver
>
>
>
> ---------- Messaggio inoltrato ----------
> From: Oliver Niebuhr <googleersatz at oliverniebuhr.de>
> To: interest at qt-project.org
> Cc:
> Bcc:
> Date: Sat, 22 Apr 2017 17:39:26 +0200
> Subject: Re: [Interest] Noob Stuck with QtIFW Code
> About 1 Week and now I found the culprit: NEVER use '(qsTr(' with the
> QMessageBox or the print Function - or they wont get shown :(
>
> Sorry and thanks everyone.
> Oliver
>
> On 22.04.2017 17:04, Oliver Niebuhr wrote:
> > Oh my. You really have to love those messy Documentations.
> > I now added <ControlScript> to config.xml, renamed the Script File,
> > removed all that is Component related and put the Script File in the
> > config Folder - but still no Luck. I also changed the File Suffix from
> > .qs to .js
> >
> > It simply does not work. I am so close to create a Bug Report. I have
> > now done everything that is stated in the Documentation and also what I
> > have found through the Internet.
> >
> > Is there a specific Mailinglist with People who have some good knowledge
> > about QtIFW? Or is this the only one which "must suffice"? :)
> >
> > Thanks
> > Oliver
> >
> >
> >
> > _______________________________________________
> > Interest mailing list
> > Interest at qt-project.org
> > http://lists.qt-project.org/mailman/listinfo/interest
> >
>
>
>
>
> ---------- Messaggio inoltrato ----------
> From: Oleg Evseev <ev.mipt at gmail.com>
> To: Sean Harmer <sean.harmer at kdab.com>
> Cc: Qt Project <interest at qt-project.org>
> Bcc:
> Date: Sun, 23 Apr 2017 13:36:01 +0300
> Subject: Re: [Interest] [Qt3D] Update vertex buffer data together with
> increasing count of vertices leads to artifacts
>
>> could you file a JIRA with a test case please?
>
>
> Yes, I'll try to do test example later.
>
> By the way, it seems that I was wrong blaming updateData function to cause
> artifacts. In fact besides update geometry in my application new alike
> entities with custom geometry are created (for simplicity let say when I
> can't append buffer data through updates anymore), and if I notice
> correctly, artifacts are caused only by setData followed by setCount (the
> second case I wrote before). I'll try to examine this on test case.
>
> --
> With regards, Oleg.
>
>
> ---------- Messaggio inoltrato ----------
> From: Patrick Stinson <patrickkidd at gmail.com>
> To: Qt Interest <interest at qt-project.org>
> Cc:
> Bcc:
> Date: Sun, 23 Apr 2017 16:35:22 -0400
> Subject: [Interest] Slow touch event sample rate after 10.3.1 iOS sdk
> Has anyone else noticed that the sample rate for touch events has dropped
> to 800ms since the last iOS SDK update? I have tested with both Qt-5.8.0
> and Qt-dev and it’s happening on my iPhone as well as iPad pro.
>
> I read somewhere that you have to update the view in order to get the
> sample rate to increase back to the usual 60Hz. Maybe this is intended to
> save battery life? I’m not even sure if I’m right.
>
> Also not sure how to make a workaround. This problem doesn’t occur for
> example when dragging a QGraphicsItem around, maybe because that uses mouse
> events? It does happen when I listen to QEvent::TouchMove, for example
> doing finger-based painting which now only creates broad, jagged lines with
> a 1.1Hz sampling frequency.
>
> I hope a whole bunch of released Qt apps didn’t just break!
>
> -P
>
> ---------- Messaggio inoltrato ----------
> From: Igor Mironchik <igor.mironchik at tut.by>
> To: interest <interest at qt-project.org>
> Cc:
> Bcc:
> Date: Fri, 14 Apr 2017 07:31:44 +0300
> Subject: [Interest] Qt 5.9 Beta
> Hello,
>
> Qt 5.9 official binaries requires QMAKE_MSC_VER on project load.
>
> Is it normal? Should I specify QMAKE_MSC_VER by hands?
>
> Thank you.
>
>
>
>
> ---------- Messaggio inoltrato ----------
> From: bunjee at omega.gg
> To: interest at qt-project.org
> Cc:
> Bcc:
> Date: Fri, 21 Apr 2017 13:27:48 +0200
> Subject: [Interest] Qt 5.8 and QPainter based rendering
> Greetings Qt community,
>
> I'm currently working on a feasability using embedded hardware (Xilinx
> Zynq).
> It has no dedicated GPU so I'm experimenting with:
> - Qt 4.8.7 (QtQuick 1.0)
> - Qt 5.8 with OpenGL (QtQuick 2.0).
> - Qt 5.8 with QtQuick 2D (QtQuick 2.0).
>
> I'm building a multitouch interface with extensive use of scaling (for
> transitions inside Row(s) or ListView(s)).
> To make it clean I'm using a custom QML component that renders SVG with
> the QPainter (based on QQuickPaintedItem for Qt 5).
>
> This is what I get with a 3.0 scale: https://image.ibb.co/ctYRkk/scale.png
> .
>
> - Qt 4 does a good job at scaling SVG(s) or anything QPainter based.
>
> - I suspect that Qt 5 just caches a static texture for a given
> QQuickPaintedItem and simply scales it.
> This gives a blurry output on both Qt 5 OpenGL and Software (QtQuick 2D).
>
> Is there a way to force Qt 5 and QQuickPaintedItem to scale without using
> its blurry texture cache ?
>
> Note: I'm a little bit surprised about the transition to QtQuick 2.0. The
> performance are there but they come with a significant graphical tradeof.
> Having a scenegraph, shaders and particles is cool but it shouldn't come at
> the expense of basic 2d rendering.
>
> Let me know If I'm missing something,
>
> Thanks !
>
>
>
> ---------- Messaggio inoltrato ----------
> From: "Kristoffersen, Even (NO14)" <Even.Kristoffersen at honeywell.com>
> To: "interest at qt-project.org" <interest at qt-project.org>
> Cc:
> Bcc:
> Date: Mon, 24 Apr 2017 11:56:42 +0000
> Subject: Re: [Interest] Qt 5.8 and QPainter based rendering
> The trick I use with SVGs is to scale the "sourceSize" of the image.
>
> SvgImage.qml
> -----
> Image {
>     sourceSize.width: width *scale
>     sourceSize.height: height *scale
> }
>
> Main.qml
> ------
> scale: 3.0
>
> SvgImage {
>         height: 40
>         width: 40
>                source: "someImage.svg"
> }
>
> This way it'll use the correctly rendered image as texture directly.
> It works pretty well as long as you don't change the scaling in real-time.
> If you do scaling in real-time you could Math.ceil(scale) for sourceSize
> calculation so that it only re-creates the texture at certain intervals.
>
> -Even
>
> -----Original Message-----
> From: Interest [mailto:interest-bounces+even.kristoffersen=honeywell.com@
> qt-project.org] On Behalf Of bunjee at omega.gg
> Sent: 21. april 2017 13:28
> To: interest at qt-project.org
> Subject: [Interest] Qt 5.8 and QPainter based rendering
>
> Greetings Qt community,
>
> I'm currently working on a feasability using embedded hardware (Xilinx
> Zynq).
> It has no dedicated GPU so I'm experimenting with:
> - Qt 4.8.7 (QtQuick 1.0)
> - Qt 5.8 with OpenGL (QtQuick 2.0).
> - Qt 5.8 with QtQuick 2D (QtQuick 2.0).
>
> I'm building a multitouch interface with extensive use of scaling (for
> transitions inside Row(s) or ListView(s)).
> To make it clean I'm using a custom QML component that renders SVG with
> the QPainter (based on QQuickPaintedItem for Qt 5).
>
> This is what I get with a 3.0 scale:
> https://image.ibb.co/ctYRkk/scale.png.
>
> - Qt 4 does a good job at scaling SVG(s) or anything QPainter based.
>
> - I suspect that Qt 5 just caches a static texture for a given
> QQuickPaintedItem and simply scales it.
> This gives a blurry output on both Qt 5 OpenGL and Software (QtQuick 2D).
>
> Is there a way to force Qt 5 and QQuickPaintedItem to scale without using
> its blurry texture cache ?
>
> Note: I'm a little bit surprised about the transition to QtQuick 2.0.
> The performance are there but they come with a significant graphical
> tradeof. Having a scenegraph, shaders and particles is cool but it
> shouldn't come at the expense of basic 2d rendering.
>
> Let me know If I'm missing something,
>
> Thanks !
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
>
> ---------- Messaggio inoltrato ----------
> From: Igor Mironchik <igor.mironchik at gmail.com>
> To: interest at qt-project.org
> Cc:
> Bcc:
> Date: Mon, 24 Apr 2017 16:15:30 +0300
> Subject: Re: [Interest] Qt 5.9 Beta
> Hi,
>
> Don't answer on this email. It's very old and was sent twice by mistake...
>
> Sorry.
>
>
> 14.04.2017 7:31, Igor Mironchik пишет:
>
>> Hello,
>>
>> Qt 5.9 official binaries requires QMAKE_MSC_VER on project load.
>>
>> Is it normal? Should I specify QMAKE_MSC_VER by hands?
>>
>> Thank you.
>>
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>
>
>
>
> ---------- Messaggio inoltrato ----------
> From: Till Oliver Knoll <till.oliver.knoll at gmail.com>
> To: Qt Project <interest at qt-project.org>
> Cc:
> Bcc:
> Date: Tue, 25 Apr 2017 07:59:46 +0200
> Subject: Re: [Interest] Crash with Qt application that use OpenGL
> [with reference to:
> http://lists.qt-project.org/pipermail/interest/2016-October/025009.html]
>
> Am 21.04.17 um 15:17 schrieb Xavier Bigand:
> > This is not directly related, but that it is why I thought it was a Qt
> > bug. It it so easy in OpenGL to use badly API and having a good result
> > that will work on almost all configurations.
>
> While it is not (directly) related to the nVidia driver crash that you
> are observing it demonstrates nicely my prior point "a driver must not
> crash" by example. Even if you feed the driver with bogus data.
>
> When you look at the actual Qt bug report that resulted out of this:
>
>   https://bugreports.qt.io/browse/QTBUG-56234
>
> "it will call API glVertexAttribPointer but input parameter pointer is a
> pointer to system memory vertex data, which violates spec because
> OpenGL 4.1 context needs to bind a vertex buffer before calling
> glVertexAttribPointer, so AMD OGL driver will report the following error
> " glVertexAttribPointer in a Core context called without a bound
> Vertex Array Object [which is now required for Core Contexts]"
>
> Yes, Qt uses the OpenGL API wrong here (for the simple reason that the
> code in question was written against OpenGL 2, where it was perfectly
> valid - jut not with a "Core Context" anymore).
>
> But note the two points:
>
>   1. "which violates spec" and
>   2. "AMD OGL driver will report the following error"
>
> This is how a properly validating driver is supposed to behave :)
>
> Disclaimer: I am neither working for AMD nor nVidia and I acknowledge
> that both drivers may have their quirks ;)
>
> >
> > Dislike in Vulkan there is no way to check if APIs are correctly used,
> > so when we test our engine we can't really expect that it will run
> > everywhere just because it runs on our computer.
>
> "There is no way" because with Vulkan most of what the driver did
> previously - that includes input validation -  is now in the
> responsibility of the application itself.
>
> In fact, the application is now in control of the "command queue", and
> as such also responsible that the "data types fit together" and the data
> arrives in the proper order (or is otherwise synchronised with
> "barriers"). The Vulkan driver only does the bare minimum, but if you
> pass it a pointer which points into system RAM instead of GPU RAM (when
> such one is expected) then Bad Things Happen(tm).
>
> That's why people say you are "closer to the metal" - there is much much
> much less between the GPU and your application. Namely much less
> validation (which in OpenGL is required by the specs, see above).
>
> Simply said: most of the code (logic) which was previously in the OpenGL
> driver is now in your application (which knows much better about the
> nature of the data it wants to render, and hence can also spare most of
> the input validation which - again by the specs - a former OpenGL driver
> always *had* to do).
>
> So it is not quite correct when you say "there is no way to check if the
> API is used correctly" - it just happens that it is YOUR application now
> that is supposed to validate the data (or at least it has to know
> exactly what it does ;)).
>
>
> Cheers, Oliver
>
>
>
>
>
> ---------- Messaggio inoltrato ----------
> From: Igor Mironchik <igor.mironchik at gmail.com>
> To: interest <interest at qt-project.org>
> Cc:
> Bcc:
> Date: Tue, 25 Apr 2017 10:02:11 +0300
> Subject: Re: [Interest] Qt 5.9 Beta and MSVC
> Hello guys,
>
> Great job. In Qt 5.9 Beta2 it is already fixed. Thank you.
>
>
> 17.04.2017 21:43, Igor Mironchik пишет:
>
>> Hello folks,
>>
>> Did anybody install Qt 5.9 Beta official binaries for MSVC?
>>
>> Does qmake from Qt 5.9 Beta works for you in question of recognizing
>> compiler version?
>>
>> I want to say that if you have qmake subdirs project, let's name it
>> root.pro, with following content:
>>
>>
>> TEMPLATE = subdirs
>>
>> SUBDIRS = src
>>
>> And in src you have src.pro with TEMPLATE = app
>>
>> Then in my case first run of qmake works fine and produces Makefile and
>> .qmake.stash file with following content at the end:
>>
>> QMAKE_CXX.QMAKE_MSC_VER = 1900
>> QMAKE_CXX.QMAKE_MSC_FULL_VER = 190024215
>> QMAKE_CXX.COMPILER_MACROS = \
>>     QMAKE_MSC_VER \
>>     QMAKE_MSC_FULL_VER
>>
>> In my case I use MSVC 14.
>>
>> This cashed values use in the next invocations of qmake. And in my case
>> it fails with:
>>
>> Project ERROR: msvc-version.conf loaded but QMAKE_MSC_VER isn't set
>>
>> Do you guys have the same issue?
>>
>>
>
>
>
> ---------- Messaggio inoltrato ----------
> From: Jan Krause <jan.krause.no19 at gmail.com>
> To: interest at qt-project.org
> Cc:
> Bcc:
> Date: Tue, 25 Apr 2017 11:10:58 +0200
> Subject: Re: [Interest] SignalTranisition: using of signal arguments
> within onTriggered handler?
> ok... I take scxml state machine ... with '_event.data' I have my
> feature... :)
>
> br
> Jan
>
> Am 21.04.2017 um 15:26 schrieb Jan Krause:
>
>> Hi all,
>>
>> a transition of a state machine has normally the properties
>> trigger/signal, guard, action... a SignalTransition (
>> http://doc.qt.io/qt-5/qml-qtqml-statemachine-signaltransition.html) of
>> the declarative state machine framework has signal + guard ...
>>
>> where is the action property?
>> there is a onTriggered handler -> but how can I use the arguments of the
>> trigger signal in the onTriggered handler?
>>
>> for example:
>>
>> signal triggerSignal(int myIntParam);
>> SignalTransition {
>>   targetState: state_2
>>   signal: triggerSignal
>>   guard: myIntParam < 10
>>   onTriggered: console.log("myIntParam: "+myIntParam)
>> }
>>
>> is this possible? or is there an other way to use signal arguments within
>> onTriggered?
>>
>> thanks and cheers
>> Jan
>>
>
>
>
>
> ---------- Messaggio inoltrato ----------
> From: Jani Heikkinen <jani.heikkinen at qt.io>
> To: "development at qt-project.org" <development at qt-project.org>, "
> releasing at qt-project.org" <releasing at qt-project.org>
> Cc: "interest at qt-project.org" <interest at qt-project.org>
> Bcc:
> Date: Tue, 25 Apr 2017 09:39:48 +0000
> Subject: [Interest] Testing help needed
> Hi all,
>
> There is now wiki page for reporting testing effort and results in
> https://wiki.qt.io/Qt59_release_testing . I also asked you all to take a
> tour for Qt 5.9 beta2 & report the effort via it. As you can see there
> isn't really any reports from community yet. It would be really beneficial
> for Qt to get packages tested early enough & find all release blockers well
> before official release. That would help us to keep the schedules and
> improve the release quality. So do you have some ideas how to get you all
> better involved to this? Is wiki page & table easy enough for this or
> should we use some other format? Getting you involved to this more will
> help us to do more patch level releases in the future as well (which has
> been the hot topic during this spring)...
>
> br,
> Jani
>
>
>
>
>
>
>
> ---------- Messaggio inoltrato ----------
> From: Christoph Keller <theoriginalgri at gmail.com>
> To: interest at qt-project.org
> Cc:
> Bcc:
> Date: Tue, 25 Apr 2017 14:56:01 +0200
> Subject: [Interest] Qt3D and QtMultimedia.Camera not working together on
> Android
> Hi,
>
> I'm using Qt3D in a mobile project for Android and iOS, but unfortunately
> the QtMultimedia Camera Item stops working from the moment a Qt3D Scene is
> loaded on Android while this does work on iOS.
>
> Is there a known issue or workaround to get these two libraries working
> together?
>
> Tested Qt versions were 5.8.0 and 5.9.0 beta2.
>
> Code: https://gist.github.com/theoriginalgri/88be555d85fcac9e7e65b
> 0c449c4a46d (run by QQmlApplicationEngine)
> Video: https://drive.google.com/open?id=0BwDDb8S_njIqQndjMm5YY1c0M00
> (tested on three devices, sorry for not rotating it)
>
> Best regards,
> Christoph
>
>
>
>
> ---------- Messaggio inoltrato ----------
> From: Tuukka Turunen <tuukka.turunen at qt.io>
> To: "releasing at qt-project.org" <releasing at qt-project.org>, "
> development at qt-project.org" <development at qt-project.org>, Jani Heikkinen <
> jani.heikkinen at qt.io>
> Cc: "interest at qt-project.org" <interest at qt-project.org>
> Bcc:
> Date: Tue, 25 Apr 2017 16:16:40 +0000
> Subject: Re: [Interest] [Development] Testing help needed
>
> Hi,
>
> There were quite many people who expressed interest a few months ago to
> help in making the releases, so hopefully we get a lot of suggestions to
> better engage with the whole community for testing the releases.
>
> Quite many are testing new Qt versions with their applications and
> reporting issues via bugreports. This is really valuable and we hope that
> with the new process of multiple betas available via the online installer
> this testing becomes even easier.
>
> In addition we would like to have people to test new releases for wider
> functionality than just what their app needs. Optimally all, but that is of
> course not possible in practice.
>
> We have automatic testing in place with quite good coverage, but in order
> to catch all the needed issues manual testing is still beneficial. This is
> what Jani is asking volunteers to help with.
>
> The sooner we find issues to fix, the better. So time for testing is now.
>
> Yours,
>
> Tuukka
> ------------------------------
> *From:* Development <development-bounces+tuukka.turunen=
> qt.io at qt-project.org> on behalf of Jani Heikkinen <jani.heikkinen at qt.io>
> *Sent:* Tuesday, April 25, 2017 11:39:48 AM
> *To:* development at qt-project.org; releasing at qt-project.org
> *Cc:* interest at qt-project.org
> *Subject:* [Development] Testing help needed
>
> Hi all,
>
> There is now wiki page for reporting testing effort and results in
> https://wiki.qt.io/Qt59_release_testing . I also asked you all to take a
> tour for Qt 5.9 beta2 & report the effort via it. As you can see there
> isn't really any reports from community yet. It would be really beneficial
> for Qt to get packages tested early enough & find all release blockers well
> before official release. That would help us to keep the schedules and
> improve the release quality. So do you have some ideas how to get you all
> better involved to this? Is wiki page & table easy enough for this or
> should we use some other format? Getting you involved to this more will
> help us to do more patch level releases in the future as well (which has
> been the hot topic during this spring)...
>
> br,
> Jani
>
>
>
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
>
> ---------- Messaggio inoltrato ----------
> From: "Russell, Matthew" <MRussell at neptec.com>
> To: "interest at qt-project.org" <interest at qt-project.org>
> Cc:
> Bcc:
> Date: Tue, 25 Apr 2017 20:51:09 +0000
> Subject: [Interest] ListView not showing data until interacted with.
>
> Hi,
>
>
>
> My QML `ListView` doesn't show my data until I perturb it with the mouse
> (e.g. just drag it up and down.)  After this the view shows the model
> without issue.  Is there way to kick this `ListView` into working?
>
>
>
> I'm using Qt 5.8 on Linux 14.04.  My model is a subclass of
> `QAbstractListModel`.  I build it by following the AbstractItemModel
> <http://doc.qt.io/qt-5/qtquick-models-abstractitemmodel-example.html>.
> The main difference is that my list model is a property of an entity,
> rather than being set with `setContextProperty` in `main.cpp`.
>
>
>
> There are a few similar issues on SO, and the Qt forums, about the
> `ListView`s not updating, but none seem to only have an issue at the
> start.  Most of them relate to the OP calling `dataChanged` manually
> instead of `beforeInsertRows()` & `endInsertRows()` - both methods I'm
> calling (see below.)
>
>
>
> My `ListView` is in an item loaded with a `SceneLoader`.
>
>
>
> I posted all the relevant code here
> <https://gist.github.com/kheaactua/13e3943e10a25f3df295148b1d2f1f86>,
> because I'm a little suspicious of how I use the Layouts on my `ListView`
> (maybe that's causing it?  Maybe my hierarchy is broken?  I haven't been
> able to prove that though.)
>
>
>
> The most important parts though (code is formatted in the SO style)
>
>
>
> ListView:
>
>
>
>     ListView {
>
>         anchors.fill: parent
>
>         model: sceneGraph.blobs
>
>         delegate: delegate
>
>     }
>
>
>
>
>
> BlobModel.cpp:
>
>
>
>     auto BlobModel::addBlob(const BlobPointDataPtr& data) -> void
>
>     {
>
>         // ...
>
>
>
>         // Each blob has a uuid
>
>
>
>         const auto idx = Contains(uuid);
>
>         if (-1 != idx)
>
>         {
>
>             blobs_[idx]->Update(data);
>
>             Q_EMIT dataChanged(createIndex(idx, 0), createIndex(idx, 0));
>
>         }
>
>         else
>
>         {
>
>             beginInsertRows(QModelIndex(), rowCount(), rowCount());
>
>             blobs_ << new Blob{data, id_count_}; id_count_++;
>
>             endInsertRows(); // responsible for the QQmlChangeSet
>
>
>
>             Q_EMIT dataChanged(createIndex(rowCount(), 0),
> createIndex(rowCount(), 0));
>
>         }
>
>     }
>
>
>
> Also, on my terminal, I receive the message:
>
>
>
>     QObject::connect: Cannot queue arguments of type 'QQmlChangeSet'
>
>     (Make sure 'QQmlChangeSet' is registered using qRegisterMetaType().)
>
>
>
> This seems to be emitted by `endInsertRows()`, but I'm not sure why.  In
> the past the solution has been to register the missing type, e.g.
> `qRegisterMetaType<QQmlChangeSet*>("QQmlChangeSet");` but this seems not
> to be a public type with Qt, and because everything mostly works without
> it, I'm not sure missing that is the exact issue.
>
>
>
> (I also cross-posted this question on SO at http://stackoverflow.com/
> questions/43620606/listview-not-initially-showing-data , just so the code
> would show better than in an email.)
>
>
>
> Thanks for any help,
>
>
> ---------- Messaggio inoltrato ----------
> From: "Frank Rueter | OHUfx" <frank at ohufx.com>
> To: "interest at qt-project.org" <interest at qt-project.org>
> Cc:
> Bcc:
> Date: Wed, 26 Apr 2017 19:50:54 +1200
> Subject: [Interest] I feel stupid: QStandardItem::insertRows: Ignoring
> duplicate insertion of item
> Hi,
>
> I seem to run into this issue a lot and I don't get why:
> I have a list of sub-classed QStandardItems that another processor
> generated, and I want to add them to a QStandardItemModel like this:
>
> for item in myItemList:
>     self.model.appendRow(item)
>
> The model is empty and hasn't been used at this point. Yet I get none of
> my items but one of those errors for each item:
>     QStandardItem::insertRows: Ignoring duplicate insertion of item
>
> I know I should know this but I can't figure out why this is happening. Is
> there something special I need to do when subclassing QStandardItem?
>
>
> Cheers,
> frank
>
> --
> <http://www.nukepedia.com>
>
> over 1,000 free tools for Nuke <http://www.nukepedia.com>
> <https://vimeo.com/channels/nukepedia/165747936>
>
> full access from within... coming soon
> <https://vimeo.com/channels/nukepedia/165747936>
>
>
> ---------- Messaggio inoltrato ----------
> From: Kevin Funk <kfunk at kde.org>
> To: interest at qt-project.org
> Cc:
> Bcc:
> Date: Wed, 26 Apr 2017 11:24:06 +0200
> Subject: Re: [Interest] I feel stupid: QStandardItem::insertRows: Ignoring
> duplicate insertion of item
> On Wednesday, 26 April 2017 19:50:54 CEST Frank Rueter | OHUfx wrote:
> > Hi,
> >
> > I seem to run into this issue a lot and I don't get why:
> > I have a list of sub-classed QStandardItems that another processor
> > generated, and I want to add them to a QStandardItemModel like this:
> >
> > for item in myItemList:
> >      self.model.appendRow(item)
> >
> > The model is empty and hasn't been used at this point. Yet I get none of
> > my items but one of those errors for each item:
> >      QStandardItem::insertRows: Ignoring duplicate insertion of item
>
> Use the source, Luke :)
>
> QStandardItemModel::appendRow calls
> - QStandardItem::appendRow which calls
> - QStandardItem::insertRow which calls
> - QStandardItemPrivate::insertRows [1]
>
> Excerpt from QStandardItemPrivate::insertRows:
> ```
> //...
> if (item->d_func()->parent == 0) {
>     item->d_func()->setParentAndModel(q, model);
> } else {
>     qWarning("QStandardItem::insertRows: Ignoring duplicate insertion of
> item
> %p",
>              item);
>     item = 0;
> }
> //...
> ```
>
> => The warning is thrown when your items already have a parent set
>
> Is that the case for you?
>
> Hope that helps,
> Kevin
>
> PS: The Woboq code browser is an awesome tool to follow call chains (or any
> decent IDE will do, if you have the Qt sources)
>
> [1] https://code.woboq.org/qt5/qtbase/src/gui/itemmodels/
> qstandarditemmodel.cpp.html#_ZN20QStandardItemPrivate10inse
> rtRowsEiiRK5QListIP13QStandardItemE
> >
> > I know I should know this but I can't figure out why this is happening.
> > Is there something special I need to do when subclassing QStandardItem?
> >
> >
> > Cheers,
> > frank
>
>
> --
> Kevin Funk | kfunk at kde.org | http://kfunk.org
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170426/740780de/attachment.html>


More information about the Interest mailing list