Comments (6)
Hi, @dakhouya , thanks for opening the bug and posting a solution. I don't plan on supporting multiple qt versions - in fact I am considering switching to something as portable as qt, such as https://github.com/ocornut/imgui - but since this fix is minimal, a pull request is more than welcome :D
from openimagedebugger.
Will do then!
from openimagedebugger.
@dakhouya yeah, it makes sense. but thanks a lot anyways :D It's just that I have only so much bandwidth and lately I am the only one maintaining the project, so I have to impose some limitations. The sad part is that I don't have a strong background in CG as @csantosbh has, so I prefer to improve code quality and developer experience :) if you have any feature you would like to contribute feel free to chime in
from openimagedebugger.
If the support for old version of Qt is wanted, something like this could do the job.
diff --git a/src/ui/gl_text_renderer.cpp b/src/ui/gl_text_renderer.cpp
index 89362bf..d682009 100644
--- a/src/ui/gl_text_renderer.cpp
+++ b/src/ui/gl_text_renderer.cpp
@@ -165,7 +165,11 @@ void GLTextRenderer::generate_glyphs_texture()
const int cropped_bitmap_height = real_ascent - real_descent;
for (p = reinterpret_cast<const unsigned char*>(text); *p; p++) {
- int advance_x = g.horizontalAdvance(*p);
+ #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
+ int advance_x = g.horizontalAdvance(*p);
+ #else
+ int advance_x = g.width(*p);
+ #endif
int bitmap_height = g.height();
text_texture_advances[*p][0] = advance_x;
@@ -193,7 +197,11 @@ void GLTextRenderer::generate_glyphs_texture()
int x = 0;
for (p = reinterpret_cast<const unsigned char*>(text); *p; p++) {
- int advance_x = g.horizontalAdvance(*p);
+ #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
+ int advance_x = g.horizontalAdvance(*p);
+ #else
+ int advance_x = g.width(*p);
+ #endif
text_texture_offsets[*p][0] = x + border_size;
text_texture_offsets[*p][1] = real_descent + border_size;
If needed I don't mind opening a PR.
from openimagedebugger.
@brunoalr with the latest changes which required Qt 5.12.8+ in cmake, I think this issue can be close.
from openimagedebugger.
I'm not sure if I have much time yet, but lets see!
Thanks for your work on this project btw!
from openimagedebugger.
Related Issues (20)
- Remove qmake support in September 2021
- Eclipse IDE and embedded image processing projects debuging (MCU) HOT 1
- create a new Qt Widgets Application instead of the current plug-in HOT 2
- cannot debug and continuing report waitforbyteswirtten HOT 1
- Add observable symbols in (this) class.
- how to build on HOT 1
- Add support to VSCode WSL remote HOT 10
- Cannot view Eigen::MatrixXf when using CodeLLDB HOT 7
- Late initialization of image structs HOT 3
- An error occurred while compiling HOT 6
- Windows version crushes with error message: The procedure entry point ?edit@QAbs......... HOT 1
- AttributeError: 'NoneType' object has no attribute 'GetSelectedTarget' HOT 4
- Eigen matrices are not working, python crashes in gdb (solution is a one liner) HOT 4
- Invalid plotting of OpenCV matrices HOT 4
- OpenCV matrix inside `std::vector` is not displayed in LLDB HOT 3
- Mac M1 compile and execute problem HOT 1
- INFO: Could not activate hooks for any IDEs Stop hook #1 added. HOT 1
- Symbols for stb style images HOT 6
- Missing proper documentation for gdbbridge -> get_casted_pointer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openimagedebugger.