I try to get started with Qt pyside with QML and JS using Qt-Creator IDE. Since the documentation remains vague about debugging capabilities of Qt-Creator I would like to have confirmed, that my debugging experience is expected behaviour.
in .py breakpoints work, but print("some string") doesn't print to application output.
in .qml breakpoint's don't work, neither does console.debug("some string") print anything
in .js breakpoint's don't work, neither does console.debug("some string") print
Is this: Qt Creator does not support mixed mode debugging ? Is PyCharm more suitable?
System: Python 3.8.2,Pyside2 (installed via pip),Qt Creator 4.13.3 Based on Qt 5.15.2
yes, it need mixed mode debug.I use PyCharm and Qt Creator.
You can use PyCharm to show the python log and debug .py , use qt creator to show the js log and debug .qml at the sometime.
First you need Enable QML , see
Next run .py on PyCharm and connect qml port on Qt Creator, see
Final , you can debug .py and .qml
My System: Python 3.9.7,Pyside6,Qt Creator 7.0.1 Based on Qt 6.2.3
Related
I want to be able to create my own custom widgets in Qt Designer using the pyqt5 plugin on my Mac!
On my windows system this is easy. I have/install pyqt5-tools, this contains pyqt5.dll and I copy this into the Qt Designers plugin directory (these packages were all installed via winPython).
I set PYQTDESIGNERPATH=.
In my current directory I have ledplugin.py and ledwidget.py
I start Qt Designer and I have my custom widget to drag and drop
( this tutorial was taken from https://www.ics.com/blog/integrating-python-based-custom-widget-qt-designer )
On my Mac, I can't figure out what the equivalent .dylib of pyqt5.dll is? What is it? Where do I get it? How do I build it?
I try: brew install Qt Creator, that doesn't have the pyqt plugin. I try: brew install pyqt5, that creates: libpyqt5qmlplugin.dylib. I copy that into the Qt Designer plugin dir and the plugin loads, but it doesn't seem to do anything with my .py plugin/widget files.
How do I get this working on a Mac? What is the actual .dylib plugin I'm looking for? I can't find anything googling around.
Thanks for any help
As my comment explained: the Qt designer plugin can be built via the reference link (SIP/PyQt5 via RiverBank and Qt src via Qt).
Make sure your Qt versions match, although Qt docs do say plugins of lower versions should work with Designers on higher versions, but I'm sure there's a limit.
Build inside a python venv, as suggested.
You'll need xtool dev pkg for building.
Everything built really easy for me.
This will place your pyqt5.dylib plugin right in your Qt/clang_64/plugins/designer folder (it will also build it in pyqt5 make folder)
At this point I expected things to work. The plugin shows that it loads fine inside Designer.
Some extra notes:
running from command line can help with debugging: Qt/clang_64/bin/Designer.app > show package > /MacOS/Designer (drag this to a terminal to execute from command line)
set an env variable (>>export QT_DEBUG_PLUGINS=1) will give debug info and show lots of stuff including that pyqt5.dylib loads fine
widget plugins are two files: widget.py and the widgetplugin.py file that exposes the widget to designer. This plugin file MUST end with "plugin.py"
widgetplugin.py files can reside in a number of places:
in /[Designer App]/plugins/designer/python/
in ~/user dir/.designer/plugins/python/
in a directory of you choosing using env var PYQTDESIGNERPATH
However, at this point still nothing showed in Designer and I had no errors to go by. Since I just built pyqt5.dylib, I figured I'd simply put a bunch of print statements in it, re-make it and debug to figure out why the pyqt5 plugin loaded fine, but my custom widgets were nowhere to be found...
first issue was trouble loading a python environment:
for this issue, I simply copied my (I use brew) /usr/local/Cellar/python/3.7.2/Frameworks/Python.framework to Qt/clang_64/lib (I'm sure there's a proper PATH/PYTHONPATH you can set for this, I'll figure that out later)
after that came, missing PyQt5.sip module
for this, I installed (pip install) pyqt5-sip and then put in in my PYTHONPATH
After that, everything finally worked and I could see my custom plugins inside Qt Designer.
I'm testing my OpenMP code in Qt creator using intel compiler icc. When I run it in Qt creator, there's always an error libiomp5.so: cannot open shared object file: No such file or directory.
Then I checked the LD_LIBRARY_PATH, everything was fine. I also used ldd command to see the linked libraries.
libiomp5.so => /opt/intel/compilers_and_libraries_2016.2.181/linux/compiler/lib/intel64/libiomp5.so (0x00007fadada3a000)
As shown, the program was actually linked to that library, and I could even run it well in terminal directly. It was so strange since I build the whole project using Qt creator.
Solved this problem by myself finally. Just add the path of the library into ld.so.conf. Then run ldconfig to update the cache.
On ubuntu 12.10 I've been using Qt Creator for a while. After updating to ubuntu 13.04 I've encountered the problem, that I can no longer see my src-files in the project editor. I only see the .pro and .pri file.
I've checked that the build path is correct and re-installed QT 5. As well, I can compile and run the project as usual, but the src-files just won't appear in the editor. I used to run the project with QT4 (qmake-qt4 makefile.pro), might this interfere?
I found a workaround by adding the required source and header files manually via right-click on the project. But this is rather inconvenient as the source files are spread across several folders. I still couldn't figure out why QT creator does not add them automatically after I've upgraded to ubuntu 13.04 and QT 5 (downgrade to QT 2.7 was in vain, too).
Before marking this as a duplicate please read the full thread
OS - Windows XP
Primary Language - Java
Scripting Language - Jython
IDE - Intellij Idea
Python Plugin - Pycharm
I am trying to remote debug my application which runs in Java and uses Jython as a scripting language. I followed the steps mentioned in the below link
http://www.jetbrains.com/pycharm/webhelp/run-debug-configuration-python-remote-debug.html#commentsSection
I can start the debugger
When my application starts up, it is able to connect to the debugger
However I am getting below critical WARNING -
pydev debugger: CRITICAL WARNING: This version of python seems to be incorrectly compiled (internal generated filenames are not absolute)
pydev debugger: The debugger may still function, but it will work slower and may miss breakpoints
pydev debugger: Related bug: http://bugs.python.org/issue1666807
The problem
Debugger doesn't stop at the break points.
I have searched lot of forums for the possible solutions -
delete all *.pyc files
reinstall python version
extract python lib folder to local file and add to sys.path
None of these work for me.
I'm having some trouble installing and configuring qt on my vista laptop.
I'm trying to setup a development environment on my laptop where I compile from the command line, because that's how the environment is setup on my university's linux machines, so I don't want to tie myself to some IDE .. (plus, real programmers use the command line!)
I haven't used the command line before for C++ development, it was all MSVC, so now I'm having a bit of trouble.
I'm still using MSVC, but from the command line. I practically have no idea what's going on, I just know that I have to run:
qmake
nmake
to compile my code!
I downloaded the opensource version of qt, and did the configuration, and tried a simple qt application (from a tutorial) and it worked, it compiled and executed pretty much as expected.
Now, when I decided to run another project that uses opengl, I got the following error:
fatal error C1083: Cannot open include file: 'qgl.h': No such file
or directory
I'm not sure where does the compiler look for header files, and I didn't copy any header files anywhere, I assume that configure.exe worked its magic somehow and added the include directory to one or more enviroment variables or to some registery location or whatever other peculier places that the MSVC compiler searches for to find include directories.
However, what I did was search my C:\qt\include\ folder to make sure that qgl.h exists, and sure enough there it was. so why can't nmake find it?
I think the actual solution to this is in your pro file:
QT += opengl
If you want to stay with the command line anyway (plus use it on a linux box later / parallel) I'd suggest at least trying out the MinGW version of Qt. I'm using it regularly, and besides of the non-existance of a GUI it works pretty well. Using MinGW also has the advantage that you can simply download and install the MinGW edition of Qt and don't need to reconfigure or recompile anything.
Also, trying out QtCreator might be interesting. It's still beta and requires the beta Qt 4.5 but it's a nice small IDE that integrates nicely with gcc.
Two potential solutions (they solved issues at my workplace)
Do you have qt include and bin folders in the PATH variable? I think the doc says only one of these is needed, but one of the students had Vista and putting the other in the PATH variable solved a "Cannot open include file" problem.
If you're using MSVC did you run configure and nmake from the Visual Studio command prompt? We had problems when using the bare windows Command Prompt because the VS one adds a lot of temporary environment variables to the configure process.
Good luck
Install the complete Qt SDK for Windows which includes Qt 4.6 SDK, Qt Creator 1.3, and MinGW.
It will also install "Qt Command Prompt" launcher that you can use to build Qt apps from the command line.
I'm sure you're more familiar with MSVC than MinGW, as I do too (I've been using MSVC 6.0 to MSVC# 2008 for developing .NET apps).
But try MinGW with Qt and I think it's better for long term. I do some C++ development on Linux too so getting familiar with MinGW will be beneficial for you in cross-platform C++/Qt development.
For more info, see Installation of Qt 4.6 SDK for Windows.
Qmake generates Makefile from *.pro file located in current directory. It has qt path compiled in. Type "qmake -v" to see it. You can't move qt's dir after compiling it. If You haven't moved it, first maybe try to install Qt following instruction from INSTALL file. Good luck.
The opensource version of Qt does not provide profiles (mkspecs in qt terms) so qmake can generate nmake (msvc) compatible makefiles.
You have to use mingw/gcc.