Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
matrixcombopopup.h
1/*
2 * Copyright (C) 2025 Andrés Martínez Mera - andresmmera@protonmail.com
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifndef MATRIXCOMBOBOX_H
19#define MATRIXCOMBOBOX_H
20
21#include <QComboBox>
22#include <QFrame>
23#include <QGridLayout>
24#include <QPaintEvent>
25#include <QPushButton>
26#include <QStringList>
27#include <QVBoxLayout>
28
29class MatrixComboPopup : public QFrame {
30 Q_OBJECT
31
32public:
33 MatrixComboPopup(const QStringList& sParams, const QStringList& otherParams,
34 QComboBox* parent = nullptr);
35 void showBelow(QWidget* widget);
36
37private slots:
38 void selectItem();
39
40private:
41 QComboBox* parentCombo;
42};
43
44class MatrixComboBox : public QComboBox {
45 Q_OBJECT
46
47public:
48 explicit MatrixComboBox(QWidget* parent = nullptr);
49 void setParameters(const QStringList& sParams,
50 const QStringList& otherParams);
51
52protected:
53 void showPopup() override;
54 void hidePopup() override;
55 void paintEvent(QPaintEvent* event) override;
56
57private:
58 QStringList sParams;
59 QStringList otherParams;
60 bool popupVisible;
61 MatrixComboPopup* popup;
62};
63
64#endif // MATRIXCOMBOBOX_H
ComboBox with custom matrix-style popup for parameter selection.
Definition matrixcombopopup.h:44
Custom popup displaying S-parameters in matrix layout with other parameters below.
Definition matrixcombopopup.h:29