OK so I started to make a calculator program and was compiling while I was coding (that's why the code isn't complete), and it gave me these errors.
error: invalid conversion from `int' to `const QObject*'
error
: initializing argument
3 of `
static bool QObject::connect(const QObject*,
const char*,
const QObject*,
const char*, Qt
::ConnectionType)'
error: invalid conversion from `int' to `const QObject*'
error: initializing argument 3 of `static bool QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)'
To copy to clipboard, switch view to plain text mode
Here is my code.
#include <QApplication>
#include <QPushButton>
#include <QLabel>
#include <QSpinBox>
#include <QLCDNumber>
int main(int argc, char *argv[])
{
int calc1, calc2;
QObject::connect(num1,
SIGNAL(valueChanged
(int)), calc1,
SLOT(setValue
(int)));
return app.exec();
}
#include <QApplication>
#include <QPushButton>
#include <QLabel>
#include <QSpinBox>
#include <QLCDNumber>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *minus = new QLabel("-");
QPushButton *equal = new QPushButton("Execute");
QSpinBox *num1 = new QSpinBox;
QSpinBox *num2 = new QSpinBox;
QLCDNumber *show = new QLCDNumber(3);
int calc1, calc2;
QObject::connect(num1, SIGNAL(valueChanged(int)), calc1, SLOT(setValue(int)));
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks