MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / InsertLinkDialog

Method InsertLinkDialog

dialog/insertlinkdialog.cpp:30–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28extern Global global;
29
30InsertLinkDialog::InsertLinkDialog(bool insert, QWidget *parent) :
31 QDialog(parent)
32{
33 okPressed = false;
34 setWindowTitle(tr("Insert Link"));
35 //setWindowIcon(new QIcon(iconPath+"link.png"));
36 QGridLayout *grid = new QGridLayout();
37 QGridLayout *input = new QGridLayout();
38 QGridLayout *button = new QGridLayout();
39 setLayout(grid);
40 insertHyperlink = insert;
41
42
43 url = new QLineEdit("");
44
45 input->addWidget(new QLabel(tr("URL")), 1,1);
46 input->addWidget(url, 1, 2);
47 input->setContentsMargins(10, 10, -10, -10);
48 grid->addLayout(input, 1,1);
49
50 ok = new QPushButton(tr("OK"));
51 connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
52 ok->setEnabled(false);
53
54 QPushButton *cancel = new QPushButton(tr("Cancel"));
55 connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
56 button->addWidget(ok, 1, 1);
57 button->addWidget(cancel, 1,2);
58 grid->addLayout(button, 3, 1);
59 connect(url,SIGNAL(textChanged(QString)), this, SLOT(validateInput()));
60
61 // setAttribute(Qt::WA_DeleteOnClose);
62 this->setFont(global.getGuiFont(font()));
63
64}
65
66// Get the password
67QString InsertLinkDialog::getUrl() {

Callers

nothing calls this directly

Calls 3

addWidgetMethod · 0.80
setEnabledMethod · 0.80
getGuiFontMethod · 0.80

Tested by

no test coverage detected