Git Product home page Git Product logo

pythonqt's Issues

patched-8 missing Qt private includes

The CMakeLists.txt in patched-8 branch is missing the inclusion of private Qt headers, resulting in build failure (using qt5-5.7.1). I have sent pull request #53 to fix that - it copies the relevant entry verbatim from the patched-7 version.

Error with python 3.7 : Require native threads

I'm in Ubuntu 18.04.5 and working with the branch patched-8
I get this issue when I use python 3.7 or higher from my system :
/usr/include/python3.7m/pythread.h:122:5: error: #error "Require native threads. See https://bugs.python.org/issue31370"

This issue doesn't occur when I use a lower python version (python 3.6.12 works for me)

The problem seems to come from this line where _POSIX_THREAD is unset :

#undef _POSIX_THREADS

If I comment this line all is working for me, but don't know if it's the best solution to fix this issue.

Qt 5.6 support

Hi,

Is patched-5 version supposed to work with Qt 5.6?
The readme says "Add Qt5 support" but while bulding I get the message saying this version is not supported and that I need Qt4

QSound belongs to QtMultimedia not QtGui

I'm working on CMakeLists and a little in PythonQt_QtAll.cpp to optionally exclude most part of Qt modules. Doing that I found that excluding Multimedia module causes a build error:

com_trolltech_qt_gui7.cpp
d:\3rd_party\pythonqt\pythonqt-master\generated_cpp_54\com_trolltech_qt_gui\com_trolltech_qt_gui7.h(55) : fatal error C1083: Cannot open include file: 'qsound.h': No such file or directory

The point is that QSound class is supposed to be located in QtGui while, at least in Qt 5, it is in fact in Multimedia module (Qt5Multimedia.dll). So, from my point of view, the QSound class should be moved in some "\generated_cpp_5\com_trolltech_qt_multimedia*" file.

Kind regards,
Gianni

cannot override a non-deleted

This issue occurs when building with c++11 on Mac 10.9 with clang compilers.

Hans

