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

Method LocationDialog

dialog/locationdialog.cpp:29–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27extern Global global;
28
29LocationDialog::LocationDialog(QWidget *parent) :
30 QDialog(parent)
31{
32 wasOkPressed = false;
33 setWindowTitle(tr("Location"));
34 //setWindowIcon(new QIcon(iconPath+"password.png"));
35 QGridLayout *grid = new QGridLayout();
36 QGridLayout *input = new QGridLayout();
37 QGridLayout *button = new QGridLayout();
38 setLayout(grid);
39
40 input->addWidget(new QLabel(tr("Longitude"), this), 1,1);
41 input->addWidget(&longitude, 1, 2);
42 input->addWidget(new QLabel(tr("Latitude"), this), 2,1);
43 input->addWidget(&latitude, 2, 2);
44 input->addWidget(new QLabel(tr("Altitude"), this), 3,1);
45 input->addWidget(&altitude, 3, 2);
46 input->setContentsMargins(10, 10, -10, -10);
47 grid->addLayout(input, 1,1);
48
49 ok.setText(tr("OK"));
50 connect(&ok, SIGNAL(clicked()), this, SLOT(okButtonPressed()));
51
52 QPushButton *cancel = new QPushButton(tr("Cancel"), this);
53 connect(cancel, SIGNAL(clicked()), this, SLOT(cancelButtonPressed()));
54 button->addWidget(&ok, 1, 1);
55 button->addWidget(cancel, 1,2);
56 grid->addLayout(button, 3, 1);
57
58 longlatval.setBottom(-90.0);
59 longlatval.setTop(90.0);
60 longlatval.setNotation(QDoubleValidator::StandardNotation);
61 longitude.setValidator(&longlatval);
62 latitude.setValidator(&longlatval);
63
64 altitudeval.setBottom(-1500);
65 altitudeval.setTop(9999.99);
66 altitudeval.setNotation(QDoubleValidator::StandardNotation);
67 altitude.setValidator(&altitudeval);
68 this->setFont(global.getGuiFont(font()));
69}
70
71
72

Callers

nothing calls this directly

Calls 3

addWidgetMethod · 0.80
getGuiFontMethod · 0.80
setTextMethod · 0.45

Tested by

no test coverage detected