So, i'm very newbie. I've started with The Book of Qt4 but i stucked. Chapter 3, ByteConverter via QDesigner. After couple of days i managed this example to start the window and validate data in the fields but i still can't force it to convert them because...

Object::connect: No such slot QDialog::decChanged(QString)
Object::connect: (sender name: 'decEdit')
Object::connect: (receiver name: 'Dialog')
Object::connect: No such slot QDialog::hexChanged(QString)
Object::connect: (sender name: 'hexEdit')
Object::connect: (receiver name: 'Dialog')
Object::connect: No such slot QDialog::binChanged(QString)
Object::connect: (sender name: 'binEdit')
Object::connect: (receiver name: 'Dialog')
And here are my files:

dialog.h:
Qt Code:
  1. #ifndef DIALOG_H
  2. #define DIALOG_H
  3.  
  4. #include <QDialog>
  5. #include "ui_byteconverterdialog.h"
  6.  
  7. namespace Ui {
  8. class Dialog;
  9. }
  10.  
  11. class Dialog : public QDialog
  12. {
  13. Q_OBJECT
  14.  
  15. public:
  16. explicit Dialog(QWidget *parent = 0);
  17. ~Dialog();
  18.  
  19. private:
  20. Ui::Dialog *ui;
  21.  
  22.  
  23. private slots:
  24. // void decChanged (const QString&);
  25. // void hexChanged (const QString&);
  26. // void binChanged (const QString&);
  27. };
  28.  
  29. #endif // DIALOG_H
To copy to clipboard, switch view to plain text mode 

