Activity for PythonQt

  • Max Max modified a comment on discussion Help

    It's a pity PythonQt lacks proper documentation. I find this project very useful, and I think it deserves to be better documented. Hope, this will come some day :) My question is - is it possible to use pure cpp-objects (not subclasses of QObject) in the Python-part of PythonQt without wrapping them with QObject-derived classes? Say, I have a small cpp-class which represents an item in a collection, and I manipulate large lists of objects of this class. If for each object in a list I need a wrpper...

  • Max Max posted a comment on discussion Help

    It's a pity PythonQt lacks proper documentation. I find this project very useful, and I think it deserves to be better documented. Hope, this will come some day :) My question is - is it possible to use pure cpp-objects (not subclasses of QObject) in the Python-part of PythonQt without wrapping them with QObject-derived classes? Say, I have a small cpp-class which represents an item in a collection, and I manipulate large lists of this cpp-classes. If for each object in a list I need a wrpper to...

  • Noah Pan Noah Pan posted a comment on discussion Help

    Hi All, I am new to the forums and I was wondering if someone could help me out with the issues I am having. I am trying to use the package, PythonQt here: https://mevislab.github.io/pythonqt/index.html to embedded a python script into a C++ Qt front end. I am having trouble building any of the examples sketches. I am running ubuntu 16.04 on vmware and I have QT 5 install and I am trying to use python2.7 I have tried two ways to compile: cmd line, I run qmake && make I run into an error that says:...

  • Erik Lundin Erik Lundin posted a comment on discussion Open Discussion

    Moved to https://github.com/MeVisLab/pythonqt/pull/1

  • Florian Link Florian Link posted a comment on discussion Help

    PythonQt has moved to GitHub: https://github.com/MeVisLab/pythonqt The SF site will stay around, but will not get updates anymore.

  • Florian Link Florian Link posted a comment on discussion Open Discussion

    PythonQt has moved to GitHub: https://github.com/MeVisLab/pythonqt The SF site will stay around, but will not get updates anymore.

  • Florian Link Florian Link created a blog post

    PythonQt has moved to GitHub

  • Max Max posted a comment on discussion Help

    Ok, thank you. Distributing standard library and Python dll is ok for me, so I'll take up attempting to embed Python into my app with PythonQt.

  • Florian Link Florian Link posted a comment on discussion Help

    Typically you will need to distribute the Python dll(s) and standard libraries together with your application, so that you have your own deployment of Python with your application. There will be a site-packages directory in the libs folder and users can install external Python libs using pip into your deployed Python installation. I would recommend copying the parts the you need from a standard Python installation into your application folder before building the installer. Python does not work without...

  • Max Max posted a comment on discussion Help

    Hello, and first of all - thanks for this great project! I am developing an app using C++/Qt5, and thought about the possibility of third-party plugins by exposing Python APIs (similar to, e.g., as done in Sublime Text editor, although it is not based on Qt). Hence, I found that PythonQt might be exactly what I need. I've downloaded PythonQt and managed to compile/run examples, which look promising to me. However, there are some points which are not obvious from your documentation (at least to a...

  • Florian Link Florian Link committed [r509]

    removed methods that are not present on all platforms/configurations

  • Florian Link Florian Link committed [r508]

    applied patch from Uwe Siems (print correct file location in parser)

  • Florian Link Florian Link committed [r507]

    fixed QTimer wrapping for Qt 5.12

  • Florian Link Florian Link committed [r506]

    enable QMutexLocker (but __enter__ and __exit__ don't work yet due to PythonQt class wrapper implementation...)

  • Florian Link Florian Link committed [r505]

    enable QThread (it was removed long time ago but makes sense now that PythonQt support multi-threading)

  • Florian Link Florian Link committed [r504]

    don't print omitted rvalue methods, we just don't want to wrap them

  • Florian Link Florian Link committed [r503]

    applied patch provided by Uwe Siems

  • Allen C Kempe Allen C Kempe posted a comment on discussion Open Discussion

    Florian, glad to see you are keeping a watch on things. I tried adding this line to the pp-qt-configuration file but it doesn't seem to have any affect. #define QT_DEPRECATED QT_DEPRECATED I would think that I should be able to set breakpoints in preprocessor.cpp but they never get called.

  • Florian Link Florian Link posted a comment on discussion Open Discussion

    Look in the preprocessor code pr the master include, I guess one of them is defining it... or you have to add a define that defines it to itself, so that the preprocessor keeps it. On Fri 5. Apr 2019 at 19:37, Allen C Kempe allenck@users.sourceforge.net wrote: I'm not having a lot of luck yet. I thought that I could add some code to check for QT_DEPRECATED on a function but it's not getting called. It seems that there is a pre-processor that is removing the QT_DEPRECATED token from the source. It...

  • Allen C Kempe Allen C Kempe posted a comment on discussion Open Discussion

    I'm not having a lot of luck yet. I thought that I could add some code to check for QT_DEPRECATED on a function but it's not getting called. It seems that there is a pre-processor that is removing the QT_DEPRECATED token from the source. It looks like the prepocessor code is QT code that I can't see so I've been unable to see how it's doing this.

  • Tonka Tonka posted a comment on discussion Open Discussion

    repo on github would be nice. makes it much easier to cooperate.

  • Allen C Kempe Allen C Kempe posted a comment on discussion Open Discussion

    In the next couple of days, I should be able to take a look at some of the problems. What if I setup a repository on github for my changes? That should make it easier to shae any changes we make.

  • Tonka Tonka posted a comment on discussion Open Discussion

    Me too. I already make a big part of our application scriptable, but the bugs that you mentioned produce a lot of trouble. Maybe we can cooperate to fix he bugs.

  • Allen C Kempe Allen C Kempe posted a comment on discussion Open Discussion

    I only got involved with PythonQt because I wanted to add scripting capabilities to a QT program.

  • Tonka Tonka posted a comment on discussion Open Discussion

    I also think that the endif warning is from an pythonqt parser bug. The strange thing is that i get it only when i add additional include directories. The parser sometimes does not see classes, but they are listed in the preprocess file. yeah, there are some weird bugs which need some checks. Do you use pythonqt only for qt stuff or do you use it for your own code as well (as i do)?

  • Allen C Kempe Allen C Kempe posted a comment on discussion Open Discussion

    I don't believe that the "#endif without #if" problems are appearing because of a real poblem in the input header files but a bug in the PythonQT parser. It may be an indication of some classes not being processed properly. I sort of got sidetracked on other issues and haven't wlooked into any of these issues. At the present time, the failure od QSignalMapper as I previously posted about is my biggest concern. My next item of interest is figuring out how to ignore methods marked QT_DEPRECATED. Of...

  • Tonka Tonka posted a comment on discussion Open Discussion

    Hey Allen C Kempe, I have the same troubles as you mentioned above. Does your last patch suggestion fix some of the above problems like #endif without #if or something like that? Greetings Tonka

  • Florian Link Florian Link posted a comment on discussion Help

    You probably need to initialize PythonQtAll, because it contains the wrappers for QFrame. without generated wrappers, PythonQt can only provide the slots,signals and properties, but not methods that the moc does not handle. Calling PythonQtAll::init() before registering your class should do the trick. You could also pass in the name of the parent clas when registerings, but that is not really needed on Qobjects, I think.

  • Mortie Mortie modified a comment on discussion Help

    Hi I'm using PythonQt for creating customized objects on a frame. what am I doing is that I'm subclassing QFrame (for example) and adding some features and methods for my own class (MyFrame) . then I wrote a wrapper class like what examples of PythonQt said. the problem comes out when I create an instance of MyFrame (myFrame) it'll not recognizing MyFrame as a subclass of QFrame and also don't show it's base class methods for using. it'll just shows my own methods in the wrapper class and i'm not...

  • Mortie Mortie modified a comment on discussion Help

    Hi I'm using PythonQt for creating customized objects on a frame. what am I doing is that I'm subclassing QFrame (for example) and adding some features and methods for my own class (MyFrame) . then I wrote a wrapper class like what examples of PythonQt said. the problem comes out when I create an instance of MyFrame (myFrame) it'll not recognizing MyFrame as a subclass of QFrame and also don't show it's base class methods for using. it'll just shows my own methods in the wrapper class and i'm not...

  • Mortie Mortie posted a comment on discussion Help

    Hi I'm using PythonQt for creating customized objects on a frame. what am I doing is that I'm subclassing QFrame (for example) and adding some features and methods for my own class (MyFrame) . then I wrote a wrapper class like what examples of PythonQt said. the problem comes out when I create an instance of MyFrame (myFrame) it'll not recognizing MyFrame as a subclass of QFrame and also don't show it's base class methods for using. it'll just shows my own methods in the wrapper class and i'm not...

  • Joe Connellan Joe Connellan posted a comment on discussion Help

    Ah great, thank you very much, I can confirm that these changes do work for me. Thanks again.

  • Florian Link Florian Link posted a comment on discussion Help

    Since you are entering Python from C++, you need to make sure that you hold the GiL, which you can do with placing the PYTHONQT_GIL_SCOPE into the scope where you communicate with Python or PythonQt (and even when you talk to a PythonQtObjectPtr, because it will do non-thread-safe ref counting of the PyObject). So you have to place PYTHONQT_GIL_SCOPE into your run method. An important thing to understand is that even it is multi threading, only one thread can talk to Python at a time, which is why...

  • Joe Connellan Joe Connellan posted a comment on discussion Help

    Hello, I am getting a crash when running PythonQtObjectPtr::evalScript() from two different threads each using their own PythonQtObjectPtr created inside each thread with PythonQt::self()->createUniqueModule(). I have read through: https://sourceforge.net/p/pythonqt/discussion/631392/thread/28c4d2bd/ and older threads but I wasn't sure exactly what process I need to go through to get it to work, eg if any explicit GIL handling is required or if it's all being handled by PythonQt now. I'm using the...

  • Jian Wang Jian Wang modified a comment on discussion Help

    Hi, can you upload your code which are used to convert qapp.arguments() to wchar please ? I entered http://doc.qt.io/qt-5/qstring.html#toWCharArray but I can‘t understand what should I do.So sad......

  • Jian Wang Jian Wang posted a comment on discussion Help

    Hi, can you upload your code which are used to convert qapp.arguments() to wchar please ? I entered http://doc.qt.io/qt-5/qstring.html#toWCharArray but I can understand what should I do.So sad......

  • Joerg Kreuzberger Joerg Kreuzberger posted a comment on discussion Open Discussion

    Hi! Currently i am going to dist my application without need for any environment variables like LD_LIBRARY_PATH, PYTHONHOME, etc. This was no problem, used CMAKE CMAKE_RPATH_INSTALL feature to replace the RPATH of the app on install with $ORIGIN:$ORIGIN/lib etc. This all worked fine, until i run into an issue with PythonQt_QtAll. The lib hard links against the Qt used for build and ignores anything on dynamically loading Qt5PrintSupport and Qt5Sql. only LD_LIBRARY_PATH seems to help. Therefore i...

  • Allen C Kempe Allen C Kempe posted a comment on discussion Open Discussion

    Here are some changes I am suggesting: Index: generator/main.h =================================================================== --- generator/main.h (revision 502) +++ generator/main.h (working copy) @@ -105,6 +105,12 @@ std::cout << "-------------------------------------------------------------" << std::endl; std::cout << "Using QT at: " << qtdir.toLocal8Bit().constData() << std::endl; std::cout << "-------------------------------------------------------------" << std::endl; + QDir dir(qtdir);...

  • Allen C Kempe Allen C Kempe posted a comment on discussion Open Discussion

    I'm still working on getting connect to work. My problem I believe was because I was trying to use QSignalMapper which doesn't work. from PythonQt import * from PythonQt.QtGui import QPushButton from PythonQt.QtCore import QSignalMapper from PythonQt.QtGui import QMainWindow from PythonQt.QtGui import QHBoxLayout from PythonQt.QtGui import QWidget list = ["A", "B", "C","D"] f = QMainWindow() f.setWindowTitle("QSignal Mapper Test") cw = QWidget(); centralWidgetLayout = QHBoxLayout() cw.setLayout(centralWidgetLayout)...

  • Allen C Kempe Allen C Kempe posted a comment on discussion Open Discussion

    In generator source file main.h, there is a check to see whether the QTDIR environment variable exists and a message is output to qWarning. It should also be output to stdout. Also, there is no check to verify that the directory specified exists. Further down, I found that "/QtWidgets" needs to be added to the list of includes in order to find QtClasses like QMainWindow. This eliminates the baseclass not found warnings. I'm wonderign whether the INCLUDES paths should also be verified that they e...

  • Allen C Kempe Allen C Kempe modified a comment on discussion Open Discussion

    I am using Qt version 5.7 Since I reported this, I have come across a few other anomalies. I have a subclass of QMainWindow. called JFrame. In my script, I got an error when I tried to 'f.setVisible(True)' that JFrame has no method called 'setVisible'. Since QMainWindow.set visible is virtual, it should have worked. What I did to solve this problem was to add a function, 'setVisible' in QFrame that just called QMainWindow::setVisible. I cannot seem to get signals and slots to do anything. I don't...

  • Allen C Kempe Allen C Kempe posted a comment on discussion Open Discussion

    I continue to work on the problem of getting connect to work. I did discover one "oops' situation in that my generator script was passing an invalid path for an 'Export QTDIR= ... statement. After correcting the path and rerunning generator, I now see that the Warning messages about QObject being an invalid baseclass have disappeared. However I am still getting warning messages about Qt classes like QMainWindow and QMenu being invalid baseclasses. and the script from https://sourceforge.net/p/pythonqt/discussion/631393/thread/bbc98b8f/?limit=25#1a5c...

  • Allen C Kempe Allen C Kempe modified a comment on discussion Open Discussion

    I am using Qt version 5.7 Since I reported this, I have come across a few other anomalies. I have a subclass of QMainWindow. called JFrame. In my script, I got an error when I tried to 'f.setVisible(True)' that JFrame has no method called 'setVisible'. Since QMainWindow.set visible is virtual, it should have worked. What I did to solve this problem was to add a function, 'setVisible' in QFrame that just called QMainWindow::setVisible. I cannot seem to get signals and slots to do anything. I don't...

  • Allen C Kempe Allen C Kempe modified a comment on discussion Open Discussion

    I am using Qt version 5.7 Since I reported this, I have come across a few other anomalies. I have a subclass of QMainWindow. called JFrame. In my script, I got an error when I tried to 'f.setVisible(True)' that JFrame has no method called 'setVisible'. Since QMainWindow.set visible is virtual, it should have worked. What I did to solve this problem was to add a function, 'setVisible' in QFrame that just called QMainWindow::setVisible. I cannot seem to get signals and slots to do anything. I don't...

  • Allen C Kempe Allen C Kempe posted a comment on discussion Open Discussion

    I am using Qt version 5.7 Since I reported this, I have come across a few other anomalies. I have a subclass of QMainWindow. called JFrame. In my script, I got an error when I tried to 'f.setVisible(True)' that JFrame has no method called 'setVisible'. Since QMainWindow.set visible is virtual, it should have worked. What I did to solve this problem was to add a function, 'setVisible' in QFrame that just called QMainWindow::setVisible. I cannot seem to get signals and slots to do anything. I don't...

  • Florian Link Florian Link posted a comment on discussion Open Discussion

    Thanks for reporting, could you say which Qt version you are using? I am not actively working on PythonQt right now, so maybe you can have a look by yourself.

  • Allen C Kempe Allen C Kempe posted a comment on discussion Open Discussion

    When using the latest version of PythonQt downloaded using SVN, I have encountered several strange or unexplained results. when a package name is specified as 'test' in the typesystem file, the generated package names are outout as 'Test' but the folder, .cpp files, and .h files generated all use 'test' in their names. generated PythonQtShell headers are created with a semicolon following the closing brace, e.g "{};" While not a major problem, it causes the lines to be highlighed as possibly in error...

  • Mortie Mortie posted a comment on discussion Help

    I've tricked this task by using queued signal and slots mechanism for GUI components that are going to be debugged. so the wrapped methods will just rise a signal and it'll catch it's appropriate method by pre-defined connections with Qt::AutoConnect so GUI components will decide how to connect to those relative slots based on the method they're running. (debug or just runeval) I know this is not a professional method for doing these stuff but it just satisfies my needs until now.

  • Mortie Mortie modified a comment on discussion Help

    Thank you so much right now I don't have any problem in debugging a GUI-less script like even working with models and other libraries of Wrapped Qt classes and it works fleuntly. I developed a UI with text editor, highighting syntax, breakpoints and any other concepts required by a simple debugger like variables table etc. but when it comes to the wrapped GUI classes it will shoot a fatal error to screen when I'm stepping over the commands related to the GUI. so do you mean I can also debug GUI-based...

  • Steve Pieper Steve Pieper posted a comment on discussion Open Discussion

    For our PythonQt app (3D Slicer, slicer.org), we bundle the ctkPythonConsole, which is great for easy access to basically everything in the system. http://www.commontk.org/index.php/Documentation/ImageGallery#Scripting.2FPython But people have also set up so that you can connect to the same python environment from many IDEs: https://www.slicer.org/wiki/Documentation/Nightly/Extensions/DebuggingTools And there's also now a way to use the python environment from Jupyter https://discourse.slicer.org/t/jupyter-notebooks-are-now-usable-in-3d-slicer/3438...

  • Andrewc Andrewc posted a comment on discussion Open Discussion

    https://itom.bitbucket.io/start.html All written in QT. A nice GPL PyQt5 Python editor debugger is "Mu". It could be "embedded" in a python aware application with some simple modifications.

  • woodwater woodwater posted a comment on discussion Help

    Hello everybody, First of all, thanks a lot for this great tool,Please forgive my broken English. I experience trouble after I used external python third party module(like pandas). I want to run my Qt program on the pc without install python and pandas. Earlier not use pandas,my program can work well only with the python36.dll PythonQt*.dll. eee, I just want to know how to config third party module without install,in Qt+PythonQt program I am on Windows 7-64b, using Qt 5.9.1(Visual Studio 2015), Python...

  • Florian Link Florian Link posted a comment on discussion Help

    No, that is currently not implemented. You could expose non-QObject C++ objects and write wrappers/decorator classes for them. Or you could modify PythonQtClassInfo to stop inheritance traversal before QObject.

  • Miguel Angel Miguel Angel posted a comment on discussion Help

    Hi, sorry for asking a noob question, but is there any way to filter out some of the slots/signals in the class to avoid them being exported to py? i.e. I would like to remove the QObject slots for clarity. thanks in advance!!

  • Mortie Mortie posted a comment on discussion Help

    Thank you so much right now I don't have any problem in debugging a GUI-less script like even working with models and other libraries of Wrapped Qt classes and it works fleuntly. I developed a UI with text editor, highighting syntax, breakpoints and any other concepts required by a simple debugger like variables table etc. but when it comes to the wrapped GUI classes it will shoot a fatal error to screen when I'm stepping over the commands related to the GUI. so do you mean I can also debug GUI-based...

  • Mortie Mortie posted a comment on discussion Open Discussion

    can you tell the name of the GPL example of python editor/debugger? or a link would be very good :) thank you

  • Florian Link Florian Link posted a comment on discussion Help

    I think you have to look into remote debugging, e.g. like in PyDev /Eclipse or PyCharm. Running a debugger in the same process with Qt Gui is not possible, because the main thread will be blocked, so your Gui can't update. You need a second process which shows the Debugger and has a UI, typically that application is the text editor as well, so that you can set breakpoints and show where the cursor is located. Maybe using an existing remote debugger would be a simple solution for you (but less integrated...

  • Mortie Mortie posted a comment on discussion Help

    Thank you Florian for your attention and reply I've managed somehow to make a debugger with PythonQt and bdb library of python. the problem is that bdb or other python debuggers are thread-based and if I use PythonQt_QtAll GUI elements it will be trapped in the thread of python I think and will crash out to desktop when stepping over script lines. do you have any suggestion for a way that I can manage it to work or any other efforts that I should follow maybe? Regards

  • Florian Link Florian Link posted a comment on discussion Help

    Qt does not allow to create widgets outside the GUI thread, this a Qt limitation, not a Python limitation.

  • Mortie Mortie posted a comment on discussion Help

    Hi I've used r502 version of PythonQt with thread support, I wanted to run a special simple script below but I'm getting crashed when I want to run it from PythonQt framework: class myWidget(threading.Thread): def __init__(self): threadin.Thread.__init__(self) def run(self): widget = Qt.QWidget() widget.show() w = myWidget() w.start() I've set PythonQt::setEnableThreadSupport(true) it gives me the errors like below (in some somehow same situtuation with a little twerk): 1: Cannot set parent, new...

  • Florian Link Florian Link posted a comment on discussion Open Discussion

    I will send you a private message.

  • Andrewc Andrewc posted a comment on discussion Open Discussion

    Florian, Sorry for the delay in replying ( holidays). When you say "closed source", do you mean it is embedded in commerical code. Are you interested in licensing your code? Obviously we could develop our own but I'm trying to kick-start some development. Andrew

  • Florian Link Florian Link posted a comment on discussion Open Discussion

    We developed our own TextEditor and Debugger using Qt. We use Jedi (in an extra process) for the autocompletion and goto definition etc. QSyntaxHighlighter for the highlighting... Debugger uses Python trace callbacks. Unfortunately it's all closed source. I dont't know a good open source option.

  • Andrewc Andrewc posted a comment on discussion Open Discussion

    We are using PythonQT and QScintilla to provide simple tools to run and edit python scripts, but would really like a more powerful QT editor/debuggger component. I have found a GPL example, but we are a commercial code so need a less restrictive license. Does anyone have a suggestion for finding a QT python editor/debugger widget?

  • Florian Link Florian Link posted a comment on discussion Open Discussion

    I don't have time to fix this right now, but I added a bug report in our internal bug tracker.

  • Erik Lundin Erik Lundin modified a comment on discussion Open Discussion

    Hi, Background When running some Python code from PythonQt the other day, I got a segfault in PythonQtConversion.cpp. It turned out that when an Enum based class is processed by PyObjToQVariant, it's recognised as a sequence (since it's possible to iterate over an Enum in Python), but PySequence_GetItem returns nullptr when the loop gets the value to add to the QVariantList, causing the segfault when calling PyObjToVariant with a null pointer. Unless Enums should be treated in a special way, I assume...

  • Erik Lundin Erik Lundin modified a comment on discussion Open Discussion

    Hi, Background When running some Python code from PythonQt the other day, I got a segfault in PythonQtConversion.cpp. It turned out that when an Enum based class is processed by PyObjToQVariant, it's recognised as a sequence (since it's possible to iterate over an Enum in Python), but PySequence_GetItem returns nullptr when the loop gets the value to add to the QVariantList, causing the segfault when calling PyObjToVariant with a null pointer. Unless Enums should be treated in a special way, I assume...

  • Erik Lundin Erik Lundin posted a comment on discussion Open Discussion

    Hi, Background When running some Python code from PythonQt the other day, I got a segfault in PythonQtConversion.cpp. It turned out that when an Enum based class is processed by PyObjToQVariant, it's recognised as a sequence (since it's possible to iterate over an Enum in Python), but PySequence_GetItem returns nullptr when the loop gets the value to add to the QVariantList. Unless Enums should be treated in a special way, I assume that the best is to handle them as "normal" classes. In order to...

  • Uriel Elias Wiebelitz Uriel Elias Wiebelitz posted a comment on discussion Help

    Ok, let's forget about this question... I read a lot of the code during the last days and I realized it is not as easy as I thought. I think what I want to do is strongly related to what is described in another thread: https://sourceforge.net/p/pythonqt/discussion/631392/thread/28c4d2bd/

  • Edvard Edvard posted a comment on discussion Help

    I used PythonQt in many of my projects but after a change in the msys directory of my system, those projects that have PythonQt used in their architecture for porting cannot start Debugging and immediately after debugging starts it says debugging has finished. I have to say I can debug those examples of PythonQt directory with the same gdb just some of my projects have this issue in debugging mode. what do you think about this problem? is it python path problem or something like this?

  • Uriel Elias Wiebelitz Uriel Elias Wiebelitz posted a comment on discussion Help

    Hi everybody, for sure I'm not the first one but I could not find another thread that answered my qestion: What keeps me from instantiating multiple instances of PythonQt (and the Python Interpreter) except the singleton implementation? What Problems would come up when running completely different and independent scripts in different instances of the interpreter from different threads? Yes, we know that we have to keep in mind to access GUI elements only from the main thread. Could it be a solution...

  • Florian Link Florian Link committed [r502]

    use C++11 {} initializer for returnValue

  • Florian Link Florian Link committed [r501]

    fixed problematic self deletion without having the GIL and while iterating the loop

  • Florian Link Florian Link committed [r500]

    added missing GIL scope

  • Florian Link Florian Link committed [r499]

    reimplemented argument frame caching (previous approach was not thread-safe when GIL is used)

  • Florian Link Florian Link committed [r498]

    fixed linux compilation problem

  • Edvard Edvard posted a comment on discussion Help

    I don't understand the usibilty of some varibles like globalValueStoragePos , globalPtrStoragePos and globalVariantStoragePos? and whay we should save these positions in PythonQtCallSlot function?

  • Edvard Edvard posted a comment on discussion Help

    thanks for helping

  • Florian Link Florian Link posted a comment on discussion Help

    Hm, there are various ways, but all require some work, especially if you want to be able to modify the data from both sides... Maybe the easiest would be to use a Python array (see standard library) of the desired type. But PythonQt does not support automatic conversion, so you would need to use a PyObject pointer in your slot and use the Python C api to talk to it from C++. Another common way is to use numpy arrays, but that will require the numpy installation and you would need to use the numpy...

  • Edvard Edvard posted a comment on discussion Help

    thanks, I want a way that each value change of variable in cpp function also applies to python. is there any way to do that?

  • Florian Link Florian Link posted a comment on discussion Help

    You can't. You could change the interface to take a QVector or QList of ints. The any sequence in Python will be converted to that list/vector.

  • Edvard Edvard posted a comment on discussion Help

    Hello I have problem with c function pointer wrapping. I have a c function that one of its argument is int pointer. so how can I pass pointer from python to it?

  • Florian Link Florian Link posted a comment on discussion Open Discussion

    You can call it before or after init (because it only stores static bools). But you have to call it at least before releasing the GIL and before starting threads. On Thu, Sep 6, 2018 at 9:45 AM Joerg Kreuzberger kreuzberger@users.sourceforge.net wrote: Is there any relation to PythonQt::init() i assume directly after PythonQt::init() Python GIL Handling with PythonQtAll Sent from sourceforge.net because you indicated interest in < https://sourceforge.net/p/pythonqt/discussion/631392/> To unsubscribe...

  • Joerg Kreuzberger Joerg Kreuzberger posted a comment on discussion Help

    and this it was. Argh. i removed the slot BEFORE trying it with this PassOwnerShipStuff. Many thanks!!!

  • Florian Link Florian Link posted a comment on discussion Help

    Hm, does your wrapper have a destructor slot (I forgot how they are named, delete_XYZ)? Because that is what PythonQt will use to destroy it (otherwise it can't destroy it).

  • Joerg Kreuzberger Joerg Kreuzberger modified a comment on discussion Help

    Hmm, does not work as expected by myself. The slot has now a return type of PythonQtPassOwnershipToPython<PyBitView*> But the destructor of the PyBitView object is never called if i delete the object in python Is there still a reference hold by the wrapper object? I currently cannot find the source code line to start debugging on, perhaps you have an hint? Started from PythonQtSlot call. The result seems to have the right flags.

  • Joerg Kreuzberger Joerg Kreuzberger modified a comment on discussion Help

    Hmm, does not work as expected by myself. The slot has now a return type of PythonQtPassOwnershipToPython<pybitview*> </pybitview*> But the destructor of the PyBitView object is never called if i delete the object in python Is there still a reference hold by the wrapper object? I currently cannot find the source code line to start debugging on, perhaps you have an hint? Maybe PythonQt::unwrapForeignWrapper?

  • Joerg Kreuzberger Joerg Kreuzberger posted a comment on discussion Help

    Hmm, does not work as expected by myself. The slot has now a return type of PythonQtPassOwnershipToPython<pybitview*> </pybitview*> But the destructor of the PyBitView object is never called if i delete the object in python Is there still a reference hold by the wrapper object? I currently cannot find the source code line to start debugging on, perhaps you have an hint?

  • Joerg Kreuzberger Joerg Kreuzberger posted a comment on discussion Open Discussion

    Is there any relation to PythonQt::init() i assume directly after PythonQt::init()

  • Florian Link Florian Link posted a comment on discussion Help

    No, there is no such mechanism. PythonQt could have a callback to notify you when an object wrapper is deleted, but it would not know where the object came from.

  • Joerg Kreuzberger Joerg Kreuzberger modified a comment on discussion Help

    Ok, understand. In my case i do not give the ownership to python currently, but i could. Then it would get deleted, and so my destructor is called. http://pythonqt.sourceforge.net/Developer.html in the section with ownership management the return type of my MyObject.get() slot could do this Question is if this is not the case, so if i do not WANT the object to be deleted, but used in python, CAN my object be INFORMED that the wrapper object is deleted? Or would this be a new feature?

  • Joerg Kreuzberger Joerg Kreuzberger posted a comment on discussion Help

    Ok, understand. in my case i do not give the ownership to python, but i could. Then it would get deleted, and thats ok. Question is if this is not the case, so if i do not WANT the object to be deleted, but used in python, CAN my object be INFORMED that the wrapper object is deleted

  • Florian Link Florian Link posted a comment on discussion Help

    The default ownership of returned objects is C++, so your object is not deleted by Python, just the wrapper to it. If your get() method returns a new object and you want Python to delete it, you can use the ownership templates in PythonQt.h http://pythonqt.sourceforge.net/classPythonQtPassOwnershipToPython.html#aaad0d16be54de03dbd53c5184f1318eb the templates don't do anything, but tell PythonQt that a returned pointer should change ownership. The shell callback is something else, it is used to set...

  • Joerg Kreuzberger Joerg Kreuzberger posted a comment on discussion Help

    Hi! I have a question regarding reference counting. I have a C++ object, owned by my app. In PythonQt i have created a wrapper, so i call registerClass("PyClassName","","", PythonQtCreateObject<cppwrapper>)</cppwrapper> The class comes into python via another c++ object. There is no wrapper to create or delete it from python. In python i call b1 = MyObject.get() b1 shows to my c++ object (adress) if i now call b1 = None, i get no hint it is not used any more how can i detect this? Is this the last...

  • Florian Link Florian Link posted a comment on discussion Open Discussion

    I did some more work on this. The thread support is now compiled in by default, but needs to be enabled using: PythonQt::setEnableThreadSupport(true)

  • Florian Link Florian Link committed [r497]

    compile thread support by default

  • Florian Link Florian Link committed [r496]

    if there is not promoter, we can't call the promoted functions

  • Joerg Kreuzberger Joerg Kreuzberger posted a comment on discussion Open Discussion

    I think they should do, cause python checks for nullptr from functions returning PyObject* and in debug do an assert. We do also not use the importer, it was just for to get the test running...

  • Joerg Kreuzberger Joerg Kreuzberger posted a comment on discussion Help

    Tried three solutions. running from generator dir with <buildtype>\pythonqt_generator, copied it to generator directory and called it from <buildtype> dir directly. Seems to depend on the generated file itself. The windows/linux file of preprocessed.tmp differs (11MB/4MB), windows contains lots of msvc stuff. but ok. Trying to get token informations in detail to see at wich token / line he fails.</buildtype></buildtype> The compiler seems to struggle around a token from Q_OBJECT where it fails with...

  • Edvard Edvard modified a comment on discussion Help

    I want to understand how pythonqt wrapp classes in deep level so when I analyze related code i notice that every thing depends on PythonQtInstanceWrapperStruct and PythonQtClassWrapper. but i do not understand how and when decorator slots add to class object. i mean when and how decorator slots of my class add to object in python. thanks for your helping me

<< < 1 2 >
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.