I need fast plotting widget in Qt, but I don't want to use anything prepared.
I have some float data, for example QVector< float > data, and I need to paint it on widget. But I don't want use paintEvent and QPainter directly on it. Is there any chance to convert this data for bitmap (pixmap?) and just load it directly to show on widget? How I can create bitmap from float numbers?
Fast plotting with pixmap or bitmap in Qt
3.5k views Asked by Tatarinho At
1
There are 1 answers
Related Questions in QT
- qt c++ fonction converting adress to coordinates (longitude, latitude)
- Qml table and chart using python
- Qt: running callback in the main thread from the worker thread
- i have installed qt version 6.0.3 and this error QMYSQL driver not loaded displaying again and again
- Frameless Qt + WinAPI maximized window size is bigger than the availableGeometry()
- new window with c++ qt
- How to get scaling from transformation matrix
- How to build just Qt core libraries from Qt sources
- doxyqml not documenting qml files properly
- Incorrect assignment from a QStringList to a char * array
- How to make QT Chart size larger than widget size?
- Queued async operations with QtConcurrent interfere QImage from freed
- Questions about qt5 dynamic link library
- how to document QML files inside C++ project?
- How do I keep my screen contents centered and also have a scrollbar in QT?
Related Questions in PLOT
- R is ignoring xaxp while plotting data.table
- From Python to R: how can I plot a vector with 100 regression lines within a ggplot?
- 'plotAtlas' function in Morpho package
- Trying to plot two polygons on the same cartesian grid with a different color for each polygon
- Strange horizontal lines when transforming base-map shapefile?
- Adding white space around plot in Matplotlib
- Plot function issue - adding a line
- Seaborn boxplot color outliers by hue variable using seaborn =< 0.12.2
- how to add multiple plot in alternating plotly html file in python
- Manually set values shown in legend for continuous variable of seaborn/matplotlib scatterplot
- Set the color of the line with the same color of the marker
- Do not want scientific notation on plot axis again
- How to prevent Pandas from plotting index as Period?
- Change size of terminal_panel = node_barplot in ctree
- Excel VBA Macro Resizing the Plot Area
Related Questions in BITMAP
- Finding a specific colour within a bitmap range - VB.net 2022
- Thermal Printing using TCP
- Applying KMeans clustering from OpenCV cannot return a Bitmap with alpha channel
- Is there a way to automatically export OpenOffice/LibreOffice drawings to bitmaps, with options?
- Jetpack Compose: "java.lang.IllegalStateException: Software rendering doesn't support hardware bitmaps"
- A bitmap gets loaded, another bitmap doesn't. LoadImage() from Windows.h
- [Solved]How can I convert Cameraview.GetSnapShot() to Bitmap in a Maui mobile App?
- How to convert a text drawn using BitmapFont in LibGDX in an array of Sprites/TextureMapObjects?
- How to increase the size of a picture without using bitmap?
- C# 16-bit grayscale Bitmap array to video
- C# WinForms drawing a Bitmap on a PictureBox draws too many times
- Where is the problem in my code for generating a bitmap from a byte array?
- Android ImageView not displaying correctly
- How to get zoomed Bitmap from original bitmap using RectF Bouunds
- Convert black and white Bitmap to Single-Channel JPEG in Android
Related Questions in REPAINT
- wxpython alpha colors overwrite previous drawing
- HTML/JS: How to prevent a render before script execution?
- Pine script version change and stop reprint and repaint issue
- Java Swing JPanel rapaint doesn't call paintcomponent
- How to update content of child window (c++) even if window size does not change
- eliminate repainting in indicator that plots price level lines on lower timeframe charts when using daily ATR to calculate price levels drawn
- {SOLVED} JFrame's repaint() functions doesn't seem to work?
- Really weird repainting issue
- Repaint issue on descaling with specific css rull : will-change:transform
- repaint() method inside ActionListener and paintComponent method
- Creating and using an invisible, topmost, non-interactable window for "screen-drawing"
- How can I call the repaint() method with a keyboard event in java?
- Possible Repainting indicator alert, but used every anti-repaint measure (Pine Script)
- When I resize my App the Components get paints into the one who where already paint and it create a mess
- Can I tell the JPanel paintComponent(Graphics g) function to only repaint the object I'm editing?
Related Questions in PIXMAP
- Referecning Pixmap from static context causing UnsatisfiedLinkError- libGDX
- Got wrong pictures while saving ZPixmap to png
- For xlib, how to create a child window with the background pixel or pixmap of its parent window?
- gnuplot: How to display transparent png with pixmap
- Setting individual pixel of a pixmap. LibGdx,
- PyQt5 display image of pixel array
- Why replacing widgets in PyQt6 layout only deletes item when in thread, while working properly outside thread?
- How to find the bounding rectangle(s) of a given color, within a pixmap in Libgdx or Java
- How to draw a line in LibGDX without ShapeRenderer
- Python 3.10 pyqt5 Label won't change 'setPixmap' when needed
- How do I display a PDF page in pygame without having to save a file in a folder in between?
- What is the correct way to use a .xbm image in source code?
- PyQt label with pixmap not resizing correctly
- Drawing a graphic with a transparent color using xlib
- How to move a pixel column in PyQt5 Pixmap?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
If painting is overhead, you can move it to another thread, this way it will not lock up the event loop of your application, and the result will be updated when it is done.
Since you want arbitrary plots, there is really no magic way to "convert data to bitmap", you have to use
QPainterto draw your stuff.Here is a quick example how to use an async plotter object:
The plotter is created with its size, range and data parameters, I used a
QRectFfor the range, basically using the x/width and y/height as horizontal and vertical range. The plotter is a very naive implementation for the sake of example, and uses themap()method to "normalize" the data points to the area of the image that is being drawn onto in a linear fashion. I also added a timer to see how long it takes to plot all points.This is the example widget which is used to create the plot, populate the data and show the result:
For my example I populate the data with 200 000 values in the range 0-1. Then create the plotter with the size of the widget, the range 0-1 for X and Y, create the thread and move the plotter to it, do the necessary connections and start the thread. Upon start up, the thread will call the
plot()slot, which will emit the plot result to the widget'supdatePlot()slot. When the result is sent the plotter will quit the thread event loop, which will delete the plotter object and the thread so they don't leak.As for how fast this is, my i7 desktop plots the 200 000 points in 8 milliseconds, so it is not slow by any means.