Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用QT。我想为 QGraphicsScene 设置可访问的名称,因为在鼠标单击时我想检查是否已单击女巫图形场景?谢谢你
从 QObject(包括 QGraphicsScene)派生的每个类都有以下函数为其设置名称:
void setObjectName ( const QString & name )
您可以使用此函数检索此名称:
QString objectName () const