From 600ea2b803660e10ce9a47ac9c11e89cc100085b Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 5 Aug 2014 18:31:22 +0200 Subject: [PATCH] Fixed several issues detected during testing / review (refs #304) * MS report 1-5 https://dev.vatsim-germany.org/issues/304#change-1800 * Clang warning https://dev.vatsim-germany.org/boards/22/topics/1982?r=1997#message-1997 * Wrong indexes for dockable widgets, RW: https://dev.vatsim-germany.org/issues/304#note-13 * Fixed wrong offset in Fsuipc class * Improved position handling for floating widgets opened 1st time --- src/blackcore/vatsimdatafilereader.cpp | 3 +- .../components/maininfoareacomponent.cpp | 139 ++++++++---------- .../components/maininfoareacomponent.h | 11 +- .../components/simulatorcomponent.cpp | 2 +- src/blackgui/components/simulatorcomponent.h | 2 +- src/blackgui/dockwidget.cpp | 10 ++ src/blackgui/dockwidget.h | 8 +- src/blackgui/stylesheetutility.cpp | 32 ++-- src/blackgui/stylesheetutility.h | 4 +- src/blackmisc/icon.h | 4 +- src/blackmisc/iconlist.cpp | 2 +- src/blackmisc/iconlist.h | 20 +-- src/blackmisc/icons.h | 13 +- src/blackmisc/namevariantpair.cpp | 2 +- src/plugins/simulator/fscommon/fsuipc.cpp | 2 +- 15 files changed, 127 insertions(+), 127 deletions(-) diff --git a/src/blackcore/vatsimdatafilereader.cpp b/src/blackcore/vatsimdatafilereader.cpp index 150b30e46..8c50bd314 100644 --- a/src/blackcore/vatsimdatafilereader.cpp +++ b/src/blackcore/vatsimdatafilereader.cpp @@ -310,8 +310,7 @@ namespace BlackCore // warnings, if required if (!illegalIcaoCodes.isEmpty()) { - const QString w = QString("Illegal ICAO code(s) in VATSIM data file: %1").arg(illegalIcaoCodes.join(", ")); - qWarning(w.toLatin1()); + qWarning() << "Illegal ICAO code(s) in VATSIM data file:" << illegalIcaoCodes.join(", "); } } } diff --git a/src/blackgui/components/maininfoareacomponent.cpp b/src/blackgui/components/maininfoareacomponent.cpp index e2ac62a27..2cfaff496 100644 --- a/src/blackgui/components/maininfoareacomponent.cpp +++ b/src/blackgui/components/maininfoareacomponent.cpp @@ -43,7 +43,6 @@ namespace BlackGui this->connectAllWidgets(); this->setFeaturesForDockableWidgets(QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable); this->tabifyAllWidgets(); - this->setPreferredSizesWhenFloating(); // context menu this->setContextMenuPolicy(Qt::CustomContextMenu); @@ -103,7 +102,7 @@ namespace BlackGui subMenuDisplay->addAction(displayMenuAction); c = connect(displayMenuAction, SIGNAL(triggered(bool)), signalMapperDisplay, SLOT(map())); Q_ASSERT(c); - signalMapperDisplay->setMapping(displayMenuAction, i); + signalMapperDisplay->setMapping(displayMenuAction, i); // action to index } c = connect(signalMapperToggleFloating, SIGNAL(mapped(int)), this, SLOT(toggleFloating(int))); Q_ASSERT(c); @@ -187,10 +186,8 @@ namespace BlackGui void CMainInfoAreaComponent::adjustSizeForAllDockWidgets() { - QList::iterator i; - for (i = this->m_dockableWidgets.begin(); i != this->m_dockableWidgets.end(); ++i) + for (CDockWidgetInfoArea *dw : this->m_dockableWidgets) { - CDockWidgetInfoArea *dw = (*i); dw->adjustSize(); } } @@ -199,11 +196,18 @@ namespace BlackGui { // I fake the double click here, which queues the events in the queue // and hence fires all depending signals in order - if (!this->m_tabBar) return; - for (int i = 0; i < this->m_tabBar->count(); i++) +// if (!this->m_tabBar) return; +// for (int i = 0; i < this->m_tabBar->count(); i++) +// { +// // emit this->m_tabBar->tabBarDoubleClicked(i); +// this->toggleFloating(i); +// } + for (CDockWidgetInfoArea *dw : this->m_dockableWidgets) { - emit this->m_tabBar->tabBarDoubleClicked(i); + if (dw->isFloating()) continue; + dw->toggleFloating(); } + } void CMainInfoAreaComponent::toggleFloating() @@ -259,10 +263,8 @@ namespace BlackGui void CMainInfoAreaComponent::ps_setDockArea(Qt::DockWidgetArea area) { - QList::iterator i; - for (i = this->m_dockableWidgets.begin(); i != this->m_dockableWidgets.end(); ++i) + for (CDockWidgetInfoArea *dw : this->m_dockableWidgets) { - CDockWidgetInfoArea *dw = (*i); Qt::DockWidgetAreas newAreas = static_cast(area); Qt::DockWidgetAreas oldAreas = dw->allowedAreas(); if (oldAreas == newAreas) continue; @@ -273,6 +275,7 @@ namespace BlackGui void CMainInfoAreaComponent::ps_setInfoAreaFloating(bool floating) { + // float whole info area this->m_infoAreaFloating = floating; if (this->m_infoAreaFloating) { @@ -297,9 +300,7 @@ namespace BlackGui { // this->setDockArea(Qt::LeftDockWidgetArea); this->setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::East); - bool init = this->m_tabBar ? false : true; - QPoint pos = CGuiUtility::assumedMainWindowPosition(); //main window pos. not initialized yet if (!this->m_dockableWidgets.isEmpty()) { @@ -310,15 +311,17 @@ namespace BlackGui Q_ASSERT(after); // trick, init widget as floating + // this completely initializes the tab bar and all docked widgets if (init) { - QPoint initPoint(pos.rx() + i * 25, pos.ry() + i * 20); + QPoint offset(i * 25, i * 20); after->setVisible(false); after->setFloating(true); - after->move(initPoint); + after->setOffsetWhenFloating(offset); + after->setPreferredSizeWhenFloating(CMainInfoAreaComponent::getPreferredSizeWhenFloating(static_cast(i))); after->setFloating(false); - after->resetWasAlreadyFLoating(); after->setVisible(true); + after->resetWasAlreadyFLoating(); } else { @@ -339,7 +342,8 @@ namespace BlackGui this->m_tabBar->setObjectName("comp_MainInfoAreaDockWidgetTab"); this->m_tabBar->setMovable(false); this->m_tabBar->setElideMode(Qt::ElideNone); - this->setDocumentMode(true); + this->setDocumentMode(true); // did not notice any effect + this->setTabPixmaps(); // East / West does not work (shown, but area itself empty) // South does not have any effect @@ -347,7 +351,6 @@ namespace BlackGui connect(this->m_tabBar, &QTabBar::tabBarDoubleClicked, this, &CMainInfoAreaComponent::ps_tabBarDoubleClicked); } - this->setTabPixmaps(); if (this->countDockedWidgets() > 0) { this->m_tabBar->setCurrentIndex(0); @@ -368,57 +371,50 @@ namespace BlackGui void CMainInfoAreaComponent::connectAllWidgets() { - QList::iterator i; - for (i = this->m_dockableWidgets.begin(); i != this->m_dockableWidgets.end(); ++i) + for (CDockWidgetInfoArea *dw : this->m_dockableWidgets) { - connect(*i, &CDockWidgetInfoArea::widgetTopLevelChanged, this, &CMainInfoAreaComponent::ps_onWidgetTopLevelChanged); + connect(dw, &CDockWidgetInfoArea::widgetTopLevelChanged, this, &CMainInfoAreaComponent::ps_onWidgetTopLevelChanged); } } void CMainInfoAreaComponent::setMarginsWhenFloating(int left, int top, int right, int bottom) { - QList::iterator i; - for (i = this->m_dockableWidgets.begin(); i != this->m_dockableWidgets.end(); ++i) + for (CDockWidgetInfoArea *dw : this->m_dockableWidgets) { //! Margins when window is floating - (*i)->setMarginsWhenFloating(left, top, right, bottom); + dw->setMarginsWhenFloating(left, top, right, bottom); } } void CMainInfoAreaComponent::setMarginsWhenDocked(int left, int top, int right, int bottom) { - QList::iterator i; - for (i = this->m_dockableWidgets.begin(); i != this->m_dockableWidgets.end(); ++i) + for (CDockWidgetInfoArea *dw : this->m_dockableWidgets) { - //! Margins when window is floating - (*i)->setMarginsWhenDocked(left, top, right, bottom); + //! Margins when window is docked + dw->setMarginsWhenDocked(left, top, right, bottom); } } - void CMainInfoAreaComponent::setPreferredSizesWhenFloating() + QSize CMainInfoAreaComponent::getPreferredSizeWhenFloating(InfoArea area) { - if (this->m_dockableWidgets.isEmpty()) return; - for (int i = 0; i < this->m_dockableWidgets.size(); i++) + switch (area) { - InfoArea ia = static_cast(i); - switch (ia) - { - case InfoAreaAircrafts: - case InfoAreaAtc: - case InfoAreaUsers: - case InfoAreaLog: - case InfoAreaSimulator: - this->m_dockableWidgets[i]->setPreferredSizeWhenFloating(QSize(400, 300)); - break; - case InfoAreaMappings: - case InfoAreaSettings: - case InfoAreaTextMessages: - case InfoAreaFlightPlan: - this->m_dockableWidgets[i]->setPreferredSizeWhenFloating(QSize(600, 400)); - break; - default: - break; - } + case InfoAreaAircrafts: + case InfoAreaAtc: + case InfoAreaUsers: + case InfoAreaLog: + case InfoAreaSimulator: + return QSize(400, 300); + break; + case InfoAreaMappings: + case InfoAreaSettings: + case InfoAreaTextMessages: + case InfoAreaFlightPlan: + return QSize(600, 400); + break; + default: + return QSize(400, 300); + break; } } @@ -451,34 +447,31 @@ namespace BlackGui } } - CDockWidgetInfoArea *CMainInfoAreaComponent::getDockableWidgetByIndex(int index) const - { - if (index >= this->m_dockableWidgets.count() || index < 0) return nullptr; - return this->m_dockableWidgets.at(index); - } - - CDockWidgetInfoArea *CMainInfoAreaComponent::selectedDockableWidget() const - { - if (!this->m_tabBar) return nullptr; - int i = this->m_tabBar->currentIndex(); - return getDockableWidgetByIndex(i); - } - int CMainInfoAreaComponent::countDockedWidgets() const { if (!this->m_tabBar) return 0; return this->m_tabBar->count(); } + CDockWidgetInfoArea *CMainInfoAreaComponent::getDockableWidgetByTabIndex(int tabBarIndex) const + { + if (tabBarIndex >= this->m_dockableWidgets.count() || tabBarIndex < 0) return nullptr; + for (CDockWidgetInfoArea *dw : this->m_dockableWidgets) + { + if (dw->isFloating()) continue; // not in tab bar + if (tabBarIndex == 0) return dw; + tabBarIndex--; + } + return nullptr; + } + int CMainInfoAreaComponent::widgetToTabBarIndex(const CDockWidgetInfoArea *dockWidget) { if (!dockWidget) return -1; if (dockWidget->isFloating()) return -1; int tabBarIndex = 0; - QList::iterator i; - for (i = this->m_dockableWidgets.begin(); i != this->m_dockableWidgets.end(); ++i) + for (CDockWidgetInfoArea *dw : this->m_dockableWidgets) { - CDockWidgetInfoArea *dw = (*i); if (dw->isFloating()) continue; // not in tab bar if (dw == dockWidget) return tabBarIndex; tabBarIndex++; @@ -488,9 +481,8 @@ namespace BlackGui void CMainInfoAreaComponent::setFeaturesForDockableWidgets(QDockWidget::DockWidgetFeatures features) { - for (int i = 0; i < this->m_dockableWidgets.size(); i++) + for (CDockWidgetInfoArea *dw : this->m_dockableWidgets) { - CDockWidgetInfoArea *dw = this->m_dockableWidgets.at(i); dw->setFeatures(features); } } @@ -506,11 +498,9 @@ namespace BlackGui } } - void CMainInfoAreaComponent::ps_tabBarDoubleClicked(int index) + void CMainInfoAreaComponent::ps_tabBarDoubleClicked(int tabBarIndex) { - CDockWidgetInfoArea *dw = (index >= 0) ? - this->getDockableWidgetByIndex(index) : - this->selectedDockableWidget(); + CDockWidgetInfoArea *dw = this->getDockableWidgetByTabIndex(tabBarIndex); if (!dw) return; dw->toggleFloating(); } @@ -529,7 +519,6 @@ namespace BlackGui { QString qss = CStyleSheetUtility::instance().style(CStyleSheetUtility::fileNameMainInfoArea()); this->setStyleSheet(qss); - if (this->m_tabBar) { QString qss = CStyleSheetUtility::instance().style(CStyleSheetUtility::fileNameDockWidgetTab()); @@ -551,10 +540,8 @@ namespace BlackGui { if (show == this->m_showTabTexts) return; this->m_showTabTexts = show; - QList::iterator i; - for (i = this->m_dockableWidgets.begin(); i != this->m_dockableWidgets.end(); ++i) + for (CDockWidgetInfoArea *dw : this->m_dockableWidgets) { - CDockWidgetInfoArea *dw = (*i); dw->showTitleWhenDocked(show); } } diff --git a/src/blackgui/components/maininfoareacomponent.h b/src/blackgui/components/maininfoareacomponent.h index c0d582ab8..3aa78cdde 100644 --- a/src/blackgui/components/maininfoareacomponent.h +++ b/src/blackgui/components/maininfoareacomponent.h @@ -139,11 +139,8 @@ namespace BlackGui //! Corresponding dockable widgets QList dockableWidgets() const; - //! Corresponding dockable widget - CDockWidgetInfoArea *getDockableWidgetByIndex(int index) const; - - //! Selected dockable widget - CDockWidgetInfoArea *selectedDockableWidget() const; + //! Corresponding dockable widget for given tab index + CDockWidgetInfoArea *getDockableWidgetByTabIndex(int tabBarIndex) const; //! Features of the dockable widgets void setFeaturesForDockableWidgets(QDockWidget::DockWidgetFeatures features); @@ -167,14 +164,14 @@ namespace BlackGui void setMarginsWhenDocked(int left, int top, int right, int bottom); //! Set window sizes when floating - void setPreferredSizesWhenFloating(); + static QSize getPreferredSizeWhenFloating(InfoArea area); //! Info area to icon static const QPixmap &infoAreaToPixmap(InfoArea infoArea); private slots: //! Tab bar has been double clicked - void ps_tabBarDoubleClicked(int index); + void ps_tabBarDoubleClicked(int tabBarIndex); //! A widget has changed its top level void ps_onWidgetTopLevelChanged(CDockWidget *widget, bool topLevel); diff --git a/src/blackgui/components/simulatorcomponent.cpp b/src/blackgui/components/simulatorcomponent.cpp index 16055ec00..1600bccf8 100644 --- a/src/blackgui/components/simulatorcomponent.cpp +++ b/src/blackgui/components/simulatorcomponent.cpp @@ -33,7 +33,7 @@ namespace BlackGui this->ui->tvp_LiveData->addOrUpdateByName(name, value, icon); } - void CSimulatorComponent::addOrUpdateByName(const QString &name, const QString &value, CIcons::IconIndexes iconIndex) + void CSimulatorComponent::addOrUpdateByName(const QString &name, const QString &value, CIcons::IconIndex iconIndex) { this->addOrUpdateByName(name, value, CIconList::iconForIndex(iconIndex)); } diff --git a/src/blackgui/components/simulatorcomponent.h b/src/blackgui/components/simulatorcomponent.h index 8bbfba2f4..d2a10423e 100644 --- a/src/blackgui/components/simulatorcomponent.h +++ b/src/blackgui/components/simulatorcomponent.h @@ -39,7 +39,7 @@ namespace BlackGui void addOrUpdateByName(const QString &name, const QString &value, const BlackMisc::CIcon &icon); //! Simple add or update name / value pair - void addOrUpdateByName(const QString &name, const QString &value, BlackMisc::CIcons::IconIndexes iconIndex); + void addOrUpdateByName(const QString &name, const QString &value, BlackMisc::CIcons::IconIndex iconIndex); //! Number of entries int rowCount() const; diff --git a/src/blackgui/dockwidget.cpp b/src/blackgui/dockwidget.cpp index f0075d3e9..04e9c7769 100644 --- a/src/blackgui/dockwidget.cpp +++ b/src/blackgui/dockwidget.cpp @@ -10,6 +10,7 @@ #include "dockwidget.h" #include "blackmisc/icons.h" #include "blackgui/stylesheetutility.h" +#include "blackgui/guiutility.h" #include #include #include @@ -126,6 +127,15 @@ namespace BlackGui { this->resize(this->m_preferredSizeWhenFloating); } + + // and move + QPoint mainWindowPos = BlackGui::CGuiUtility::mainWindowPosition(); + if (!mainWindowPos.isNull()) + { + int x = mainWindowPos.x() + this->m_offsetWhenFloating.x(); + int y = mainWindowPos.y() + this->m_offsetWhenFloating.y(); + this->move(x, y); + } } this->m_wasAlreadyFloating = true; } diff --git a/src/blackgui/dockwidget.h b/src/blackgui/dockwidget.h index ad8f02c85..fffb1b542 100644 --- a/src/blackgui/dockwidget.h +++ b/src/blackgui/dockwidget.h @@ -66,9 +66,12 @@ namespace BlackGui //! Was widget already floating bool wasAlreadyFloating() const { return this->m_wasAlreadyFloating; } - //! Size when floating + //! Size when floating first time void setPreferredSizeWhenFloating(const QSize &size) { this->m_preferredSizeWhenFloating = size; } + //! Position offset when floating first time + void setOffsetWhenFloating(const QPoint &point) { this->m_offsetWhenFloating = point; } + public slots: //! Toggle floating void toggleFloating(); @@ -109,7 +112,8 @@ namespace BlackGui QString m_windowTitleBackup; //!< original title, even if the widget title is deleted for layout purposes bool m_windowTitleWhenDocked = true; bool m_wasAlreadyFloating = false; - QSize m_preferredSizeWhenFloating; + QSize m_preferredSizeWhenFloating; //!< preferred size men floating 1st time + QPoint m_offsetWhenFloating; //!< initial offset to main window when floating first time //! Empty widget with no size void initTitleBarWidgets(); diff --git a/src/blackgui/stylesheetutility.cpp b/src/blackgui/stylesheetutility.cpp index 7d5cc9f3b..bbce62078 100644 --- a/src/blackgui/stylesheetutility.cpp +++ b/src/blackgui/stylesheetutility.cpp @@ -21,38 +21,48 @@ namespace BlackGui this->read(); } - const QString CStyleSheetUtility::fontStyleAsString(const QFont &font) + const QString &CStyleSheetUtility::fontStyleAsString(const QFont &font) { + static const QString n("normal"); + static const QString i("italic"); + static const QString o("oblique"); + static const QString e; + switch (font.style()) { - case QFont::StyleNormal: return "normal"; - case QFont::StyleItalic: return "italic"; - case QFont::StyleOblique: return "oblique"; - default: return ""; + case QFont::StyleNormal: return n; + case QFont::StyleItalic: return i; + case QFont::StyleOblique: return o; + default: return e; } } - const QString CStyleSheetUtility::fontWeightAsString(const QFont &font) + const QString &CStyleSheetUtility::fontWeightAsString(const QFont &font) { if (font.weight() < static_cast(QFont::Normal)) { - return "light"; + static const QString l("light"); + return l; } else if (font.weight() < static_cast(QFont::DemiBold)) { - return "normal"; + static const QString n("normal"); + return n; } else if (font.weight() < static_cast(QFont::Bold)) { - return "demibold"; + static const QString d("demibold"); + return d; } else if (font.weight() < static_cast(QFont::Black)) { - return "bold"; + static const QString b("bold"); + return b; } else { - return "black"; + static const QString b("black"); + return b; } } diff --git a/src/blackgui/stylesheetutility.h b/src/blackgui/stylesheetutility.h index ee393ecc9..67fedc5f1 100644 --- a/src/blackgui/stylesheetutility.h +++ b/src/blackgui/stylesheetutility.h @@ -96,10 +96,10 @@ namespace BlackGui explicit CStyleSheetUtility(QObject *parent = nullptr); //! Font style as string - static const QString fontStyleAsString(const QFont &font); + static const QString &fontStyleAsString(const QFont &font); //! Font weight as string - static const QString fontWeightAsString(const QFont &font); + static const QString &fontWeightAsString(const QFont &font); }; } diff --git a/src/blackmisc/icon.h b/src/blackmisc/icon.h index 2f68b51d8..c856656d9 100644 --- a/src/blackmisc/icon.h +++ b/src/blackmisc/icon.h @@ -28,7 +28,7 @@ namespace BlackMisc CIcon() {} //! Constructor. - CIcon(CIcons::IconIndexes index, const QString &descriptiveText) : + CIcon( CIcons::IconIndex index, const QString &descriptiveText) : m_index(static_cast(index)), m_descriptiveText(descriptiveText) {} //! \copydoc CValueObject::toQVariant @@ -38,7 +38,7 @@ namespace BlackMisc const QString &getDescriptiveText() const { return this->m_descriptiveText; } //! Index - CIcons::IconIndexes getIndex() const { return static_cast(this->m_index);} + CIcons::IconIndex getIndex() const { return static_cast< CIcons::IconIndex>(this->m_index);} //! Corresponding pixmap QPixmap toPixmap() const; diff --git a/src/blackmisc/iconlist.cpp b/src/blackmisc/iconlist.cpp index bad46e1ff..466bab569 100644 --- a/src/blackmisc/iconlist.cpp +++ b/src/blackmisc/iconlist.cpp @@ -15,7 +15,7 @@ namespace BlackMisc CSequence(other) { } - CIcon CIconList::findByIndex(CIcons::IconIndexes index) const + CIcon CIconList::findByIndex(CIcons::IconIndex index) const { return this->findBy(&CIcon::getIndex, index).frontOrDefault(); } diff --git a/src/blackmisc/iconlist.h b/src/blackmisc/iconlist.h index 710171efb..46f06437b 100644 --- a/src/blackmisc/iconlist.h +++ b/src/blackmisc/iconlist.h @@ -34,7 +34,7 @@ namespace BlackMisc CIconList(const CSequence &other); //! Find by index - CIcon findByIndex(CIcons::IconIndexes index) const; + CIcon findByIndex(CIcons::IconIndex index) const; //! \copydoc CValueObject::asQVariant virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); } @@ -126,24 +126,18 @@ namespace BlackMisc } //! Icon for given index - static const CIcon &iconForIndex(CIcons::IconIndexes index) + static const CIcon &iconForIndex(CIcons::IconIndex index) { - // remark, find by is copy, need reference of icon - int s = allIcons().size(); - for (int i = 0; i < s; i++) - { - if (allIcons()[i].getIndex() == index) - { - return allIcons()[i]; - } - } + auto foundRange = allIcons().findBy(&CIcon::getIndex, index); + if (!foundRange.isEmpty()) { return foundRange.front(); } Q_ASSERT_X(false, "iconForIndex", "Missing index"); return iconForIndex(CIcons::StandardIconUnknown16); } //! Icon for given index - static const CIcon &iconForIndex(int index) { - return iconForIndex(static_cast(index)); + static const CIcon &iconForIndex(int index) + { + return iconForIndex(static_cast(index)); } }; diff --git a/src/blackmisc/icons.h b/src/blackmisc/icons.h index ae5748618..f2b2f223b 100644 --- a/src/blackmisc/icons.h +++ b/src/blackmisc/icons.h @@ -19,14 +19,13 @@ namespace BlackMisc //! Standard icons class CIcons { - private: - //! Constructor, use class static only - CIcons(); - public: + //! Constructor, use class static only + CIcons() = delete; + //! Index for each icon, allows to send them via DBus, efficiently store them, etc. - enum IconIndexes + enum IconIndex { NotSet, StandardIconInfo16, @@ -606,7 +605,7 @@ namespace BlackMisc // ------------------------------------------------------------- //! Pixmap by given index - static const QPixmap &pixmapByIndex(IconIndexes index) + static const QPixmap &pixmapByIndex(IconIndex index) { switch (index) { @@ -687,7 +686,7 @@ namespace BlackMisc } //! Pixmap by given index rotated - static QPixmap pixmapByIndex(IconIndexes index, int rotateDegrees) + static QPixmap pixmapByIndex(IconIndex index, int rotateDegrees) { const QPixmap original = pixmapByIndex(index); if (rotateDegrees == 0) return original; diff --git a/src/blackmisc/namevariantpair.cpp b/src/blackmisc/namevariantpair.cpp index 6e7658efd..a794e5773 100644 --- a/src/blackmisc/namevariantpair.cpp +++ b/src/blackmisc/namevariantpair.cpp @@ -154,7 +154,7 @@ namespace BlackMisc case IndexIcon: if (variant.canConvert()) { - CIcons::IconIndexes index = static_cast(variant.toInt()); + CIcons::IconIndex index = static_cast(variant.toInt()); this->m_icon = CIconList::iconForIndex(index); } else diff --git a/src/plugins/simulator/fscommon/fsuipc.cpp b/src/plugins/simulator/fscommon/fsuipc.cpp index 1117f01c1..d963ce2a3 100644 --- a/src/plugins/simulator/fscommon/fsuipc.cpp +++ b/src/plugins/simulator/fscommon/fsuipc.cpp @@ -126,7 +126,7 @@ namespace BlackSimPlugin // COM Settings, transponder, SB3 FSUIPC_Read(0x7b91, 1, &xpdrModeSb3Raw, &dwResult) && - FSUIPC_Read(0x7b92, 1, &xpdrIdentSb3Raw, &dwResult) && + FSUIPC_Read(0x7b93, 1, &xpdrIdentSb3Raw, &dwResult) && // Speeds, situation FSUIPC_Read(0x02b4, 4, &groundspeedRaw, &dwResult) &&