Skip to content

Commit

Permalink
Added docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugen Fischer authored and Eugen Fischer committed Jan 19, 2024
1 parent 7c8e6a2 commit 915cfd4
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions src/gui/nmcgui/nmcadvertwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,18 @@
class NMCCustomGraphicsView : public QGraphicsView
{
public:
/**
* @brief Constructs an NMCCustomGraphicsView object.
* @param parent The parent widget (default is nullptr).
*/
NMCCustomGraphicsView(QWidget *parent = nullptr) : QGraphicsView(parent) {}

protected:
/**
* @brief Reimplemented from QGraphicsView.
* Handles wheel events to ignore them and disable scrolling.
* @param event The wheel event.
*/
void wheelEvent(QWheelEvent *event) override
{
event->ignore();
Expand All @@ -39,13 +48,22 @@ class NMCClickableLabel : public QLabel
Q_OBJECT

public:
/**
* @brief Constructs an NMCClickableLabel object.
* @param parent The parent widget (default is nullptr).
*/
explicit NMCClickableLabel(QWidget *parent = nullptr) : QLabel(parent)
{
}

~NMCClickableLabel() = default;

protected:
/**
* @brief Reimplemented from QLabel.
* Handles mouse press events and emits the clicked signal.
* @param event The mouse press event.
*/
void mousePressEvent(QMouseEvent *event) override {
Q_UNUSED(event)
emit clicked();
Expand All @@ -61,19 +79,69 @@ class NMCAdvertWidget : public QWidget
Q_OBJECT

public:
/**
* @brief Constructs an NMCAdvertWidget object.
* @param parent The parent widget (default is nullptr).
*/
explicit NMCAdvertWidget(QWidget *parent = nullptr);

~NMCAdvertWidget() = default;

private:
/**
* @brief Loads a PNG image into the QPixmap.
* @param pixmap The QPixmap to load the image into.
*/
void loadPNG(const QPixmap &pixmap);

/**
* @brief Generates a list of Pixmaps from a specified image name.
* @param name The base name of the image.
*/
void generatePixmapList(const QString &name);

/**
* @brief Initializes the start button.
*/
void initStartButton();

/**
* @brief Sets the start button properties.
*/
void setStartButton();

/**
* @brief Sets the detail text label.
* @param p_text The text to set.
*/
void setDetailText(const QString &p_text);

/**
* @brief Sets the header text label.
* @param p_text The text to set.
*/
void setHeaderText(const QString &p_text);

/**
* @brief Sets the header label.
* @param p_text The text to set.
*/
void setHeader(const QString &p_text);

/**
* @brief Sets the left and right arrows for navigation.
*/
void setArrows();

/**
* @brief Loads the next or previous picture in the list.
* @param next If true, loads the next picture; otherwise, loads the previous.
*/
void loadPicture(bool next = true);

/**
* @brief Selects text by its ID.
*/
void selectTextByID();

private:
Expand Down

0 comments on commit 915cfd4

Please sign in to comment.