This commit is contained in:
Matthias Koefferlein 2021-11-25 20:44:39 +01:00
parent 2ee4d5414e
commit 39aa5cb805
4 changed files with 11 additions and 8 deletions

View File

@ -115,9 +115,7 @@ D25View::menu_activated (const std::string &symbol)
static QString scale_factor_to_string (double f)
{
QString s;
s.sprintf ("%.3g", f);
return s;
return QString (QString::fromUtf8 ("%.3g").arg (f));
}
void

View File

@ -244,8 +244,13 @@ D25ViewWidget::wheelEvent (QWheelEvent *event)
return;
}
#if QT_VERSION >= 0x60000
double px = (event->position ().x () - width () / 2) * 2.0 / width ();
double py = -(event->position ().y () - height () / 2) * 2.0 / height ();
#else
double px = (event->pos ().x () - width () / 2) * 2.0 / width ();
double py = -(event->pos ().y () - height () / 2) * 2.0 / height ();
#endif
if (top_view ()) {
@ -389,7 +394,7 @@ D25ViewWidget::mousePressEvent (QMouseEvent *event)
{
mp_mode.reset (0);
if (event->button () == Qt::MidButton) {
if (event->button () == Qt::MiddleButton) {
mp_mode.reset (new D25PanInteractionMode (this, event->pos ()));
} else if (event->button () == Qt::LeftButton) {
if (! top_view ()) {

View File

@ -25,3 +25,7 @@ SOURCES = \
FORMS = \
D25View.ui \
greaterThan(QT_MAJOR_VERSION, 5) {
QT += openglwidgets
}

View File

@ -7,10 +7,6 @@ contains(QT_CONFIG, opengl) {
SUBDIRS = lay_plugin unit_tests
}
greaterThan(QT_MAJOR_VERSION, 5) {
QT += openglwidgets
}
unit_tests.depends += lay_plugin
}