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

Originally Posted by
jefftee
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:
if (event->button() & (Qt::LeftButton | Qt::RightButton))
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.
Bookmarks