
Originally Posted by
ricardo
Do you mean !=NULL?
From the docs:
T qobject_cast ( QObject * object )
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns 0.
So
if(dock)
{
// sender is a QDockWidget
}
QDockWidget *dock = qobject_cast<QDockWidget *>(QObject::sender());
if(dock)
{
// sender is a QDockWidget
}
To copy to clipboard, switch view to plain text mode
... if you only dealing with a small number of dock widgets in you application and the slot has a pointer to them you can also of course use:
if (myglobalpointer
== QObject::sender()) //...
if (myglobalpointer == QObject::sender())
//...
To copy to clipboard, switch view to plain text mode
Bookmarks