Dialog.cpp
Qt Code:
  1. #include <QtGui>
  2.  
  3. #include "Dialog.h"
  4. #include "ConvertDialog.h"
  5.  
  6.  
  7.  
  8. Dialog::Dialog(QWidget *parent)
  9. : QDialog(parent)
  10. {
  11. ui.setupUi(this);
  12.  
  13. connect(pushButton, SIGNAL(clicked()), this, SLOT(convertDialog::settingUp()));
  14.  
  15. }
  16.  
  17.  
  18. convertDialog(QWidget *parent)
  19. : QDialog(parent)
  20. {
  21. ui.setupUi(this);
  22.  
  23. }
  24.  
  25. bool convertDialog::settingUp()
  26. {
  27. if (beaufortBox->isChecked() && beaufortBox_2->isChecked())
  28. {
  29. int ret = QMessageBox::information(this, tr("Speed Units Converter"),
  30. tr("You can't convert value to the same unit"),
  31. QMessageBox::Ok | QMessageBox::Default);
  32. if (ret == QMessageBox::Ok)
  33. {
  34. return false;
  35. }
  36.  
  37. }
  38.  
  39. if (knotBox->isChecked() && knotBox_2->isChecked())
  40. {
  41. int ret = QMessageBox::information(this, tr("Speed Units Converter"),
  42. tr("You can't convert value to the same unit"),
  43. QMessageBox::Ok | QMessageBox::Default);
  44. if (ret == QMessageBox::Ok)
  45. {
  46. return false;
  47. }
  48.  
  49. }
  50.  
  51. if (mpsBox->isChecked() && mpsBox_2->isChecked())
  52. {
  53. int ret = QMessageBox::information(this, tr("Speed Units Converter"),
  54. tr("You can't convert value to the same unit"),
  55. QMessageBox::Ok | QMessageBox::Default);
  56. if (ret == QMessageBox::Ok)
  57. {
  58. return false;
  59. }
  60.  
  61. }
  62.  
  63. if (kphBox->isChecked() && kphBox_2->isChecked())
  64. {
  65. int ret = QMessageBox::information(this, tr("Speed Units Converter"),
  66. tr("You can't convert value to the same unit"),
  67. QMessageBox::Ok | QMessageBox::Default);
  68. if (ret == QMessageBox::Ok)
  69. {
  70. return false;
  71. }
  72.  
  73. }
  74.  
  75. if (mphBox->isChecked() && mphBox_2->isChecked())
  76. {
  77. int ret = QMessageBox::information(this, tr("Speed Units Converter"),
  78. tr("You can't convert value to the same unit"),
  79. QMessageBox::Ok | QMessageBox::Default);
  80. if (ret == QMessageBox::Ok)
  81. {
  82. return false;
  83. }
  84.  
  85.  
  86.  
  87. }
  88.  
  89.  
  90. if (beaufortBox->isChecked() && knotBox_2->isChecked())
  91. {
  92. convertDialog->setWindowTitle("Converting value from Beaufort to Knot");
  93. toLabel->setText("Knot(s)");
  94. Dialog::displayConvertDialog();
  95. }
  96.  
  97. if (beaufortBox->isChecked() && mpsBox_2->isChecked())
  98. {
  99. convertDialog->setWindowTitle("Converting value from Beaufort to Mps");
  100.  
  101. Dialog::displayConvertDialog();
  102. }
  103.  
  104. /...and many the same looking
  105. }
  106.  
  107. if (mphBox->isChecked() && kphBox_2->isChecked())
  108. {
  109. convertDialog->setWindowTitle("Converting value from Kph to Kph");
  110. fromLabel->setText("Mile(s) per hour it's");
  111. toLabel->setText("Kilometer(s) per hour");
  112. Dialog::displayConvertDialog();
  113. }
  114.  
  115.  
  116.  
  117. }
  118.  
  119. void Dialog::displayConvertDialog()
  120. {
  121. convertDialog dlg( this );
  122.  
  123. dlg.exec();
  124. }
To copy to clipboard, switch view to plain text mode 

and also ui_Dialog.h, ui_ConvertDialog.h and main.cpp which contents are obvious. Here are those problems:
Dialog.cpp:18:error: expected ) before * token
Dialog.cpp:18:error: expected , or ; before * token
In bool convertDialog.h:
beaufortBox undeclared (and the same with others e.g. knotBox)
Dialog.cpp:99:error: expected primary expression before -> token (im reporting about it only once, I've got much errors like this)
Dialog.cpp:94:error cannot call member function void Dialog::displayConvertDialog() without object

When I try to solve the undeclared e.g. knotBox by calling Dialog::knotBox I reach error that undefined reference to Ui:ialog or something like this because I didn't call the same to ui part of this class. How to solve all this problems? Regards
p.s. I had to split the text between 2 posts