通过QT设计器创建的Qtoolbar上的单击操作调用函数

时间:2018-03-19 19:50:11

标签: python pyqt pyqt4

我正在使用带有pyqt 4.10的python 2.7并且我使用QT设计器创建了这个UI,我试图找到工具栏上的动作来添加一些调用它的函数,但我找不到它

# -*- coding: utf-8 -*-

# Form implementation generated from reading UI file 'Warehouse.ui'
#
# Created: Mon Mar 19 19:13:01 2018
#      by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui
import item_entry 

try:
    _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
    def _fromUtf8(s):
        return s

try:
    _encoding = QtGui.QApplication.UnicodeUTF8
    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig)

class Ui_mainWindow(object):
    def setupUi(self, mainWindow):
        mainWindow.setObjectName(_fromUtf8("mainWindow"))
        mainWindow.resize(1262, 698)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/media/media/wh.ico")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        mainWindow.setWindowIcon(icon)
        self.centralwidget = QtGui.QWidget(mainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.gridLayout = QtGui.QGridLayout(self.centralwidget)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.comboBox = QtGui.QComboBox(self.centralwidget)
        self.comboBox.setObjectName(_fromUtf8("comboBox"))
        self.gridLayout.addWidget(self.comboBox, 1, 0, 1, 1)
        self.tabWidget = QtGui.QTabWidget(self.centralwidget)
        self.tabWidget.setObjectName(_fromUtf8("tabWidget"))
        self.items_tab = QtGui.QWidget()
        self.items_tab.setObjectName(_fromUtf8("items_tab"))
        self.listView = QtGui.QListView(self.items_tab, )
        self.listView.setGeometry(QtCore.QRect(0, 0, 481, 521))
        self.listView.setObjectName(_fromUtf8("listView"))
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(_fromUtf8(":/media/media/item_icon.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.tabWidget.addTab(self.items_tab, icon1, _fromUtf8(""))
        self.category_tab = QtGui.QWidget()
        self.category_tab.setObjectName(_fromUtf8("category_tab"))
        self.listView_2 = QtGui.QListView(self.category_tab)
        self.listView_2.setEnabled(True)
        self.listView_2.setGeometry(QtCore.QRect(0, 0, 481, 521))
        self.listView_2.setObjectName(_fromUtf8("listView_2"))
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap(_fromUtf8(":/media/media/cat_icon.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.tabWidget.addTab(self.category_tab, icon2, _fromUtf8(""))
        self.gridLayout.addWidget(self.tabWidget, 2, 0, 1, 1)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.verticalLayout_3 = QtGui.QVBoxLayout()
        self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
        self.label_3 = QtGui.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Adobe Arabic"))
        font.setPointSize(16)
        self.label_3.setFont(font)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.verticalLayout_3.addWidget(self.label_3)
        self.label_2 = QtGui.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Adobe Arabic"))
        font.setPointSize(16)
        self.label_2.setFont(font)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.verticalLayout_3.addWidget(self.label_2)
        self.horizontalLayout.addLayout(self.verticalLayout_3)
        self.verticalLayout_2 = QtGui.QVBoxLayout()
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.lineEdit = QtGui.QLineEdit(self.centralwidget)
        self.lineEdit.setEnabled(True)
        self.lineEdit.setObjectName(_fromUtf8("lineEdit"))
        self.verticalLayout_2.addWidget(self.lineEdit)
        self.lineEdit_3 = QtGui.QLineEdit(self.centralwidget)
        self.lineEdit_3.setEnabled(True)
        self.lineEdit_3.setEchoMode(QtGui.QLineEdit.Password)
        self.lineEdit_3.setObjectName(_fromUtf8("lineEdit_3"))
        self.verticalLayout_2.addWidget(self.lineEdit_3)
        self.horizontalLayout.addLayout(self.verticalLayout_2)
        self.gridLayout.addLayout(self.horizontalLayout, 0, 2, 1, 1)
        self.verticalLayout = QtGui.QVBoxLayout()
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.label_5 = QtGui.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Adobe Arabic"))
        font.setPointSize(18)
        font.setBold(False)
        font.setWeight(50)
        self.label_5.setFont(font)
        self.label_5.setObjectName(_fromUtf8("label_5"))
        self.verticalLayout.addWidget(self.label_5)
        self.gridLayout.addLayout(self.verticalLayout, 0, 4, 1, 1)
        self.label = QtGui.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Adobe Arabic"))
        font.setPointSize(36)
        self.label.setFont(font)
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem, 0, 1, 1, 1)
        self.verticalLayout_4 = QtGui.QVBoxLayout()
        self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4"))
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.label_4 = QtGui.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Adobe Arabic"))
        font.setPointSize(20)
        self.label_4.setFont(font)
        self.label_4.setLineWidth(5)
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.horizontalLayout_2.addWidget(self.label_4)
        self.label_6 = QtGui.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Adobe Arabic"))
        font.setPointSize(28)
        self.label_6.setFont(font)
        self.label_6.setObjectName(_fromUtf8("label_6"))
        self.horizontalLayout_2.addWidget(self.label_6)
        self.verticalLayout_4.addLayout(self.horizontalLayout_2)
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        self.label_7 = QtGui.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Adobe Arabic"))
        font.setPointSize(24)
        self.label_7.setFont(font)
        self.label_7.setObjectName(_fromUtf8("label_7"))
        self.horizontalLayout_3.addWidget(self.label_7)
        self.lcdNumber = QtGui.QLCDNumber(self.centralwidget)
        self.lcdNumber.setFrameShape(QtGui.QFrame.NoFrame)
        self.lcdNumber.setObjectName(_fromUtf8("lcdNumber"))
        self.horizontalLayout_3.addWidget(self.lcdNumber)
        self.verticalLayout_4.addLayout(self.horizontalLayout_3)
        self.gridLayout.addLayout(self.verticalLayout_4, 2, 1, 1, 2)
        self.gridLayout_2 = QtGui.QGridLayout()
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.lcdNumber_4 = QtGui.QLCDNumber(self.centralwidget)
        self.lcdNumber_4.setObjectName(_fromUtf8("lcdNumber_4"))
        self.gridLayout_2.addWidget(self.lcdNumber_4, 2, 1, 1, 1)
        self.label_10 = QtGui.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Adobe Arabic"))
        font.setPointSize(20)
        self.label_10.setFont(font)
        self.label_10.setObjectName(_fromUtf8("label_10"))
        self.gridLayout_2.addWidget(self.label_10, 2, 0, 1, 1)
        self.lcdNumber_2 = QtGui.QLCDNumber(self.centralwidget)
        self.lcdNumber_2.setObjectName(_fromUtf8("lcdNumber_2"))
        self.gridLayout_2.addWidget(self.lcdNumber_2, 0, 1, 1, 1)
        self.label_9 = QtGui.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Adobe Arabic"))
        font.setPointSize(20)
        self.label_9.setFont(font)
        self.label_9.setObjectName(_fromUtf8("label_9"))
        self.gridLayout_2.addWidget(self.label_9, 0, 0, 1, 1)
        self.lcdNumber_3 = QtGui.QLCDNumber(self.centralwidget)
        self.lcdNumber_3.setObjectName(_fromUtf8("lcdNumber_3"))
        self.gridLayout_2.addWidget(self.lcdNumber_3, 1, 1, 1, 1)
        self.label_8 = QtGui.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Adobe Arabic"))
        font.setPointSize(20)
        self.label_8.setFont(font)
        self.label_8.setObjectName(_fromUtf8("label_8"))
        self.gridLayout_2.addWidget(self.label_8, 1, 0, 1, 1)
        self.label_11 = QtGui.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Adobe Arabic"))
        font.setPointSize(20)
        self.label_11.setFont(font)
        self.label_11.setObjectName(_fromUtf8("label_11"))
        self.gridLayout_2.addWidget(self.label_11, 0, 2, 1, 1)
        self.label_12 = QtGui.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Adobe Arabic"))
        font.setPointSize(20)
        self.label_12.setFont(font)
        self.label_12.setObjectName(_fromUtf8("label_12"))
        self.gridLayout_2.addWidget(self.label_12, 1, 2, 1, 1)
        self.label_13 = QtGui.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Adobe Arabic"))
        font.setPointSize(20)
        self.label_13.setFont(font)
        self.label_13.setObjectName(_fromUtf8("label_13"))
        self.gridLayout_2.addWidget(self.label_13, 2, 2, 1, 1)
        self.gridLayout.addLayout(self.gridLayout_2, 2, 4, 1, 1)
        self.pushButton = QtGui.QPushButton(self.centralwidget)
        self.pushButton.setEnabled(True)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.pushButton.sizePolicy().hasHeightForWidth())
        self.pushButton.setSizePolicy(sizePolicy)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Adobe Arabic"))
        font.setPointSize(14)
        self.pushButton.setFont(font)
        self.pushButton.setObjectName(_fromUtf8("pushButton"))
        self.gridLayout.addWidget(self.pushButton, 1, 2, 1, 1)
        self.pushButton_2 = QtGui.QPushButton(self.centralwidget)
        self.pushButton_2.setEnabled(False)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Adobe Arabic"))
        font.setPointSize(16)
        self.pushButton_2.setFont(font)
        self.pushButton_2.setObjectName(_fromUtf8("pushButton_2"))
        self.gridLayout.addWidget(self.pushButton_2, 0, 3, 1, 1)
        mainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(mainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1262, 21))
        self.menubar.setObjectName(_fromUtf8("menubar"))
        self.menu = QtGui.QMenu(self.menubar)
        self.menu.setObjectName(_fromUtf8("menu"))
        self.menu_2 = QtGui.QMenu(self.menubar)
        self.menu_2.setObjectName(_fromUtf8("menu_2"))
        self.menu_3 = QtGui.QMenu(self.menubar)
        self.menu_3.setObjectName(_fromUtf8("menu_3"))
        self.menu_4 = QtGui.QMenu(self.menubar)
        self.menu_4.setObjectName(_fromUtf8("menu_4"))
        self.menu_5 = QtGui.QMenu(self.menubar)
        self.menu_5.setObjectName(_fromUtf8("menu_5"))
        mainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(mainWindow)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        mainWindow.setStatusBar(self.statusbar)
        self.toolBar = QtGui.QToolBar(mainWindow)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.toolBar.sizePolicy().hasHeightForWidth())
        self.toolBar.setSizePolicy(sizePolicy)
        self.toolBar.setMovable(False)
        self.toolBar.setIconSize(QtCore.QSize(100, 100))
        self.toolBar.setToolButtonStyle(QtCore.Qt.ToolButtonTextUnderIcon)
        self.toolBar.setFloatable(False)
        self.toolBar.setObjectName(_fromUtf8("toolBar"))
        mainWindow.addToolBar(QtCore.Qt.RightToolBarArea, self.toolBar)
        self.action = QtGui.QAction(mainWindow)
        icon3 = QtGui.QIcon()
        icon3.addPixmap(QtGui.QPixmap(_fromUtf8(":/media/media/in.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.action.setIcon(icon3)
        self.action.setObjectName(_fromUtf8("action"))
        self.action_3 = QtGui.QAction(mainWindow)
        icon4 = QtGui.QIcon()
        icon4.addPixmap(QtGui.QPixmap(_fromUtf8(":/media/media/edit.svg")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.action_3.setIcon(icon4)
        self.action_3.setObjectName(_fromUtf8("action_3"))
        self.action_4 = QtGui.QAction(mainWindow)
        icon5 = QtGui.QIcon()
        icon5.addPixmap(QtGui.QPixmap(_fromUtf8(":/media/media/out.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.action_4.setIcon(icon5)
        self.action_4.setObjectName(_fromUtf8("action_4"))
        self.action_5 = QtGui.QAction(mainWindow)
        self.action_5.setIcon(icon3)
        self.action_5.setObjectName(_fromUtf8("action_5"))
        self.action_7 = QtGui.QAction(mainWindow)
        self.action_7.setIcon(icon1)
        self.action_7.setObjectName(_fromUtf8("action_7"))
        self.action_8 = QtGui.QAction(mainWindow)
        self.action_8.setIcon(icon5)
        self.action_8.setObjectName(_fromUtf8("action_8"))
        self.new_item_entry = QtGui.QAction(mainWindow)
        self.new_item_entry.setCheckable(False)
        self.new_item_entry.setIcon(icon3)
        self.new_item_entry.setObjectName(_fromUtf8("new_item_entry"))
        self.exiting_item = QtGui.QAction(mainWindow)
        self.exiting_item.setIcon(icon5)
        self.exiting_item.setObjectName(_fromUtf8("exiting_item"))
        self.item_edit_name = QtGui.QAction(mainWindow)
        self.item_edit_name.setIcon(icon4)
        self.item_edit_name.setObjectName(_fromUtf8("item_edit_name"))
        self.action_9 = QtGui.QAction(mainWindow)
        icon6 = QtGui.QIcon()
        icon6.addPixmap(QtGui.QPixmap(_fromUtf8(":/media/media/close.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.action_9.setIcon(icon6)
        self.action_9.setObjectName(_fromUtf8("action_9"))
        self.action_10 = QtGui.QAction(mainWindow)
        self.action_10.setIcon(icon3)
        self.action_10.setObjectName(_fromUtf8("action_10"))
        self.action_11 = QtGui.QAction(mainWindow)
        self.action_11.setIcon(icon5)
        self.action_11.setObjectName(_fromUtf8("action_11"))
        self.action_13 = QtGui.QAction(mainWindow)
        self.action_13.setIcon(icon4)
        self.action_13.setObjectName(_fromUtf8("action_13"))
        self.action_15 = QtGui.QAction(mainWindow)
        self.action_15.setIcon(icon4)
        self.action_15.setObjectName(_fromUtf8("action_15"))
        self.action_16 = QtGui.QAction(mainWindow)
        self.action_16.setIcon(icon6)
        self.action_16.setObjectName(_fromUtf8("action_16"))
        self.action_17 = QtGui.QAction(mainWindow)
        self.action_17.setObjectName(_fromUtf8("action_17"))
        self.action_18 = QtGui.QAction(mainWindow)
        self.action_18.setObjectName(_fromUtf8("action_18"))
        self.action_19 = QtGui.QAction(mainWindow)
        icon7 = QtGui.QIcon()
        icon7.addPixmap(QtGui.QPixmap(_fromUtf8(":/media/media/save.ico")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.action_19.setIcon(icon7)
        self.action_19.setObjectName(_fromUtf8("action_19"))
        self.action_20 = QtGui.QAction(mainWindow)
        icon8 = QtGui.QIcon()
        icon8.addPixmap(QtGui.QPixmap(_fromUtf8(":/media/media/restore.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.action_20.setIcon(icon8)
        self.action_20.setObjectName(_fromUtf8("action_20"))
        self.action_22 = QtGui.QAction(mainWindow)
        self.action_22.setIcon(icon6)
        self.action_22.setObjectName(_fromUtf8("action_22"))
        self.menu.addAction(self.action)
        self.menu.addSeparator()
        self.menu.addAction(self.action_3)
        self.menu.addAction(self.action_4)
        self.menu_2.addAction(self.action_5)
        self.menu_2.addSeparator()
        self.menu_2.addAction(self.action_7)
        self.menu_2.addAction(self.action_8)
        self.menu_3.addAction(self.action_10)
        self.menu_3.addAction(self.action_11)
        self.menu_3.addSeparator()
        self.menu_3.addAction(self.action_13)
        self.menu_3.addSeparator()
        self.menu_3.addAction(self.action_15)
        self.menu_3.addAction(self.action_16)
        self.menu_4.addAction(self.action_17)
        self.menu_4.addAction(self.action_18)
        self.menu_5.addAction(self.action_19)
        self.menu_5.addAction(self.action_20)
        self.menu_5.addSeparator()
        self.menu_5.addAction(self.action_22)
        self.menubar.addAction(self.menu.menuAction())
        self.menubar.addAction(self.menu_2.menuAction())
        self.menubar.addAction(self.menu_3.menuAction())
        self.menubar.addAction(self.menu_5.menuAction())
        self.menubar.addAction(self.menu_4.menuAction())
        self.toolBar.addAction(self.new_item_entry)
        self.toolBar.addAction(self.exiting_item)
        self.toolBar.addAction(self.item_edit_name)
        self.toolBar.addAction(self.action_9)

        self.retranslateUi(mainWindow)
        self.tabWidget.setCurrentIndex(0)
        QtCore.QMetaObject.connectSlotsByName(mainWindow)

    def retranslateUi(self, mainWindow):
        mainWindow.setWindowTitle(_translate("mainWindow", "Town of technoloy  - إدارة المخازن", None))
        self.comboBox.setStatusTip(_translate("mainWindow", "قم بإختيار الفئة", None))
        self.tabWidget.setStatusTip(_translate("mainWindow", "اختار ما بين الاصناف و الفئات", None))
        self.listView.setStatusTip(_translate("mainWindow", "الاصناف فى المخزن", None))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.items_tab), _translate("mainWindow", "الأصناف", None))
        self.listView_2.setStatusTip(_translate("mainWindow", "الفئات فى المخزن", None))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.category_tab), _translate("mainWindow", "الفئات", None))
        self.label_3.setText(_translate("mainWindow", "إسم المستخدم", None))
        self.label_2.setText(_translate("mainWindow", "كلمة المرور", None))
        self.lineEdit.setStatusTip(_translate("mainWindow", "ادخل إسم المستخدم ", None))
        self.lineEdit.setPlaceholderText(_translate("mainWindow", "إسم المستخدم هنا", None))
        self.lineEdit_3.setStatusTip(_translate("mainWindow", "ادخل كلمة المرور", None))
        self.lineEdit_3.setPlaceholderText(_translate("mainWindow", "كلمة المرور هنا", None))
        self.label_5.setStatusTip(_translate("mainWindow", "Town of Technology", None))
        self.label_5.setText(_translate("mainWindow", "<html><head/><body><p><img src=\":/media/media/town-of-technology.png\"/></p></body></html>", None))
        self.label.setStatusTip(_translate("mainWindow", "برنامج إدارة المخازن من Town of Technology", None))
        self.label.setText(_translate("mainWindow", "<html><head/><body><p><span style=\" color:#ff0000; vertical-align:super;\">T</span><span style=\" vertical-align:super;\">own of technology </span><img src=\":/media/media/wh.ico\"/><span style=\" vertical-align:sub;\">إدارة المخازن</span></p></body></html>", None))
        self.label_4.setText(_translate("mainWindow", "       إسم الصنف", None))
        self.label_6.setStatusTip(_translate("mainWindow", "إسم الصنف ", None))
        self.label_6.setText(_translate("mainWindow", "إختر صنف", None))
        self.label_7.setText(_translate("mainWindow", "      الكمية", None))
        self.lcdNumber.setStatusTip(_translate("mainWindow", "الكمية الموجودة من الصنف", None))
        self.label_10.setText(_translate("mainWindow", "عدد المستخدمين", None))
        self.label_9.setText(_translate("mainWindow", "عدد الفئات فى المخزن", None))
        self.label_8.setText(_translate("mainWindow", "عدد الاصناف فى المخزن", None))
        self.label_11.setText(_translate("mainWindow", "فئة", None))
        self.label_12.setText(_translate("mainWindow", "صنف", None))
        self.label_13.setText(_translate("mainWindow", "مستخدم", None))
        self.pushButton.setStatusTip(_translate("mainWindow", "اضغط لتسجيل الدخول", None))
        self.pushButton.setText(_translate("mainWindow", "تسجيل الدخول", None))
        self.pushButton_2.setText(_translate("mainWindow", "تسجيل الخروج", None))
        self.menu.setTitle(_translate("mainWindow", "الفئات", None))
        self.menu_2.setTitle(_translate("mainWindow", "المستخدمين", None))
        self.menu_3.setTitle(_translate("mainWindow", "الأصناف", None))
        self.menu_4.setTitle(_translate("mainWindow", "التقارير", None))
        self.menu_5.setTitle(_translate("mainWindow", "البيانات", None))
        self.toolBar.setWindowTitle(_translate("mainWindow", "toolBar", None))
        self.action.setText(_translate("mainWindow", "فئة جديدة", None))
        self.action_3.setText(_translate("mainWindow", "تعديل الفئات", None))
        self.action_4.setText(_translate("mainWindow", "مسح الفئات", None))
        self.action_5.setText(_translate("mainWindow", "مستخدم جديد", None))
        self.action_7.setText(_translate("mainWindow", "تعديل المستخدمين", None))
        self.action_8.setText(_translate("mainWindow", "مسح مستخدمين", None))
        self.new_item_entry.setText(_translate("mainWindow", "إدخال صنف للمخزن", None))
        self.new_item_entry.setToolTip(_translate("mainWindow", "<html><head/><body><p><span style=\" font-weight:600;\">إدخال صنف للمخزن</span></p></body></html>", None))
        self.exiting_item.setText(_translate("mainWindow", "خروج صنف من المخزن", None))
        self.item_edit_name.setText(_translate("mainWindow", "تعديل اسم صنف", None))
        self.action_9.setText(_translate("mainWindow", "خروج من البرنامج", None))
        self.action_10.setText(_translate("mainWindow", "دخول أصناف", None))
        self.action_11.setText(_translate("mainWindow", "خروج أصناف", None))
        self.action_13.setText(_translate("mainWindow", "تعديل اسم صنف", None))
        self.action_15.setText(_translate("mainWindow", "تعديل كمية الاصناف", None))
        self.action_16.setText(_translate("mainWindow", "مسح اصناف", None))
        self.action_17.setText(_translate("mainWindow", "عرض التقارير ( قريباً )", None))
        self.action_18.setText(_translate("mainWindow", "طباعة التقارير ( قريباً )", None))
        self.action_19.setText(_translate("mainWindow", "حفظ قاعدة البيانات", None))
        self.action_20.setText(_translate("mainWindow", "إسترجاع قاعدة البيانات", None))
        self.action_22.setText(_translate("mainWindow", "مسح قاعدة البيانات", None))





import resrcs


if __name__ == "__main__":
    import sys
    app = QtGui.QApplication(sys.argv)
    app.setLayoutDirection(QtCore.Qt.RightToLeft)
    app.setStyle('Plastique')
    mainWindow = QtGui.QMainWindow()
    mainWindow.showMaximized()
    ui = Ui_mainWindow()
    ui.setupUi(mainWindow)
    mainWindow.show()
    sys.exit(app.exec_())

QT设计师使用的编码和OOP与我的预期略有不同。

我尝试添加的函数是使用相同的QT设计器版本调用另一个完全在另一个文件中创建的窗口,因此import item_entry 语句使用的是调用其他文件并将其视为模块

1 个答案:

答案 0 :(得分:1)

你必须使用triggered的{​​{1}}信号,但要订购一个新的类,它继承自在Qt Designer中选择的小部件,并且设计如下所示:

QAction