In file included from /Users/johnsonhj/src/Slicer-11/CTK-build/PythonQt/generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui1.cpp:1:
/Users/johnsonhj/src/Slicer-11/CTK-build/PythonQt/generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui1.h:378:7: error: deleted function '~PythonQtPublicPromoter_QClipboard' cannot override a non-deleted function
class PythonQtPublicPromoter_QClipboard : public QClipboard
^
/usr/local/Cellar/qt/4.8.6/include/QtGui/qclipboard.h:68:5: note: overridden virtual function is here
~QClipboard();
^
1 error generated.
make[5]: *** [CMakeFiles/PythonQt.dir/generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui1.cpp.o] Error 1
make[4]: *** [CMakeFiles/PythonQt.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [PythonQt-cmake/src/PythonQt-stamp/PythonQt-install] Error 2
make[1]: *** [CMakeFiles/PythonQt.dir/all] Error 2
make: *** [all] Error 2

Problem compiling the "add-qt5-branch" with MSVC2010

Hi,

I'm pretty sure that this issue has a lot to do with my bad understanding of CMake. I'd like to compile PythonQt with Qt5. After cloning the "add-qt5-branch", I started Cmake-gui, set the source code directory to the newly downloaded branch and pressed 'Configure'.

This returns the following error :

CMake Error in CMakeLists.txt:
  A logical block opening on the line
    C:/Users/Me/Desktop/PythonQt-add-qt5-support/CMakeLists.txt:30 (foreach)
  is not closed.

This lets me think that there may be a missing endforeach around line 33 in CMakeFile.txt, but since it is in a block of code for Qt versions less than 5, I added the following line just above the 'Build options' block to compile with Qt5 :

set(PythonQt_QT_VERSION "5")

I've only set PythonQt_wrap_QtCore to true, and the Qt5Core_DIR accordingly, and the QMake configure step now returns :

CMake Error at CMakeLists.txt:244 (qt5_wrap_ui):
  Unknown CMake command "qt5_wrap_ui".

Is there something I can do to make this work ?

Thanks

Crash if delegate subclass implements displayText

This self-contained test helps reproduce the problem:

class PaddingDelegate(qt.QStyledItemDelegate):
  def __init__(self, padding=1, parent=None):
    super(PaddingDelegate, self).__init__(parent)
    self._padding = ' ' * max(1, padding)
  def displayText(self, text, locale):
    return self._padding + text
  def createEditor(self, parent, option, index):
    editor = super().createEditor(parent, option, index)
    margins = editor.textMargins()
    padding = editor.fontMetrics().width(self._padding) + 1
    margins.setLeft(margins.left() + padding)
    editor.setTextMargins(margins)
    return editor

table = qt.QTableWidget()
delegate = PaddingDelegate(3)
table.setItemDelegate(delegate)
table.setRowCount(1)
table.setColumnCount(1)
item = qt.QTableWidgetItem('Test')
table.show()
table.setItem(0,0,item)

The call stack looks like this:

	Qt5Cored.dll!QAtomicOpsBySize<4>::deref<int>(int & _q_value) Line 314	C++
 	Qt5Cored.dll!QBasicAtomicInteger<int>::deref() Line 114	C++
 	Qt5Cored.dll!QVariant::~QVariant() Line 1515	C++
 	PythonQt.dll!PythonQtConv::ConvertPythonToQt(const PythonQtMethodInfo::ParameterInfo & info, _object * obj, bool strict, PythonQtClassInfo * __formal, void * alreadyAllocatedCPPObject, PythonQtArgumentFrame * frame) Line 603	C++
 	PythonQt.dll!PythonQtShell_QStyledItemDelegate::displayText(const QVariant & value0, const QLocale & locale1) Line 814	C++
 	Qt5Widgetsd.dll!QStyledItemDelegate::initStyleOption(QStyleOptionViewItem * option, const QModelIndex & index) Line 348	C++
 	PythonQt.dll!PythonQtShell_QStyledItemDelegate::initStyleOption(QStyleOptionViewItem * option0, const QModelIndex & index1) Line 986	C++
 	Qt5Widgetsd.dll!QStyledItemDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) Line 387	C++
 	PythonQt.dll!PythonQtShell_QStyledItemDelegate::paint(QPainter * painter0, const QStyleOptionViewItem & option1, const QModelIndex & index2) Line 1008	C++
 	Qt5Widgetsd.dll!QTableViewPrivate::drawCell(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) Line 925	C++
 	Qt5Widgetsd.dll!QTableView::paintEvent(QPaintEvent * event) Line 1470	C++

In PythonQtConv::ConvertPythonToQt the crash happens in this part:

    case QMetaType::QString:
       {
         QString str = PyObjGetString(obj, strict, ok);
         if ( ok) {
           PythonQtArgumentFrame_ADD_VARIANT_VALUE_IF_NEEDED(alreadyAllocatedCPPObject, frame, QVariant(str), ptr);
           ptr = (void*)((QVariant*)ptr)->constData();
         }
       }
       break;
     case QMetaType::QStringList:

at the line with ADD_VARIANT_VALUE_IF_NEEDED.

Cannot find external simbol: QBasicMutex::QBasicMutex(void)

Compiling PythonQt together with pre-compiled Qt 5.14.1 in visual studio 2019, following error occur:

1>com_trolltech_qt_core0.obj : error LNK2019: unresoved external simbol "__declspec(dllimport) public: __cdecl QBasicMutex::QBasicMutex(void)" (_imp??0QBasicMutex@@qeaa@XZ),it is used in function "public: __cdecl PythonQtShell_QBasicMutex::PythonQtShell_QBasicMutex(void)" (??0PythonQtShell_QBasicMutex@@qeaa@XZ)

Where in the QT source code, this QBasicMutex is defined as follows:

class Q_CORE_EXPORT QBasicMutex
{
public:
#ifdef Q_COMPILER_CONSTEXPR
constexpr QBasicMutex()
: d_ptr(nullptr)
{}
#endif
...

How can I get around of this?

PythonQt_DEBUG=ON generates error, anyone know what I am doing wrong? Ubuntu 17.04

In folder PythonQt:

cmake -DPythonQt_DEBUG=ON -DPythonQt_Wrap_QtAll=ON -DQt5_DIR:PATH=~/Qt/5.5/gcc_64/lib/cmake/Qt5 ../PythonQt

.../PythonQt/src/PythonQtClassInfo.cpp:284:86: error: request for member ‘constData’ in ‘* meta->QMetaObject::className()’, which is of non-class type ‘const char’ ut << "caching enum " << memberName << " on " << meta->className()->constData() << std::endl;

Ideally PythonQtPythonInclude header should be configured

Doing so would prevent people depending on PythonQt from defining PYTHONQT_USE_RELEASE_PYTHON_FALLBACK

Since PythonQt cab be built either using qmake or cmake, the header configuration would have to work for both build system.

cross compile with mingw

I'm trying to cross compile using mingw and I get an error when compiling

[  3%] Building CXX object CMakeFiles/PythonQt.dir/src/PythonQt.cpp.obj
/usr/bin/i686-w64-mingw32-g++  -DPYTHONQT_EXPORTS -DPYTHONQT_SUPPORT_NAME_PROPERTY -DPYTHONQT_USE_RELEASE_PYTHON_FALLBACK -DPYTHONQT_WRAP_Qtcore -DPYTHONQT_WRAP_Qtgui -DPYTHONQT_WRAP_Qtnetwork -DPYTHONQT_WRAP_Qtopengl -DPYTHONQT_WRAP_Qtqml -DPYTHONQT_WRAP_Qtquick -DPYTHONQT_WRAP_Qtsql -DPYTHONQT_WRAP_Qtsvg -DPYTHONQT_WRAP_Qtuitools -DPYTHONQT_WRAP_Qtxml -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_PRINTSUPPORT_LIB -DQT_QML_LIB -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_SQL_LIB -DQT_SVG_LIB -DQT_UITOOLS_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB @CMakeFiles/PythonQt.dir/includes_CXX.rsp -std=gnu++11 -o CMakeFiles/PythonQt.dir/src/PythonQt.cpp.obj -c /mnt/local/src/neutrinoMaster/PythonQt/src/PythonQt.cpp
/mnt/local/src/neutrinoMaster/PythonQt/src/PythonQt.cpp:1951:10: fatal error: private/qmetaobjectbuilder_p.h: No such file or directory
 #include <private/qmetaobjectbuilder_p.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/PythonQt.dir/build.make:164: CMakeFiles/PythonQt.dir/src/PythonQt.cpp.obj] Error 1
make[2]: Leaving directory '/mnt/local/src/neutrinoMaster/PythonQt/cross'
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/PythonQt.dir/all] Error 2
make[1]: Leaving directory '/mnt/local/src/neutrinoMaster/PythonQt/cross'
make: *** [Makefile:130: all] Error 2

I bet you already run into this since : https://github.com/commontk/PythonQt/blob/patched-8/CMakeLists.txt#L154

but in my case the variable ${Qt5Core_PRIVATE_INCLUDE_DIRS} is empty

qmetaobjectbuilder_p.h is located here:

/usr/i686-w64-mingw32/sys-root/mingw/include/qt5/QtCore/5.9.3/QtCore/private/qmetaobjectbuilder_p.h

Integrate upstream change

The text reported below has been sent by Florian Link from Mesvis lab after he integrated the CTK contributions:

- Renamed set/enableRedirectStdInCallBack to set/enableRedirectStdInCallback 
(since other methods use Callback spelling)
See https://github.com/commontk/CTK/issues/156
EDIT: DONE

- Removed VTK wrapping from PythonQt
EDIT: DONE

- Removed VTK wrapping from PythonQtConversion
EDIT: DONE

- Removed VTK from CMake filelist
EDIT: DONE

- Added new PythonQt::addWrapperFactory(PythonQtForeignWrapperFactory*) 
which allows to implement the VTK integration
  (or any other wrapper integration) externally (so you can do it in CTK)
See https://github.com/commontk/CTK/issues/157
EDIT: DONE

- PyMapping_Items -> PyObject_CallMethod fix not taken (PythonQtConversion.cpp), 
since it is not a good idea to expand PyMapping_Items just to get rid of the const char* 
warning (PyMapping_Items might change anytime in the future)

- renamed dPython.h to PythonQtPythonInclude and made it optional by adding a define check:  
  PYTHONQT_USE_RELEASE_PYTHON_FALLBACK and added that define to the CMake file list. 
