Skip to content
QtWS25 Call for Papers
  • 0 Votes
    2 Posts
    714 Views
    D

    After looking through implementation of Qt positioners (qquickpositioners.* in qtdeclarative) I have found that the positioning itself is done in updatePolish method while in itemChange and onCompleted methods positioning is schedule and polish is called.
    At this point I don't completely understand how it works, but it resolved my problem and I didn't have to resort to using qt private modules.

  • 0 Votes
    4 Posts
    2k Views
    H

    @jsulm When the pop up Message Box shows "python has stopped working", I clicked "debug" rather than close, then visual studio was started, in visual studio,
    it shows
    Unhandled exception at 0x0000000059A17DF1 (QtGui4.dll) in python.exe: 0xC000041D: An unhandled exception was encountered during a user
    callback

    I was using pycharm to trace code step by step, however it nev, aer run to this issue by step by step since there are two many small steps/callback/signal/slot to go through, as long as I let it run without breakpoint, it will crash with segmentation fault.

  • 0 Votes
    3 Posts
    1k Views
    beeckscheB

    @Wieland
    Thanks for the informations!

    In the Surface Example they only delete the Q3DSurface instance.

    But i will pass the parents to the classes, so i can be sure, that they are destroyed. Thanks!

  • 1 Votes
    5 Posts
    9k Views
    T

    @dxmachina Well, that's not true ;) Just a little mistake. Happy coding! :D

  • 0 Votes
    1 Posts
    554 Views
    No one has replied
  • 0 Votes
    4 Posts
    6k Views
    kshegunovK

    @alogim
    Hello,
    Unfortunately, no. To make use of the parent-child mechanism your object must derive from QObject at least. Search through the forum for "QObject" and "RAII", Here is a thread where I've put some effort in explaining the QObject ownership. Back to your question:

    class Object : public QObject { public: Object(QWidget * parent = 0) : QObject(parent) { } };

    Will do what you want, i.e. delete the Object when the parent is destroyed. Then you indeed create your object like this:

    Object * obj = new Object(this);

    and it's sufficient to ensure proper cleanup.

    Kind regards.

  • 0 Votes
    3 Posts
    2k Views
    A

    Thanks for the reply. I wasn't using QtQuick so I couldn't use that as you suggested but I tried using the C++ equivalent and it acted the same as the property animation. After all the QPropertyAnimation pretty much just works on the QGraphicsOpacityEffect directly which is probably exactly what QtQuick uses under the hood to do it's opacity.

    Sorry for the delay in response I didn't realize the new forum system didn't email me when I got a response to a thread and I was busy enough with work not to check it. :)

    Also, I figured out what was causing it. It seems that I was using a QLabel with setAutoFillBackground(true) and the opacity effect couldn't handle that for some reason. When I removed that (I'll find another way to draw the background) it fades out properly. Just in case anyone else gets here from google.