Qul: Model Property Signals of Singleton class Not Recognized in Auto-generated C++ Code
-
Using Qt MCU 2.11.
//Vehiclemanager.h
class VehicleManager : public Qul::Singleton<VehicleManager> {
public:
friend class Qul::Singleton<VehicleManager>;Qul::Property<WarningModel*> warningModel;
private:
VehicleManager();
WarningModel m_warn;
};//WarningModel.h
class WarningModel : public Qul::Object {
public:
WarningModel();Qul::Property<int> warningState; Qul::Signal<void()> warningStateChanged; void setWarningState(VehicleEnums::WarningStates state);
};
//I can able to use properties in QML like this
property int chargeState: VehicleManager.warningModel.warningState//but i cant able use Signals of same class like below
VehicleManager.warningModel.onWarningStateChanged: {
console.log("warning state changed")
}//error
C:\Users\Girish\Documents\TestApp\build\Qt_for_MCUs_2_11_Desktop_32bpp_MINGW-Debug\CMakeFiles\TestApp.dir\TestApp.cpp:395: error: 'warningModel' was not declared in this scope; did you mean 'WarningModel'?
C:/Users/Girish/Documents/TestApp/build/Qt_for_MCUs_2_11_Desktop_32bpp_MINGW-Debug/CMakeFiles/TestApp.dir/TestApp.cpp: In constructor 'TestApp::TestApp()':
C:/Users/Girish/Documents/TestApp/build/Qt_for_MCUs_2_11_Desktop_32bpp_MINGW-Debug/CMakeFiles/TestApp.dir/TestApp.cpp:395:69: error: 'warningModel' was not declared in this scope; did you mean 'WarningModel'?
395 | _warningModel_value____onWarningStateChanged_binding.connect(&(*warningModel.value()).warningStateChanged, Qul::Private::SlotConnectInitial);
| ^~~~~~~~~~~~
| WarningModel//and as it suggested to use WarningModel instead warningModel, if i use that
//error
C:\Users\Girish\Documents\TestApp\qmlproject\TestApp.qml:54: error: WarningModel does not have any attached properties defined
C:/Users/Girish/Documents/TestApp/qmlproject/TestApp.qml:54:20: error: WarningModel does not have any attached properties defined
VehicleManager.WarningModel.warningStateChanged: {
^~~~~~~~~~~~can anyone please help me how to resolve this issue?