Automatically pull dependencies from QtDesigner plugins - qt

I have created a widget, MyWidget, and a QtDesigner plugin for MyWidget. Now I want to use MyWidget in bigger project, MyProject. I created a ui file for MyProject with QtDesigner and add a MyWidget in the designer. Now when I try to compile MyProject, I get "error: can't find MyWidget.h". Is there any way to automatically pull in dependencies from qtdesigner plugins? Or would I have to manually copy MyWidget.h/cpp into the MyProject directory?

Related

Integrating ros to an existing qt application

I have a QML, OpenCV application on qt5 which uses qmake and has a .pro file. I want to add publishers/subscribers to my qt project to publish video stream and instructions etc. I tried to use catkin_create_qt_pkg command to create a template and transfer my project to the template but there were numerous problems which made me question my approach. The ros-qt template uses Cmakelist and .ui instead of qml. So, I will need to change some things to integrate them.
First, is it possible to use ros with qmake and .pro instead of cmake. It would be easier to add just ros publishers and listeners to my existing application than changing the entire QML application. If not, how do I convert qmake and .pro to cmake and Cmakelist.txt (assuming that I can use QML with ros). Also, although it doesn't sound well, is it possible to use .pro for qt and Cmakelist.txt for ros in the same package?
Second, is it safe to use qt5 and qml with ros? The ros_qt app template uses qt4, not qt5. Here is the app template.

Install Custom Widget on QtCreator

I create a custom widget project with a qled. Now, i want to use it on my project but i can't find the correct way to install this custom widget in the qtcreator. Can you help me?

Qt QML/Quick component missing in Qt Designer

I have created some Quick components, each in its individual .qml file and defined by a root Item object.
I would like to interact with those items through the Qt Designer in Qt Creator, in order to assemble my screens more easily.
However it only shows the .qml files from a folder that I created called qml/. It does not index sub directories such as qml/misc/, etc.
Already tried
Updated the environment variable QML_IMPORT_PATH and QML2_IMPORT_PATH in my .pro
Closed my project between QMake calls and reloaded the Designer
It only works if I place every .qml file inside the qml/ folder

QtCreator Build doesn't update UI changes in design form

My Qt project uses shadow build.
When I change in MainWindow form ( .ui file), I build the project but my program doesn't update GUI.
If I rebuild all, GUI will be updated. But rebuild is very very slow.
I try creating a new project (an empty QMainWindow with some labels), I modify some texts. I build and GUI is updated.
How can I use shadow build correctly, without a rebuild of all my project?
The same issue occurs if the *.ui file name is changed.
For example, Changing yourUi.ui to myUi.ui.
If that is the scenario, then the ui_*.h should also be changed, that is, yourUi.ui to ui_myUi.h.
close Qt creator, go to your project directory and delete the .pro.user file, open the project again and this time Qt creator will ask you to configure your project by choosing the kit you use to build your project. Select the appropriate kit and press the "configure project" button. Apply your shadow build. I hope it will work.
Have you tried to just run qmake (Build -> Run qmake) ?
Edit
As suggested by a comment, I copied the comment to preserve it.
It seems that QtCreator correctly rebuild the .h file of the ui in the shadow build directory, and then include the ones in the source directory, which is not regenerated. I don't know if this is a bug or an intended behaviour, but a quick workaround can be to build the project in the shadow build directory, copy the generated .h files back in the source directory and rebuild again. This work with my simple project, don't know if can be workable also for bigger and more complex project. Or do not use shadow builds

Widget accessibility in all applications

How do I copy a widget to a place where it will be available for all projects in an installation?
You can make a widget namespace available to all applications by copying it to <aviarc-data>/widgets, and then restarting Aviarc. (This is also the folder where the default widget namespaces com.aviarc.toronto.widget.core* are located.)
If your widget isn't namespaced, copy it to something like <aviarc-data>/widgets/awesome-widget-namespace/1.0.0/widgets/<your-widget>.

Resources