ViewerToolbar::ViewerToolbar(QWidget* theParent, XGUI_ViewPort* thePort)
: QToolBar(theParent), myVPort(thePort), myResize(false)
{
- setBackgroundRole(QPalette::NoRole);
- setAttribute(Qt::WA_NoSystemBackground);
- //setAttribute(Qt::WA_PaintOnScreen);
- setAutoFillBackground(false);
connect(myVPort, SIGNAL(resized()), this, SLOT(onViewPortResized()));
}
void ViewerToolbar::paintEvent(QPaintEvent* theEvent)
{
+ //QToolBar::paintEvent(theEvent);
// Paint background
QPainter aPainter(this);
QRect aRect = rect();
ViewerLabel::ViewerLabel(QWidget* theParent, XGUI_ViewPort* thePort)
: QLabel(theParent), myVPort(thePort), myResize(false)
{
- setBackgroundRole(QPalette::NoRole);
- setAttribute(Qt::WA_NoSystemBackground);
- //setAttribute(Qt::WA_PaintOnScreen);
- setAutoFillBackground(false);
connect(myVPort, SIGNAL(resized()), this, SLOT(onViewPortResized()));
}
QHBoxLayout* aToolLay = new QHBoxLayout();
aToolLay->setMargin(0);
aToolLay->setSpacing(0);
- aVPLay->setContentsMargins(0,0,0,0);
+ aToolLay->setContentsMargins(0,0,0,0);
aVPLay->addLayout(aToolLay);
aVPLay->addStretch();
}
parentWidget()->activateWindow();
myMinimizeBtn->setIcon(MinimizeIco);
+
+ // In order to avoid frosen background in toolbars when it shown as a second view
+ QTimer::singleShot(50, parentWidget(), SLOT(setFocus()));
}
//****************************************************************
} else {
showNormal();
}
- raise();
myViewer->onWindowActivated((QMdiSubWindow*)parentWidget());
+
+ // In order to avoid frosen background in toolbars when it shown as a second view
+ QTimer::singleShot(20, parentWidget(), SLOT(setFocus()));
+
return true;
}
}
QMdiSubWindow* vw = myViewer->createView();
XGUI_ViewWindow* aNewWnd = static_cast<XGUI_ViewWindow*>(vw->widget());
aNewWnd->viewPort()->syncronizeWith(myViewPort);
+
emit viewCloned( vw );
+
+ // In order to avoid frosen background in toolbars when it shown as a second view
+ QTimer::singleShot(20, vw, SLOT(setFocus()));
}
void XGUI_ViewWindow::dumpView()