mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-03 03:43:15 +02:00
Merge branch 'qt6'
This commit is contained in:
@@ -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 ("%1")).arg (f, 0, 'g', 3);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -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 ()) {
|
||||
|
||||
@@ -25,3 +25,7 @@ SOURCES = \
|
||||
|
||||
FORMS = \
|
||||
D25View.ui \
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 5) {
|
||||
QT += openglwidgets
|
||||
}
|
||||
|
||||
@@ -109,8 +109,13 @@ public:
|
||||
QFontMetrics fm (font ());
|
||||
m_line_height = std::max (fm.height (), m_pixmap_size + 4);
|
||||
m_font_height = fm.height () * 3 / 2;
|
||||
#if QT_VERSION >= 0x60000
|
||||
m_first_column_width = fm.horizontalAdvance (QString::fromUtf8 ("LAYERNAME"));
|
||||
m_column_width = m_pixmap_size + 4 + m_spacing + fm.horizontalAdvance (QString::fromUtf8 ("1.00G "));
|
||||
#else
|
||||
m_first_column_width = fm.width (QString::fromUtf8 ("LAYERNAME"));
|
||||
m_column_width = m_pixmap_size + 4 + m_spacing + fm.width (QString::fromUtf8 ("1.00G "));
|
||||
#endif
|
||||
}
|
||||
|
||||
QSize sizeHint () const
|
||||
|
||||
Reference in New Issue
Block a user