Skip to content

Commit

Permalink
fully support Qt6 on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
LiangliangNan committed Dec 20, 2024
1 parent c0202fe commit b0e8a08
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions code/PolyFit/paint_canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,7 @@ void PaintCanvas::draw() {
return;
}

if (show_coord_sys_)
drawCornerAxis();

bool interacting = camera()->frame()->isManipulated();

if (point_set_ && show_input_ && point_set_render_)
point_set_render_->draw(point_set_);

Expand All @@ -233,7 +229,14 @@ void PaintCanvas::draw() {
mesh_render_->draw(optimized_mesh_, interacting);
}

const static QFont font("Times", 12/*, QFont::Bold*/); // "Times", "Helvetica", "Bradley Hand ITC"
if (show_coord_sys_)
drawCornerAxis();

// Liangliang: Qt's renderText() changes some OpenGL states.
// Save OpenGL state
glPushAttrib(GL_ALL_ATTRIB_BITS);

const static QFont font("Times", 12/*, QFont::Bold*/); // "Times", "Helvetica", "Bradley Hand ITC"
if (show_hint_text_) {
if (!hint_text_.isEmpty()) {
glColor3f(0, 0, 0.7f);
Expand All @@ -254,10 +257,8 @@ void PaintCanvas::draw() {
drawText(30, 190, " - Zoom: wheel", font);
}

// Liangliang: It seems the renderText() func disables multi-sample and depth test
// Is this a bug in Qt ?
glEnable(GL_MULTISAMPLE);
glEnable(GL_DEPTH_TEST);
// Restore GL state
glPopAttrib();
}


Expand Down

0 comments on commit b0e8a08

Please sign in to comment.