MCPcopy Create free account
hub / github.com/OpenBoard-org/OpenBoard / showEmbedDialog

Method showEmbedDialog

src/web/UBEmbedController.cpp:86–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84
85
86void UBEmbedController::showEmbedDialog()
87{
88 if (!mTrapDialog)
89 {
90 Qt::WindowFlags flag = Qt::Dialog | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint ;
91 flag &= ~ Qt::WindowContextHelpButtonHint;
92 flag &= ~ Qt::WindowMinimizeButtonHint;
93
94 mTrapDialog = new QDialog(mParentWidget, flag);
95 mTrapFlashUi = new Ui::trapFlashDialog();
96 mTrapFlashUi->setupUi(mTrapDialog);
97 mTrapFlashUi->widgetNameLineEdit->setMaxLength(240);
98
99 int viewWidth = mParentWidget->width() / 2;
100 int viewHeight = mParentWidget->height() * 2. / 3.;
101 mTrapDialog->resize(viewWidth, viewHeight);
102
103 QWebEngineProfile* profile = UBApplication::webController->webProfile();
104 mTrapFlashUi->webView->setPage(new WebPage(profile, this));
105
106 connect(mTrapFlashUi->flashCombobox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &UBEmbedController::selectFlash);
107 connect(mTrapFlashUi->widgetNameLineEdit, &QLineEdit::textChanged, this, &UBEmbedController::textChanged);
108 connect(mTrapFlashUi->createWidgetButton, &QPushButton::clicked, this, &UBEmbedController::createWidget);
109 connect(mTrapFlashUi->webView, &QWebEngineView::loadFinished, this, [this](){
110 mTrapFlashUi->webView->update();
111 });
112 }
113
114 mTrapDialog->show();
115}
116
117
118void UBEmbedController::hideEmbedDialog() const

Callers 2

downloadFinishedMethod · 0.80
trapMethod · 0.80

Calls 7

webProfileMethod · 0.80
setPageMethod · 0.80
widthMethod · 0.45
heightMethod · 0.45
resizeMethod · 0.45
updateMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected