0
iam trying to build this program but it give me c1057 fatal error . When i removed connect function (line 15) it worked well and i don't know the reason this is the message : C:\Users\Ahmed\Documents\Qt-App\SpinnerAndSliders\main.cpp:15: error: C1057: unexpected end of file in macro expansionQt Creator的VS 2013(錯誤C1057)
#include <QSpinBox>
#include <QSlider>
#include <QApplication>
#include <QHBoxLayout>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QWidget *mainWindow = new QWidget();
mainWindow -> setWindowTitle("Sound volume");
QSpinBox *spinner = new QSpinBox();
QSlider *slider = new QSlider(Qt::Horizontal) ;
QHBoxLayout *layout = new QHBoxLayout ;
spinner -> setRange(0,50);
slider -> setRange(0,50);
QObject::connect(spinner,SIGNAL(valueChanged(int),slider , SLOT(setValue(int));
layout -> addWidget(spinner);
layout -> addWidget(slider);
spinner->setValue(10);
mainWindow -> setLayout(layout);
mainWindow -> show();
return app.exec();
}
謝謝,它運作良好 –