Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4793167
  • 博文数量: 22
  • 博客积分: 731
  • 博客等级: 军士长
  • 技术积分: 260
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-25 17:53
个人简介

技术宅,开源软件爱好者 虚拟机,编译器,编辑器,MCU IP,数据结构,操作系统,TCP/IP协议

文章分类

全部博文(22)

文章存档

2015年(1)

2014年(2)

2013年(2)

2011年(4)

2010年(13)

分类: LINUX

2010-12-08 17:06:26

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");
    }
    


阅读(3414) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~