Heya
I'm fighting with pyqt for another week and uhh uhh uhh I rather be
scripting some scripts than learning UI whh...
Anyway I'm trying to wrap my head around QT I have Justin latest tutorial
but its such a hard topic and he somehow skips all the basic and use all
the fancy stuff that I get lost :(
I'm trying to basically make ... a button that I click and that will create
sphere... as basic as it gets...
I noticed Justin is using the cmd tool to convert UI. to PY code which is
cool-ich even tho I don't know how to run it from maya hyh...
Anyway a friend Kurian dropped me a few lines as to how to load it but
since them I just cant find good place to learn... any hints as to
resources? Where do I look for info, maya help python file or QT - where ?
:O
Code:
"from PyQt4 import QtCore, QtGui, uic
import maya.OpenMayaUI as mui
import sip
baseUI = "C:\Users\dmakowski\Desktop\PyQTtests\My\ui\ui3.ui"
baseUIClass, baseUIWidget = uic.loadUiType(baseUI)
class Ui_MainWindow(baseUIWidget, baseUIClass):
def __init__(self,parent=None):
super(baseUIWidget, self).__init__(parent)
self.setupUi(self)
def getMayaWindow():
ptr = mui.MQtUtil.mainWindow()
return sip.wrapinstance(long(ptr), QtCore.QObject)
def mayaMain():
maya_ui1_window = Ui_MainWindow(getMayaWindow())
maya_ui1_window.show()
mayaMain()
"
It sort off make sense... I'd love to find a proper help file to read what
each line means but argh... I guess from now on I have to write a maya
function and just link it to python button/text field(I dont even want to
know how hard it will be to write a textfield wrrr... :( )
In any case here is my basic stuff if any1 can hint me that would be great !
Thanks, bye...
cant attach files so I'm sticking text here...
ui3.ui
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QLabel" name="labRenderSettings">
<property name="geometry">
<rect>
<x>5</x>
<y>5</y>
<width>131</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Render Settings</string>
</property>
</widget>
<widget class="QPushButton" name="btallsettings">
<property name="geometry">
<rect>
<x>2</x>
<y>20</y>
<width>80</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>All settings</string>
</property>
</widget>
<widget class="QLabel" name="labEditors">
<property name="geometry">
<rect>
<x>5</x>
<y>40</y>
<width>131</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Editors</string>
</property>
</widget>
<widget class="QPushButton" name="BTmatedit">
<property name="geometry">
<rect>
<x>2</x>
<y>55</y>
<width>80</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Material Editor</string>
</property>
</widget>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
</ui>
--
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings:
http://groups.google.com/group/python_inside_maya/subscribe