Qt: Don't need these functions defined in the header

This commit is contained in:
Stenzek
2025-10-29 23:32:21 +10:00
parent cd8d6d8387
commit d54234444f
2 changed files with 72 additions and 21 deletions

View File

@@ -212,6 +212,11 @@ GameListModel::GameListModel(GameListWidget* parent)
GameListModel::~GameListModel() = default;
bool GameListModel::getShowLocalizedTitles() const
{
return m_show_localized_titles;
}
void GameListModel::setShowLocalizedTitles(bool enabled)
{
m_show_localized_titles = enabled;
@@ -223,25 +228,25 @@ void GameListModel::setShowLocalizedTitles(bool enabled)
refreshCovers();
}
bool GameListModel::getShowCoverTitles() const
{
return m_show_titles_for_covers;
}
void GameListModel::setShowCoverTitles(bool enabled)
{
m_show_titles_for_covers = enabled;
emit dataChanged(index(0, Column_Cover), index(rowCount() - 1, Column_Cover), {Qt::DisplayRole});
}
void GameListModel::setShowGameIcons(bool enabled)
int GameListModel::getRowHeight() const
{
m_show_game_icons = enabled;
if (enabled)
GameList::ReloadMemcardTimestampCache();
refreshIcons();
return getIconSizeWithPadding();
}
void GameListModel::refreshIcons()
int GameListModel::getIconSize() const
{
m_icon_pixmap_cache.Clear();
emit dataChanged(index(0, Column_Icon), index(rowCount() - 1, Column_Icon), {Qt::DecorationRole});
return m_icon_size;
}
int GameListModel::getIconSizeWithPadding() const
@@ -269,6 +274,17 @@ void GameListModel::setIconSize(int size)
refreshIcons();
}
void GameListModel::refreshIcons()
{
m_icon_pixmap_cache.Clear();
emit dataChanged(index(0, Column_Icon), index(rowCount() - 1, Column_Icon), {Qt::DecorationRole});
}
float GameListModel::getCoverScale() const
{
return m_cover_scale;
}
void GameListModel::setCoverScale(float scale)
{
if (m_cover_scale == scale)
@@ -353,6 +369,11 @@ void GameListModel::updateCacheSize(int num_rows, int num_columns, QSortFilterPr
m_cover_pixmap_cache.SetMaxCapacity(static_cast<u32>(cache_size));
}
qreal GameListModel::getDevicePixelRatio() const
{
return m_device_pixel_ratio;
}
void GameListModel::setDevicePixelRatio(qreal dpr)
{
if (m_device_pixel_ratio == dpr)
@@ -565,6 +586,20 @@ const QPixmap& GameListModel::getFlagPixmapForEntry(const GameList::Entry* ge) c
return it->second;
}
bool GameListModel::getShowGameIcons() const
{
return m_show_game_icons;
}
void GameListModel::setShowGameIcons(bool enabled)
{
m_show_game_icons = enabled;
if (enabled)
GameList::ReloadMemcardTimestampCache();
refreshIcons();
}
QIcon GameListModel::getIconForGame(const QString& path)
{
QIcon ret;
@@ -907,6 +942,21 @@ QVariant GameListModel::headerData(int section, Qt::Orientation orientation, int
return ret;
}
const QPixmap& GameListModel::getNoAchievementsPixmap() const
{
return m_no_achievements_pixmap;
}
const QPixmap& GameListModel::getHasAchievementsPixmap() const
{
return m_has_achievements_pixmap;
}
const QPixmap& GameListModel::getMasteredAchievementsPixmap() const
{
return m_mastered_achievements_pixmap;
}
const GameList::Entry* GameListModel::getTakenGameListEntry(u32 index) const
{
return (m_taken_entries.has_value() && index < m_taken_entries->size()) ? &m_taken_entries.value()[index] : nullptr;

View File

@@ -74,9 +74,9 @@ public:
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
ALWAYS_INLINE const QPixmap& getNoAchievementsPixmap() const { return m_no_achievements_pixmap; }
ALWAYS_INLINE const QPixmap& getHasAchievementsPixmap() const { return m_has_achievements_pixmap; }
ALWAYS_INLINE const QPixmap& getMasteredAchievementsPixmap() const { return m_mastered_achievements_pixmap; }
const QPixmap& getNoAchievementsPixmap() const;
const QPixmap& getHasAchievementsPixmap() const;
const QPixmap& getMasteredAchievementsPixmap() const;
const GameList::Entry* getTakenGameListEntry(u32 index) const;
bool hasTakenGameList() const;
@@ -87,32 +87,33 @@ public:
bool titlesLessThan(const GameList::Entry* left, const GameList::Entry* right) const;
bool lessThan(const GameList::Entry* left, const GameList::Entry* right, int column) const;
bool lessThan(const QModelIndex& left_index, const QModelIndex& right_index, int column) const;
bool getShowLocalizedTitles() const { return m_show_localized_titles; }
bool getShowLocalizedTitles() const;
void setShowLocalizedTitles(bool enabled);
bool getShowCoverTitles() const { return m_show_titles_for_covers; }
bool getShowCoverTitles() const;
void setShowCoverTitles(bool enabled);
int getRowHeight() const { return getIconSizeWithPadding(); }
int getIconSize() const { return m_icon_size; }
int getRowHeight() const;
int getIconSize() const;
int getIconSizeWithPadding() const;
void refreshIcons();
void setIconSize(int size);
bool getShowGameIcons() const { return m_show_game_icons; }
bool getShowGameIcons() const;
void setShowGameIcons(bool enabled);
QIcon getIconForGame(const QString& path);
void refreshIcons();
float getCoverScale() const { return m_cover_scale; }
float getCoverScale() const;
void setCoverScale(float scale);
QSize getCoverArtSize() const;
int getCoverArtSpacing() const;
void refreshCovers();
void updateCacheSize(int num_rows, int num_columns, QSortFilterProxyModel* const sort_model, int top_left_row);
qreal getDevicePixelRatio() const { return m_device_pixel_ratio; }
qreal getDevicePixelRatio() const;
void setDevicePixelRatio(qreal dpr);
const QPixmap* lookupIconPixmapForEntry(const GameList::Entry* ge) const;