{
struct TEvent: public SALOME_Event
{
- QWidget* myWidget;
+ SVTK_ViewWindow* myVW;
SALOMEDS::Color myColor;
public:
- TEvent(QWidget* theWidget,
+ TEvent(SVTK_ViewWindow* theViewWindow,
const SALOMEDS::Color& theColor):
- myWidget(theWidget),
+ myVW(theViewWindow),
myColor(theColor)
{}
virtual void Execute(){
aColor[0] = int(255.0*myColor.R);
aColor[1] = int(255.0*myColor.G);
aColor[2] = int(255.0*myColor.B);
- QPalette aPal( myWidget->palette() );
- aPal.setColor( myWidget->backgroundRole(), QColor(aColor[0],aColor[1],aColor[2]) );
- myWidget->setPalette( aPal );
- //myWidget->setBackgroundColor(QColor(aColor[0],aColor[1],aColor[2]));
+ QColor aNewColor (aColor[0],aColor[1],aColor[2]);
+ myVW->setBackgroundColor(aNewColor);
}
};
-
- SUIT_ViewWindow* aVW = GetViewWindow();
+
+ SVTK_ViewWindow* aVW = dynamic_cast<SVTK_ViewWindow*>(GetViewWindow());
if (aVW)
ProcessVoidEvent(new TEvent(aVW, theColor));
}
struct TBackgroundEvent: public SALOME_Event
{
- QWidget* myWidget;
+ SVTK_ViewWindow* myVW;
typedef SALOMEDS::Color TResult;
TResult myResult;
- TBackgroundEvent(QWidget* theWidget):
- myWidget(theWidget)
+ TBackgroundEvent(SVTK_ViewWindow* theViewWindow):
+ myVW(theViewWindow)
{}
virtual
void
Execute()
{
- const QColor& aColor = myWidget->palette().color( myWidget->backgroundRole() );
- myResult.R = aColor.red()/255.0;
- myResult.G = aColor.green()/255.0;
- myResult.B = aColor.blue()/255.0;
+ vtkFloatingPointType backint[3];
+ GetRenderer(myVW)->GetBackground(backint);
+ myResult.R = backint[0];
+ myResult.G = backint[1];
+ myResult.B = backint[2];
}
};
View_i::
GetBackground()
{
- SUIT_ViewWindow* aVW = GetViewWindow();
+ SVTK_ViewWindow* aVW = dynamic_cast<SVTK_ViewWindow*>(GetViewWindow());
if (aVW)
return ProcessEvent(new TBackgroundEvent(aVW));