Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RPi 3
#9
None of your images works get 403.
(Mar-12-2019, 12:31 PM)bescf Wrote: But i should see form of code, so project should be converted. I want to ask how i do this for file being "pyqtdesigner.ui". Which lines should be changed?
There is pyuic5 which convert .iu to .py
C:\1
λ pyuic5 my.ui -o my_app.py
So i need to add the last bit after if __name__ == '__main__':
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'my.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!

from PyQt5 import QtCore, QtGui, QtWidgets
import sys

class Ui_Dialog(object):
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(400, 300)
        self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
        self.buttonBox.setGeometry(QtCore.QRect(30, 240, 341, 32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.radioButton = QtWidgets.QRadioButton(Dialog)
        self.radioButton.setGeometry(QtCore.QRect(60, 100, 82, 17))
        self.radioButton.setObjectName("radioButton")

        self.retranslateUi(Dialog)
        self.buttonBox.accepted.connect(Dialog.accept)
        self.buttonBox.rejected.connect(Dialog.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog)

    def retranslateUi(self, Dialog):
        _translate = QtCore.QCoreApplication.translate
        Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
        self.radioButton.setText(_translate("Dialog", "RadioButton"))

if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)
    firstgui =  QtWidgets.QDialog()
    ui = Ui_Dialog()
    ui.setupUi(firstgui)
    firstgui.show()
    sys.exit(app.exec_())
This run my.ui directly.
from PyQt5 import uic, QtWidgets
import sys

class Ui(QtWidgets.QDialog):
    def __init__(self):
        super(Ui, self).__init__()
        uic.loadUi('my.ui', self)
        self.show()

if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)
    window = Ui()
    sys.exit(app.exec_())
Quote:I have to access TCP/IP protocol so i should get data from HTTP. Actually, This is not possible with QT designer ? Also, I prefer gui because i should represent this data to user.
Yes you can get data and put into PyQt5 designer,i just mention that i would choose web UI create with Flask.
I have moved more away from GUI and now doing most stuff it needed with web-app.
Getting data from HTTP has a more natural conntion to a web-app,but if want to do GUI that will work to.
Reply


Messages In This Thread
RPi 3 - by bescf - Mar-06-2019, 01:53 PM
RE: RPi 3 - by Larz60+ - Mar-06-2019, 08:29 PM
RE: RPi 3 - by bescf - Mar-07-2019, 02:03 PM
RE: RPi 3 - by Larz60+ - Mar-07-2019, 05:16 PM
RE: RPi 3 - by bescf - Mar-11-2019, 03:07 PM
RE: RPi 3 - by snippsat - Mar-11-2019, 03:53 PM
RE: RPi 3 - by bescf - Mar-12-2019, 08:33 AM
RE: RPi 3 - by bescf - Mar-12-2019, 12:31 PM
RE: RPi 3 - by snippsat - Mar-12-2019, 01:39 PM
RE: RPi 3 - by bescf - Mar-13-2019, 12:35 PM
RE: RPi 3 - by snippsat - Mar-14-2019, 06:48 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020