Chinaunix首页 | 论坛 | 博客

OS

  • 博客访问: 2226250
  • 博文数量: 691
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 2660
  • 用 户 组: 普通用户
  • 注册时间: 2014-04-05 12:49
个人简介

不浮躁

文章分类

全部博文(691)

文章存档

2019年(1)

2017年(12)

2016年(99)

2015年(207)

2014年(372)

分类: LINUX

2014-11-14 19:35:12

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


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