Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 [PyQt] Problem how to click a button inside a group box?
#1
I have a button inside a groupbox which in turn is inside a larger group box.
How do I run a function by clicking the button inside the groupbox?

I have the following code:
from PyQt5 import QtCore, QtGui, QtWidgets
from propertyDialog import Ui_Dialog
import sys

class mainProgram(QtWidgets.QMainWindow, Ui_Dialog):
    def __init__(self, parent=None):

        super(mainProgram, self).__init__(parent)
        self.setupUi(self)
        self.cntPipe = 0
        self.cntLiner = 0
        self.cntCoating = 0
        self.pipeproperty = {}
        self.liner = {}
        self.coating = {}

        self.response_AddPipe.clicked.connect(self.add_pipe)

    def add_pipe(self):
        self.cntPipe += 1
        self.cntLiner = 0
        self.cntCoating = 0
        self.pipeproperty[self.cntPipe] = {}
        pipe_name = self.input_PipeName.text()
        self.pipeproperty[self.cntPipe]["Name"] = pipe_name
        pipe_OD = self.input_PipeOuterDiameter.text()
        self.pipeproperty[self.cntPipe]["Outside diameter"] = pipe_OD
        pipe_WT = self.input_PipeWallThickness.text()
        self.pipeproperty[self.cntPipe]["Wall thickness"] = pipe_WT
        pipe_density = self.input_PipeDensity.text()
        self.pipeproperty[self.cntPipe]["Density"] = pipe_density
        print(self.pipeproperty)
Error:
"C:\Users\USr\Desktop\Work Folder PPM\VirtualEnvironment\Scripts\python.exe" "C:/Users/USr/Desktop/Work Folder PPM/VirtualEnvironment/Scripts/Complete Program.py" Traceback (most recent call last): File "C:/Users/USr/Desktop/Work Folder PPM/VirtualEnvironment/Scripts/Complete Program.py", line 74, in <module> main() File "C:/Users/USr/Desktop/Work Folder PPM/VirtualEnvironment/Scripts/Complete Program.py", line 67, in main nextGui = mainProgram() File "C:/Users/USr/Desktop/Work Folder PPM/VirtualEnvironment/Scripts/Complete Program.py", line 17, in __init__ self.response_AddPipe.clicked.connect(self.add_pipe) AttributeError: 'mainProgram' object has no attribute 'response_AddPipe' Process finished with exit code 1
I have no clue what to address such that it can find the push button "response_AddPipe".
Quote

Top Page

Messages In This Thread
Problem how to click a button inside a group box? - by mart79 - Aug-05-2019, 08:18 AM

Possibly Related Threads...
Thread Author Replies Views Last Post
  Problem with Submit button Tkinter Reldaing 2 206 Jan-05-2020, 01:58 AM
Last Post: balenaucigasa
  [Tkinter] Checking button click in Tkinter GalaxyCoyote 3 506 Oct-20-2019, 03:28 AM
Last Post: GalaxyCoyote
  [PySimpleGui] How to alter mouse click button of a standard submit button? skyerosebud 3 680 Jul-21-2019, 06:02 PM
Last Post: FullOfHelp
  [Tkinter] Tkinter window pop up again when i click button Orimura_Sandy 1 905 May-12-2019, 08:17 PM
Last Post: joe_momma
  [Tkinter] Not getting entry values on button click & treeview not updating ? swanysto 4 1,920 May-10-2019, 04:16 PM
Last Post: swanysto
  Simple Button click on image file to create action? jpezz 4 753 Mar-27-2019, 10:08 PM
Last Post: jpezz
  right mouse button click with PyQt5 brecht83 4 6,193 Nov-09-2018, 02:55 PM
Last Post: brecht83
  [Tkinter] loop function when called from tkinter button click WantedStarling 5 3,082 Jul-13-2018, 06:12 PM
Last Post: nilamo
  Tkinter touch screen button click ashtona 2 3,499 Apr-13-2018, 11:46 AM
Last Post: buran
  Button click doesnt work from my second class/layout in Python imamideb 0 940 Feb-13-2018, 12:09 PM
Last Post: imamideb

Forum Jump:


Users browsing this thread: 1 Guest(s)