c++ - Qt- How to know about visibility of QDialog? -
is there anyway check visibility of specific qdialog? trying check this. here code:
messagedialog::messagedialog(qwidget *parent, int id, qstring name, qpixmap *photo) : qdialog(parent), m_id(id), m_name(name) { // ... if (messagedialog.isvisible()) qdebug()<<"visbile"; else qdebug()<<"invisible"; }
i'm getting error:
error: expected primary-expression before '.' token if (messagedialog.isvisible())
the problem trying call non-static function on messagedialog
class. should call isvisible()
function on dialog object, in case, should use this
or call isvisible()
.
if ( this->isvisible() ) // if ( isvisible() ) qdebug()<<"visbile"; else qdebug()<<"invisible";
but think won't either, because in constructor dialog not yet visible.
Comments
Post a Comment