1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-04 16:01:14 -05:00

Merge pull request #1629 from Mohamedadlyi/fix-qt6

fixing errors when compiling using qt6
This commit is contained in:
Edouard Griffiths 2023-03-18 11:08:38 +01:00 committed by GitHub
commit 3873bed81c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 4 deletions

View File

@ -19,9 +19,12 @@
#define PLUGINS_CHANNELRX_DEMODFT8_FT8DEMODSETTINGSDIALOG_H_
#include "ui_ft8demodsettingsdialog.h"
class FT8DemodSettings;
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
#include <QStringList>
#else
class QStringList;
#endif
class FT8DemodSettings;
class QTableWidgetItem;
class FT8DemodSettingsDialog : public QDialog {

View File

@ -218,7 +218,7 @@ void HeatMapGUI::on_sampleRate_valueChanged(int value)
{
m_settings.m_sampleRate = (int)std::pow(10.0f, (float)value);
ui->sampleRateText->setText(m_sampleRateTexts[value-1]);
ui->averagePeriod->setMinimum(std::max(1, m_averagePeriodTexts.size() - value));
ui->averagePeriod->setMinimum(std::max(1, static_cast<int> ( m_averagePeriodTexts.size()) - value));
m_scopeVis->setLiveRate(m_settings.m_sampleRate);
applySettings();
}
@ -696,7 +696,7 @@ void HeatMapGUI::displaySettings()
value = (int)std::log10(m_settings.m_sampleRate);
ui->sampleRate->setValue(value);
ui->sampleRateText->setText(m_sampleRateTexts[value-1]);
ui->averagePeriod->setMinimum(std::max(1, m_averagePeriodTexts.size() - value));
ui->averagePeriod->setMinimum(std::max(1, static_cast<int> (m_averagePeriodTexts.size()) - value));
ui->txPosition->setChecked(m_settings.m_txPosValid);
displayTXPosition(m_settings.m_txPosValid);

View File

@ -358,7 +358,9 @@ void MainCore::initPosition()
if (m_positionSource)
{
connect(m_positionSource, &QGeoPositionInfoSource::positionUpdated, this, &MainCore::positionUpdated);
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
connect(m_positionSource, &QGeoPositionInfoSource::updateTimeout, this, &MainCore::positionUpdateTimeout);
#endif
connect(m_positionSource, qOverload<QGeoPositionInfoSource::Error>(&QGeoPositionInfoSource::error), this, &MainCore::positionError);
m_position = m_positionSource->lastKnownPosition();
m_positionSource->setUpdateInterval(1000);
@ -398,6 +400,12 @@ void MainCore::positionUpdateTimeout()
void MainCore::positionError(QGeoPositionInfoSource::Error positioningError)
{
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
if (positioningError == 4){
positionUpdateTimeout();
return;
}
#endif
qWarning() << "MainCore::positionError: " << positioningError;
}

View File

@ -29,10 +29,12 @@ DialogPositioner::DialogPositioner(QWidget *dialog, bool center) :
m_center(center)
{
connect(dialog->screen(), &QScreen::orientationChanged, this, &DialogPositioner::orientationChanged);
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
dialog->screen()->setOrientationUpdateMask(Qt::PortraitOrientation
| Qt::LandscapeOrientation
| Qt::InvertedPortraitOrientation
| Qt::InvertedLandscapeOrientation);
#endif
if (m_center) {
DialogPositioner::centerDialog(m_dialog);
} else {

View File

@ -174,10 +174,12 @@ MainWindow::MainWindow(qtwebapp::LoggerWithFile *logger, const MainParser& parse
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleMessages()), Qt::QueuedConnection);
connect(screen(), &QScreen::orientationChanged, this, &MainWindow::orientationChanged);
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
screen()->setOrientationUpdateMask(Qt::PortraitOrientation
| Qt::LandscapeOrientation
| Qt::InvertedPortraitOrientation
| Qt::InvertedLandscapeOrientation);
#endif
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
m_statusTimer.start(1000);