Unsolved register c++ class in pyqt6
-
@SGaist header and source class (.h) (.c++)
-
How you handle the separation of declaration and implementation is not the question here.
The question is: what kind of class do you want to implement in C++ and then use with Python ?
What should it do ? Why does it need to be implemented in C++ ? etc. -
@SGaist said in register c++ class in pyqt6:
How you handle the separation of declaration and implementation is not the question here.
The question is: what kind of class do you want to implement in C++ and then use with Python ?
What should it do ? Why does it need to be implemented in C++ ? etc.oh ok, sorry
i wanna use QSetting and QDebug class to save somethings with QSetting -
@qAminzzz
Why go into C++ when these are supported from Python/PyQt?? We are trying to save you lots of headache when it's not apparent you ever need to leave Python to do whatever you want. It's an awful lot simpler to stick in one language.... -
@JonB thanks for your answer. yes i know, but i'm on frontend and frontend and backend should be separate this is more beautiful (;
-
@qAminzzz Not sure what this has to do with front-end/back-end?
Can you explain why you want to write C++ class for something you already have in PyQt (QSettings)?
Do you mean you want to use this C++ class in front-end and back-end and one of them is pure C++?
Writing such a class only makes sense if you're doing more than just reading/writing settings (for that you can use QSettings directly). -
@jsulm actually i am not allowed to use pyqt for frontend. can't to create and use c++ class in pyqt?
-
@qAminzzz said in register c++ class in pyqt6:
can't to create and use c++ class in pyqt?
Of course you can.
My question was: do you really need a C++ class for reading/writing settings if there is already QSettings Qt (C++) class which can be used in C++ and Python code? -
@jsulm yes i really need, actually may you think that not needed but i like to frontend and backend be really separate, even if be just something simple (:
thank you for you answers
and sorry if my language is bad -
@qAminzzz said in register c++ class in pyqt6:
but i like to frontend and backend be really separate
I did not say anything about the need to separate frontend and backend.
All I said is that there is QSettings class which can be used in Python AND C++...If you want/need to write a C++ class and also use it in Python then this is what you need to read: https://docs.python.org/3/extending/extending.html
-
@qAminzzz You keep talking about backend and front end however Python can be used for both just like C++ can also be used for both.
Please explain your application architecture.
As @jsulm already wrote, writing C++ for the sake of writing C++ and then having to create Python bindings does not make much sense unless you are really adding something new.
The set of classes you described you want to use are already available for using in Python.
Hence: provide more information about your use case, application, architecture.
-
Здраствуйте уменя вот такое проблема как можна решить !
-
@madik said in register c++ class in pyqt6:
Здраствуйте уменя вот такое проблема как можна решить !
Please English :-)
There is dedicated forum where you can ask questions in Russian: https://forum.qt.io/category/27/russian
Also, please open your own topic! -
@jsulm thanks for answer. actually it is not good to make a c++ class for this topic, in last i made a pyqt class and i use from that class for frontend. i learned somethings and thanks (: