DAZScript インストールフォルダから、Qt Designer を起動(ファイル名は、designer.exe)
※ C:\Daz 3D\Applications\64-bit\DAZ 3D\DAZStudio4
Dialog without Buttons テンプレートを選んで、[Create]。
画面を Qt Designer を利用してフォームを作成しますが、すべてのコンポーネントが使えないようです。
対応しているコンポーネントと、それに対応する DAZ API クラスが、利用できるのでは?と思われます。
| コンポーネント | API クラス |
|---|---|
| Push Button | DzPushButton |
| Radio Button | DzRadioButton |
| Check Box | DzCheckBox |
| List Widget (Item-Based) | DzListBox |
| Table Widget (Item-Based) | DzListView |
| Tree Widget (Item-Based) | DzListView |
| Group Box | DzGroupBox |
| Combo Box | DzComboBox [...] |
| Tab Widget | DzTabWidget |
| Widget | DzWidget |
| Line Edit | DzLineEdit |
| Text Edit | DzTextEdit |
| Label | DzLabel |
| LCD Number | DzLCDNumber |
| Dial | DzDial |
| Date/Time Edit | DzDateTimeEdit |
| Horizontal Slider | DzIntSlider* |
| Horizontal Layout | DzHBoxLayout |
| Vertical Layout | DzVBoxLayout |
| Horizontal Spacer | - |
| Vertical Spacer | - |
https://www.daz3d.com/dialog-design を購入します。
Qt Editor で作成したフォームのテンプレートファイルを、Dalog Design Utility で取り込んで、Signal (いわゆるイベント)に反応するようにする。
Dalog Design Utility を出力すると、画面作成のスクリプトが出力されるので、以下のようなコードを加筆して、イベントが応答するように設定する。
あとは、関数内で、好きな処理を書くといいよ!という感じです。
connect(textEdit, "textChanged()", textAction);
connect(horizontalSlider, "valueChanged(int)", sliderAction);
function textAction()
{
print(textEdit.text);
}
function sliderAction(num)
{
print(num);
}
// Create Dialog Box
var Dialog = new DzDialog();
Dialog.width = 400;
Dialog.height = 300;
Dialog.caption = "";
// Create and define DzLabel: 'label'
var label = new DzLabel( Dialog );
label.setGeometry( 40, 30, 101, 101 );
label.text = "TextLabel";
// Create and define DzPushButton: 'pushButton'
var pushButton = new DzPushButton( Dialog );
pushButton.setGeometry( 100, 190, 75, 23 );
pushButton.text = "PushButton";
pushButton.objectName = 'pushButton';
Dialog.setAcceptButton(pushButton);
// Create and define DzPushButton: 'pushButton_2'
var pushButton_2 = new DzPushButton( Dialog );
pushButton_2.setGeometry( 220, 230, 75, 23 );
pushButton_2.text = "PushButton";
pushButton_2.objectName = 'pushButton_2';
Dialog.setRejectButton(pushButton_2);
// Create and define DzIntSlider: 'horizontalSlider'
var horizontalSlider = new DzIntSlider( Dialog );
horizontalSlider.setGeometry( 200, 80, 160, 22 );
// Create and define DzTextEdit: 'textEdit'
var textEdit = new DzTextEdit( Dialog );
textEdit.setGeometry( 200, 130, 104, 71 );
connect(textEdit, "textChanged()", textAction);
connect(horizontalSlider, "valueChanged(int)", sliderAction);
function textAction()
{
print(textEdit.text);
}
function sliderAction(num)
{
print(num);
}
var pixImage = new Pixmap("C:/01/Right_Collar-Twist.gif");
// Display the dialog box
var bResult = Dialog.exec();
if( bResult ) {
// Do if dialog box was accepted
} else {
// Do if dialog box was canceled
}