ui_byteconverterdialog.h:
Qt Code:
  1. /********************************************************************************
  2. ** Form generated from reading UI file 'byteconverterdialog.ui'
  3. **
  4. ** Created: Thu May 10 20:34:47 2012
  5. ** by: Qt User Interface Compiler version 4.8.1
  6. **
  7. ** WARNING! All changes made in this file will be lost when recompiling UI file!
  8. ********************************************************************************/
  9.  
  10. #ifndef UI_BYTECONVERTERDIALOG_H
  11. #define UI_BYTECONVERTERDIALOG_H
  12.  
  13. #include <QtCore/QVariant>
  14. #include <QtGui/QAction>
  15. #include <QtGui/QApplication>
  16. #include <QtGui/QButtonGroup>
  17. #include <QtGui/QDialog>
  18. #include <QtGui/QDialogButtonBox>
  19. #include <QtGui/QGridLayout>
  20. #include <QtGui/QHBoxLayout>
  21. #include <QtGui/QHeaderView>
  22. #include <QtGui/QLabel>
  23. #include <QtGui/QLineEdit>
  24. #include <QtGui/QSpacerItem>
  25. #include <QtGui/QVBoxLayout>
  26. #include <QtGui/QWidget>
  27.  
  28. QT_BEGIN_NAMESPACE
  29.  
  30. class Ui_Dialog
  31. {
  32. public:
  33. QWidget *layoutWidget;
  34. QVBoxLayout *verticalLayout_2;
  35. QGridLayout *gridLayout;
  36. QLabel *label;
  37. QVBoxLayout *verticalLayout;
  38. QLineEdit *decEdit;
  39. QLineEdit *hexEdit;
  40. QLineEdit *binEdit;
  41. QLabel *label_2;
  42. QLabel *label_3;
  43. QSpacerItem *verticalSpacer;
  44. QHBoxLayout *horizontalLayout;
  45. QSpacerItem *horizontalSpacer;
  46. QDialogButtonBox *buttonBox;
  47.  
  48. void setupUi(QDialog *Dialog)
  49. {
  50. if (Dialog->objectName().isEmpty())
  51. Dialog->setObjectName(QString::fromUtf8("Dialog"));
  52. Dialog->resize(331, 261);
  53. layoutWidget = new QWidget(Dialog);
  54. layoutWidget->setObjectName(QString::fromUtf8("layoutWidget"));
  55. layoutWidget->setGeometry(QRect(10, 10, 311, 241));
  56. verticalLayout_2 = new QVBoxLayout(layoutWidget);
  57. verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2"));
  58. verticalLayout_2->setContentsMargins(0, 0, 0, 0);
  59. gridLayout = new QGridLayout();
  60. gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
  61. label = new QLabel(layoutWidget);
  62. label->setObjectName(QString::fromUtf8("label"));
  63.  
  64. gridLayout->addWidget(label, 0, 0, 1, 1);
  65.  
  66. verticalLayout = new QVBoxLayout();
  67. verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
  68. decEdit = new QLineEdit(layoutWidget);
  69. decEdit->setObjectName(QString::fromUtf8("decEdit"));
  70.  
  71. verticalLayout->addWidget(decEdit);
  72.  
  73. hexEdit = new QLineEdit(layoutWidget);
  74. hexEdit->setObjectName(QString::fromUtf8("hexEdit"));
  75.  
  76. verticalLayout->addWidget(hexEdit);
  77.  
  78. binEdit = new QLineEdit(layoutWidget);
  79. binEdit->setObjectName(QString::fromUtf8("binEdit"));
  80.  
  81. verticalLayout->addWidget(binEdit);
  82.  
  83.  
  84. gridLayout->addLayout(verticalLayout, 0, 1, 3, 1);
  85.  
  86. label_2 = new QLabel(layoutWidget);
  87. label_2->setObjectName(QString::fromUtf8("label_2"));
  88.  
  89. gridLayout->addWidget(label_2, 1, 0, 1, 1);
  90.  
  91. label_3 = new QLabel(layoutWidget);
  92. label_3->setObjectName(QString::fromUtf8("label_3"));
  93.  
  94. gridLayout->addWidget(label_3, 2, 0, 1, 1);
  95.  
  96.  
  97. verticalLayout_2->addLayout(gridLayout);
  98.  
  99. verticalSpacer = new QSpacerItem(20, 98, QSizePolicy::Minimum, QSizePolicy::Expanding);
  100.  
  101. verticalLayout_2->addItem(verticalSpacer);
  102.  
  103. horizontalLayout = new QHBoxLayout();
  104. horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
  105. horizontalSpacer = new QSpacerItem(248, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
  106.  
  107. horizontalLayout->addItem(horizontalSpacer);
  108.  
  109. buttonBox = new QDialogButtonBox(layoutWidget);
  110. buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
  111. buttonBox->setOrientation(Qt::Horizontal);
  112. buttonBox->setStandardButtons(QDialogButtonBox::Close);
  113. buttonBox->setCenterButtons(false);
  114.  
  115. horizontalLayout->addWidget(buttonBox);
  116.  
  117.  
  118. verticalLayout_2->addLayout(horizontalLayout);
  119.  
  120. #ifndef QT_NO_SHORTCUT
  121. label->setBuddy(decEdit);
  122. label_2->setBuddy(hexEdit);
  123. label_3->setBuddy(binEdit);
  124. #endif // QT_NO_SHORTCUT
  125. QWidget::setTabOrder(decEdit, hexEdit);
  126. QWidget::setTabOrder(hexEdit, binEdit);
  127.  
  128. retranslateUi(Dialog);
  129. QObject::connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), Dialog, SLOT(accept()));
  130.  
  131.  
  132. QIntValidator* decValidator = new QIntValidator(0, 255, decEdit);
  133. decEdit -> setValidator(decValidator);
  134.  
  135. QRegExpValidator* hexValidator = new QRegExpValidator(QRegExp ("[0-9A-Fa-f]{1,2}"), hexEdit);
  136. hexEdit -> setValidator(hexValidator);
  137.  
  138. QRegExpValidator* binValidator = new QRegExpValidator(QRegExp("[01]{1,8}"), binEdit);
  139. binEdit -> setValidator(binValidator);
  140.  
  141.  
  142. QObject::connect(decEdit, SIGNAL(textEdited(QString)), Dialog, SLOT(decChanged(QString)));
  143. QObject::connect(hexEdit, SIGNAL(textChanged(QString)), Dialog, SLOT(hexChanged(QString)));
  144. QObject::connect(binEdit, SIGNAL(textChanged(QString)), Dialog, SLOT(binChanged(QString)));
  145.  
  146. QMetaObject::connectSlotsByName(Dialog);
  147. } // setupUi
  148.  
  149. void retranslateUi(QDialog *Dialog)
  150. {
  151. Dialog->setWindowTitle(QApplication::translate("Dialog", "Byte Converter", 0, QApplication::UnicodeUTF8));
  152. Dialog->setProperty("on_DecEdit_Changed", QVariant(QApplication::translate("Dialog", "0", 0, QApplication::UnicodeUTF8)));
  153. label->setText(QApplication::translate("Dialog", "Dec", 0, QApplication::UnicodeUTF8));
  154. binEdit->setProperty("binProbe", QVariant(QApplication::translate("Dialog", "asfad", 0, QApplication::UnicodeUTF8)));
  155. label_2->setText(QApplication::translate("Dialog", "Hex", 0, QApplication::UnicodeUTF8));
  156. label_3->setText(QApplication::translate("Dialog", "Bin", 0, QApplication::UnicodeUTF8));
  157. } // retranslateUi
  158.  
  159. private slots:
  160. // void decChanged (const QString&);
  161. // void hexChanged (const QString&);
  162. // void binChanged (const QString&);
  163.  
  164. void decChanged (const QString &newValue)
  165. {
  166. bool ok;
  167. int num = newValue.toInt(&ok);
  168. if (ok) {
  169. hexEdit->setText(QString::number(num, 16));
  170. binEdit->setText(QString::number(num, 2));
  171. } else {
  172. hexEdit->setText("0");
  173. binEdit->setText("0");
  174. }
  175. }
  176.  
  177. void hexChanged (const QString &newValue)
  178. {
  179. bool ok;
  180. int num = newValue.toInt(&ok, 16);
  181. if (ok) {
  182. decEdit->setText(QString::number(num, 10));
  183. binEdit->setText(QString::number(num, 2));
  184. } else {
  185. decEdit->setText("");
  186. binEdit->setText("");
  187. }
  188. }
  189.  
  190. void binChanged (const QString &newValue)
  191. {
  192. bool ok;
  193. int num = newValue.toInt(&ok, 2);
  194. if (ok) {
  195. decEdit->setText(QString::number(num, 10));
  196. hexEdit->setText(QString::number(num, 16));
  197. } else {
  198. decEdit->setText("");
  199. hexEdit->setText("");
  200. }
  201. }
  202.  
  203.  
  204. /*void on_DecEdit_Changed ( const QString& newValue )
  205.   {
  206.   bool ok;
  207.   int num = newValue.toInt ( &ok );
  208.   if ( ok ) {
  209.   QLineEdit hexEdit ( QString::number ( num, 16 ) );
  210.   QLineEdit binChanged ( QString::number ( num, 2 ) );
  211.   } else {
  212.   QLineEdit hexChanged ( "" );
  213.   QLineEdit binChanged ( "" );
  214.   }
  215.   }*/
  216. };
  217.  
  218. namespace Ui {
  219. class Dialog: public Ui_Dialog {};
  220. } // namespace Ui
  221.  
  222. QT_END_NAMESPACE
  223.  
  224. #endif // UI_BYTECONVERTERDIALOG_H
To copy to clipboard, switch view to plain text mode 

dialog.cpp:
Qt Code:
  1. #include "dialog.h"
  2. #include "ui_byteconverterdialog.h"
  3.  
  4. Dialog::Dialog(QWidget *parent) :
  5. QDialog(parent),
  6. ui(new Ui::Dialog)
  7. {
  8. ui->setupUi(this);
  9. }
  10.  
  11. Dialog::~Dialog()
  12. {
  13. delete ui;
  14. }
To copy to clipboard, switch view to plain text mode 

main.cpp:
Qt Code:
  1. #include <QtGui/QApplication>
  2. #include "dialog.h"
  3. #include "ui_byteconverterdialog.h"
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7. QApplication a(argc, argv);
  8. QDialog dlg;
  9. Ui_Dialog ui;
  10. ui.setupUi(&dlg);
  11. dlg.setAttribute(Qt::WA_QuitOnClose);
  12. dlg.show();
  13.  
  14. return a.exec();
  15. }
To copy to clipboard, switch view to plain text mode 

Please help.