C++ (Qt)void paneWidget::showCustomMenu(const QPoint &pos){ QMenu * arrowMenu = new QMenu( this ); arrowMenu ->addAction( "anytext1" ); arrowMenu ->addAction( "anytext2" ); QAction * textAction = arrowMenu ->exec( m_toolButtonArrow->mapToGlobal( pos ) ); qDebug() << textAction->text();}
void f(int) {}void f(void *) {}void g(){ f(0); // f(int) f(nullptr); // f(void*)}