PDA

View Full Version : qt designer and maya 2011



clapperboy
10th September 2010, 04:08
Hello, I'm a new user to qt and pyqt.
It is mainly to design ui to be used in Maya 2011.

I'm still experimenting with both qt designer and the pyqt.

But I had a question about list view from the qt designer.
It might be way ahead, but I was wondering if it can be set up in a way that I can refresh the list item by running a mel or python command inside maya.

What I need is a listview that update its list elements as I work in maya.
Now in the designer, I can make a list view, and was thinking about usung a -command flag to start a mel procedure that would update the list elements.

Also, I've read that there is 2 flag -command, and -dragcommand. I cant seem to find a list of dynamic string attribute that can be use in conjunction with maya. Is there such a list?

Anyone ever did this? or something similar?

Ill post my finding as I explore this.

Thanks

clapperboy
10th September 2010, 05:31
I found a good tutorial for what I wanted to do.
http://www.creativecrash.com/maya/tutorials/scripting/mel/c/maya-mel-qt-and-you-interfacing-with-the-qt-designer

so I was able to update the list inside maya by using a mel proc.
the important thing is that the listView widget name has to be the same as the widget you call whn using textScrollList
here's my procs


proc listStuff()
{
string $list[]=`ls `;
textScrollList -e -ra listWidget;
for($item in $list)
{
textScrollList -e -a $item listWidget;
}
}

proc printThis()
{
print "This\n";
}

They're in mel, not qt.. :)

now i've linked these 2 procs to my 2 buttons of my ui.
They work fine using the -command dynamic attributes.

I tried using the -command on the listView widget but nothing happened.

I know with Pyqt you can link signal to slot or python def. Is that possible with the qt designer? I'd like to be able to run a mel proc or python def whn I select an item from the listview? actually i'd like to know all event I could run a mel command or python command.

I included the ui file in case its needed.

more later... :)

P.S. I'm just testing how qt and mel/pyMel works together at the moment, so my solution are not very elegant at the moment. The link I post is very well done and has lots of explanation.

clapperboy
10th September 2010, 15:46
Here's another tutorial I found:
http://www.creativecrash.com/tutorials/using-qt-designer-for-mel-interfaces#tabs

Found the signals & slot editor in qt designer.
I seem to be able to assign signal to slot inside the qt ui, but was wondering if you could link the signal to string dynamic attribute so I could use the signal to call up mel proc or python def inside maya. The menu doesnt seem to be able to let me...

I know this can be done in PyQt.

On the other hand, I've found that you can edit certain qt ui control via mel or python command once you're in maya.

In the case of a listView(make sure you use item-based), it is accessible via the textScrollEdit command. I can then assign it a command that way. The options available via mel are selectionCommand, doubleClickCommand, deleteCommand, and drag and drop callback.

You can refer to the list in the link above to see which mel command controls the qt ui. The problem is that not all of the ui option for qt are supported within maya.
The link says that tabLayout control tabWidget, but I havent been able to at this point. All the other mel command/qt ui combination works.

more Later...