Files
transmission/qt/FilterBarComboBox.h
Yat Ho f495047a33 ci(qt): run clang-tidy on Linux (#8557)
* ci(qt): run clang-tidy

* chore(qt): silence warnings
2026-02-19 09:30:05 -06:00

41 lines
1.1 KiB
C++

// This file Copyright © Mnemosyne LLC.
// It may be used under GPLv2 (SPDX: GPL-2.0-only), GPLv3 (SPDX: GPL-3.0-only),
// or any future license endorsed by Mnemosyne LLC.
// License text can be found in the licenses/ folder.
#pragma once
#include <QComboBox>
class FilterBarComboBox : public QComboBox
{
Q_OBJECT
public:
// NOLINTNEXTLINE(performance-enum-size)
enum
{
CountRole = Qt::UserRole + 1,
CountStringRole,
UserRole
};
explicit FilterBarComboBox(QWidget* parent = nullptr);
~FilterBarComboBox() override = default;
FilterBarComboBox(FilterBarComboBox&&) = delete;
FilterBarComboBox(FilterBarComboBox const&) = delete;
FilterBarComboBox& operator=(FilterBarComboBox&&) = delete;
FilterBarComboBox& operator=(FilterBarComboBox const&) = delete;
// QWidget
[[nodiscard]] QSize minimumSizeHint() const override;
[[nodiscard]] QSize sizeHint() const override;
protected:
// QWidget
void paintEvent(QPaintEvent* e) override;
private:
[[nodiscard]] QSize calculateSize(QSize const& text_size, QSize const& count_size) const;
};