See https://github.com/commontk/PythonQt/issues/4

- Changed polymorphic handler signature to const char** so that no const_cast<char*>
 is needed anymore

PythonQT Fails to Build in Debug on MSVC 2010

I experienced this issue while building Slicer 4.2 on Windows 7 with MSVC 2010. I then tested it outside of Slicer, building it against both the x64 version of Python built by Slicer and a x86 version of Python 2.7.2. When building inside Slicer in debug, I get this error:

2>Link:
2> Creating library D:/src/Slicer4/SlicerBuild-Debug/CTK-build/PythonQt-build/Debug/PythonQt.lib and object D:/src/Slicer4/SlicerBuild-Debug/CTK-build/PythonQt-build/Debug/PythonQt.exp
2>PythonQt.obj : error LNK2019: unresolved external symbol __imp__invalid_parameter_noinfo_noreturn referenced in function "public: int const & __cdecl std::_Vector_const_iterator<class std::_Vector_val<int,class std::allocator > >::operator*(void)const " (??D?$_Vector_const_iterator@V?$_Vector_val@HV?$allocator@H@std@@@std@@@std@@QEBAAEBHXZ)
2>D:\src\Slicer4\SlicerBuild-Debug\CTK-build\PythonQt-build\Debug\PythonQt.dll : fatal error LNK1120: 1 unresolved externals

If I change to Release mode using the PythonQt.sln inside the Slicer/CTK project, it builds fine.

I get the same error when building outside of slicer in debug, but it works fine in release both for when I build against the Slicer Python and my 32 bit Python 2.7.2/Qt 4.7.4.

I know the suggestion is to use MSVC 2008, but our software needs 2010 and I figured this should at least be reported here instead of just on the mailing lists.

Use Qt_all extension

Hi,
I'm trying to use the qt_all extension of python and can't figure out how to use it.

I cmaked pythonqt with

cmake -DPythonQt_Wrap_QtAll=ON .

and compiled, but it seems that the header extensions/PythonQt_QtAll/PythonQt_QtAll.h is not installed.
I added it to the cmake headers variable but when i compile my main.cc with the init method

PythonQt_QtAll::init();

the linker throws an

Undefined symbols for architecture x86_64:
  "__ZN14PythonQt_QtAll4initEv", referenced from:
      _main in main.cc.o
ld: symbol(s) not found for architecture x86_64
clang-3.5: error: linker command failed with exit code 1 (use -v to see invocation)

Any suggestion?

Compile on Ubuntu with Qt5 installed using binary package installer

Hi,
Before getting to compile on Ubuntu, the build on Windows using MSVC2013 just work fine.
I'm trying to use the official repository of PythonQt and using Qt Creator to open project and do the build, but always getting the error -lPythonQt library not found (although I copied .so files to /usr/lib and /usr/local). After fixing around the library path in project config, it doesn't work.

When using this CMake version to generate the build project, even when I provide the full path to qmake (that comes with Qt 5.5 install), the output is still using qmake 4, hence, it uses generator 4.8 which won't work with my Qt 5.5 install.

Is there any way to get through these issues?

Any suggestion would be appreciated.
Thanks.

Problem with Paraview compling

Hi,
I'm trying to compile Paraview with loaded PythonQt plugin but it returns with error
Plugins\PythonQtPlugin\pqPluginDecorators.h(129): error C2039: 'getWidget': is not a member of 'pqRenderViewBase'

Any suggestions?

Build Against Anaconda Python?

I am trying to build PythonQt against anaconda python (2.7.x). Running the included PyGuiExample I am unable to get any Python other than the system install.

Running OS X 10.10, Qt 5.5, latest Anaconda.

I have set the python.prf as

PYTHON_CONFIG_PATH = /Users/me/anaconda/bin/python-config
QMAKE_CXXFLAGS += $$system($${PYTHON_CONFIG_PATH} --includes)
LIBS += $$system($${PYTHON_CONFIG_PATH} --libs)

Two environment variables have been set

PYTHON_PATH /Users/me/anaconda/include/python2.7
PYTHON_LIB /Users/me/anaconda/lib

The build (in QtCreator) is successful with a high number of warnings about unused parameters.

