Hi,
I change including <mywidget.h> from declaration to implementation (in qtDesigner) and now compile. But Why?
Thanks
Hi,
I change including <mywidget.h> from declaration to implementation (in qtDesigner) and now compile. But Why?
Thanks
Last edited by mickey; 28th February 2006 at 23:46.
Regards
And what is mywidget.h? Could we see its contents? Are you by any chance including mainwindow.h there?
Qt Code:
ifndef MYWIDGET_H #define MYWIDGET_H #include <qgl.h> #include <qpoint.h> #include <qtimer.h> #include "mainform.h" class MainForm; #define BUFSIZE 512 { Q_OBJECT public: ~MyWidget(); ......... };To copy to clipboard, switch view to plain text mode
Is it #include "mainform.h" the problems? I need take it here... But wich is different between include in implem and in declaration? I thought it was the same for success of compile...
Regards
Probably yes.Originally Posted by mickey
No you don't. Do you use methods defined there?I need take it here...
No. You should avoid including to much files in headers, because it slows down the compilation. But the reason of failure might be that qmake sees that it needs that included file in the current file, but that file is included in the other one, so it depends on it and thus it creates a cycle. Of course it might be something different, but you should try removing that include from the header file.But wich is different between include in implem and in declaration? I thought it was the same for success of compile...
yes I use members of mainform from here; But if I put it in implementation compile..Originally Posted by wysota
[QUOTE=wysota]
No. You should avoid including to much files in headers, because it slows down the compilation. [QUOTE]
including much headers where? from QTdesigner? in implementation? in declarations? Or at begin of file by hand?
thanks
Regards
In header files. Because each file which includes that file will also include all the files including it and each time cpp has to parse them. That's why using precompiled headers results in such a big speed gainOriginally Posted by mickey
Parsing header files takes much time.
Sorry but I have some problems with english also. Do you say me to put #incldue much more In implementation or implemention (from qtDesinger).
And is this an help for speed:
ThanksQt Code:
#ifndef MYWIDGET_H #define MYWIDGET_H .......To copy to clipboard, switch view to plain text mode
Regards
Bookmarks