0
main_windowはデザイナーとpyuicによって生成された.pyファイルです。PyQt5のあるクラスから別のクラスへのテキストの取得方法を教えてください。
私はlineedit.text() と呼ばれるが、このコードの戻り値は..私を助けてくださいnullである必要
※ SCENARIO 1. program start 2. input ip(lienedit)/port(lineedit_2)/id(lineedit_3)/password(lineedit_4) 3. click pushButton_2 (called self.pushButton_2.clicked.connect(self.engine_mgmt)) 4. popup eng_mgmt_window 5. click auth_Start_Btn (called self.auth_Start_Btn.clicked.connect(self.auth_func)) 6. popup ip text (to get lineedit.text())... but this code is null Popup... T.T
..
# -*- coding:utf-8 -*-
from PyQt5 import QtCore, QtGui, QtWidgets
import os, sys, time, re, paramiko
from Main_Window import main_window
from Engine_Mgmt import engine_mgmt_window
class win_Main(QtWidgets.QDialog, main_window):
def __init__(self, parent=None):
QtWidgets.QDialog.__init__(self, parent)
self.setupUi(self)
self.pushButton.clicked.connect(self.param_check)
self.pushButton_2.clicked.connect(self.engine_mgmt)
def param_check(self):
conn_ip = self.lineEdit.text()
conn_port = self.lineEdit_2.text()
user_id = self.lineEdit_4.text()
user_pw = self.lineEdit_5.text()
if conn_ip == "" or conn_port == "" or user_id == "" or user_pw == "":
QtWidgets.QMessageBox.information(self, "Param Check Error", "Input filed cannot be left blank")
def engine_mgmt(self):
self.dialog = eng_mgmt_window(self)
self.dialog.show()
class eng_mgmt_window(engine_mgmt_window, win_Main):
def __init__(self, parent=win_Main):
QtWidgets.QDialog.__init__(self, parent)
self.setupUi(self)
self.auth_Start_Btn.clicked.connect(self.auth_func)
def auth_func(self):
#
# INPUT win_Main() in lineedit = 192.168.0.1 but Result... Null
# I WANT GET win_Main() in lineedit text
#
gets.QMessageBox.information(self, "Config Check", wm.lineEdit.text())
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
dlg = win_Main()
dlg.show()
sys.exit(app.exec_())