Commit 6fd2ff34 authored by Norby, Tom's avatar Norby, Tom

Fortify changes.

parent b3857c82
Pipeline #91212 passed with stages
in 28 minutes and 27 seconds
......@@ -47,6 +47,7 @@ NumberPadWidget::NumberPadWidget(QWidget *parent, bool toggle)
{
mToggle = toggle;
mMapper = new QSignalMapper(this);
mButton = new QPushButton(this);
connect(mMapper, SIGNAL(mapped(int)), SLOT(buttonClicked(int)));
// add widget containing
......@@ -70,8 +71,8 @@ NumberPadWidget::NumberPadWidget(QWidget *parent, bool toggle)
col = 0;
continue;
}
QPushButton *button = new QPushButton(this);
int colSpan = 1;
int colSpan = 1;
switch (keyboardLayout[i].key)
{
case Qt::Key_Delete:
......@@ -81,28 +82,28 @@ NumberPadWidget::NumberPadWidget(QWidget *parent, bool toggle)
case Qt::Key_3:
case Qt::Key_6:
case Qt::Key_9:
button->setObjectName("number_pad_button_wide");
mButton->setObjectName("number_pad_button_wide");
colSpan = 2;
break;
default:
button->setObjectName("number_pad_button");
mButton->setObjectName("number_pad_button");
break;
}
button->setText(QString::fromLatin1(keyboardLayout[i].label));
mButton->setText(QString::fromLatin1(keyboardLayout[i].label));
if (mToggle && keyboardLayout[i].key == Qt::Key_Plus)
connect(button, SIGNAL(clicked()), this, SLOT(makePositive()));
connect(mButton, SIGNAL(clicked()), this, SLOT(makePositive()));
else if (mToggle && keyboardLayout[i].key == Qt::Key_Minus)
connect(button, SIGNAL(clicked()), this, SLOT(makeNegative()));
connect(mButton, SIGNAL(clicked()), this, SLOT(makeNegative()));
else
{
mMapper->setMapping(button, keyboardLayout[i].key);
connect(button, SIGNAL(clicked()), mMapper, SLOT(map()));
mMapper->setMapping(mButton, keyboardLayout[i].key);
connect(mButton, SIGNAL(clicked()), mMapper, SLOT(map()));
}
mNumLayout->addWidget(button, row, col, 1, colSpan);
mNumLayout->addWidget(mButton, row, col, 1, colSpan);
col++;
}
}
......
......@@ -14,6 +14,7 @@ class RADIX_PUBLIC NumberPadWidget : public QLineEdit
{
Q_OBJECT
QPushButton* mButton;
QSignalMapper* mMapper;
QWidget* mNumberWidget;
QGridLayout* mNumLayout;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment