nsbaci 1.0
Loading...
Searching...
No Matches
userGuideDialog.h
Go to the documentation of this file.
1
9
10#ifndef USERGUIDEDIALOG_H
11#define USERGUIDEDIALOG_H
12
13#include <QDialog>
14#include <QLabel>
15#include <QListWidget>
16#include <QPlainTextEdit>
17#include <QPushButton>
18#include <QSplitter>
19#include <QString>
20#include <QVBoxLayout>
21
22#include <vector>
23
24namespace nsbaci::ui {
25
30 QString title;
31 QString category;
32 QString resourcePath;
33 QString description;
34};
35
43class UserGuideDialog : public QDialog {
44 Q_OBJECT
45
46 public:
47 explicit UserGuideDialog(QWidget* parent = nullptr);
48 ~UserGuideDialog() override = default;
49
50 signals:
55 void loadExampleRequested(const QString& code);
56
57 private slots:
58 void onExampleSelected(QListWidgetItem* current, QListWidgetItem* previous);
59 void onLoadInEditor();
60 void onOpenOnlineDocs();
61
62 private:
63 void setupUi();
64 void populateExamples();
65 void applyDialogStyle();
66 QString loadExampleCode(const QString& resourcePath) const;
67
68 // UI elements
69 QListWidget* exampleList = nullptr;
70 QLabel* titleLabel = nullptr;
71 QLabel* descriptionLabel = nullptr;
72 QPlainTextEdit* codeViewer = nullptr;
73 QPushButton* loadButton = nullptr;
74 QPushButton* onlineDocsButton = nullptr;
75 QPushButton* closeButton = nullptr;
76
77 // Data
78 std::vector<ExampleEntry> examples;
79};
80
81} // namespace nsbaci::ui
82
83#endif // USERGUIDEDIALOG_H
void loadExampleRequested(const QString &code)
Emitted when the user clicks "Load in Editor".
User interface namespace for nsbaci.
Definition drawingWidget.cpp:18
Data for a single example entry in the User Guide.
Definition userGuideDialog.h:29
QString description
Short description shown above the code.
Definition userGuideDialog.h:33
QString title
Display title (e.g. "Variables & Operators").
Definition userGuideDialog.h:30
QString resourcePath
Qt resource path (e.g. ":/examples/01_basics.nsb").
Definition userGuideDialog.h:32
QString category
Category grouping (e.g. "Basics").
Definition userGuideDialog.h:31