wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
LengthDialog.cpp
Go to the documentation of this file.
1// Copyright 2015 - 2026, GIBIS-UNIFESP and the wiRedPanda contributors
2// SPDX-License-Identifier: GPL-3.0-or-later
3
5
7
8LengthDialog::LengthDialog(const int currentLength, QWidget *parent)
9 : QDialog(parent)
10 , m_ui(std::make_unique<LengthDialogUi>())
11{
12 m_ui->setupUi(this);
13
14 // Pre-populate with the existing simulation length so the user sees the current value
15 m_ui->lengthSpinBox->setValue(currentLength);
16
17 setWindowTitle(tr("Simulation Length Selection"));
18
19 connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
20 connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
21}
22
26
28{
29 // Pure accessor: the caller runs exec() and reads this only on QDialog::Accepted.
30 return m_ui->lengthSpinBox->value();
31}
LengthDialogUi: hand-written UI class for the LengthDialog.
LengthDialog: dialog for setting the BeWavedDolphin simulation length.
LengthDialog(const int currentLength, QWidget *parent=nullptr)
Constructs the dialog.
~LengthDialog() override
int length() const