I want to highlight the grid layout view port after click?
-
Hi,
What are these sections ?
-
What about QRubberBand ?
-
What about QRubberBand ?
-
Well... With that much information, it sure is easy to help you.
You might want to consider explaining what you tried, what you got, etc.
-
Well... With that much information, it sure is easy to help you.
You might want to consider explaining what you tried, what you got, etc.
@SGaist I used this one code for highlighting. I do not understand, why we r taking "origin". In this link http://doc.qt.io/qt-5/qrubberband.html
void mainwindow::mousePressEvent(QMouseEvent *event)
{
//origin = event->pos();
if (!this->ui->view1)
return;
this->ui->view1->setGeometry(QRect(event->pos(), QSize()));
this->ui->view1->show();
}void mainwindow::mouseMoveEvent(QMouseEvent *event)
{
this->ui->view1->setGeometry(QRect(event->pos(), event->pos()).normalized());
}void mainwindow::mouseReleaseEvent(QMouseEvent *event)
{
this->ui->view1->hide();
} -
Well... With that much information, it sure is easy to help you.
You might want to consider explaining what you tried, what you got, etc.
-
In your case, you don't build the rectangle using mouse move, hence you can ignore that part. A border around what ?
-
In your case, you don't build the rectangle using mouse move, hence you can ignore that part. A border around what ?