how make a modalless dialog?

Is that possible to make a modaless dialog with daz script?

Comments

  • Richard HaseltineRichard Haseltine Posts: 100,867
    edited December 1969

    Not as far as I know, no.

  • rbtwhizrbtwhiz Posts: 2,250
    edited August 2014

    The short answer... Richard is correct.

    The longer answer...

    DzBasicDialog inherits DzDialog, which is a thin wrapper around QDialog. Among other things, DzDialog exposes QDialog::exec(), which ignores any modality setting when it calls QWidget::show(). DzDialog inherits DzWidget, which provides a getWidget() method that will return the wrapped QWidget. Because you can access properties, public slots and signals of a QObject in script... you can actually set QDialog::modal to true and call QWidget::show(), and it will show... momentarily. The problem is, show is non-blocking... so the script continues on to the next statement and ultimately finishes. To avoid memory leaks, all DzWidget derived objects have "ScriptOwnership", meaning they are owned by the script environment and are garbage collected when the script goes out of scope... i.e. when the script finishes or crashes. So, while you can actually create and show a modeless dialog in script, the script will finish and garbage collect it before you have a chance to use it. So, effectively... "no."

    Stylistically, a "modeless dialog" is implemented as a DzPane subclass in DAZ Studio. And while portions of DzPane are exposed to script, you cannot construct one via script. You must use the SDK for that.

    -Rob

    Post edited by rbtwhiz on
  • edited December 1969

    Thanks for you long replay,I really want go to SDK,But the SDK samples are too few to study,Acutally I just met a problem with SDK,can I direct access assets on content panel?I can do it with script by using "MainWindow.getPaneMgr().findPane("DzContentLibraryPane").getSelectedAssets()",But there are no such a class or method in SDK.so How can I get selected asset's fullpath?
    Thx again!

  • rbtwhizrbtwhiz Posts: 2,250
    edited December 1969

    Answered your question in the SDK forum.

    -Rob

Sign In or Register to comment.