Component{} Unknown component. (M300) - qt

qml project config file:
my qml file:
qt version:
How to solve this problem?

This had been bugging me for a while. For me, the fix was that noted by #JarMan in the comments to the original question. I think it deserves to be a proper answer. (I'm mot looking to take any credit so if JarMan wants to make their own answer I am happy to delete this.)
In Qt Creator main menu:
Tools > QML/JS > Reset Code Model

For me, adding an addition line:
import QtQml 1.1
does trick.

you can resolve it by add "// #disable-check M300"
Like this:
Component { // #disable-check M300
//code
}

Related

Howto resolve qml module not found (qml designer)

As per https://doc.qt.io/qtcreator/qtquick-placeholder-data.html#creating-dummy-context I want to add a dummy context to my QT 5.15.2 project. The webpage mentioned creating a qml file with the following content:
import QtQuick 2.0
import QmlDesigner 2.0 // this is where the error is indicated: qml module not found (qml designer)
DummyContextObject {
parent: Item {
width: 640
height: 300
}
}
Apparently the QmlDesigner module is unknown. I don't know how to solve this.
The qml code model does not know anything about the existence of that type. So it is correct if it shows that to you.
In detail, that object only exists if the backend process (qmlpuppet or in documentation called emulation layer) renders stuff for the form view in the designer.
But in the current implementation, the qml code model does not know anything about added objects when the emulation layer is running.
I would create a bug report at https://bugreports.qt.io/ about that issue. So the qml code model needs to know about that type somehow.
To make sure that the feature works in the design mode please make sure you are following the help for example there is no qmldesigner 2.0 version only 1.0 exists.
Explanation in the puppet the object is registered with:
qmlRegisterType("QmlDesigner", 1, 0, "DummyContextObject");
see https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp#n184
Also, the file and folder structure is importent.

QT: how to open a new window

Well, I tried a lot.
For example,
#include "secdialog.h"
buttton ::on clicked()
{
secdialog secdialog;
secdialog.setmodal(true);
secdialog.exec();
}
Well, secdialog does not exist!
Those posts are old at least 5 years.
So, I think some headers are changed or I missed something to add.
Hopefully, I'll find someone to help me.
Easy example where to add headers and where to write...
#include "QDialog"
buttton::onClicked()
{
QDialog d;
d.exec();
}
Please also consult the documentation of QDialog. It may also be interesting to go through some basic examples.

Prestashop 1.5 - cannot over ride top menu css

I am new to Presta Shop and trying to create a custom theme. I have read about the documented way to do this by extending the current module css/template files where necessary here: http://doc.prestashop.com/display/PS15/Overriding+default+behaviors
It all seems straight forward. I have over rode the templates and CSS for 2 modules so far with ease but on my 3rd attempt I am encountering some issues. I attempted to over ride the following CSS file:
/modules/blocktopmenu/css/superfish-modified.css
with this
/themes/newtheme/css/blocktopmenu/superfish-modified.css
but it did not work. Out of interest I also tried overwriting with this path too:
/themes/newtheme/css/blocktopmenu/blocktopmenu.css
but that also did not work?
Hopefully someone out there can help or shed some light as to the reason for this or a solution?
Thanks, Matt
Actually I just figured out the issue, the superfish-modified.css is in its own css folder in the actually module so the correct path to over ride should be:
/themes/newtheme/css/blocktopmenu/css/superfish-modified.css
10 points to me.
Is there a missing "modules" in that path? Is it not…
/themes/newtheme/css/modules/blocktopmenu/css/superfish-modified.css
to me, should be
/themes/newtheme/modules/blocktopmenu/css/superfish-modified.css
and you must copy blocktopmenu from /modules to /themes/newtheme/modules/
Seems to be an issue related to this module. Here the solution

Comments on .pro file Qt Creator

