title: c++ class forward declaration and invalid use of incomplete type
body: <p>When I run the code on QtCreator I got:</p>
  
  <pre><code>08:23:56: Running steps for project dialog...
  08:23:56: Configuration unchanged, skipping qmake step.
  08:23:56: Starting: "/usr/bin/make" -w
  make: Entering directory `/home/entel/program/c++/dialog-build-Desktop_Qt_5_0_1_GCC_32bit-Debug'
  g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/opt/Qt5.0.1/5.0.1/gcc/mkspecs/linux-g++ -I../dialog -I/opt/Qt5.0.1/5.0.1/gcc/include -I/opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets -I/opt/Qt5.0.1/5.0.1/gcc/include/QtGui -I/opt/Qt5.0.1/5.0.1/gcc/include/QtCore -I. -I. -I. -o dialog.o ../dialog/dialog.cpp
  ../dialog/dialog.cpp: In constructor 'FindDialog::FindDialog(QWidget*)':
  ../dialog/dialog.cpp:5:40: error: invalid use of incomplete type 'class QLabel'
  In file included from ../dialog/dialog.cpp:1:0:
  ../dialog/dialog.h:9:7: error: forward declaration of 'class QLabel'
  ../dialog/dialog.cpp:6:20: error: invalid use of incomplete type 'class QLineEdit'
  In file included from ../dialog/dialog.cpp:1:0:
  ../dialog/dialog.h:10:7: error: forward declaration of 'class QLineEdit'
  ../dialog/dialog.cpp:7:10: error: invalid use of incomplete type 'class QLabel'
  In file included from ../dialog/dialog.cpp:1:0:
  ../dialog/dialog.h:9:7: error: forward declaration of 'class QLabel'
  ../dialog/dialog.cpp:9:47: error: invalid use of incomplete type 'class QCheckBox'
  In file included from ../dialog/dialog.cpp:1:0:
  ../dialog/dialog.h:8:7: error: forward declaration of 'class QCheckBox'
  ../dialog/dialog.cpp:10:60: error: invalid use of incomplete type 'class QCheckBox'
  In file included from ../dialog/dialog.cpp:1:0:
  ../dialog/dialog.h:8:7: error: forward declaration of 'class QCheckBox'
  ../dialog/dialog.cpp:12:45: error: invalid use of incomplete type 'class QPushButton'
  In file included from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/QDialog:1:0,
                   from ../dialog/dialog.h:4,
                   from ../dialog/dialog.cpp:1:
  /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/qdialog.h:52:7: error: forward declaration of 'class QPushButton'
  ../dialog/dialog.cpp:13:15: error: invalid use of incomplete type 'class QPushButton'
  In file included from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/QDialog:1:0,
                   from ../dialog/dialog.h:4,
                   from ../dialog/dialog.cpp:1:
  /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/qdialog.h:52:7: error: forward declaration of 'class QPushButton'
  ../dialog/dialog.cpp:14:15: error: invalid use of incomplete type 'class QPushButton'
  In file included from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/QDialog:1:0,
                   from ../dialog/dialog.h:4,
                   from ../dialog/dialog.cpp:1:
  /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/qdialog.h:52:7: error: forward declaration of 'class QPushButton'
  ../dialog/dialog.cpp:16:46: error: invalid use of incomplete type 'class QPushButton'
  In file included from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/QDialog:1:0,
                   from ../dialog/dialog.h:4,
                   from ../dialog/dialog.cpp:1:
  /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/qdialog.h:52:7: error: forward declaration of 'class QPushButton'
  ../dialog/dialog.cpp:17:103: error: no matching function for call to 'FindDialog::connect(QLineEdit*&amp;, const char*, FindDialog* const, const char*)'
  ../dialog/dialog.cpp:17:103: note: candidates are:
  In file included from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/qwidget.h:46:0,
                   from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/qdialog.h:45,
                   from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/QDialog:1,
                   from ../dialog/dialog.h:4,
                   from ../dialog/dialog.cpp:1:
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:211:36: note: static QMetaObject::Connection QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:211:36: note:   no known conversion for argument 1 from 'QLineEdit*' to 'const QObject*'
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:214:36: note: static QMetaObject::Connection QObject::connect(const QObject*, const QMetaMethod&amp;, const QObject*, const QMetaMethod&amp;, Qt::ConnectionType)
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:214:36: note:   no known conversion for argument 1 from 'QLineEdit*' to 'const QObject*'
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:430:32: note: QMetaObject::Connection QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:430:32: note:   no known conversion for argument 1 from 'QLineEdit*' to 'const QObject*'
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:227:43: note: template&lt;class Func1, class Func2&gt; static QMetaObject::Connection QObject::connect(const typename QtPrivate::FunctionPointer&lt;Func1&gt;::Object*, Func1, const typename QtPrivate::FunctionPointer&lt;Func2&gt;::Object*, Func2, Qt::ConnectionType)
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:227:43: note:   template argument deduction/substitution failed:
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h: In substitution of 'template&lt;class Func1, class Func2&gt; static QMetaObject::Connection QObject::connect(const typename QtPrivate::FunctionPointer&lt;Func1&gt;::Object*, Func1, const typename QtPrivate::FunctionPointer&lt;Func2&gt;::Object*, Func2, Qt::ConnectionType) [with Func1 = const char*; Func2 = const char*]':
  ../dialog/dialog.cpp:17:103:   required from here
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:227:43: error: no type named 'Object' in 'struct QtPrivate::FunctionPointer&lt;const char*&gt;'
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:257:13: note: template&lt;class Func1, class Func2&gt; static typename QtPrivate::QEnableIf&lt;((int)(QtPrivate::FunctionPointer&lt;Func2&gt;::ArgumentCount) &gt;= 0), QMetaObject::Connection&gt;::Type QObject::connect(const typename QtPrivate::FunctionPointer&lt;Func1&gt;::Object*, Func1, Func2)
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:257:13: note:   template argument deduction/substitution failed:
  ../dialog/dialog.cpp:17:103: note:   candidate expects 3 arguments, 4 provided
  In file included from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/qwidget.h:46:0,
                   from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/qdialog.h:45,
                   from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/QDialog:1,
                   from ../dialog/dialog.h:4,
                   from ../dialog/dialog.cpp:1:
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:280:13: note: template&lt;class Func1, class Func2&gt; static typename QtPrivate::QEnableIf&lt;(QtPrivate::FunctionPointer&lt;Func2&gt;::ArgumentCount == (-1)), QMetaObject::Connection&gt;::Type QObject::connect(const typename QtPrivate::FunctionPointer&lt;Func1&gt;::Object*, Func1, Func2)
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:280:13: note:   template argument deduction/substitution failed:
  ../dialog/dialog.cpp:17:103: note:   candidate expects 3 arguments, 4 provided
  ../dialog/dialog.cpp:18:66: error: no matching function for call to 'FindDialog::connect(QPushButton*&amp;, const char*, FindDialog* const, const char*)'
  ../dialog/dialog.cpp:18:66: note: candidates are:
  In file included from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/qwidget.h:46:0,
                   from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/qdialog.h:45,
                   from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/QDialog:1,
                   from ../dialog/dialog.h:4,
                   from ../dialog/dialog.cpp:1:
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:211:36: note: static QMetaObject::Connection QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:211:36: note:   no known conversion for argument 1 from 'QPushButton*' to 'const QObject*'
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:214:36: note: static QMetaObject::Connection QObject::connect(const QObject*, const QMetaMethod&amp;, const QObject*, const QMetaMethod&amp;, Qt::ConnectionType)
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:214:36: note:   no known conversion for argument 1 from 'QPushButton*' to 'const QObject*'
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:430:32: note: QMetaObject::Connection QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:430:32: note:   no known conversion for argument 1 from 'QPushButton*' to 'const QObject*'
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:227:43: note: template&lt;class Func1, class Func2&gt; static QMetaObject::Connection QObject::connect(const typename QtPrivate::FunctionPointer&lt;Func1&gt;::Object*, Func1, const typename QtPrivate::FunctionPointer&lt;Func2&gt;::Object*, Func2, Qt::ConnectionType)
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:227:43: note:   template argument deduction/substitution failed:
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h: In substitution of 'template&lt;class Func1, class Func2&gt; static QMetaObject::Connection QObject::connect(const typename QtPrivate::FunctionPointer&lt;Func1&gt;::Object*, Func1, const typename QtPrivate::FunctionPointer&lt;Func2&gt;::Object*, Func2, Qt::ConnectionType) [with Func1 = const char*; Func2 = const char*]':
  ../dialog/dialog.cpp:18:66:   required from here
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:227:43: error: no type named 'Object' in 'struct QtPrivate::FunctionPointer&lt;const char*&gt;'
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:257:13: note: template&lt;class Func1, class Func2&gt; static typename QtPrivate::QEnableIf&lt;((int)(QtPrivate::FunctionPointer&lt;Func2&gt;::ArgumentCount) &gt;= 0), QMetaObject::Connection&gt;::Type QObject::connect(const typename QtPrivate::FunctionPointer&lt;Func1&gt;::Object*, Func1, Func2)
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:257:13: note:   template argument deduction/substitution failed:
  ../dialog/dialog.cpp:18:66: note:   candidate expects 3 arguments, 4 provided
  In file included from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/qwidget.h:46:0,
                   from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/qdialog.h:45,
                   from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/QDialog:1,
                   from ../dialog/dialog.h:4,
                   from ../dialog/dialog.cpp:1:
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:280:13: note: template&lt;class Func1, class Func2&gt; static typename QtPrivate::QEnableIf&lt;(QtPrivate::FunctionPointer&lt;Func2&gt;::ArgumentCount == (-1)), QMetaObject::Connection&gt;::Type QObject::connect(const typename QtPrivate::FunctionPointer&lt;Func1&gt;::Object*, Func1, Func2)
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:280:13: note:   template argument deduction/substitution failed:
  ../dialog/dialog.cpp:18:66: note:   candidate expects 3 arguments, 4 provided
  ../dialog/dialog.cpp:19:61: error: no matching function for call to 'FindDialog::connect(QPushButton*&amp;, const char*, FindDialog* const, const char*)'
  ../dialog/dialog.cpp:19:61: note: candidates are:
  In file included from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/qwidget.h:46:0,
                   from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/qdialog.h:45,
                   from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/QDialog:1,
                   from ../dialog/dialog.h:4,
                   from ../dialog/dialog.cpp:1:
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:211:36: note: static QMetaObject::Connection QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:211:36: note:   no known conversion for argument 1 from 'QPushButton*' to 'const QObject*'
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:214:36: note: static QMetaObject::Connection QObject::connect(const QObject*, const QMetaMethod&amp;, const QObject*, const QMetaMethod&amp;, Qt::ConnectionType)
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:214:36: note:   no known conversion for argument 1 from 'QPushButton*' to 'const QObject*'
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:430:32: note: QMetaObject::Connection QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:430:32: note:   no known conversion for argument 1 from 'QPushButton*' to 'const QObject*'
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:227:43: note: template&lt;class Func1, class Func2&gt; static QMetaObject::Connection QObject::connect(const typename QtPrivate::FunctionPointer&lt;Func1&gt;::Object*, Func1, const typename QtPrivate::FunctionPointer&lt;Func2&gt;::Object*, Func2, Qt::ConnectionType)
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:227:43: note:   template argument deduction/substitution failed:
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h: In substitution of 'template&lt;class Func1, class Func2&gt; static QMetaObject::Connection QObject::connect(const typename QtPrivate::FunctionPointer&lt;Func1&gt;::Object*, Func1, const typename QtPrivate::FunctionPointer&lt;Func2&gt;::Object*, Func2, Qt::ConnectionType) [with Func1 = const char*; Func2 = const char*]':
  ../dialog/dialog.cpp:19:61:   required from here
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:227:43: error: no type named 'Object' in 'struct QtPrivate::FunctionPointer&lt;const char*&gt;'
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:257:13: note: template&lt;class Func1, class Func2&gt; static typename QtPrivate::QEnableIf&lt;((int)(QtPrivate::FunctionPointer&lt;Func2&gt;::ArgumentCount) &gt;= 0), QMetaObject::Connection&gt;::Type QObject::connect(const typename QtPrivate::FunctionPointer&lt;Func1&gt;::Object*, Func1, Func2)
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:257:13: note:   template argument deduction/substitution failed:
  ../dialog/dialog.cpp:19:61: note:   candidate expects 3 arguments, 4 provided
  In file included from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/qwidget.h:46:0,
                   from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/qdialog.h:45,
                   from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/QDialog:1,
                   from ../dialog/dialog.h:4,
                   from ../dialog/dialog.cpp:1:
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:280:13: note: template&lt;class Func1, class Func2&gt; static typename QtPrivate::QEnableIf&lt;(QtPrivate::FunctionPointer&lt;Func2&gt;::ArgumentCount == (-1)), QMetaObject::Connection&gt;::Type QObject::connect(const typename QtPrivate::FunctionPointer&lt;Func1&gt;::Object*, Func1, Func2)
  /opt/Qt5.0.1/5.0.1/gcc/include/QtCore/qobject.h:280:13: note:   template argument deduction/substitution failed:
  ../dialog/dialog.cpp:19:61: note:   candidate expects 3 arguments, 4 provided
  ../dialog/dialog.cpp:21:5: error: 'QHBoxLayout' was not declared in this scope
  ../dialog/dialog.cpp:21:18: error: 'topLeftLayout' was not declared in this scope
  ../dialog/dialog.cpp:21:38: error: expected type-specifier before 'QHBoxLayout'
  ../dialog/dialog.cpp:21:38: error: expected ';' before 'QHBoxLayout'
  ../dialog/dialog.cpp:25:5: error: 'QVBoxLayout' was not declared in this scope
  ../dialog/dialog.cpp:25:18: error: 'leftLayout' was not declared in this scope
  ../dialog/dialog.cpp:25:35: error: expected type-specifier before 'QBoxLayout'
  ../dialog/dialog.cpp:25:35: error: expected ';' before 'QBoxLayout'
  ../dialog/dialog.cpp:30:5: error: 'QVBoxLayoout' was not declared in this scope
  ../dialog/dialog.cpp:30:19: error: 'rightLayout' was not declared in this scope
  ../dialog/dialog.cpp:30:37: error: expected type-specifier before 'QVBoxLayout'
  ../dialog/dialog.cpp:30:37: error: expected ';' before 'QVBoxLayout'
  ../dialog/dialog.cpp:35:5: error: 'QHBoxLayoout' was not declared in this scope
  ../dialog/dialog.cpp:35:19: error: 'mainLayout' was not declared in this scope
  ../dialog/dialog.cpp:35:36: error: expected type-specifier before 'QHBoxLayout'
  ../dialog/dialog.cpp:35:36: error: expected ';' before 'QHBoxLayout'
  ../dialog/dialog.cpp: In member function 'void FindDialog::findClicked()':
  ../dialog/dialog.cpp:46:28: error: invalid use of incomplete type 'class QLineEdit'
  In file included from ../dialog/dialog.cpp:1:0:
  ../dialog/dialog.h:10:7: error: forward declaration of 'class QLineEdit'
  ../dialog/dialog.cpp:47:42: error: invalid use of incomplete type 'class QCheckBox'
  In file included from ../dialog/dialog.cpp:1:0:
  ../dialog/dialog.h:8:7: error: forward declaration of 'class QCheckBox'
  ../dialog/dialog.cpp:49:25: error: invalid use of incomplete type 'class QCheckBox'
  In file included from ../dialog/dialog.cpp:1:0:
  ../dialog/dialog.h:8:7: error: forward declaration of 'class QCheckBox'
  ../dialog/dialog.cpp: In member function 'void FindDialog::enableFindButton(const QString&amp;)':
  ../dialog/dialog.cpp:56:15: error: invalid use of incomplete type 'class QPushButton'
  In file included from /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/QDialog:1:0,
                   from ../dialog/dialog.h:4,
                   from ../dialog/dialog.cpp:1:
  /opt/Qt5.0.1/5.0.1/gcc/include/QtWidgets/qdialog.h:52:7: error: forward declaration of 'class QPushButton'
  ../dialog/dialog.cpp:56:33: error: cannot convert 'QString::isEmpty' from type 'bool (QString::)()const' to type 'bool'
  ../dialog/dialog.cpp:56:33: error: in argument to unary !
  make: *** [dialog.o] Error 1
  make: Leaving directory `/home/entel/program/c++/dialog-build-Desktop_Qt_5_0_1_GCC_32bit-Debug'
  08:23:57: The process "/usr/bin/make" exited with code 2.
  Error while building/deploying project dialog (kit: Desktop Qt 5.0.1 GCC 32bit)
  When executing step 'Make'
  </code></pre>
  
  <p>some part of my code:
  dialog.h</p>
  
  <pre><code>#ifndef FINDDIALOG_H
  #define FINDDIALOG_H
  
  #include &lt;QDialog&gt;
  #include &lt;QtGui&gt;
  #include &lt;QWidget&gt;
  
  class QCheckBox;
  class QLabel;
  class QLineEdit;
  class QPushButton;
  
  class FindDialog : public QDialog
  {
      Q_OBJECT
  public:
      FindDialog(QWidget *parent = 0);
  signals:
      void findNext(const QString &amp;str,Qt::CaseSensitivity cs);
      void findPrevious(const QString &amp;str,Qt::CaseSensitivity cs);
  private slots:
      void findClicked();
      void enableFindButton(const QString &amp;text);
  private:
      QLabel *label;
      QLineEdit *lineEdit;
      QCheckBox *caseCheckBox;
      QCheckBox *backwardCheckBox;
      QPushButton *findButton;
      QPushButton *closeButton;
  };
  
  #endif
  </code></pre>
  
  <p>dialog.cpp</p>
  
  <pre><code>#include "dialog.h"
  
  FindDialog::FindDialog(QWidget *parent) : QDialog(parent)
  {
      label = new QLabel(tr("Find &amp;what"));
      lineEdit = new QLineEdit;
      label-&gt;setBuddy(lineEdit);
  
      caseCheckBox = QCheckBox(tr("Match &amp;case"));
      backwardCheckBox = new QCheckBox(tr("Search &amp;backward"));
  
      findButton = new QPushButton(tr("&amp;Find"));
      findButton-&gt;setDefault(true);
      findButton-&gt;setEnable(false);
  
      closeButton = new QPushButton(tr("close"));
      connect(lineEdit,SIGNAL(textChanged(const Qstring &amp;)),this,SLOT(enableFindButton(const QString &amp;)));
      connect(findButton,SIGNAL(clicked()),this,SLOT(findClicked()));
      connect(closeButton,SIGNAL(clicked()),this,SLOT(close()));
  
      QHBoxLayout *topLeftLayout = new QHBoxLayout;
      topLeftLayout-&gt;addWidget(label);
      topLeftLayout-&gt;addWidget(lineEdit);
  
      QVBoxLayout *leftLayout = new QBoxLayout;
      leftLayout-&gt;addLayout(topLeftLayout);
      leftLayout-&gt;addWidget(caseCheckBox);
      leftLayout-&gt;addWidget(backwardCheckBox);
  
      QVBoxLayoout *rightLayout = new QVBoxLayout;
      rightLayout-&gt;addWidget(findButton);
      rightLayout-&gt;addWidget(closeButton);
      rightLayout-&gt;addStretch();
  
      QHBoxLayoout *mainLayout = new QHBoxLayout;
      mainLayout-&gt;addLayout(leftLayout);
      mainLayout-&gt;addLayout(rightLayout);
      setLayout(mainLayout);
  
      setWindowTitle(tr("Find"));
      setFixedHeight(sizeHint().height());
  }
  
  void FindDialog::findClicked()
  {
      QString text = lineEdit-&gt;text();
      Qt::CaseSensitivity cs = caseCheckBox-&gt;isChecked() ? Qt::CaseSensitive
                                                         : Qt::CaseInsensitive;
      if (backwardCheckBox-&gt;isChecked())
          emit findPrevious(text,cs);
      else emit findNext(text,cs);
  }
  
  void FindDialog::enableFindButton(const QString &amp;text)
  {
      findButton-&gt;setEnable(!text.isEmpty);
  }
  </code></pre>
  
  <p>I don't know what to do.I search for the solution but I didn't find anything similar to my problem.Thanks for any help...</p>