Qt Creator and adding plugins - kindly help
-
Hi,
I am in the process of adding a new plug-in to Qt Creator.
I followed the procedure mentioned in the linkhttp://doc.qt.digia.com/qtcreator-extending/first-plugin.html
before that i have created a build directory for Qt Creator by following another link
http://doc.qt.digia.com/qtcreator-extending/getting-and-building.html
i used the following command<QtInstall>/bin/qmake -r QT_PRIVATE_HEADERS=<QtSources>/include <QtCreatorSources>
by appropriately replacing QtInsatll ,QtSources and QtCreatorSources and could succeed with out any errors.
and i am using Qt4.8.0
I also created a project from
File ->
New File or Project ->
Libraries ->
Qt Creator PluginThe files are generated upon selection finish from project dialouge and are same as what they mentioned in site.
Now comes the problem , when i say Build i am getting the error saying
Unable to find file for inclusion qtcreatorplugin.pri, and
<projectname>_dependencies.pri
qtcreatorplugin.pri: You must provide a targetwhen i double click on error message, it is going to this place in qtcreatorplugin.pri
include($$replace(PRO_FILE_PWD, ([^/]+$), \1/\1_dependencies.pri))
TARGET = $$QTC_PLUGIN_NAMEi verified the generated .pro files with the content provided in the ..first-plugin.html
and it is same.kindly request you to let me know what am i missing.
i think we cannot attach zip or png here , else i would have a added for reference.Thanks in advance.
-
I heard there is a plug-in for eclipse IDE for running android mobile applications.
i want to do the same with Qt Creator, does it allow us to do the same.
i read that Qt creator allow us to develop plug-in's( i am having hard time doing that) , but does that give an interface where we write some code to run applications contained in plug-in.
if needed i am going to elaborate the requirement..
please kindly reply.. -
You might want to have a look "onto the wiki":http://qt-project.org/wiki/Qt5ForAndroidBuilding However, there are more articles on Android using Qt in the wiki.
-
I don't want to do any thing on Android.
I just want to know , in Qt creator can i add my own plug-in?
that plug-in is going to contain some applications, and then i want to write some code to run the applications present in the plug-in. -
Actually QtCreator plugins are modules. In other words, there are no stable API and ABI, any method can be renamed or it's behaviour can be changed in future version. So, you will have to update plugin for each new version (~once per 4 months) or add it to upstream.
In the other hand, methods of any exported class are API, and you can send patches to codereview in order to extend plugins API.
About your compile error: are you using latest sources from master? If you are, I know where is problem. Most of QtCreator plugins depend on other plugins: ProjectExplorer depends on Core, CppEditor depends on ProjectExplorer and CppTools, etc. A few weeks ago Oswald Buddenhagen commited patch that changed a way to specify plugin dependencies. Now if you have plugin PluginName (and project file pluginname.pro), you should create pluginname_dependencies.pri similar to this:
@
QTC_PLUGIN_NAME = ClangCodeModel
QTC_LIB_DEPENDS +=
utils
QTC_PLUGIN_DEPENDS +=
coreplugin
cpptools
texteditor
@ -
bq. I heard there is a plug-in for eclipse IDE for running android mobile applications.
i want to do the same with Qt Creator, does it allow us to do the same.You can develop for android phones using Qt Creator, yes.
bq. i read that Qt creator allow us to develop plug-in’s( i am having hard time doing that) ,
Yes, you can develop plugins for Qt Creator. In fact Qt Creator is basically a plugin loader only that comes bundled with a list of plugins that implement almost all the functionality you see.
bq. but does that give an interface where we write some code to run applications contained in plug-in.
Applications contained in a plugin? I don't understand what you are going at here, sorry.
bq. if needed i am going to elaborate the requirement.. please kindly reply..
That might help, yes:)
-
[quote author="sergey-shambir" date="1366298783"]Actually QtCreator plugins are modules. In other words, there are no stable API and ABI, any method can be renamed or it's behaviour can be changed in future version. So, you will have to update plugin for each new version (~once per 4 months) or add it to upstream.
In the other hand, methods of any exported class are API, and you can send patches to codereview in order to extend plugins API.
About your compile error: are you using latest sources from master? If you are, I know where is problem. Most of QtCreator plugins depend on other plugins: ProjectExplorer depends on Core, CppEditor depends on ProjectExplorer and CppTools, etc. A few weeks ago Oswald Buddenhagen commited patch that changed a way to specify plugin dependencies. Now if you have plugin PluginName (and project file pluginname.pro), you should create pluginname_dependencies.pri similar to this:
@
QTC_PLUGIN_NAME = ClangCodeModel
QTC_LIB_DEPENDS +=
utils
QTC_PLUGIN_DEPENDS +=
coreplugin
cpptools
texteditor
@
[/quote]this is the place where i downloaded the Qt Creator sources.
http://qt.gitorious.org/qt-creator/qt-creator/trees/master
i really dont know about the dependency files until today , and i read it as used to specify the sub folder in project.
but dont know how to create one.
do i need to add the above mentioned code to make it work.
-
You can create it manually: if you plugin and *.pro file named SomethingBeautiful, create file somethingbeautiful_dependencies.pri and add all this code (but of course, QTC_PLUGIN_NAME should be SomethingBeautiful). In this case, plugin will depend on Core (coreplugin), CppTools (cpptools) and TextEditor (texteditor).
Each plugin depends on others, and most important plugins are Core (core functions like MIME-type, session and UI management), ProjectExplorer (base for all project managers and build settings), CppTools (provides both interface and most part of reference implementation for C++ support in editor). Also you can look at Android and QtSupport.
-
[quote author="Tobias Hunger" date="1366299639"]
if needed i am going to elaborate the requirement.. please kindly reply..That might help, yes:)[/quote]
- this is not a mobile , but Desktop *
The plug-in i am going to add to Qt Creator will have some applications(games, facebook, media player , address book, etc..)
which are all controlled by some gui that is embedded as default main application.
now when i load my plugin which should just display the gui for controlling apps.
after that i will specify what ever app i want to run and it should run.
not exactly , but it is some thing like this..
@int main()
{
ControlWindow CW;
CW.show();
}
@default, which displays the Controlwindow.
@int main()
{
ControlWindow CW;
facebook Fb;
CW.show();
}
@should run facebook on the window
@int main()
{
ControlWindow CW;
Mediaplayer Mb;
CW.show();
}
@should run media player on the window
-
[quote author="sergey-shambir" date="1366488549"]You can create it manually: if you plugin and *.pro file named SomethingBeautiful, create file somethingbeautiful_dependencies.pri and add all this code (but of course, QTC_PLUGIN_NAME should be SomethingBeautiful). In this case, plugin will depend on Core (coreplugin), CppTools (cpptools) and TextEditor (texteditor).
Each plugin depends on others, and most important plugins are Core (core functions like MIME-type, session and UI management), ProjectExplorer (base for all project managers and build settings), CppTools (provides both interface and most part of reference implementation for C++ support in editor). Also you can look at Android and QtSupport.[/quote]
i have created _dependencies.pri file with the same name as .pro
now it is saying
Project LOAD(): Feature /home/Plugs/qt-creator-qt-creator/src/qtcreatorplugin.pri cannot be found.TARGET = appshub
TEMPLATE = libDEFINES += APPSHUB_LIBRARY
appshub files
SOURCES += appshubplugin.cpp
HEADERS += appshubplugin.h
appshub_global.h
appshubconstants.hQt Creator linking
set the QTC_SOURCE environment variable to override the setting here
QTCREATOR_SOURCES = $$(QTC_SOURCE)
isEmpty(QTCREATOR_SOURCES):QTCREATOR_SOURCES=/home/Plugs/qt-creator-qt-creatorset the QTC_BUILD environment variable to override the setting here
IDE_BUILD_TREE = $$(QTC_BUILD)
isEmpty(IDE_BUILD_TREE):IDE_BUILD_TREE=/home/Plugs/qt-creator-qt-creator/qtcreator-builduncomment to build plugin into user config directory
<localappdata>/plugins/<ideversion>
where <localappdata> is e.g.
"%LOCALAPPDATA%\QtProject\qtcreator" on Windows Vista and later
"$XDG_DATA_HOME/data/QtProject/qtcreator" or "~/.local/share/data/QtProject/qtcreator" on Linux
"~/Library/Application Support/QtProject/Qt Creator" on Mac
USE_USER_DESTDIR = yes
PROVIDER = MyCompany
include($$QTCREATOR_SOURCES/src/qtcreatorplugin.pri)
include($$QTCREATOR_SOURCES/src/plugins/coreplugin/coreplugin.pri)LIBS += -L$$IDE_PLUGIN_PATH/QtProject
OTHER_FILES +=
appshub_dependencies.pri -
Where are placed QtCreator sources exactly?
-
Thanks for staying with me..
The location of qtCreator sources is
/home/Plugs/qt-creator-qt-creator
and build is
/home/Plugs/qt-creator-qt-creator/qtcreator-buildwhich is inside qt-creator-qt-creator
i checked for qtcreatorplugin.pri file and it is present in the src folder.
for your reference :
i dint mention this before, i dint follow these steps@ cd <QtSources>
configure -developer-build
make@i directly followed steps
@cd <QtCreatorSources>/..
mkdir qtcreator-build
cd qtcreator-build
<QtInstall>/bin/qmake -r <QtCreatorSources>
make@mentioned here
http://doc.qt.digia.com/qtcreator-extending/getting-and-building.htmldoes it cause this problem .
-
Please check exact path with 'ls' utility: /home/Plugs/qt-creator-qt-creator/src/qtcreatorplugin.pri
-
yes, i checked it and i am 100% sure it is present in the location. but how come it is not able to be found.
this is the procedure i am following.
1.Download the qt creator sources from
http://qt.gitorious.org/qt-creator/qt-creator/trees/master- Extract the tar.zip you get folder
qt-creator-qt-creator
cd qt-creator-qt-creator
mkdir qtcreator-build
cd qtcreator-build
<QtInstall>/bin/qmake -r QT_PRIVATE_HEADERS=<QtSources>/include <QtCreatorSources>QtInstall = /usr/local/Trolltech/Qt-4.8.0
QtSources = Qt4.8 sources path
QtCreatorSources = /home/Plugs/qt-creator-qt-creator
substitue the above values respectively and press enter
after the step the qtcreator-build directory gets below
app libs Makefile plugins tools
while creating the project
i am creating my plugin project inside
/home/Plugs/qt-creator-qt-creator/src/plugin/and the source and build directories are specified as below.
Qt Creator sources: /home/Plugs/qt-creator-qt-creator
Qt Creator build: /home/Plugs/qt-creator-qt-creator/qtcreator-buildopen a text file save it with pluginname_dependencies.pri
and copy the conetents of pluginname.pro into it and add lines@ QTC_PLUGIN_NAME = pluginname
QTC_LIB_DEPENDS +=
utils
QTC_PLUGIN_DEPENDS +=
coreplugin
cpptools
texteditor@above all the contents in the _dependencies.pri and save it.
now run
/usr/local/Trolltech/Qt-4.8.0/bin/qmake
Project LOAD(): Feature /home/Plugs/qt-creator-qt-creator/src/qtcreatorplugin.pri cannot be found.
*Request : *
I am doing all this to achieve my ultimate goal as mentioned above( to run my own applications using the plug-in)Is that achievable?
- Extract the tar.zip you get folder
-
sergey-shambir kindly reply
i need to update the result to my superior. -
Are you talking about writing plugins that are meant to be used in Qt Creator or are you talking about using Qt Creator to write an other application that is using its own plugins?
-
Thanks for the reply..
I think the second one you mentioned suits my requirement.when we create a project in Qt, generally we are asked for QMainWindow,QWidget and QDialouge, and based on what we select basic appilcation is created with some .cpp and .h files. , if i run this application a defualt window is shown. we can build up our own application on this.
I want to develop the same(like QMainWindow or QWidget or QDialouge but with my own container ) using Qt Creator and also want to add that to Qt Creator, upon running my basic application i want to display a keypad and a display window.
display window is used to display my furthur applications(need to code for that), keypad is used to control that applications.an application can be a video player( i can do play , pause ect using keypad) or a game (i naviagate using arrow keys)
i hope it is clear now.
-
So you want "Dcqt's special project" show up in File->New Project?
Check this for information on how to add "project wizards": http://qt-project.org/doc/qtcreator-2.7/creator-project-wizards.html
If you want to do something more complex you can also do that, but that will require some C++ coding in Creator then.