Skip to content
  • 143k Topics
    718k Posts
    G
    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?
  • Jobs, project showcases, announcements - anything that isn't directly development
    4k 23k
    4k Topics
    23k Posts
    V
    Because the game was release before 2020 (you can see that in the ratings/comments of the game) and Qt 6 was release 2021. So the developers where a) too lazy to update to Qt6 OR It is maybe a licensing problem. Qt 5 was much cheaper. I guess they still have that old contract and that is why they probably stay at Qt 5. As you can see there are only 18 comments for that game (even it looks nice!), but that is much too low to have enough customers that pay the Qt 6 commercial license.
  • Everything related to designing and design tools

    129 391
    129 Topics
    391 Posts
    J
    In QT Design Studio, Tab Buttons are mostly for navigation within the UI, but each tab doesn’t automatically hide other content. Usually, a StackView or Loader is needed to switch visible content depending on the active tab.
  • Everything related to the QA Tools

    80 216
    80 Topics
    216 Posts
    P
    trying to start test automation from scratch here. I'm working on adding the objects (commonly used basic ones). When I've added an object in the names.py file, when I edit the properties, is there a way to know if the object i still identifiable?
  • Everything related to learning Qt.

    386 2k
    386 Topics
    2k Posts
    Ash_QtA
    Hey there! You can return to the course in the catalog and relaunch it. Are you experiencing issues with this?
  • 2k Topics
    13k Posts
    Kent-DorfmanK
    I do a lot of python/pyqt database access using psycopg2 for PostgreSQL. It's so much easier to prototype these kinds of ideas in a language like python, and if needed then port it to c++, but truth be told, most of the time the python app is just works as is so no need to rewrite in c++. For something as simple as you are alluding to, the hard core OO models using DAO/DTO are probably overkill. Also, when dealing qith SQL queries it's "nice" to work in a language that is NOT strongly typed. Sorry if this is a round-about way to respond. Your path has merit in the realm of intellectual curiosity, but if you want it done quickly then python is a better option, and you can still wrap it in a Qt GUI. Yikes! Didn't notice OP was 9 months ago...
  • 4k Topics
    18k Posts
    O
    Bonjour, Dans votre fonction, call, le device est détruit à la fin de la fonction, Le signal signalWithoutPointer ne peut pas marcher car cela demanderai un copy de l'objet Device mais il s'agit d'un QObject ou le constructeur par copy est désactivé. Le passage d'un pointeur vers Device, ben, la moment juste après le pointeur est null. Le passage avec signal sur pointeur "pointer", lui il marche mais c'est la responsabilité de la classe connection de détruire pointer (et donc de garder une variable dessus). Le plus simple c'est de faire un retour de fonction si vous voulez vous simplifiez la vie. // in Connection.cpp Device* Connection::call() { return new Device("Pointeur"); } //main.qml (à la place de la Connections) property Device device: Connection.call() Dans ce cadre cas là, par passage par pointer via un retour de fonction, l'objet appartiendra au QML et sera détruit par le QML Engine. Cependant, je recommande plutot de passer par une propriété. // in connection.h // je suggère de renommer cette classe en ConnectionController (pour éviter la confusion avec le type qml Connections class Connection : public QObject { Q_OBJECT Q_PROPERTY(Device* device READ device CONSTANT) public: explicit Connection(QObject *parent = nullptr); Device* device() const; private: std::unique_ptr<Device> m_device; }; // in connection.cpp Connection::Connection(QObject *parent) : QObject(parent), m_device(new Device("Pointeur"){} Device* Device::device() const { return m_device.get(); } // main.qml property Device device: Connection.device Ici le device reste la responsabilité de la classe Connection, mais c'est géré par le uinique_ptr. Si le device peut changer, il conviendra d'ajouter un signal deviceChanged et de supprimer le CONSTANT de la Q_PROPERTY pour y mettre un "NOTIFY deviceChanged".
  • This is where all the posts related to the Qt web services go. Including severe sillyness.
    1k 10k
    1k Topics
    10k Posts
    Axel SpoerlA
    Everything looks right in my eyes. If I e.g. search for @Volker-Hilsheimer's blog post about QRangeModel, I'll find it here. Do you have a specific link for me to check?