I have a grid layout as(vtkOpenGLWidget) and inside I distribute the layout in four section. So, I want to highlight the view port when i will clicking on the it. This is my grid layout image view :
I will use this code for highlighting the view port code:
void QvtkOpenGLWidgetdrag::paintEvent(QPaintEvent *event)
{
QOpenGLWidget::paintEvent(event);
QPainter painter(this);
painter.setPen(QPen(QBrush(Qt::blue), 2));
if (hasFocus())
painter.drawRect(QRect(1, 1, width() - 2, height() - 2));
}
Its work fine, when i will clicked on the viewport. But i am getting issue when i will select any other module inside the Ui-viewer then it wil by default shows unselected. But, I have selected everytime and once i will select to the other viewport then only it unselect and select to the next view port and vice versa.
Any help is considerable for me. Thank you in advance