MAXScript Qt UI

MAXScript Qt UI

Swordslayer
Advisor Advisor
4,966 Views
23 Replies
Message 1 of 24

MAXScript Qt UI

Swordslayer
Advisor
Advisor

In the end, using Qt from MAXScript was more straightforward than I thought, kudos to @denisT.MaxDoctor for setting me on the right track with the QtUiLoader. Here's an edited sample from the max python sample scripts:

 

 

(
	local QFile = (python.import "PySide2.QtCore").QFile
	local QUiLoader = (python.import "PySide2.QtUiTools").QUiLoader
	local GetQMaxMainWindow = (python.import "qtmax").GetQMaxMainWindow

	local ui_file = QFile "QtTest.ui"
	ui_file.open QFile.ReadOnly
	local ui = (QUiLoader()).load ui_file (GetQMaxMainWindow())
	ui_file.close()

	fn hello = messageBox "Hello world!"

	ui.pushButton.clicked.connect hello
	ui.toolButton.clicked.connect getSaveFileName
	ui.show()
)

 

Put it in the same folder as the .ui file from the attached zip and run the ms file. The two buttons are connected to maxscript functions, I guess you get the idea. Have fun 🙂

4,967 Views
23 Replies
Replies (23)
Message 21 of 24

Anonymous
Not applicable

thought the question was related to this thread enough...

anyway:

https://forums.autodesk.com/t5/3ds-max-programming/maxscript-qt-close-event/td-p/10725223

0 Likes
Message 22 of 24

denisT.MaxDoctor
Advisor
Advisor

@Anonymous wrote:

thought the question was related to this thread enough...


In my experience, some "nested" topics (questions) are very easy to get lost, and it is often more difficult to find a similar but more specific question / answers in a generically named topic ("Using MXS with Python", "Qt UI", "Script Controllers", etc.).

(also the tag "solved" can be received only by the question of the author of the topic and is determined by the author)

0 Likes
Message 23 of 24

Anonymous
Not applicable

okay, thank you for the clarification, makes sense 😉

0 Likes
Message 24 of 24

FranciscoHermida
Explorer
Explorer

Fantastic topic, thank you for sharing!

www.boxofapps.com
0 Likes