How can I see custom components in QtDesigner? - qt

I am developing a Qt Quick 2 Application using QML to define my components.
I would like to create a folder in the project where to put common components (such as customized buttons or labels), and specifically I would like to see this components in the Qt Designer view, in order to be able to drag-drop those elements while designing new views.
I see that the Qt Designer view only shows to you the components located at the same path of the qml that you are currently developing, but I haven't found a way to display components located in other paths.
The project tree should be something like this:
RootFolder
CommonComponents
Views
where the qmls developed in the Views folder will use components defined in the CommonComponents folder.
Does anyone know how to configure the project or the QtDesigner in order to achieve this goal?
Thanks

Related

Create QML component library

I wasn't able to create and use a QML component library by following the fragmented parts of tutorials and Qt documentation, so I'm just gonna ask somebody to answer it all at once.
I want to create a single file (located in /usr/lib/project/components.rcc), that will include all components in ~/Project/src/components/ and their child components located in ~/Projects/src/components/insertparentcomponentname/. I want to be able to use those components in normal QML code.
The question is, how can I create this file and how can I import components in it to use in QML?
( Using Qt Quick 2.0 and C++ with CMake on Arch Linux )

Qt Virtual Keyboard Custom Style

I need to build a custom Style for a Qt VirtualKeyboard on a small screen to maximize its readability. I have built a custom layout into my project, and using the QT_VIRTUALKEYBOARD_LAYOUT_PATH it works great.
The problem I am having is that the documentation states that the custom style must be placed in the Qt Directory. I need this style to be portable, however, so storing this newly built style on my local machine, rather than in the project itself, will not be acceptable.
Is there any way to build a use a keyboard style within a project?
It doesn't have to be in the Qt directory, just in a directory that is under QtQuick/VirtualKeyboard/Styles/ and in the QML import path.
As an example, take a look at the auto test:
http://code.qt.io/cgit/qt/qtvirtualkeyboard.git/tree/tests/auto/styles/data
You can also put the style in a .qrc file under that folder structure:
http://code.qt.io/cgit/qt/qtvirtualkeyboard.git/tree/src/virtualkeyboard/virtualkeyboardsettings.cpp#n70
I've created a task to make this clearer: https://bugreports.qt.io/browse/QTBUG-66172

Use custom made widget in another project

I have come across this custom widget,
https://github.com/akontsevich/WidgetBox
however I am unable to work out how to use it in my current project.
I have tried including the files in my project, as well as including a .pri file in my project.pro but it won't.
How do you use custom widgets, (this one for example) in a project?
You've got two ways to work with that.
First look at the project file for the widget: WidgetBox pro.
Notice the lines:
TEMPLATE = lib
...
creator_target.output = WidgetBoxPlugin.dll
This means you can build a library from the project and use it inside yours (after including proper headers)
Another way would be to include all the sources from the WidgetBox project into yours and build them along with your source.
Which approach to use depends on your needs. If you don't plan to modify the widget building it once from the authors project should be enough for you.

Using mx components in an "actionscript project" in Flash Builder

In Flash builder, I want to create an "Actionscript Project" that uses the mx datagrid component. Unfortunately the mx/spark components don't seem to be available unless your project is a "flex project". Is there a way around this? (I really don't like using that mxml mark-up, and just want to write pure code)
thanks!
In ActionScript Build Path, you have to manually add SWC libraries outside Flex library as shown below (add additional libraries as per your requirement):

Qt widgets project

When I looked at some of the GUI examples, I noticed some of the projects contains Forms folder and XXXX.ui files allowing user to modify the layout on the Design screen. But some of them don't have Forms folder and ui files but still have GUI to display.
So the GUI display on above latter cases are hand-coded and the other is using Designer. Is there a way to convert these two kind of projects from one to another?
Those .ui files are used by the User Interface Compiler[1] to generate some file named ui_formname.h that contains a class, Formname, inside the Ui namespace. So ultimately, everything resumes to C++ code
[1] http://qt-project.org/doc/qt-4.8/uic.html

Resources