Merge pull request #930 from manongjohn/fix_incorrect_qt_version_check

Fix incorrect QT_VERSION checks
This commit is contained in:
manongjohn 2022-03-21 10:44:21 -04:00 committed by GitHub
commit ccee82315f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 7 deletions

View file

@ -179,7 +179,7 @@ TPoint TFont::drawChar(QImage &outImage, TPoint &unused, wchar_t charcode,
// (21/1/2022) Use this workaround for all platforms as the crash also occured
// in windows when the display is scaled up.
if (chars[0].isSpace()) {
#if QT_VERSION >= 0x051100
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
int w = QFontMetrics(m_pimpl->m_font).horizontalAdvance(chars[0]);
#else
int w = raw.averageCharWidth();

View file

@ -249,7 +249,7 @@ AudioRecordingPopup::~AudioRecordingPopup() {}
//-----------------------------------------------------------------------------
void AudioRecordingPopup::onRecordButtonPressed() {
#if QT_VERSION >= 0x051000
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
if (m_audioInput->state() == QAudio::InterruptedState) {
DVGui::warning(
tr("The microphone is not available: "

View file

@ -995,7 +995,7 @@ void XSheetPDFTemplate::drawCellNumber(QPainter& painter, QRect rect,
circlePen.setWidth(mm2px(0.3));
painter.setPen(circlePen);
QFontMetrics fm(font);
#if QT_VERSION >= 0x051100
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
int keyR_width =
std::max(param(RowHeight), fm.horizontalAdvance(str) + mm2px(1));
#else

View file

@ -246,7 +246,7 @@ ImageViewer::ImageViewer(QWidget *parent, FlipBook *flipbook,
if (Preferences::instance()->isColorCalibrationEnabled())
m_lutCalibrator = new LutCalibrator();
#if QT_VERSION >= 0x051000
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
if (Preferences::instance()->is30bitDisplayEnabled())
setTextureFormat(TGL_TexFmt10);
#endif

View file

@ -280,7 +280,7 @@ PreferencesPopup::Display30bitChecker::GLView::GLView(QWidget* parent,
bool is30bit)
: QOpenGLWidget(parent), m_is30bit(is30bit) {
setFixedSize(500, 100);
#if QT_VERSION >= 0x051000
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
if (m_is30bit) setTextureFormat(TGL_TexFmt10);
#endif
}
@ -1618,7 +1618,7 @@ QWidget* PreferencesPopup::createInterfacePage() {
// insertUI(interfaceFontStyle, lay, buildFontStyleList());
QGridLayout* colorCalibLay = insertGroupBoxUI(colorCalibrationEnabled, lay);
{ insertUI(colorCalibrationLutPaths, colorCalibLay); }
#if QT_VERSION >= 0x051000
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
insertUI(displayIn30bit, lay);
row = lay->rowCount();
lay->addWidget(check30bitBtn, row - 1, 2, Qt::AlignRight);

View file

@ -836,7 +836,7 @@ SceneViewer::SceneViewer(ImageUtils::FullScreenWidget *parent)
if (Preferences::instance()->isColorCalibrationEnabled())
m_lutCalibrator = new LutCalibrator();
#if QT_VERSION >= 0x051000
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
if (Preferences::instance()->is30bitDisplayEnabled())
setTextureFormat(TGL_TexFmt10);
#endif