Hello everybody.
When I have been studying this book : "Qt GUI Programming with Qt4, Second Edition"; saw an example which I implemented it on my Ubuntu, but it NOT compiled ...
And the given error when I try to make it, is :
finddialog.cpp:26:40: error: no matching function for call to ‘QVBoxLayout::addWidget(QHBoxLayout*&)’
finddialog.cpp:26:40: note: candidate is:
/usr/include/qt4/QtGui/qboxlayout.h:85:10: note: void QBoxLayout::addWidget(QWidget*, int, Qt::Alignment)
/usr/include/qt4/QtGui/qboxlayout.h:85:10: note: no known conversion for argument 1 from ‘QHBoxLayout*’ to ‘QWidget*’
Although I don't manipulation the codes!
I know the nature of the error, but I don't know how to solve it ...
The codes that have beed this error are :
QHBoxLayout *topLeftLayout = new QHBoxLayout;
topLeftLayout->addWidget(label);
topLeftLayout->addWidget(lineEdit);
QVBoxLayout *leftLayout = new QVBoxLayout;
leftLayout->addWidget(topLeftLayout);
what is the problem? and how to solve it?
Thanks everybody.
---
finddialog.h ->
http://ubuntuone.com/0burFhFtN2mJbJhowBM51b[
^]
finddialog.cpp ->
http://ubuntuone.com/2WhfmK2hLPb0HrQCH2EwXp[
^]
main.cpp ->
http://ubuntuone.com/5Q23kS6xHcNUlB3Z0zYsgn[
^]
terminal output ->
http://ubuntuone.com/6ve3wygjYu31rYWlLgO8KJ[
^]