MCPcopy Index your code
hub / github.com/DreamSourceLab/DSView / Popup

Method Popup

DSView/pv/dock/keywordlineedit.cpp:254–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

252}
253
254void PopupLineEditInput::Popup(QWidget *editline)
255{
256 assert(editline);
257 _line = editline;
258
259 _textInput->setFixedSize(editline->size());
260 this->setFixedSize(editline->size());
261
262 QPoint pt = mapToGlobal(editline->rect().bottomLeft());
263
264 QPoint p1 = editline->pos();
265 QPoint p2 = editline->mapToGlobal(p1);
266 int x = p2.x() - p1.x();
267 int y = p2.y() - p1.y();
268 this->move(x, y);
269
270 _textInput->setFocus();
271 _textInput->setCursorPosition(_textInput->text().length());
272
273 if (move_timer != NULL){
274 move_timer->stop();
275 delete move_timer;
276 move_timer = NULL;
277 }
278 move_timer = new QTimer(this);
279 move_timer->setInterval(100);
280
281 connect(move_timer, SIGNAL(timeout()), this, SLOT(onCheckPositionTimeout()));
282 move_timer->start();
283
284 this->show();
285}
286
287//---------PopupLineEdit
288 PopupLineEdit::PopupLineEdit(QWidget *parent)

Callers 1

showPupopInputMethod · 0.80

Calls 4

sizeMethod · 0.80
stopMethod · 0.45
startMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected