MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / PageDialog

Method PageDialog

launcher/ui/pagedialog/PageDialog.cpp:29–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27#include "ui/widgets/PageContainer.h"
28
29PageDialog::PageDialog(BasePageProvider *pageProvider, QString defaultId, QWidget *parent)
30 : QDialog(parent)
31{
32 setWindowTitle(pageProvider->dialogTitle());
33 m_container = new PageContainer(pageProvider, defaultId, this);
34
35 QVBoxLayout *mainLayout = new QVBoxLayout;
36 mainLayout->addWidget(m_container);
37 mainLayout->setSpacing(0);
38 mainLayout->setContentsMargins(0, 0, 0, 0);
39 setLayout(mainLayout);
40
41 QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Help | QDialogButtonBox::Close);
42 buttons->button(QDialogButtonBox::Close)->setDefault(true);
43 buttons->setContentsMargins(6, 0, 6, 0);
44 m_container->addButtons(buttons);
45
46 connect(buttons->button(QDialogButtonBox::Close), SIGNAL(clicked()), this, SLOT(close()));
47 connect(buttons->button(QDialogButtonBox::Help), SIGNAL(clicked()), m_container, SLOT(help()));
48
49 restoreGeometry(QByteArray::fromBase64(APPLICATION->settings()->get("PagedGeometry").toByteArray()));
50}
51
52void PageDialog::closeEvent(QCloseEvent *event)
53{

Callers

nothing calls this directly

Calls 4

addButtonsMethod · 0.80
dialogTitleMethod · 0.45
getMethod · 0.45
settingsMethod · 0.45

Tested by

no test coverage detected