ORE Studio 0.0.4
Loading...
Searching...
No Matches
CompositeLegsWidget.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2026 Marco Craveiro <marco.craveiro@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20#ifndef ORES_QT_COMPOSITE_LEGS_WIDGET_HPP
21#define ORES_QT_COMPOSITE_LEGS_WIDGET_HPP
22
23#include <vector>
24#include <QWidget>
25#include "ores.trading.api/domain/composite_leg.hpp"
26
27namespace Ui {
28class CompositeLegsWidget;
29}
30
31namespace ores::qt {
32
39class CompositeLegsWidget final : public QWidget {
40 Q_OBJECT
41
42public:
43 explicit CompositeLegsWidget(QWidget* parent = nullptr);
44 ~CompositeLegsWidget() override;
45
51 void setLegs(const std::vector<trading::domain::composite_leg>& legs);
52
58 std::vector<trading::domain::composite_leg> legs() const;
59
63 void setReadOnly(bool readOnly);
64
65signals:
66 void legsChanged();
67
68private slots:
69 void onAddLegClicked();
70 void onRemoveLegClicked();
71
72private:
73 void setupUi();
74 void setupConnections();
75
76 Ui::CompositeLegsWidget* ui_;
77 bool readOnly_{false};
78};
79
80}
81
82#endif
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
Reusable widget for displaying and editing a list of composite legs.
Definition CompositeLegsWidget.hpp:39
std::vector< trading::domain::composite_leg > legs() const
Collect the current table contents as a typed vector.
Definition CompositeLegsWidget.cpp:80
void setLegs(const std::vector< trading::domain::composite_leg > &legs)
Populate the table from a vector of legs.
Definition CompositeLegsWidget.cpp:60
void setReadOnly(bool readOnly)
Enable or disable editing of the legs table and buttons.
Definition CompositeLegsWidget.cpp:98