Skip to content

Commit eb7e3bd

Browse files
committed
docs
1 parent eabb4b9 commit eb7e3bd

File tree

9 files changed

+406
-40
lines changed

9 files changed

+406
-40
lines changed

source/interfaces/database-settings/database_settings.h

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,37 +29,89 @@ QT_BEGIN_NAMESPACE
2929
namespace Ui { class DatabaseSettings; }
3030
QT_END_NAMESPACE
3131

32+
/**
33+
* @class DatabaseSettings
34+
* @brief The DatabaseSettings class provides a dialog for managing database settings.
35+
*
36+
* This class provides a QDialog with fields for the user to input database settings such as host, port, username, password, database, and schema.
37+
* It also provides buttons to test the connection and save the settings.
38+
*/
3239
class DatabaseSettings : public QDialog {
3340
Q_OBJECT
3441

3542
public:
43+
/**
44+
* @brief Construct a new Database Settings object
45+
*
46+
* @param database_settings_ Reference to a Database object where the settings will be stored.
47+
* @param parent Pointer to the parent QWidget. Default is nullptr.
48+
*/
3649
explicit DatabaseSettings(Models::Database &database_settings_, QWidget *parent = nullptr);
3750

51+
/**
52+
* @brief Destroy the Database Settings object
53+
*/
3854
~DatabaseSettings() override;
3955

4056
private slots:
4157

58+
/**
59+
* @brief Slot for handling changes in the host field.
60+
*
61+
* @param text The new text in the host field.
62+
*/
4263
void on_host_edit_textChanged(const QString &text);
4364

65+
/**
66+
* @brief Slot for handling changes in the port field.
67+
*
68+
* @param text The new text in the port field.
69+
*/
4470
void on_port_edit_textChanged(const QString &text);
4571

72+
/**
73+
* @brief Slot for handling changes in the username field.
74+
*
75+
* @param text The new text in the username field.
76+
*/
4677
void on_username_edit_textChanged(const QString &text);
4778

79+
/**
80+
* @brief Slot for handling changes in the password field.
81+
*
82+
* @param text The new text in the password field.
83+
*/
4884
void on_password_edit_textChanged(const QString &text);
4985

86+
/**
87+
* @brief Slot for handling changes in the database field.
88+
*
89+
* @param text The new text in the database field.
90+
*/
5091
void on_database_edit_textChanged(const QString &text);
5192

93+
/**
94+
* @brief Slot for handling changes in the schema field.
95+
*
96+
* @param text The new text in the schema field.
97+
*/
5298
void on_schema_edit_textChanged(const QString &text);
5399

100+
/**
101+
* @brief Slot for handling the test button click event.
102+
*/
54103
void on_test_button_clicked();
55104

105+
/**
106+
* @brief Slot for handling the save button click event.
107+
*/
56108
void on_save_button_clicked();
57109

58110
private:
59111

60-
Ui::DatabaseSettings *ui;
112+
Ui::DatabaseSettings *ui; ///< Pointer to the UI object for this dialog.
61113

62-
Models::Database &database_settings_;
63-
Models::Database database_settings_buffer_;
114+
Models::Database &database_settings_; ///< Reference to the Database object where the settings are stored.
115+
Models::Database database_settings_buffer_; ///< Buffer for storing the current settings while they are being edited.
64116

65117
};

source/interfaces/font-editor/font_editor.h

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,37 +30,91 @@ namespace Ui {
3030
class FontEditor;
3131
}
3232

33+
/**
34+
* @class FontEditor
35+
* @brief The FontEditor class provides a dialog for managing font settings.
36+
*
37+
* This class provides a QDialog with fields for the user to input font settings such as color, font type, boldness, and size.
38+
* It also provides a save button to store the settings.
39+
*/
3340
class FontEditor : public QDialog {
3441
Q_OBJECT
3542

3643
public:
44+
/**
45+
* @brief Construct a new Font Editor object
46+
*
47+
* @param font_settings Reference to a FontSettings object where the settings will be stored.
48+
* @param parent Pointer to the parent QWidget. Default is nullptr.
49+
*/
3750
explicit FontEditor(Models::FontSettings &font_settings, QWidget *parent = nullptr);
3851

52+
/**
53+
* @brief Destroy the Font Editor object
54+
*/
3955
~FontEditor() override;
4056

4157
private slots:
4258

59+
/**
60+
* @brief Slot for handling changes in the red color slider.
61+
*
62+
* @param value The new value of the red color slider.
63+
*/
4364
void on_red_slider_valueChanged(int value);
4465

66+
/**
67+
* @brief Slot for handling changes in the green color slider.
68+
*
69+
* @param value The new value of the green color slider.
70+
*/
4571
void on_green_slider_valueChanged(int value);
4672

73+
/**
74+
* @brief Slot for handling changes in the blue color slider.
75+
*
76+
* @param value The new value of the blue color slider.
77+
*/
4778
void on_blue_slider_valueChanged(int value);
4879

80+
/**
81+
* @brief Slot for handling changes in the font type combo box.
82+
*
83+
* @param font The new font selected in the combo box.
84+
*/
4985
void on_font_combo_box_currentFontChanged(const QFont &font);
5086

87+
/**
88+
* @brief Slot for handling changes in the boldness check box.
89+
*
90+
* @param value The new state of the boldness check box.
91+
*/
5192
void on_bold_check_box_stateChanged(int value);
5293

94+
/**
95+
* @brief Slot for handling changes in the font size spin box.
96+
*
97+
* @param value The new value of the font size spin box.
98+
*/
5399
void on_size_spin_box_valueChanged(int value);
54100

101+
/**
102+
* @brief Slot for handling the save button click event.
103+
*
104+
* This function saves the current settings to the font_settings_ object and closes the dialog.
105+
*/
55106
void on_save_button_clicked();
56107

57108
private:
58109

110+
/**
111+
* @brief Load the current font settings into the UI.
112+
*/
59113
void LoadFontSettings();
60114

61-
Models::FontSettings font_settings_buffer_;
115+
Models::FontSettings font_settings_buffer_; ///< Buffer for storing the current settings while they are being edited.
62116

63-
Models::FontSettings &font_settings_;
117+
Models::FontSettings &font_settings_; ///< Reference to the FontSettings object where the settings are stored.
64118

65-
Ui::FontEditor *ui;
66-
};
119+
Ui::FontEditor *ui; ///< Pointer to the UI object for this dialog.
120+
};

source/interfaces/mainwindow/mainwindow.h

Lines changed: 93 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,70 +40,153 @@ QT_BEGIN_NAMESPACE
4040
namespace Ui { class MainWindow; }
4141
QT_END_NAMESPACE
4242

