Hi. I've got some annoying errors which appear in my Dialog.cpp file:
#include <QtGui>
#include "Dialog.h"
{
ui.setupUi(this);
fromLineEdit->hide();
fromLabel->hide();
whiteLabel->hide();
toLabel->hide();
convertButton->hide();
exitButton_2->hide();
connect(nextStepButton, SIGNAL(clicked()), this, SLOT(settingUp()));
}
bool Dialog::settingUp()
{
if (beaufortBox->isChecked() && beaufortBox_2->isChecked())
{
int ret
= QMessageBox::information(this, tr
("Speed Units Converter"),
tr("You can't convert value to the same unit"),
{
return false;
}
}
// And few other which look almost the same
if (beaufortBox->isChecked() && knotBox_2->isChecked())
{
Dialog->setWindowTitle("Converting value from Beaufort to Knot");
toLabel->setText("Knot(s)");
fromLineEdit->hide();
fromLabel->setVisible(bool);
whiteLabel->setVisible(bool);
toLabel->setVisible(bool);
convertButton->setVisible(bool);
exitButton_2->setVisible(bool);
}
if (beaufortBox->isChecked() && mpsBox_2->isChecked())
{
Dialog->setWindowTitle("Converting value from Beaufort to Mps");
fromLabel->setVisible(bool);
whiteLabel->setVisible(bool);
toLabel->setVisible(bool);
convertButton->setVisible(bool);
exitButton_2->setVisible(bool);
}
// And others which look almost the same
}
#include <QtGui>
#include "Dialog.h"
Dialog::Dialog(QWidget *parent)
: QDialog(parent)
{
ui.setupUi(this);
fromLineEdit->hide();
fromLabel->hide();
whiteLabel->hide();
toLabel->hide();
convertButton->hide();
exitButton_2->hide();
connect(nextStepButton, SIGNAL(clicked()), this, SLOT(settingUp()));
}
bool Dialog::settingUp()
{
if (beaufortBox->isChecked() && beaufortBox_2->isChecked())
{
int ret = QMessageBox::information(this, tr("Speed Units Converter"),
tr("You can't convert value to the same unit"),
QMessageBox::Ok | QMessageBox::Default);
if (ret == QMessageBox::Ok)
{
return false;
}
}
// And few other which look almost the same
if (beaufortBox->isChecked() && knotBox_2->isChecked())
{
Dialog->setWindowTitle("Converting value from Beaufort to Knot");
toLabel->setText("Knot(s)");
fromLineEdit->hide();
fromLabel->setVisible(bool);
whiteLabel->setVisible(bool);
toLabel->setVisible(bool);
convertButton->setVisible(bool);
exitButton_2->setVisible(bool);
}
if (beaufortBox->isChecked() && mpsBox_2->isChecked())
{
Dialog->setWindowTitle("Converting value from Beaufort to Mps");
fromLabel->setVisible(bool);
whiteLabel->setVisible(bool);
toLabel->setVisible(bool);
convertButton->setVisible(bool);
exitButton_2->setVisible(bool);
}
// And others which look almost the same
}
To copy to clipboard, switch view to plain text mode
Errors are the same for each if instruction (exeptions are first if's which return false):
In member function bool Dialog::settingUp()
expected primary expression before "bool"
expected primary expression before -> token
I've got much this kind of errors, only the line which the error appears its different. When I was trying to do setVisible() instead of setVisible(bool) I reached errors that candidates are setVisible(bool) and a few others about setVisible()
Bookmarks