MCPcopy Create free account
hub / github.com/alpha-liu-01/SpeedyNote / SaveDocumentDialog

Method SaveDocumentDialog

source/ui/dialogs/SaveDocumentDialog.cpp:14–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12#include <QRegularExpression>
13
14SaveDocumentDialog::SaveDocumentDialog(const QString& title,
15 const QString& defaultName,
16 QWidget* parent)
17 : QDialog(parent)
18 , m_title(title)
19 , m_defaultName(defaultName)
20{
21 setWindowTitle(title);
22 setWindowIcon(QIcon(":/resources/icons/mainicon.svg"));
23 setModal(true);
24
25 // Mobile-friendly size
26 setMinimumSize(420, 280);
27 setMaximumSize(600, 400);
28 setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
29
30 setupUI();
31
32 // Center the dialog
33 if (parent) {
34 move(parent->geometry().center() - rect().center());
35 } else {
36 QScreen* screen = QGuiApplication::primaryScreen();
37 if (screen) {
38 move(screen->geometry().center() - rect().center());
39 }
40 }
41}
42
43void SaveDocumentDialog::setupUI()
44{

Callers

nothing calls this directly

Calls 1

centerMethod · 0.80

Tested by

no test coverage detected