diff --git a/shared/properties-view/properties-view.cpp b/shared/properties-view/properties-view.cpp index 3301de8e121d05..d6f048340c0d98 100644 --- a/shared/properties-view/properties-view.cpp +++ b/shared/properties-view/properties-view.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/shared/qt/icon-label/CMakeLists.txt b/shared/qt/icon-label/CMakeLists.txt index c5325d158f105f..76e2d6ee7a160e 100644 --- a/shared/qt/icon-label/CMakeLists.txt +++ b/shared/qt/icon-label/CMakeLists.txt @@ -5,7 +5,7 @@ find_package(Qt6 REQUIRED Core Widgets) add_library(qt-icon-label INTERFACE) add_library(OBS::qt-icon-label ALIAS qt-icon-label) -target_sources(qt-icon-label INTERFACE icon-label.hpp) +target_sources(qt-icon-label INTERFACE IconLabel.cpp IconLabel.hpp) target_include_directories(qt-icon-label INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}") target_link_libraries(qt-icon-label INTERFACE Qt::Core Qt::Widgets) diff --git a/shared/qt/icon-label/IconLabel.cpp b/shared/qt/icon-label/IconLabel.cpp new file mode 100644 index 00000000000000..9c4aa3ad17529c --- /dev/null +++ b/shared/qt/icon-label/IconLabel.cpp @@ -0,0 +1,29 @@ +/****************************************************************************** + Copyright (C) 2024 by Sebastian Beckmann + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +******************************************************************************/ + +#include "moc_IconLabel.cpp" + +void IconLabel::setIcon(const QIcon &icon) +{ + m_icon = icon; + QLabel::setPixmap(icon.pixmap(m_iconSize)); +} + +void IconLabel::setIconSize(int newSize) +{ + m_iconSize = newSize; +} diff --git a/shared/qt/icon-label/icon-label.hpp b/shared/qt/icon-label/IconLabel.hpp similarity index 90% rename from shared/qt/icon-label/icon-label.hpp rename to shared/qt/icon-label/IconLabel.hpp index b75842e64b6de3..15c3d93cd18771 100644 --- a/shared/qt/icon-label/icon-label.hpp +++ b/shared/qt/icon-label/IconLabel.hpp @@ -35,14 +35,10 @@ class IconLabel : public QLabel { inline IconLabel(QWidget *parent = nullptr) : QLabel(parent), m_icon(), m_iconSize(16) {} inline QIcon icon() const { return m_icon; } - void setIcon(const QIcon &icon) - { - m_icon = icon; - QLabel::setPixmap(icon.pixmap(m_iconSize)); - } + void setIcon(const QIcon &icon); inline int iconSize() const { return m_iconSize; } - void setIconSize(int newSize) { m_iconSize = newSize; } + void setIconSize(int newSize); private: QIcon m_icon;