initViewActions();
     initCursors();
+
+       setBackgroundRole( QPalette::NoRole );//NoBackground );
+       // set focus policy to threat QContextMenuEvent from keyboard  
+       setFocusPolicy( Qt::StrongFocus );
+       setAttribute( Qt::WA_PaintOnScreen );
+       setAttribute( Qt::WA_NoSystemBackground );
+
 }
 
 View::~View()
     return myViewActions;
 }
 
+/*!
+  Get paint engine for the OpenGL viewer. [ virtual public ]
+*/
+QPaintEngine* View::paintEngine() const
+{
+  return 0;
+}
+
 void View::initViewActions()
 {
   if ( myViewActions )
         theButtonDownY = y;
     }
 
-    if ( TheState == 0 )
+    if ( TheState == 1 )
     {
         myContext->Select( theButtonDownX, theButtonDownY, x, y, myView );
         emit selectionChanged();
 
                                                       Standard_Integer&,
                                                                              TopAbs_ShapeEnum& SelectionMode,
                                                                              Standard_Boolean& );
+       virtual QPaintEngine*          paintEngine() const;
 signals:
     void                          selectionChanged();
 
 
        Handle(V3d_View) getView() const { return myView; }
     Voxel_Selector& getSelector() { return mySelector; }
     void setPrs(const Handle(Voxel_Prs)& prs) { myPrs = prs; }
+       virtual QPaintEngine*          paintEngine() const;
 
 signals:
        
 
     myView->TriedronDisplay(Aspect_TOTP_LEFT_LOWER, Quantity_NOC_BLACK, 0.1, V3d_ZBUFFER);
 
     mySelector.Init(myView);
+
+       setBackgroundRole( QPalette::NoRole );//NoBackground );
+       // set focus policy to threat QContextMenuEvent from keyboard  
+       setFocusPolicy( Qt::StrongFocus );
+       setAttribute( Qt::WA_PaintOnScreen );
+       setAttribute( Qt::WA_NoSystemBackground );
 }
 
 Viewer::~Viewer()
 }
 
 
+/*!
+  Get paint engine for the OpenGL viewer. [ virtual public ]
+*/
+QPaintEngine* Viewer::paintEngine() const
+{
+  return 0;
+}
+
 void Viewer::resizeEvent(QResizeEvent * e)
 {
     if (!myView.IsNull())