Portál AbcLinuxu, 30. října 2025 00:38
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Jablka:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Hrušky:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_2"/>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
Vygenerovaný form_layout.py
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'form_layout.ui'
#
# Created: Tue Nov 9 15:41:01 2010
# by: PyQt4 UI code generator 4.8.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.resize(400, 300)
self.formLayout = QtGui.QFormLayout(Form)
self.formLayout.setObjectName(_fromUtf8("formLayout"))
self.label = QtGui.QLabel(Form)
self.label.setObjectName(_fromUtf8("label"))
self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.label)
self.lineEdit = QtGui.QLineEdit(Form)
self.lineEdit.setObjectName(_fromUtf8("lineEdit"))
self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.lineEdit)
self.label_2 = QtGui.QLabel(Form)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.label_2)
self.lineEdit_2 = QtGui.QLineEdit(Form)
self.lineEdit_2.setObjectName(_fromUtf8("lineEdit_2"))
self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.lineEdit_2)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
Form.setWindowTitle(QtGui.QApplication.translate("Form", "Form", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("Form", "Jablka:", None, QtGui.QApplication.UnicodeUTF8))
self.label_2.setText(QtGui.QApplication.translate("Form", "Hrušky:", None, QtGui.QApplication.UnicodeUTF8))
test2.py
from PyQt4.QtGui import * from PyQt4.QtCore import * from form_layout import Ui_Form import sys if __name__ == "__main__": app = QApplication(sys.argv) w = QWidget() ui = Ui_Form() ui.setupUi(w) w.show() sys.exit(app.exec_())Python 2.6, PyQt4 4.8.1 Absolutně netuším, čím to může být. qt-config jsem prošel, nic jsem nenašel. Asi to bude nějaký bug, ale kde?
Řešení dotazu:
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.