Any thoughts on getting PythonQt built against a Python installation other than the system framework?

Do not use complex typed static variables

The pythonqt.dll crashes when you try to load it dynamically on Windows. The crash happens at this point:

static void registerMetaTypeToPythonConverter(int metaTypeId, PythonQtConvertMetaTypeToPythonCB* cb) { _metaTypeToPythonConverters.insert(metaTypeId, cb); }

The static function refers to a static variable that has complex type (QHash). The static variable is not initialised.

The issue is described here:
http://stackoverflow.com/questions/5114683/loading-dll-not-initializing-static-c-classes
Basically, complex typed static variables should be avoided in dll-s.

Pull request follows. I tried to get rid of every references to complex typed static variables. The object typed (non pointer) static data members I replaced by static getters that declare the variable as pointer, assignes NULL to it, and then does a NULL check and assigns a 'new' instance at the first time.

There were many static locals declared with type QByteArray but used only as const char * later. I changed the types to 'const char *' wherever I could.

In other cases the static locals were used only as performance tweak. There, I simply removed the 'static' keyword. All of them were trivial functions, the 'static' keyword was not necessary and I doubt that it made noticeable difference in execution time.

qt4.8.6 with patched-7

Patched-7 is supposed to work with qt4 but at configure time I have:

CMake Error at CMakeLists.txt:366 (add_library):
  Cannot find source file:

    generated_cpp_48/PythonQt_QtBindings.cpp

And indeed, on branch patched-7 the folder generated_cpp_48 was removed by commit d27f8b9

@jcfr : Do you have an idea to fix this ? My project should build with a recent qt5 (OK with patched-7) and if may be with qt 4.8

I'm on debian buster with cmake 3.9.5 and gcc 7.2

QVector3D "!=" is missing

The "!=" operator is missing from the metadata for QVector3D. Unfortunately, PythonQtInstanceWrapper_richcompare does not assert when asked to call this operator - it simply returns "True" in all cases! Cue mysterious vector math bugs :)

I looked at the PythonQt generator code, but couldn't figure out why "==/eq" was working, but "!=/ne" was not.

Update plan?

Looks like (from README) latest code is based on r403 at sourceforge repo. I see they have just released a version 3.2 which seems to include up to r455.

Is there any plan to update code here to include the other sourceforge commits (r404 - r455)?

Error when enabling PythonQt_Wrap_Qtopengl on Mac 10.7.4 / XCode 4.3.3

Message when qt's opengl is enabled.  Was forced on by 'all'

[25] PythonQt-build $ make -j10
Linking CXX shared library libPythonQt.dylib
Undefined symbols for architecture x86_64:
  "_glClearDepth", referenced from:
      QGLFunctions::glClearDepthf(float) in com_trolltech_qt_opengl0.cpp.o
  "_glDepthRange", referenced from:
      QGLFunctions::glDepthRangef(float, float) in
com_trolltech_qt_opengl0.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libPythonQt.dylib] Error 1
make[1]: *** [CMakeFiles/PythonQt.dir/all] Error 2
make: *** [all] Error 2

fatal error: private/qmetaobjectbuilder_p.h: No such file or directory for ubuntu 16.04

xxx@xxx:/home/xxx/Documents/project$ cd PythonQt-build/
xxx@xxx:/home/xxx/Documents/project/PythonQt-build$ cmake /home/xxx/Documents/gitlab/LidarViewX64/build/install/lib/cmake/Qt5 ../pythonqt
-- PythonQt: Required Qt components [Core;Widgets]
-- Configuring done
-- Generating done
-- Build files have been written to: /home/raokaiyuan/Documents/project/PythonQt-build

