void
SomeClass
::SomeLabel::mouseMoveEvent( QMouseEvent *event
){
Q_UNUSED( event );
// Show tooltip at a particular place of the icon, no matter where
// the mouse comes into the icon
QToolTip::showText( this
->mapToGlobal
( QPoint( this
->minimumSize
().
width()/2, this
->minimumSize
().
height()/2 ) ), this
->toolTip
(),
this, this
->rect
() );
QLabel::mouseMoveEvent( event
);
return;
}
// virtual
void
{
menu.addAction( m_copyInvalidityMessage );
menu.exec( event->globalPos() );
return;
}
void
SomeClass::SomeLabel::copyInvalidityMessageAction( void )
{
m_copyInvalidityMessage
= new QAction( QIcon( ":/application/Copy.ico" ), tr
( "Copy Message" ),
this );
connect( m_copyInvalidityMessage, SIGNAL( triggered( void ) ), this, SLOT( copyInvalidityTriggered( void ) ) );
return;
}
void
SomeClass::SomeLabel::copyInvalidityTriggered(void)
{
return;
}
void
SomeClass::SomeLabel::mouseMoveEvent( QMouseEvent *event )
{
Q_UNUSED( event );
// Show tooltip at a particular place of the icon, no matter where
// the mouse comes into the icon
QToolTip::showText( this->mapToGlobal( QPoint( this->minimumSize().width()/2, this->minimumSize().height()/2 ) ), this->toolTip(), this, this->rect() );
QLabel::mouseMoveEvent( event );
return;
}
// virtual
void
SomeClass::SomeLabel::contextMenuEvent( QContextMenuEvent *event )
{
QMenu menu;
menu.addAction( m_copyInvalidityMessage );
menu.exec( event->globalPos() );
return;
}
void
SomeClass::SomeLabel::copyInvalidityMessageAction( void )
{
m_copyInvalidityMessage = new QAction( QIcon( ":/application/Copy.ico" ), tr( "Copy Message" ), this );
connect( m_copyInvalidityMessage, SIGNAL( triggered( void ) ), this, SLOT( copyInvalidityTriggered( void ) ) );
return;
}
void
SomeClass::SomeLabel::copyInvalidityTriggered(void)
{
QApplication::clipboard()->setText( text() );
return;
}
To copy to clipboard, switch view to plain text mode
Bookmarks