Commit e2db3ecf authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

bezier curve widget: adjust height to monitor resolution

parent a82db684
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <QKeyEvent> #include <QKeyEvent>
#include <QMouseEvent> #include <QMouseEvent>
#include <QResizeEvent> #include <QResizeEvent>
#include <QFontInfo>
template <typename Curve_t> template <typename Curve_t>
AbstractCurveWidget<Curve_t>::AbstractCurveWidget(QWidget *parent) AbstractCurveWidget<Curve_t>::AbstractCurveWidget(QWidget *parent)
...@@ -30,7 +31,7 @@ AbstractCurveWidget<Curve_t>::AbstractCurveWidget(QWidget *parent) ...@@ -30,7 +31,7 @@ AbstractCurveWidget<Curve_t>::AbstractCurveWidget(QWidget *parent)
setMouseTracking(true); setMouseTracking(true);
setAutoFillBackground(false); setAutoFillBackground(false);
setAttribute(Qt::WA_OpaquePaintEvent); setAttribute(Qt::WA_OpaquePaintEvent);
setMinimumSize(150, 150); setMinimumSize(150, QFontInfo(font()).pixelSize() * 12);
QSizePolicy sp(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); QSizePolicy sp(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
sp.setHeightForWidth(true); // force widget to have a height dependent on width; sp.setHeightForWidth(true); // force widget to have a height dependent on width;
setSizePolicy(sp); setSizePolicy(sp);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment