PDA

View Full Version : QInputDialog shifting its position



cleanzero
2nd May 2014, 23:37
Hi all,
I wrote a simple code where I ask the user to input some values during a for loop using a QInputDialog.



for(i=0;i<3;++i)
{
s = QInputDialog::getText(this,tr("Insert a number"),tr("Input"),QLineEdit::Normal,
NULL,&ok);
if(s!=NULL)
ui->listWidget->addItem(s);
}

Problem is that after each iteration the Dialog window shifts a bit along the x and y direction. Why ? How can I fix its position ?

anda_skoa
3rd May 2014, 16:34
Sounds like something the platform's window manager is doing.

You could try using a QInputDialog instance and calling its move() method before exec().

Cheers,
_