Adding Image in a dialog

So what I did is I used Dialog Design to create a dialog and added a label as a placeholder for the image. So apparently with the Piximage, I get a error that says "QFileInfo::absolutePath: Constructed with empty filename". 

here's the code

var label = new DzLabel( Dialog );label.setGeometry( 200, 60, 46, 13 );var sPath = new DzFileInfo(getScriptFileName()).path();var filepath = sPath + "\\aero_header.png";var pixImage = new Pixmap(filepath);label.pixmap = pixImage;

What did I do wrong??

Comments

  • MikeDMikeD Posts: 299

    Well, it is working pretty well for me, as long as I have save the script in the image folder. The error you said "QFileInfo::absolutePath: Constructed with empty filename" is usually poping up if you call the

    getScriptFileName().path()

     without have saved the script file. In any changes you made, first save the script and then run it....

  • PraxisPraxis Posts: 247

    If you are using the "Reload Script" action of the Script IDE Pane, then your problem may be due to this bug that was introduced in v4.11.0.383 and is still present in v4.12.0.47:  It causes getScriptFileName() to return ""

    https://www.daz3d.com/forums/discussion/333656/bug-since-ds-v4-11-0-236-dzsireloadaction-sets-getscriptfilename

Sign In or Register to comment.