mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-11-03 21:20:31 -05:00 
			
		
		
		
	Fix for Qt 5
This commit is contained in:
		
							parent
							
								
									1baca797f6
								
							
						
					
					
						commit
						c50097e420
					
				@ -686,8 +686,16 @@ void Aircraft::addCoordinate(const QDateTime& dateTime, AircraftModel *model)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if (keepCount <= 0)
 | 
					        if (keepCount <= 0)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
 | 
				
			||||||
            m_recentCoordinates.remove(0, i + 1);
 | 
					            m_recentCoordinates.remove(0, i + 1);
 | 
				
			||||||
            m_recentCoordinateColors.remove(0, i + 1);
 | 
					            m_recentCoordinateColors.remove(0, i + 1);
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					            for (int j = 0; j < i + 1; j++)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                m_recentCoordinates.removeAt(0);
 | 
				
			||||||
 | 
					                m_recentCoordinateColors.removeAt(0);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
            removed = true;
 | 
					            removed = true;
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -696,7 +704,13 @@ void Aircraft::addCoordinate(const QDateTime& dateTime, AircraftModel *model)
 | 
				
			|||||||
            if (size > keepCount)
 | 
					            if (size > keepCount)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                int remove = size - keepCount + 1;
 | 
					                int remove = size - keepCount + 1;
 | 
				
			||||||
 | 
					#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
 | 
				
			||||||
                m_recentCoordinates[i].remove(0, remove);
 | 
					                m_recentCoordinates[i].remove(0, remove);
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					                for (int j = 0; j < remove; j++) {
 | 
				
			||||||
 | 
					                    m_recentCoordinates[i].removeAt(0);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
                removed = true;
 | 
					                removed = true;
 | 
				
			||||||
                keepCount -= remove;
 | 
					                keepCount -= remove;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@ -1114,7 +1128,7 @@ QVariant AirspaceModel::data(const QModelIndex &index, int role) const
 | 
				
			|||||||
    else if (role == AirspaceModel::airspaceFillColorRole)
 | 
					    else if (role == AirspaceModel::airspaceFillColorRole)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (m_airspaces[row]->m_name.startsWith("IC")) {
 | 
					        if (m_airspaces[row]->m_name.startsWith("IC")) {
 | 
				
			||||||
            int ic = m_airspaces[row]->m_name.sliced(3).toInt();
 | 
					            int ic = m_airspaces[row]->m_name.mid(3).toInt();
 | 
				
			||||||
            int i = (ic & 0x3f) * 3;
 | 
					            int i = (ic & 0x3f) * 3;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return QVariant::fromValue(QColor(colors[i], colors[i+1], colors[i+2], 0x40));
 | 
					            return QVariant::fromValue(QColor(colors[i], colors[i+1], colors[i+2], 0x40));
 | 
				
			||||||
@ -1545,7 +1559,8 @@ Aircraft *ADSBDemodGUI::getAircraft(int icao, bool &newAircraft)
 | 
				
			|||||||
        newAircraft = true;
 | 
					        newAircraft = true;
 | 
				
			||||||
        aircraft = new Aircraft(this);
 | 
					        aircraft = new Aircraft(this);
 | 
				
			||||||
        aircraft->m_icao = icao;
 | 
					        aircraft->m_icao = icao;
 | 
				
			||||||
        aircraft->m_icaoHex = QString::number(aircraft->m_icao, 16);
 | 
					        //aircraft->m_icaoHex = QString::number(aircraft->m_icao, 16);
 | 
				
			||||||
 | 
					        aircraft->m_icaoHex = QString("%1").arg(aircraft->m_icao, 6, 16, QChar('0'));
 | 
				
			||||||
        m_aircraft.insert(icao, aircraft);
 | 
					        m_aircraft.insert(icao, aircraft);
 | 
				
			||||||
        aircraft->m_icaoItem->setText(aircraft->m_icaoHex);
 | 
					        aircraft->m_icaoItem->setText(aircraft->m_icaoHex);
 | 
				
			||||||
        ui->adsbData->setSortingEnabled(false);
 | 
					        ui->adsbData->setSortingEnabled(false);
 | 
				
			||||||
@ -2061,12 +2076,12 @@ void ADSBDemodGUI::handleADSB(
 | 
				
			|||||||
        } else if (updateTCStats(tc, TC_9_18, 9, 18)) {
 | 
					        } else if (updateTCStats(tc, TC_9_18, 9, 18)) {
 | 
				
			||||||
        } else if (updateTCStats(tc, TC_19, 19, 19)) {
 | 
					        } else if (updateTCStats(tc, TC_19, 19, 19)) {
 | 
				
			||||||
        } else if (updateTCStats(tc, TC_20_22, 20, 22)) {
 | 
					        } else if (updateTCStats(tc, TC_20_22, 20, 22)) {
 | 
				
			||||||
        } else if (updateTCStats(tc, TC_RESERVED, 23, 23)) {
 | 
					        } else if (updateTCStats(tc, TC_UNUSED, 23, 23)) {
 | 
				
			||||||
        } else if (updateTCStats(tc, TC_24, 24, 24)) {
 | 
					        } else if (updateTCStats(tc, TC_24, 24, 24)) {
 | 
				
			||||||
        } else if (updateTCStats(tc, TC_RESERVED, 25, 27)) {
 | 
					        } else if (updateTCStats(tc, TC_UNUSED, 25, 27)) {
 | 
				
			||||||
        } else if (updateTCStats(tc, TC_28, 28, 28)) {
 | 
					        } else if (updateTCStats(tc, TC_28, 28, 28)) {
 | 
				
			||||||
        } else if (updateTCStats(tc, TC_29, 29, 29)) {
 | 
					        } else if (updateTCStats(tc, TC_29, 29, 29)) {
 | 
				
			||||||
        } else if (updateTCStats(tc, TC_RESERVED, 30, 30)) {
 | 
					        } else if (updateTCStats(tc, TC_UNUSED, 30, 30)) {
 | 
				
			||||||
        } else if (updateTCStats(tc, TC_31, 31, 31)) {
 | 
					        } else if (updateTCStats(tc, TC_31, 31, 31)) {
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -5514,7 +5529,7 @@ void ADSBDemodGUI::adsbData_customContextMenuRequested(QPoint pos)
 | 
				
			|||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        QString icaoHex = QString("%1").arg(icao, 6, 16, '0');
 | 
					        QString icaoHex = QString("%1").arg(icao, 6, 16, QChar('0'));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        QMenu* tableContextMenu = new QMenu(ui->adsbData);
 | 
					        QMenu* tableContextMenu = new QMenu(ui->adsbData);
 | 
				
			||||||
        connect(tableContextMenu, &QMenu::aboutToHide, tableContextMenu, &QMenu::deleteLater);
 | 
					        connect(tableContextMenu, &QMenu::aboutToHide, tableContextMenu, &QMenu::deleteLater);
 | 
				
			||||||
@ -8631,7 +8646,13 @@ void ADSBDemodGUI::initCoverageMap()
 | 
				
			|||||||
    float lon = m_azEl.getLocationSpherical().m_longitude;
 | 
					    float lon = m_azEl.getLocationSpherical().m_longitude;
 | 
				
			||||||
    for (int i = 0; i < 2; i++)
 | 
					    for (int i = 0; i < 2; i++)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
 | 
				
			||||||
        m_maxRange[i].resize(360/ADSBDemodGUI::m_maxRangeDeg, 0.0f);
 | 
					        m_maxRange[i].resize(360/ADSBDemodGUI::m_maxRangeDeg, 0.0f);
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					        for (int j = 0; j < 360/ADSBDemodGUI::m_maxRangeDeg; j++) {
 | 
				
			||||||
 | 
					            m_maxRange[i].append(0.0f);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
        m_coverageAirspace[i].m_polygon.resize(2 * 360/ADSBDemodGUI::m_maxRangeDeg);
 | 
					        m_coverageAirspace[i].m_polygon.resize(2 * 360/ADSBDemodGUI::m_maxRangeDeg);
 | 
				
			||||||
        m_coverageAirspace[i].m_center.setX(lon);
 | 
					        m_coverageAirspace[i].m_center.setX(lon);
 | 
				
			||||||
        m_coverageAirspace[i].m_center.setY(lat);
 | 
					        m_coverageAirspace[i].m_center.setY(lat);
 | 
				
			||||||
 | 
				
			|||||||
@ -971,7 +971,7 @@ public:
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
    QList<Airspace *> m_airspaces;
 | 
					    QList<const Airspace *> m_airspaces;
 | 
				
			||||||
    QList<QVariantList> m_polygons;
 | 
					    QList<QVariantList> m_polygons;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void updatePolygon(const Airspace *airspace, int row)
 | 
					    void updatePolygon(const Airspace *airspace, int row)
 | 
				
			||||||
@ -1266,7 +1266,7 @@ private:
 | 
				
			|||||||
        TC_28,
 | 
					        TC_28,
 | 
				
			||||||
        TC_29,
 | 
					        TC_29,
 | 
				
			||||||
        TC_31,
 | 
					        TC_31,
 | 
				
			||||||
        TC_RESERVED,
 | 
					        TC_UNUSED,
 | 
				
			||||||
        DF0,
 | 
					        DF0,
 | 
				
			||||||
        DF4,
 | 
					        DF4,
 | 
				
			||||||
        DF5,
 | 
					        DF5,
 | 
				
			||||||
 | 
				
			|||||||
@ -1012,16 +1012,16 @@
 | 
				
			|||||||
         <number>2</number>
 | 
					         <number>2</number>
 | 
				
			||||||
        </property>
 | 
					        </property>
 | 
				
			||||||
        <property name="leftMargin">
 | 
					        <property name="leftMargin">
 | 
				
			||||||
         <number>3</number>
 | 
					         <number>0</number>
 | 
				
			||||||
        </property>
 | 
					        </property>
 | 
				
			||||||
        <property name="topMargin">
 | 
					        <property name="topMargin">
 | 
				
			||||||
         <number>3</number>
 | 
					         <number>0</number>
 | 
				
			||||||
        </property>
 | 
					        </property>
 | 
				
			||||||
        <property name="rightMargin">
 | 
					        <property name="rightMargin">
 | 
				
			||||||
         <number>3</number>
 | 
					         <number>0</number>
 | 
				
			||||||
        </property>
 | 
					        </property>
 | 
				
			||||||
        <property name="bottomMargin">
 | 
					        <property name="bottomMargin">
 | 
				
			||||||
         <number>3</number>
 | 
					         <number>0</number>
 | 
				
			||||||
        </property>
 | 
					        </property>
 | 
				
			||||||
        <item>
 | 
					        <item>
 | 
				
			||||||
         <widget class="QWidget" name="widget" native="true">
 | 
					         <widget class="QWidget" name="widget" native="true">
 | 
				
			||||||
@ -1083,6 +1083,12 @@
 | 
				
			|||||||
               </property>
 | 
					               </property>
 | 
				
			||||||
               <item>
 | 
					               <item>
 | 
				
			||||||
                <widget class="QTableWidget" name="adsbData">
 | 
					                <widget class="QTableWidget" name="adsbData">
 | 
				
			||||||
 | 
					                 <property name="sizePolicy">
 | 
				
			||||||
 | 
					                  <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
 | 
				
			||||||
 | 
					                   <horstretch>1</horstretch>
 | 
				
			||||||
 | 
					                   <verstretch>0</verstretch>
 | 
				
			||||||
 | 
					                  </sizepolicy>
 | 
				
			||||||
 | 
					                 </property>
 | 
				
			||||||
                 <property name="minimumSize">
 | 
					                 <property name="minimumSize">
 | 
				
			||||||
                  <size>
 | 
					                  <size>
 | 
				
			||||||
                   <width>0</width>
 | 
					                   <width>0</width>
 | 
				
			||||||
@ -1731,7 +1737,7 @@
 | 
				
			|||||||
                   <item>
 | 
					                   <item>
 | 
				
			||||||
                    <widget class="QLabel" name="photoHeader">
 | 
					                    <widget class="QLabel" name="photoHeader">
 | 
				
			||||||
                     <property name="sizePolicy">
 | 
					                     <property name="sizePolicy">
 | 
				
			||||||
                      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
 | 
					                      <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
 | 
				
			||||||
                       <horstretch>0</horstretch>
 | 
					                       <horstretch>0</horstretch>
 | 
				
			||||||
                       <verstretch>0</verstretch>
 | 
					                       <verstretch>0</verstretch>
 | 
				
			||||||
                      </sizepolicy>
 | 
					                      </sizepolicy>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user