From b1a5c6d3872db50a59491402a95754fe2127c7a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=91=D0=BE=D0=B3=D0=B4=D0=B0?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2?= Date: Sat, 22 Jan 2022 12:10:01 +0000 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=BC=D0=B5=D1=87=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BF=D0=BE=20mainwindow.cpp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lab2/mainwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lab2/mainwindow.cpp b/lab2/mainwindow.cpp index 1d753ba..0dfe7dd 100644 --- a/lab2/mainwindow.cpp +++ b/lab2/mainwindow.cpp @@ -264,6 +264,9 @@ static bool permission_number=true; void EngineeringCalculator::PushButtons(){ QObject* obj = sender(); + //!!! Указатель нужно привести на основе qobject_cast и проверить правильность приведения. + //!!! Где гарантия, что sender был QPushButton ? + if(obj==button_0 ||obj==button_1 ||obj==button_2 || obj==button_3 || obj==button_4 || obj==button_5 ||obj==button_6 ||obj==button_7 || obj==button_8 ||obj==button_9){ //кнопки с цифрами QString str; -- GitLab