xxx@xxx:~/Documents/project/PythonQt-build$ make
[ 2%] Generating generated_cpp_56/com_trolltech_qt_gui_builtin/moc_com_trolltech_qt_gui_builtin0.cpp
[ 5%] Generating src/moc_PythonQt.cpp
[ 7%] Generating src/moc_PythonQtStdDecorators.cpp
[ 10%] Generating generated_cpp_56/com_trolltech_qt_core_builtin/moc_com_trolltech_qt_core_builtin0.cpp
Scanning dependencies of target PythonQt
[ 13%] Building CXX object CMakeFiles/PythonQt.dir/src/PythonQtBoolResult.cpp.o
[ 15%] Building CXX object CMakeFiles/PythonQt.dir/src/PythonQtClassInfo.cpp.o
[ 18%] Building CXX object CMakeFiles/PythonQt.dir/src/PythonQtClassWrapper.cpp.o
[ 21%] Building CXX object CMakeFiles/PythonQt.dir/src/PythonQtConversion.cpp.o
[ 23%] Building CXX object CMakeFiles/PythonQt.dir/src/PythonQt.cpp.o
/home/raokaiyuan/Documents/project/pythonqt/src/PythonQt.cpp:1991:42: fatal error: private/qmetaobjectbuilder_p.h: No such file or directory
compilation terminated.
CMakeFiles/PythonQt.dir/build.make:182: recipe for target 'CMakeFiles/PythonQt.dir/src/PythonQt.cpp.o' failed
make[2]: *** [CMakeFiles/PythonQt.dir/src/PythonQt.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/PythonQt.dir/all' failed
make[1]: *** [CMakeFiles/PythonQt.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Crash in PythonQt::cleanup()

I can reproduce this using system installed Python 2.7 and Qt 4.8 on my Ubuntu 14.04 desktop and Mac laptop (using homebrew python 2.7 and qt 4.8).

I could try to put together a pure c++ example to reproduce the crash. For now, I am reproducing the crash by launching the python console widget provided by ctkPythonConsole.cpp and entering these lines:

from PythonQt import QtCore
x = QtCore.QFile.ReadOnly

The crash occurs when the application exits. The crash is not specific to the QFile.ReadOnly flag. Referencing any flag will lead to a crash later. It seems like this crash would have been encountered by other people, so maybe the issue is only on my end? Same crash in Debug or Release mode. My PythonQt is configured with only these enabled:

PythonQt_Wrap_Qtcore
PythonQt_Wrap_Qtgui

Here is gdb backtrace:
#0 0x00007ffff5ce9721 in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#1 0x00007ffff506a2a3 in PythonQtObjectPtr::~PythonQtObjectPtr (this=0xbcebd0, __in_chrg=)

at /home/pat/source/drc/drc/software/externals/pod-build/src/PythonQt/src/PythonQtObjectPtr.cpp:52

#2 0x00007ffff4fa1110 in PythonQtMemberInfo::~PythonQtMemberInfo (this=0xbcebb8, __in_chrg=)

at /home/pat/source/drc/drc/software/externals/pod-build/src/PythonQt/src/PythonQtClassInfo.h:45

#3 0x00007ffff4fa51cd in QHashNode<QByteArray, PythonQtMemberInfo>::~QHashNode (this=0xbceba0, __in_chrg=) at /usr/include/qt4/QtCore/qhash.h:216
#4 0x00007ffff4fa5224 in QHash<QByteArray, PythonQtMemberInfo>::deleteNode2 (node=0xbceba0) at /usr/include/qt4/QtCore/qhash.h:521
#5 0x00007ffff6ab0609 in QHashData::free_helper(void ()(QHashData::Node)) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#6 0x00007ffff4fa3330 in QHash<QByteArray, PythonQtMemberInfo>::freeData (this=0x84d2a0, x=0xbcb2d0) at /usr/include/qt4/QtCore/qhash.h:570
#7 0x00007ffff4fa1628 in QHash<QByteArray, PythonQtMemberInfo>::~QHash (this=0x84d2a0, __in_chrg=) at /usr/include/qt4/QtCore/qhash.h:283
#8 0x00007ffff4f9b25e in PythonQtClassInfo::~PythonQtClassInfo (this=0x84d2a0, __in_chrg=)

at /home/pat/source/drc/drc/software/externals/pod-build/src/PythonQt/src/PythonQtClassInfo.cpp:70

#9 0x00007ffff4fba118 in PythonQtPrivate::~PythonQtPrivate (this=0x87f320, __in_chrg=)

at /home/pat/source/drc/drc/software/externals/pod-build/src/PythonQt/src/PythonQt.cpp:333

#10 0x00007ffff4fba3a2 in PythonQtPrivate::~PythonQtPrivate (this=0x87f320, __in_chrg=)

at /home/pat/source/drc/drc/software/externals/pod-build/src/PythonQt/src/PythonQt.cpp:341

#11 0x00007ffff4fba005 in PythonQt::~PythonQt (this=0x827280, __in_chrg=) at /home/pat/source/drc/drc/software/externals/pod-build/src/PythonQt/src/PythonQt.cpp:322
#12 0x00007ffff4fba06e in PythonQt::~PythonQt (this=0x827280, __in_chrg=) at /home/pat/source/drc/drc/software/externals/pod-build/src/PythonQt/src/PythonQt.cpp:324
#13 0x00007ffff4fb9ab5 in PythonQt::cleanup () at /home/pat/source/drc/drc/software/externals/pod-build/src/PythonQt/src/PythonQt.cpp:249
#14 0x00007ffff7bce057 in ctkAbstractPythonManager::~ctkAbstractPythonManager (this=0x7fffffffd630, __in_chrg=)

at /home/pat/source/drc/drc/software/externals/pod-build/src/ctkPythonConsole/src/ctkAbstractPythonManager.cpp:90

#15 0x000000000040129a in main (argc=1, argv=0x7fffffffd778) at /home/pat/source/drc/drc/software/externals/pod-build/src/ctkPythonConsole/src/main.cpp:37

matplotlib.pyplot.ion() does not work very well

When using following code in PythonQt, the plotting window has no interaction, for example, zooming, save figures:

import matplotlib.pyplot as plt
plt.ion()
plt.plot([1,2,3], [1,2,1])
plt.draw()

I even could not close the plotting window with clicking the 'close button' on the title bar.

State of cmake files

Not an issue, but a question:

I would like to re-add cmake support to (original) PythonQt (additionally to qmake support that seems still to be needed by some users). I have noticed that you already have done this, and that you also support current Qt 5 versions (despite the note in the top-level CMakeLists.txt). Some earlier version of your changes had been integrated some time in the past, and been removed again a few years ago.

My questions are:

  • what is the state here - is it ready to use (I guess patched-10 is where to look)?
  • do you want to make a PR for this, or should I just copy your files (and adapt if needed) and make a PR on my own?

Thanks

How to deal with multiple py files?

There are two py files is defined in the resources. The 2th file call the 1th file. How to deal with it.

If codes are as followings, No correct result meet.

// evaluate the python script which is defined in the resources
mainModule.evalFile(":writefile.py");
mainModule.evalFile(":GettingStarted.py");

fatal error: 'private/qmetaobjectbuilder_p.h' on Mac

Hi,

I'm trying to build on macOS High Sierra, 10.13, and running into an issue with finding a Qt5Core header.

PythonQt.cpp:1951:10: fatal error: 'private/qmetaobjectbuilder_p.h' file not found

I've tried both Qt5.4.2 and Qt5.6 with branches patched-7 and patched-8 but none of them seem to work.

There was a similar issue raised for windows previously: #62

The solution seems a little hacky. Are there plans to try and include the extra Qt5Core dir within cmake for PythonQt or will I need to do something similar?

Thanks!

'number' operators are set up incorrectly

Hi!

Thanks to everyone involved in creating PythonQt, being able to glue Qt/Python/OGL together is an absolute godsend for productivity :)

Anyway, I found an issue and thankfully was able to diagnose the cause. For all 'number' type objects wrapped by PythonQt (e.g QVector3D), the standard operators for '+', '-' an d'' are set up incorrectly - they are set to the 'in-place' versions '+=', '-=' and '=' instead, so for example:

print str( vecA + vecB )

...will actually execute this:

print str( vecA += vecB )

...so the value of vecA will unexpectedly change!

The erroneous code is in initializeSlots() in PythonQtClassWrapper.cpp.

The fix is trivial (just replace an instance of 'nb_add' with 'nb_inplace_add', etc), but I'm not sure what the rules/procedures are for updating the PythonQt code.

FYI I am using the latest code, downloaded from here:

http://sourceforge.net/projects/pythonqt/files/pythonqt/PythonQt-2.1/PythonQt2.1_Qt4.6.2.zip/download

Hope this is helpful!

iestyn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.