i used your code
Qt Code:
  1. void Widget::mousePressEvent(QMouseEvent *event)
  2. {
  3. if (event->button() & (Qt::LeftButton | Qt::RightButton))
  4. {
  5. showMaximized();
  6. activateWindow();
  7. update();
  8.  
  9. }
  10. }
To copy to clipboard, switch view to plain text mode 
when i press widget its get maximized,, but
Qt Code:
  1. void Widget::mousePressEvent(QMouseEvent *event)
  2. {
  3. if (event->button() & (Qt::LeftButton | Qt::RightButton))
  4. {
  5.  
  6. label->showMaximized();
  7. }
  8. }
To copy to clipboard, switch view to plain text mode 
when i clik label its not get maximized,,whats wrong am doing??

Quote Originally Posted by jefftee View Post
You ignored my question about setting a breakpoint to determine if your Widget::mousePressEvent is even being called. You can change the code all you want, but until you can confirm the method is being executed, you're wasting your time.

Also, the way you changed your code is not very efficient. Why would you duplicate the code like that? How about something like:

Qt Code:
  1. if (event->button() & (Qt::LeftButton | Qt::RightButton))
To copy to clipboard, switch view to plain text mode 
Before you respond and tell me that it's not working, please confirm your Widget::mousePressEvent is being executed.