QtOpenGL | some Qt OpenGL Demo | Build Tool library
kandi X-RAY | QtOpenGL Summary
kandi X-RAY | QtOpenGL Summary
some Qt OpenGL Demo
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of QtOpenGL
QtOpenGL Key Features
QtOpenGL Examples and Code Snippets
Community Discussions
Trending Discussions on QtOpenGL
QUESTION
I am trying to build an app from a python file (Mac OS) using the py2app extension. I have a folder with the python file and the "setup.py" file.
- I first tested the app by running
python setup.py py2app -A
in the terminal and the dist and build folder are successfully created and the app works when launched. - Now when I try to build it non-locally by running the command
python setup.py py2app
in the terminal, there are various "WARNING: ImportERROR" messages while building and finally aerror: [Errno 2] No such file or directory: '/opt/anaconda3/lib/python3.8/site-packages/rtree/lib'
error.
How can I fix this? I've tried to delete anaconda fully as I don't use it but it seems to still want to run through it. Additionally, I have tried to run the build command using a virtual environment but I end up having even more import errors.
*I Left out a lot of the "skipping" and "warning" lines using "..." for space
ANSWER
Answered 2022-Mar-13 at 16:13The error error: [Errno 2] No such file or directory: '/opt/anaconda3/lib/python3.8/site-packages/rtree/lib'
was caused by py2app trying to build the program bundle using a non-existent interpreter. This means that even if you try to uninstall a manager like Anaconda, it still has option logs somewhere on your mac.
The fix:
- Open the terminal and type the command
type -a python
.
- You will see similar lines
QUESTION
after several failed attempts to create a QOpenGLWidget.I tried to run the QT example code https://code.qt.io/cgit/qt/qtbase.git/tree/examples/opengl/2dpainting?h=5.15 But that does not work too. I get the same vtable error as in the previous attempts. Here is the complete error code.
I already reinstalled QT and added
...ANSWER
Answered 2021-Dec-25 at 16:22If you use Qt6, then you need to link against openglwidgets
.
QUESTION
I am trying to use PyQt5 to show two widgets, the first one is a plot of sin, cos and tan function. I am using the pyqtgraph
and used the code that was found in the answer of this question. I am also using another widget that draws a cube using PyOpenGL, by taking the example found in this link. I am trying to show this two widgets in one main widget, which is the main window. My approach is the following
- Take a main widget.
- In the main widget, use a QVBoxLayout()
- In the QVBoxLayout, at two widgets mentioned above
But when I am running the code, only the plot that is using the pyqtgraph
is shown but not the cube that is drawn using PyOpenGL
. After a little bit debugging, I was able to find out that the height of the cube widget is setting to 0 by default. I am not sure why this is hapenning. I tried calling glWidget.resize(640,480)
. But it didn't work. I am new on working with PyQt and PyOpenGL. I think I am missing some details that will allow the height of the glWidget
to be greater than 0, if my assumption is correct. Also I am not sure if this is actually possible to do. My current code is given below, it is a little bit messy.
ANSWER
Answered 2021-Dec-15 at 21:30It seems that QGLWidget (which, by the way, is deprecated, and QOpenGLWidget should be used instead) doesn't implement sizeHint()
, so it returns an invalid size (QSize(-1, -1)
), which means that the widget can be possibly resized to a 0 width and/or height.
Since the plot widget has an expanding size policy (and dynamically reimplements sizeHint()
) the result is that the gl widget is completely hidden, having 0 height.
A possible solution is to add the widgets with a proper stretch
argument to the layout.
If you want both widgets to have the same height, you can do the following:
QUESTION
I am aware it is possible to install PySide2 on Raspbian using the following command:
...ANSWER
Answered 2021-Nov-15 at 18:21So I finally found the solution myself. From what I understand, the reason you cannot find QtWebEngine in the Raspberry Pi OS repositories, is that the Pi OS is made to run on all Raspberry Pi's, including Pi 1 and Pi 2, which have an ARMv6 and ARMv7 CPU architecture respectively. The WebEngine module however is platform dependend and not tested, compiled and distributed for ARMv6/7 anymore, so they won't release it in the repositories for Raspberry Pi OS. Luckily though, the Raspberry Pi 3 that I use has ARMv8, so it is possible to install QtWebEngine from Debian repositories, which offer QtWebEngine for exactly that architecture. Here is how:
Open your sources.list
file
QUESTION
While the original "Textures" example [2] that comes with the installation of PySide2
/PySide6
works fine with PySide2
, when trying to run the same/common example (which also comes) with PySide6
, fails, it throws an error that makes it imposible to run:
ANSWER
Answered 2021-Aug-28 at 20:12The things I eventually had to do were slightly more than I first thought & expected and so I decided to share the whole now-fixed example, with you:
The steps I had to take:- First I found out in the QT's Documentaion that the content of the
QGLWidget
module had been replaced with a new module calledQtOpenGLWidgets
and that many of theQMouseEvent
's functions had been deprecated. - Then that the equivalent
QGLWidget
'supdateGL()
function for theQtOpenGlWidgets
was theupdate()
2. QGLWidget
's functionbindTexture()
had to be replaced withQtOpenGL.QOpenGLTexture()
.QGLWidget
'sqglClearColor()
withglClearColor()
.- and make some changes on the original example .
Redistributions of source code must retain the above copyright notice...
QUESTION
My GUI code compiles fine but when I click on a button which does some computation, I get the following error :
...ANSWER
Answered 2021-Jul-27 at 11:17You showed nm
output for /usr/local/lib64/ libclFFT.so yet ldd says it found /lib/x86_64-linux-gnu/ libclFFT.so.2.
Set the LD_LIBRARY_PATH
environment variable to /usr/local/lib64
when you run main
to make sure it looks there first. Alternatively, add it to your /etc/ld.so.conf.d
tree (and re-run ldconfig
).
QUESTION
I was wondering if anyone could help me with this problem that has been plaguing me.
I am currently using Qt Creator with verion 5.11.3 Qt on Ubuntu to build a project. Every time I try to build I get the error "gl.h: No such file or directory".
The error occurs next to the line in my code that says "#include
I have ran the following code as well and it did not change the outcome
...ANSWER
Answered 2021-Jul-26 at 18:58Install the OpenGL dev support:
QUESTION
I have a widget containing two buttons that can be (drag and drop) swapped using the mouse middle button. I am trying to restrain the mouse cursor from leaving the QWidget area when dragging and dropping a Qpushbutton... I am using dragMoveEvent() which offsets the cursor every time it crosses the border of the widget. It works when you move the mouse slowly but fast movements will make the cursor leave the area. What is the best way to make this happen? Thanks.
PS: Go to the Drag and Drop area for reference
...ANSWER
Answered 2021-Jul-09 at 02:17This answer is very limited to the specific question (prevent the user to move the mouse outside the boundaries of the given widget). Unfortunately, it's not a complete solution due to many conceptual problems in the given code:
- both drag and drop events should always be managed by the widget that will actually handle them (in this case,
nodeBoardWidget
), not their parent; - getting the layout index of an item should always consider the item geometry (using a fixed size is discouraged, since widget sizes depend on lots of aspects) and the fact that an item could not be a widget (nested layouts are still layout items, so
layout.itemAt().widget()
could returnNone
); - "swapping" items based on item indexes doesn't always keep the item index, as the resulting indexes could be unreliable (especially for grid layouts);
The important aspect to keep in mind is that trying to move the mouse by a small and fixed amount to "fix" its position is wrong, because mouse events are not continuous: if the mouse is moved very fast from x=0
to x=100
you don't get all values between 0 and 100, but only a small fraction of the intermediate positions.
For the same reason, trying to "fix" the position just by a fixed amount of pixels is wrong, since the offset can be variable depending on the mouse speed.
The above results in dragMoveEvent
not being called if the mouse moves too fast outside the parent boundaries. While in your specific case it "works", it's only because you implemented the function in the parent (which, as said, is not the suggested approach, and this is a clear example of that reason). If the mouse position has to be "contained", the dragLeaveEvent
must be implemented instead.
QUESTION
Im writing gcode sender. I want visualize path of machine work by lines (and separate G00 move lines by other color). To render element I used VBO and its works fine, but I dont know how to set individual colors for edges. I tried "mark" a vertex with G00 move in a separate list of rgb colors (as you can easy guess, its doesnt work propertly). All solutions found on the internet dont work with my code. Im really newbie in OpenGL and Im run out of ideas. Maybe someone can show me a solution that I dont see. For help I really thanks.
My code that extracts points from the buffer and establish edges:
...ANSWER
Answered 2021-Jul-14 at 14:25The last parameter of glVertexPointer
and glColorPointer
is not the buffer object, but an offset in to the buffer objects data store.
When you call glVertexPointer
or glColorPointer
, the buffer currently bound to the target GL_ARRAY_BUFFER
is associated to the fixed function attribute. You need to bind the proper buffer before calling glVertexPointer
or glColorPointer
:
QUESTION
I am using Qt 5.15.2 and Win10 64-bit
I have just downloaded the GLFW source package from the original site, not the pre-compiled binaries. I do not know how to compile it with Qt. Then I would like to use it in Qt.
I know that there are pre-compiled binaries but those can use only in Visual Studio.
I know that there is an integrated QtOpenGL to Qt but I would like to use the "original" OpenGL.
Edit:
I downloaded the 64-bit GLFW package.
The files location C:/LIBS/glfw
, folder contain the following files: glfw3.dll, glfw3dll.a, libglfw3.a, glfw3.h
.pro file
...ANSWER
Answered 2021-Apr-14 at 17:35You don't have to compile the GLFW source package. The precompiled binary package contains binaries for both Visual Studio and MinGW.
You have to link the OpenGL binary, so your LIBS
line in the .pro
file should be:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install QtOpenGL
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page