The UI is as following
 
The UI is as following
http://img.my.csdn.net/uploads/201211/07/1352267120_2257.jpg

I saved  the  form as a file named re.ui
Then I convert it into Python script named ui_re.py
Third ,I create the source file with the name
callFirstApp.pyw and import the ui_re.py to it

The code in the callFirstApp.pyw is as shown here:
@

import sys
from PySide.QtGui import *
from ui_re  import *

class MainWindow(QMainWindow, Ui_MainWindow):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        self.setupUi(self)
        self.plainTextEdit.setPlainText("Type code here...")
        
  

if __name__ == '__main__':
    app =QApplication(sys.argv)
    frame = MainWindow()
    frame.show()    
    app.exec_()
@
I want to reimplement the QPlainText’s focusInEvent in this file ,my code 
is as following 
(means let the default text "Type code here..." disappear when focus  in 
the QTextEdit’s editable area)

@
def focusInEvent(self, event):
        self.clear()
        QPlainTextEdit.focusInEvent(self, event)
@
But I don’t know how to add the code to the file correctly ?
Thanks in advance .

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to