Is there anyway to comment certain sections of my .pro file (Qt project)?
In my case I want to comment specific parts that do not apply to the platform I'm currently targeting.
Found this now: http://doc.qt.io/qt-4.8/qmake-project-files.html.
You can comment lines by using a # symbol.
In the .pro file, # before any line or statement indicates a comment.
you have to place a # at the begin of each line.
I think Silva is looking for something like this in .pro file:
if(false) {
...
your block
...
}
This is the programmatic way to do commenting, and you have control of it. Similar approaches may available for other test functions.
If using QtCreator, highlight the section you wish to comment out, then right click for context menu and select 'Toggle Comment Selection'. This is good for large blocks code to comment out.

Could not resolve * to a component implementation

I'm a wee bit stuck on this, and was hoping you might have some input to help me.
I'm getting the "Could not resolve * to a component implementation." error message. However, everything I've read about this via Google hasn't helped my case in the slightest. I presume I'm just missing something obvious, but maybe its something more serious.
So, to solve this problem, I've tried two things, and both work, as far as they take me. First, I added a new component, of the exact same variety, and then copied the contents of the erroring component into it. I replace the viewstack 'page' with the new component (which as near as I can tell is IDENTICAL, but with a different name), and the compiler error goes away.
I can also solve this by simply renaming the original component & letting FB4 refactor for me. The error goes away again. But if I then re-rename back to the original name, I get the compiler error again.
I've tried to clean the project several times, and that doesn't help. Neither does deleting the workspace, and re-importing the project.
I'd really like to understand what I've done wrong here. What am I missing?
Thanks much!
Try the following:
Right-click on your project in the
Package Explorer.
Select "Properties" in the pop-up
menu (last item).
Click "Flex Library Build Path"
Click the "Classes" tab
Try to find the name of your new component in there. If you do, see if it is checked or not. If it is not, check it. That should solve the problem right there, but you may have to clean and (sometimes) quit FB4 and relaunch.
Usually errors like this means you have two components named similarly and the compiler couldn't tell which one you wanted to use.
Do you have another component with the same, even in a different package? Or do you have a variable in your component the same name as the component? Be sure to check your SWCs and/or Library projects.
I'm assuming this is a compile time error; is that correct?
In my case the problem was solved by changing the SDK version of the Flex Compiler to 4.5
You can try with different SDK versions, until you get your component to compile or until the error changes to something related to a theme related error.
After changin this I got an error related to a propertie that is not supported by the current theme, so I open the component in design view and in the Properties View selected the Appearance tab and changed the theme from SPARK to HALO
Hope this is usefull for somebody else
One cause of this error is that the default xml namespace for the component is not the same as the the package in which the component resides.
Check to make sure that the default xmlns entry in the component definition is the same as the package.
For example:
If you have an component MyControl.mxml located in the package com.company.components.controls
The mxml opening tag might look something like this:
<MyControl xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:util="com.company.components.util.*"
xmlns:components="com.company.components.*"
xmlns="com.company.components.controls.*">
Note how the default xmlns entry points to the same package.
Why this happens:
What often happens is that after you refactor an MXML class by moving it to a new package you will end up with a an valid but not correct mxml definition.
For example say I refactor and move the MyControl.mxml from the com.company.components package to the com.company.components.controls package. The xmlns definitions will not be updated so they will look like this:
<controls:MyControl xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:util="com.company.components.util.*"
xmlns="com.company.components.*"
xmlns:controls="com.company.components.controls.*">
Note how the default namespace still points to the com.company.components package and the mxml tag MyControl has to be prefixed by the namespace controls this is an indication of the issue.
Now here is the catch; This is technically valid and will often work. The reason is that it is valid and the components can all be found in their defined xmlns locations.
The problem comes when you try to use a component that is expected to be found, by the framework or parent component, in the default namespace. A good example of this is and other subcomponents of the parent mxml component you might be extending.
To fix this you should modify the mxml tag and namespaces so that the default namespace is the same as the current package. (As in the first example)
Might be I am very late to answer this question, but this might be because the package name which is associating with your class is not the exact and appropriate.

Resources