the other method:
I Reimplement mousePressEvent(), the code as following:
the code in .h:
void mousePressEvent(QMouseEvent *event);
To copy to clipboard, switch view to plain text mode
the code in .cpp:
{
if( )//the condition:the position is in the List
{
event->ignore();
}
else event->accept();
}
void ProgramList::mousePressEvent(QMouseEvent *event)
{
QWidget::mousePressEvent(event);
if( )//the condition:the position is in the List
{
event->ignore();
}
else event->accept();
}
To copy to clipboard, switch view to plain text mode
Then i find the function "mousePressEvent" don't excute when i click the list ; but it excute when i click the Label.
There must be something wrong in my program. it's so nice for you to point it out and give me the correct code. thanks very much.
Bookmarks