Qt application not working with qrc prefixes - qt

I think I'm missing some fundamental way of working with various prefixes in the Qt Creator qrc environment.
If I place a qml component in the default prefix, the application builds and runs fine. But if I add a new prefix and then add a new component with this new prefix, the application output tells me it is not a type when I run the app (it builds without error).
Qt Creator recognizes it when it is assigned a different prefix, and I can work with it in the IDE. It shows up in the qrc editor & it becomes a component that I can select within 'Designer'. It also builds without problem... but when I run my application, the application output tells me it is not a type.
If I then open qrc editor and move that component to the default prefix, the application will then run fine.
It seems like I've not given it the direction to find the component at runtime when it is assigned to an alternative prefix.
I'm at a loss as to where I would direct the application to the other prefixes.
I've tried using the "import" in the component that I wish to use it in without success.
I've tried giving it an alias without success.
What needs to happen for this component to be recognized in my app as a type... even though it's already recognized within Qt-Creator?
If it's a prefix, it seems I should add it as a prefix to something I can type in; where would that be?

I was able to solve my problem with a syntax adjustment.
If a qml file wants to use a qml component from a different qml file that is listed in the qrc under a different prefix, it must import the prefix.
I was trying this without success: import "/myOtherPrefix"
However, it needs it to be like this: import "qrc:/myOtherPrefix"
I was not able to find a reference for this in the Qt documentation (it's probably there somewhere)

Related

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

Java app deployment and installer parameters

I am using javapackager for making installer from .jar. I need to give some params to my installer(splash screen icon, remove version from app name etc), that can't be given directly by javapackager. Instead javapackager has an paramfile option, but I don't know how to use it, and what structure will it have?? Can anyone help me??
it is a java properties file. You can look in https://github.com/Debian/openjfx for the parameter you want to override and then set it in the properties file.

Unable to use playn JSON classes in Eclipse

I'm not able to access the playn.core.json.* classes inside eclipse even though everything else works in general. I have used this http://code.google.com/p/playn/wiki/GettingStarted in setting up my eclipse project.
However the following classes are visible -
JsonImpl
JsonParserException
JsonSink
JsonTypedArray
JsonWriterException
When I go to the referenced libraries in Eclipse, I can see playn.core.json and
can see all classes inside it. I'm just not able to use them inside my
code.
Thanks!
Just saw the samples.
You're supposed to use the interface Json.Object/Json.Array.
Use PlayN.json().createObject() to create a new Json.Object instance, and PlayN.json().createArray() to create a new Json.Array instance.
Make sure you have statically imported playn.core.PlayN.*

Help context tagging Qt with slickedit

I am trying to get Slickedit working with the Qt framework so that I can navigate the codebase easily and because of the other features it provides. To context tag the library I go to Tools > Tag Files, then I right click on C/C++ to add tag file. I name it Qt.vtg and then select the following trees:
C:\Qt\2010.05\qt\src
C:\Qt\2010.05\qt\include
I get context tagging for something, but I can't get context tagging for some scenarios where I normally get it:
When I try to get the parameters for a second pointer, it shows nothing:
oldAddress = ui->addressText->
When I try to complete specific headers it also gives no help
#include <QtCore/ >
I don't know if I am missing a step for context tagging QT, or the additional steps for context tagging QT.
Ted.
You have to provide the include directories of QT for your project, either in your project's properties (Menu Project, Project properties, directories' tab), or in your compiler's properties (Menu Tools, Options, search for "Compiler properties"). This will enable your project to find the include files; the tag file alone doesn't really help, since you may have conflicting tags in the many tag files you could have, so the include files are necessary.
Make sure you have activated all the macros QT provides to your build system. It's been ten years since I used Qt, but IIRC there were several macro defines optionally specified on a compiler command line; make sure SlickEdit knows about them. (Menu Project, Project properties, compile/link tab).
If that's not sufficient, please give more details (where the definition is contained, settings for autocomplete, for context tagging, etc).

Flex Builder: Not picking up new files

I have a working AS3 project and it compiles fine to a SWF. I added a new file (via various means: import, drag-drop, new), but it doesn't compile this new file. I'm using Flex Builder 3. I've tried a clean an rebuild. I've tried renaming. It picks up the existing files fine, but not the new one. The project is set to use a HTML wrapper. I see some build files (I think). The new file is in an existing folder and package.
Any idea what could be wrong?
First, the SWF Compiler will optimize your end code. If you never use a class or create an instance of it anywhere in your application; that code will never be compiled in your application. this is a common occurrence if you're using Flex Remoting with some backend; and a VAlue Object is never instantiated directly, instead you're always returning arrays of it. You'll find you get a lot of "Generic Objects" without the backend object-to- AS3 object translation of the Flex Remoting Gateway.
You didn't specify what type of file you are adding. If it is an ActionScript file it won't automatically be compiled in the swf. You'll have to 'include' it in another class somehow. IF it is an ActionScript class or MXML Component, make sure you are using that class somehow in your code. If it is another file type, such as an image or other asset you'll have to embed that file into your code somehow.
We might be able to offer more help if you were to tell us what type of file is not being added to the final SWC. Also tell us how you can tell.

Resources