Skip to content

Commit

Permalink
fixing errors when compiling using qt6
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed committed Mar 13, 2023
1 parent 7928d48 commit 71b6ea9
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
# See: https://doc-snapshots.qt.io/qt6-dev/cmake-qt5-and-qt6-compatibility.html
if(ENABLE_QT6)
# Qt6 doesn't currently support Location
add_definitions(-DENABLE_QT6)
find_package(Qt6
COMPONENTS
Core
Expand Down
7 changes: 5 additions & 2 deletions plugins/channelrx/demodft8/ft8demodsettingsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
#define PLUGINS_CHANNELRX_DEMODFT8_FT8DEMODSETTINGSDIALOG_H_

#include "ui_ft8demodsettingsdialog.h"

class FT8DemodSettings;
#if defined(ENABLE_QT6)
#include <QStringList>
#else
class QStringList;
#endif
class FT8DemodSettings;
class QTableWidgetItem;

class FT8DemodSettingsDialog : public QDialog {
Expand Down
4 changes: 2 additions & 2 deletions plugins/channelrx/heatmap/heatmapgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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((long long){1}, m_averagePeriodTexts.size() - value));
m_scopeVis->setLiveRate(m_settings.m_sampleRate);
applySettings();
}
Expand Down Expand Up @@ -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((long long){1}, m_averagePeriodTexts.size() - value));

ui->txPosition->setChecked(m_settings.m_txPosValid);
displayTXPosition(m_settings.m_txPosValid);
Expand Down
8 changes: 8 additions & 0 deletions sdrbase/maincore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,9 @@ void MainCore::initPosition()
if (m_positionSource)
{
connect(m_positionSource, &QGeoPositionInfoSource::positionUpdated, this, &MainCore::positionUpdated);
#if !defined(ENABLE_QT6)
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);
Expand Down Expand Up @@ -398,6 +400,12 @@ void MainCore::positionUpdateTimeout()

void MainCore::positionError(QGeoPositionInfoSource::Error positioningError)
{
#if defined(ENABLE_QT6)
if (positioningError == 4){
positionUpdateTimeout();
return;
}
#endif
qWarning() << "MainCore::positionError: " << positioningError;
}

Expand Down
2 changes: 2 additions & 0 deletions sdrgui/gui/dialogpositioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ DialogPositioner::DialogPositioner(QWidget *dialog, bool center) :
m_center(center)
{
connect(dialog->screen(), &QScreen::orientationChanged, this, &DialogPositioner::orientationChanged);
#if !defined(ENABLE_QT6)
dialog->screen()->setOrientationUpdateMask(Qt::PortraitOrientation
| Qt::LandscapeOrientation
| Qt::InvertedPortraitOrientation
| Qt::InvertedLandscapeOrientation);
#endif
if (m_center) {
DialogPositioner::centerDialog(m_dialog);
} else {
Expand Down
2 changes: 2 additions & 0 deletions sdrgui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 !defined(ENABLE_QT6)
screen()->setOrientationUpdateMask(Qt::PortraitOrientation
| Qt::LandscapeOrientation
| Qt::InvertedPortraitOrientation
| Qt::InvertedLandscapeOrientation);
#endif

connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
m_statusTimer.start(1000);
Expand Down

0 comments on commit 71b6ea9

Please sign in to comment.