initial commit

Signed-off-by: Peter Siegmund <mars3142@noreply.mars3142.dev>
This commit is contained in:
2025-10-31 23:37:30 +01:00
commit bf6b52fd94
9654 changed files with 4035664 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/private/compat.h
// Purpose: Helpers for dealing with various Qt versions
// Author: Vadim Zeitlin
// Created: 2022-10-21
// Copyright: (c) 2022 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_PRIVATE_COMPAT_H_
#define _WX_QT_PRIVATE_COMPAT_H_
#include <QtGui/QFontMetrics>
// Hide the difference in name of QFontMetrics::width() in various Qt versions.
inline int
wxQtGetWidthFromMetrics(const QFontMetrics& metrics, const QString& string)
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
return metrics.horizontalAdvance( string );
#else
return metrics.width( string );
#endif
}
// Hide the difference in getting Qt event position in various Qt versions.
template<typename T>
inline QPoint wxQtGetEventPosition(T* event)
{
#if QT_VERSION_MAJOR >= 6
return event->position().toPoint();
#else
return event->pos();
#endif
}
#endif // _WX_QT_PRIVATE_COMPAT_H_