[Qt-interest] Finding window ID

Brian McGillion brian.mcgillion at symbio.com
Wed May 5 12:19:09 CEST 2010


Hi,


I am creating a widget in one application, and trying to find that widget
id in another application.

WidgetCreator:

QWidget *myWidget = new QWidget();
myWidget->show();
qDebug() << myWidget->winId(); //used in second application

QWidget *foundWidget = QWidget::find(myWidget->winId());
if (!foundWidget)
    qDebug("Cant find widget");


WidgetConsumer:

QWidget *remote = QWidget::find((WId)77594641); //from qDebug()

if (!remote)
    qDebug() << "Error finding window";


in WidgetCreator the widget is found successfully, but in the Consumer I
always get NULL returned from QWidget::find().

I am using linux and from a terminal I run "xwininfo -tree -root" and I
can see the window listed there.

Does anyone know what I can do to correct this?

Thanks,
Brian




More information about the Qt-interest-old mailing list