I am thinking the shadow that you see is related to the Windows theme that you are using. I am using the Windows Classic Theme here and i don't see any shadows :)
Anyways, what if you connect the textChanged() SIGNAL of the QLineEdit into a custom action that restores the focus of the Main Window? Something like:
void PopupTest::handleClick()
{
QFrame* popup1 = new QFrame(this, Qt::Tool | Qt::Window | Qt::FramelessWindowHint);
popup1->resize(150,100);
QLineEdit *tmpE = new QLineEdit( popup1 );
connect( tmpE, SIGNAL( returnPressed() ), popup1, SLOT( hide() ) );
connect( tmpE, SIGNAL( textChanged(const QString&)), this, SLOT( setActive() ) );
tmpE->setGeometry(10,10, 130, 30);
tmpE->setFocus();
popup1->show();
}
void MainWindow::setActive()
{
this->activateWindow();
}
You will have to create a slot called setActive() and you should also put the QLineEdit into your class header so that from the setActive() function you can do something like:
tmpE->setFocus();
to restore the focus on the QLineEdit as well.