MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / updateGeometry

Method updateGeometry

src/plugins/chat/widgets/referencepopup.cpp:229–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229void PopupWidget::updateGeometry()
230{
231 Q_ASSERT(parentWidget());
232 const int border = list->frameWidth();
233 QSize size = parentWidget()->size();
234 auto itemHeight = fontMetrics().height() * 2 + 5; // same as itemdelegate
235 auto height = 10 * itemHeight;
236 if (model && model->rowCount() < 10)
237 height = model->rowCount() * itemHeight;
238
239 height = height < minimumHeight() ? minimumHeight() : height;
240 const QRect rect(parentWidget()->mapToGlobal(QPoint(-border, -(height + 5))), QSize(size.width(), height));
241 setGeometry(rect);
242}
243
244void PopupWidget::selectFirstRow()
245{

Callers

nothing calls this directly

Calls 4

widthMethod · 0.80
QPointClass · 0.50
sizeMethod · 0.45
rowCountMethod · 0.45

Tested by

no test coverage detected