QWidget * QWidget::childAt ( int x, int y ) const
Returns the visible child widget at the position (x, y) in the widget's coordinate system. If there is no visible child widget at the specified position, the function returns 0.
fileDialog->childAt(160,120)->setFocus();
QFileDialog * fileDialog=new QFileDialog(this);
fileDialog->setWindowTitle(tr("发送文件"));
fileDialog->setDirectory("/lkj_send");
//fileDialog.setFilter(tr("All Files(*.*)"));
fileDialog->showMaximized();
//----------------------------------
// focusScrollArea
//----------------------------------
QDir dir("/test");
QStringList files(dir.entryList());
if(files.count()>3)
{
QString tmp2(files.at(2));
qWarning(tmp2.toLatin1());
fileDialog->selectFile(tmp2);
}
if(fileDialog->childAt(160,120)) //(160,120) viewWindow point
{
fileDialog->childAt(160,120)->setFocus();
QString oname(fileDialog->childAt(160,120)->objectName());
qWarning(oname.toLatin1());
}
else
{
qWarning("chindWidget not find");
}
|
阅读(1511) | 评论(0) | 转发(0) |