SHARE
TWEET

Python - PyQt - example

furas Jun 10th, 2018 (edited) 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # -*- coding: utf-8 -*-
  2.  
  3. # Form implementation generated from reading ui file '/Users/reezalaq/PycharmProjects/WoocommerceProject/GUI/project-ui.ui'
  4. #
  5. # Created by: PyQt5 UI code generator 5.10.1
  6. #
  7. # WARNING! All changes made in this file will be lost!
  8.  
  9. from PyQt5 import QtCore, QtGui, QtWidgets
  10.  
  11.  
  12. class Ui_MainWindow(QtWidgets.QMainWindow):
  13.  
  14.     def __init__(self): # (self, *args, **kwargs):
  15.         super().__init__()
  16.         self.setupUi(self)
  17.         self.show()
  18.  
  19.     def setupUi(self, MainWindow):
  20.         MainWindow.setObjectName("MainWindow")
  21.         MainWindow.resize(1051, 668)
  22.         self.centralwidget = QtWidgets.QWidget(MainWindow)
  23.         self.centralwidget.setObjectName("centralwidget")
  24.         self.pushButton = QtWidgets.QPushButton(self.centralwidget)
  25.         self.pushButton.setGeometry(QtCore.QRect(190, 100, 191, 32))
  26.         self.pushButton.setObjectName("pushButton")
  27.         self.lineEdit = QtWidgets.QLineEdit(self.centralwidget)
  28.         self.lineEdit.setGeometry(QtCore.QRect(190, 30, 261, 21))
  29.         self.lineEdit.setObjectName("lineEdit")
  30.         self.label = QtWidgets.QLabel(self.centralwidget)
  31.         self.label.setGeometry(QtCore.QRect(40, 30, 141, 20))
  32.         self.label.setObjectName("label")
  33.         self.label_2 = QtWidgets.QLabel(self.centralwidget)
  34.         self.label_2.setGeometry(QtCore.QRect(40, 70, 141, 20))
  35.         self.label_2.setObjectName("label_2")
  36.         self.lineEdit_2 = QtWidgets.QLineEdit(self.centralwidget)
  37.         self.lineEdit_2.setGeometry(QtCore.QRect(190, 70, 261, 21))
  38.         self.lineEdit_2.setObjectName("lineEdit_2")
  39.         self.label_4 = QtWidgets.QLabel(self.centralwidget)
  40.         self.label_4.setGeometry(QtCore.QRect(520, 30, 190, 20))
  41.         self.label_4.setObjectName("label_4")
  42.         self.lineEdit_3 = QtWidgets.QLineEdit(self.centralwidget)
  43.         self.lineEdit_3.setGeometry(QtCore.QRect(750, 70, 251, 21))
  44.         self.lineEdit_3.setObjectName("lineEdit_3")
  45.         self.lineEdit_4 = QtWidgets.QLineEdit(self.centralwidget)
  46.         self.lineEdit_4.setGeometry(QtCore.QRect(750, 30, 251, 21))
  47.         self.lineEdit_4.setObjectName("lineEdit_4")
  48.         self.pushButton_2 = QtWidgets.QPushButton(self.centralwidget)
  49.         self.pushButton_2.setGeometry(QtCore.QRect(750, 100, 231, 32))
  50.         self.pushButton_2.setObjectName("pushButton_2")
  51.         self.label_5 = QtWidgets.QLabel(self.centralwidget)
  52.         self.label_5.setGeometry(QtCore.QRect(520, 70, 190, 20))
  53.         self.label_5.setObjectName("label_5")
  54.         self.line = QtWidgets.QFrame(self.centralwidget)
  55.         self.line.setGeometry(QtCore.QRect(40, 140, 961, 21))
  56.         self.line.setFrameShape(QtWidgets.QFrame.HLine)
  57.         self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
  58.         self.line.setObjectName("line")
  59.         self.tableWidget = QtWidgets.QTableWidget(self.centralwidget)
  60.         self.tableWidget.setGeometry(QtCore.QRect(40, 170, 961, 351))
  61.         self.tableWidget.setObjectName("tableWidget")
  62.         self.tableWidget.setColumnCount(0)
  63.         self.tableWidget.setRowCount(0)
  64.         self.pushButton_3 = QtWidgets.QPushButton(self.centralwidget)
  65.         self.pushButton_3.setGeometry(QtCore.QRect(390, 530, 221, 32))
  66.         self.pushButton_3.setObjectName("pushButton_3")
  67.         MainWindow.setCentralWidget(self.centralwidget)
  68.         self.menubar = QtWidgets.QMenuBar(MainWindow)
  69.         self.menubar.setGeometry(QtCore.QRect(0, 0, 1051, 22))
  70.         self.menubar.setObjectName("menubar")
  71.         MainWindow.setMenuBar(self.menubar)
  72.         self.statusbar = QtWidgets.QStatusBar(MainWindow)
  73.         self.statusbar.setObjectName("statusbar")
  74.         MainWindow.setStatusBar(self.statusbar)
  75.  
  76.         self.retranslateUi(MainWindow)
  77.         QtCore.QMetaObject.connectSlotsByName(MainWindow)
  78.  
  79.     def retranslateUi(self, MainWindow):
  80.         _translate = QtCore.QCoreApplication.translate
  81.         MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
  82.         self.pushButton.setText(_translate("MainWindow", "Connect to AliExpress API"))
  83.         self.label.setText(_translate("MainWindow", "AliExpress API Key     :"))
  84.         self.label_2.setText(_translate("MainWindow", "AliExpress Affiliate ID :"))
  85.         self.label_4.setText(_translate("MainWindow", "Woocommerce Consumer Key     :"))
  86.         self.pushButton_2.setText(_translate("MainWindow", "Connect to Woocommerce API"))
  87.         self.label_5.setText(_translate("MainWindow", "Woocommerce Consumer Key     :"))
  88.         self.pushButton_3.setText(_translate("MainWindow", "Export to Woocommerce"))
  89.  
  90.  
  91. import sys
  92. app = QtWidgets.QApplication(sys.argv)
  93. #app = QtWidgets.QApplication([]) # empty list instead of list sys.argv
  94. win = Ui_MainWindow()
  95. app.exec()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top