43+
/**
44+
* @class MainWindow
45+
* @brief The MainWindow class provides the main application window.
46+
*
47+
* This class provides a QMainWindow with various menu actions for managing the application's functionality.
48+
* It also manages the database and image display.
49+
*/
4350
class MainWindow : public QMainWindow {
4451
Q_OBJECT
4552

4653
public:
54+
/**
55+
* @brief Construct a new Main Window object
56+
*
57+
* @param parent Pointer to the parent QWidget. Default is nullptr.
58+
*/
4759
explicit MainWindow(QWidget *parent = nullptr);
4860

61+
/**
62+
* @brief Destroy the Main Window object
63+
*/
4964
~MainWindow() override;
5065

5166
private slots:
5267

68+
/**
69+
* @brief Slot for handling the save_some_images action.
70+
*/
5371
void on_save_some_images_triggered();
5472

73+
/**
74+
* @brief Slot for handling the copy action.
75+
*/
5576
void on_copy_triggered();
5677

78+
/**
79+
* @brief Slot for handling the settings action.
80+
*/
5781
void on_settings_triggered();
5882

83+
/**
84+
* @brief Slot for handling the save_image action.
85+
*/
5986
void on_save_image_triggered();
6087

88+
/**
89+
* @brief Slot for handling the print action.
90+
*/
6191
void on_print_triggered();
6292

93+
/**
94+
* @brief Slot for handling changes in the database search field.
95+
*/
6396
void on_database_search_textChanged();
6497

98+
/**
99+
* @brief Slot for handling the show_database action.
100+
*/
65101
void on_show_database_triggered();
66102

103+
/**
104+
* @brief Slot for handling the hide_database action.
105+
*/
67106
void on_hide_database_triggered();
68107

108+
/**
109+
* @brief Slot for handling the show_image action.
110+
*/
69111
void on_show_image_triggered();
70112

113+
/**
114+
* @brief Slot for handling the hide_image action.
115+
*/
71116
void on_hide_image_triggered();
72117

73-
void on_database_table_view_clicked(const QModelIndex &);
118+
/**
119+
* @brief Slot for handling clicks on the database table view.
120+
*
121+
* @param index The index of the clicked item.
122+
*/
123+
void on_database_table_view_clicked(const QModelIndex &index);
74124

125+
/**
126+
* @brief Slot for handling the image_scale_up action.
127+
*/
75128
void on_image_scale_up_triggered();
76129

130+
/**
131+
* @brief Slot for handling the image_scale_down action.
132+
*/
77133
void on_image_scale_down_triggered();
78134

135+
/**
136+
* @brief Slot for handling the refresh_database_action.
137+
*/
79138
void on_refresh_database_action_triggered();
80139

140+
/**
141+
* @brief Slot for handling the insert_single_record action.
142+
*/
81143
void on_insert_single_record_triggered();
82144

145+
/**
146+
* @brief Slot for handling the insert_same_records action.
147+
*/
83148
void on_insert_same_records_triggered();
84149

150+
/**
151+
* @brief Slot for handling the clear_database action.
152+
*/
85153
void on_clear_database_triggered();
86154

155+
/**
156+
* @brief Slot for handling changes in the database table view data.
157+
*
158+
* @param index The index of the changed item.
159+
*/
87160
void database_table_view_data_changed(const QModelIndex &index);
88161

89162
private:
90163

91-
Logger log_ = Logger("logs");
164+
Logger log_ = Logger("logs"); ///< Logger object for logging application events.
92165

93-
QSize current_image_size_;
166+
QSize current_image_size_; ///< Current size of the displayed image.
94167

95-
std::array<TextPainter::ContentTemplate, 3> items_;
168+
std::array<TextPainter::ContentTemplate, 3> items_; ///< Array of content templates for the TextPainter.
96169

97-
TextPainter text_painter_;
98-
SettingsManager settings_manager_;
170+
TextPainter text_painter_; ///< TextPainter object for generating images.
99171

100-
Database database_;
101-
std::unique_ptr<QSqlTableModel> table_model_;
172+
SettingsManager settings_manager_; ///< SettingsManager object for managing application settings.
102173

103-
std::unique_ptr<Ui::MainWindow> ui;
174+
Database database_; ///< Database object for managing the application's database.
104175

176+
std::unique_ptr<QSqlTableModel> table_model_; ///< QSqlTableModel object for managing the database table view.
177+
178+
std::unique_ptr<Ui::MainWindow> ui; ///< Pointer to the UI object for this window.
179+
180+
/**
181+
* @brief Redraw the displayed image.
182+
*/
105183
void ReDrawImage();
106184

185+
/**
186+
* @brief Set the contents of the TextPainter based on the given index.
187+
*
188+
* @param index The index of the item to use for setting the contents.
189+
*/
107190
void SetContents(const QModelIndex &index);
108191

109-
};
192+
};

0 commit comments

Comments
 (0)