I have two more question.
1. I I noticed strange behavior dialogues inside my widget. When I run it separately - dialog works. Inside freeCAD - no. Does FreeCAD puts any restrictions?
this is my code:
Code: Select all
...
QtCore.QObject.connect(self.SaveBtn, QtCore.SIGNAL(_fromUtf8("clicked()")), self.saveFile)
...
def saveFile(self):
filename = QtGui.QFileDialog.getSaveFileName(None, 'Save File', os.getenv('HOME'))
f = open(filename, 'w')
filedata = self.textEdit.toPlainText()
f.write(filedata)
f.close()
...
app = QtGui.QApplication
FCmw = app.activeWindow() # I also tried mw = FreeCADGui.getMainWindow(), but it couses name error
redactor = QtGui.QDockWidget()
redactor.ui = my_ui()
redactor.ui.setupUi(redactor) # setup the ui
FCmw.addDockWidget(QtCore.Qt.RightDockWidgetArea, redactor)
2. And encoding problem. ToolTip for my tools.py file doesn't work with cyrillic symbols.

- f1.png (2.04 KiB) Viewed 2106 times
I used getpreferredencoding in console and saw it was ascii. I changed locale end now
>>> locale.getpreferredencoding()
'cp1251'
but it still doesn't work. But when i change # -*- coding: utf-8 -*- to other coding symbols are also changing, but not the ones that I need.
Ui from QtDesigner works ok.