Source files do not appear
-
wrote on 26 Nov 2010, 16:06 last edited by
I have 2 Qt installations both using the Qt 4.7 SDK precompiled binaries install. One works fine. On the other when I open a *.pro file in Qt Creator the source *.cpp & *.h files do not appear in the edit mode when the project opens. The projects can compile and run ok though. Any ideas?
-
wrote on 26 Nov 2010, 16:20 last edited by
What do you mean with "files do not appear in the edit mode when the project opens"? Do you select the file with Ctrl-K or using double click in the project explorer?
-
wrote on 26 Nov 2010, 16:31 last edited by
Using the working installation from the main Qt Creator menu I select.
File > Open File or Project>
Then from the OPen File dialog I selcect the *.pro file.
Thi simmediately brings up/ highlights the Edit mode and a project window with all the project files in it.if I do this in the other installation th eproject window doesn't open at all. If I want to edit the files I have to open the manually one by one from the main menu.
-
wrote on 26 Nov 2010, 16:44 last edited by
You can open the sidebar with the project view with Ctrl-0 (zero, not capital O). If needed you can select from the combobox the desired view (projects, open documents, etc).
See "Qt Development Tools":http://qt.nokia.com/products/developer-tools/ for some details.
-
wrote on 26 Nov 2010, 17:54 last edited by
The sidebar is visible and the Edit icon for the Edit mode is highlighted but there is no project view or functioning combobox. I will read your link but it does seem to be behaving very differently from the other installation of Qt Creator. I have already tried to reinstall the full SDK once as well.
-
wrote on 26 Nov 2010, 19:50 last edited by
What happens if you create new project in the broken QtCreator and add files to it?
-
wrote on 27 Nov 2010, 00:19 last edited by
On this "screenshot!http://qt.nokia.com/images/products/qtcreatorbreakdown.png(Qt Creator screenshot)! look at the arrow of the sidebar caption. There is a combo box left of the filter sign. In that combo box you can choose the project view.
-
wrote on 2 Dec 2010, 00:15 last edited by
If I create a new GUI application project the Sidebar does not appear only the Mode selector is visible with Edit highlighted and only "mainwindow.cpp" is visible. (thankyou for clearing up what the sidebar is I was wrong earlier)
I've noticed that this project won't build either on the broken Qt Creator. I get the following error:
redeclaration of C++ built-in type 'wchar_t' referencing my MS Visual Studio include path and stddef.h.
I am using MinGW gcc compiler for my LGPL Qt compilation and use MS Visual Studio 6.0 and 2005 for other projects. This setup is the same on both of my machines.
I'm currently looking for differences in the Environment variables on the 2 machines. There doesn't seem to be a difference.
Here are the relevant values on the broken installation machine:User variables
include
C:\Qt\2010.05\mingw\include;C:\Qt\2010.05\qt\include;C:\Program Files\Microsoft Visual Studio\VC98\atl\include;C:\Program Files\Microsoft Visual Studio\VC98\mfc\include;C:\Program Files\Microsoft Visual Studio\VC98\include;C:\nasm
lib
C:\Qt\2010.05\qt\lib;C:\Qt\2010.05\mingw\lib;C:\Program Files\Microsoft Visual Studio\VC98\mfc\lib;C:\Program Files\Microsoft Visual Studio\VC98\lib
path
C:\Qt\2010.05\mingw\bin;C:\Qt\2010.05\qt\bin;C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;C:\Sun\SDK\jdk\bin;C:\Program Files\Gemplus\GAC;C:\opt\gtk\bin;C:\nasm;C:\Perl\bin
MINGW
C:\Qt\2010.05\mingw
QMAKESPEC
win32-g++
QTDIR
C:\Qt\2010.05\qtSystem variables
include
C:\Qt\2010.05\mingw\include;C:\Qt\2010.05\qt\include;C:\Program Files\Microsoft Visual Studio\VC98\atl\include;C:\Program Files\Microsoft Visual Studio\VC98\mfc\include;C:\Program Files\Microsoft Visual Studio\VC98\include
lib
C:\Qt\2010.05\qt\lib;C:\Qt\2010.05\mingw\lib;C:\Program Files\Microsoft Visual Studio\VC98\mfc\lib;C:\Program Files\Microsoft Visual Studio\VC98\lib
path
C:\Qt\2010.05\mingw\bin;C:\Qt\2010.05\qt\bin;C:\Perl\site\bin;C:\Perl\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\wbem;C:\Program Files\PC Connectivity Solution;C:\Program Files\Microsoft DirectX SDK (April 2006)\Utilities\Bin\x86;C:\Program Files\Windows Resource Kits\Tools;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\Common Files\Teleca Shared;C:\PROGRA~1\Gemplus\GAC;C:\Sun\SDK\jdk\bin;C:\Program Files\Gemplus\GAC;C:\nasm
MINGW
C:\Qt\2010.05\mingw
QMAKESPEC
win32-g++
QTDIR
C:\Qt\2010.05\qtThanks for all of your efforts.
-
wrote on 2 Dec 2010, 00:24 last edited by
I suspect mixing include paths of Visual Studio and MinGW to be the cause of the errors. I seriously doubt that they are compatible. I never used MinGW thoug, so maybe some of the geeks on that can jump in.
AFAIR, the sidebar ist hidden by default. Press Ctrl-0 or click on the little icon directly left to the locator to open it.
-
wrote on 2 Dec 2010, 00:53 last edited by
It seems to work if I clear the build directory paths with set lib= and set include= within the Qt command prompt. Has anyone got an automated way of achieving this. Thanks for the help with Qt Creators IDE though that all seems fine now.
-
wrote on 2 Dec 2010, 01:07 last edited by
No the problem keeps recurring.
I can build everything within Qt command prompt using:
qmake -project
qmake
make(make is a batch file to call the MinGW gcc compiler). If I do a build in Qt command prompt then I can edit the source within Qt Creator and build without any problems. If I don't do the Qt command prompt build first then Qt Creator hits the MSVS conflict problem in the build. Any ideas?
-
wrote on 2 Dec 2010, 18:24 last edited by
In Qt Creator's project view on tab build settings on the very bottom you can tweak the environment. There is a checkbox "delete system environment" (or something like that, I have a German version). You can try to check this and get rid of the "polluted" env vars.
-
wrote on 3 Dec 2010, 10:32 last edited by
Thankyou that seems to do the trick. Checking the clean environment box in Projects mode under Build Settings and then setting all of the environment variables solves the issue. If yoiu arte using one of the example applications you have to create a fresh project file though to avoid using the System Environment variables.. So for example with examples/widgets/scribble below the existing project file was:
@HEADERS = mainwindow.h
scribblearea.h
SOURCES = main.cpp
mainwindow.cpp
scribblearea.cppinstall
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/scribble
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS scribble.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/scribble
INSTALLS += target sourcessymbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)@
After running Qmake -project and creating a new project file, below evrerything is fine.
@######################################################################
Automatically generated by qmake (2.01a) Fri 3. Dec 10:02:34 2010
######################################################################
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .Input
HEADERS += mainwindow.h scribblearea.h
SOURCES += main.cpp mainwindow.cpp scribblearea.cpp@ -
wrote on 3 Dec 2010, 10:54 last edited by
One more question though. Is there a quicker way of doing this rather than setting up all of the environment variables manually for each project?
I would use MSVS C++ compilers but with the LGPL there is no support for using MSVS C++. Is this correct? This problem must be common for developers who want to use the LGPL or developers who have a commercial license and have clients who want them to develop under the LGPL for their own future maintenance requirements.
-
wrote on 3 Dec 2010, 13:18 last edited by
As far as I know there is no limitation on compiling the LGPL version with Visual Studio. It seems there are just no prebuilt binaries available, so you will have to compile Qt yourself (that's not difficult, just get you some coffee or, better, have lunch in the meantime :-) )
You will find some instructions on how to compile Qt on Windows here: http://doc.qt.nokia.com/4.7/install-win.html
-
wrote on 3 Dec 2010, 15:39 last edited by
It was on that URL
http://doc.qt.nokia.com/4.7/install-win.html
where I was put off using the LGLP of Qt with Visual Studio.
bq. Open Source Versions of Qt is not officially supported for use with any version of Visual Studio. Integration with Visual Studio is available as part of the Qt Commercial Edition.
Do you advise using Visual Studio over Qt Creator? I have MSVS 6.0 and MSVS 2005.
Thanks again for your help.
-
wrote on 3 Dec 2010, 16:59 last edited by
It's not supported does not mean, it does not work :-)
As the commercial versions are supported by Nokia, I don't see any reasons not to go with MSVS. Although the Visual Studio add in is only available for the commercial users of Qt. Without that, developing Qt in MSVS is quite cumbersome.
I don't know if the open source version of Qt Creator does support MSVS. But as it calls command line tools only, I cannot see any reason why not. I'd give it a try.
-
wrote on 3 Dec 2010, 17:03 last edited by
Volker, quote from qt.nokia.com:
bq. Want to use Qt together with Visual Studio on Windows? Download the Visual-Studio add-in, which can be used for development together with all Qt licenses.
-
wrote on 3 Dec 2010, 17:12 last edited by
Citing http://doc.qt.nokia.com/4.7/install-win.html
bq. Open Source Versions of Qt is not officially supported for use with any version of Visual Studio. Integration with Visual Studio is available as part of the Qt Commercial Edition.
So the Qt docs are not up to date and consistent everywhere. Good to hear, that I'm wrong :-)
-
wrote on 3 Dec 2010, 17:13 last edited by
Volker, yes, I think that info at downloads page at qt.nokia.com is more up to date than docs.
10/23