# QVTKOpenGLNativeWidget turn to be transparent when pick actor

**URL:** https://discourse.vtk.org/t/qvtkopenglnativewidget-turn-to-be-transparent-when-pick-actor/7445
**Category:** Support
**Created:** [December 21, 2021, 10:13am UTC](https://discourse.vtk.org/t/qvtkopenglnativewidget-turn-to-be-transparent-when-pick-actor/7445 "2021-12-21T10:13:45Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![zhang-qiang-github](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhang-qiang-github/32/2519_2.png) [@zhang-qiang-github](https://discourse.vtk.org/u/zhang-qiang-github)
#### Post date: [December 21, 2021, 10:13am UTC](https://discourse.vtk.org/t/qvtkopenglnativewidget-turn-to-be-transparent-when-pick-actor/7445/1 "2021-12-21T10:13:45Z")

</div>

I am implement the project with `QVTKOpenGLNativeWidget`, and it works fine.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/d/d1f53718370911c90018adbd12a3ec6487d79447.png)

Then, I want to pick actor in the `mouseMoveEvent`, but the widget turn to be transparent when the cursor is move to the button (no click):

 ![image](https://discourse.vtk.org/uploads/default/original/2X/5/57bb923b969eb871f0f8b96ac843384c2be4cb96.png)

The code to reproduce this bug is:

```auto
class Widget : public QVTKOpenGLNativeWidget
{
public:
	Widget()
	{
		vtkSmartPointer<vtkSphereSource> sphere = vtkSmartPointer<vtkSphereSource>::New();
		vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();

		mapper->SetInputConnection(sphere->GetOutputPort());
		vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
		actor->SetMapper(mapper);
		render = vtkSmartPointer<vtkRenderer>::New();
		render->AddActor(actor);

		renWin = vtkSmartPointer<vtkGenericOpenGLRenderWindow>::New();
		renWin->AddRenderer(render);
		this->setRenderWindow(renWin);

		picker = vtkSmartPointer<vtkPropPicker>::New();
	}

	void mouseMoveEvent(QMouseEvent* event)
	{
		QVTKOpenGLNativeWidget::mouseMoveEvent(event);
		QPoint pos = event->pos();
		picker->PickProp(pos.x(), pos.y(), render);
	}

	vtkSmartPointer<vtkRenderer> render;
	vtkSmartPointer<vtkGenericOpenGLRenderWindow> renWin;
	vtkSmartPointer<vtkPropPicker> picker;
};

void main(int argc, char* argv[])
{
	
	QApplication a(argc, argv);
	QSurfaceFormat::setDefaultFormat(QVTKOpenGLNativeWidget::defaultFormat());
	QWidget* win = new QWidget();
	win->setWindowTitle("test project");
	QVBoxLayout* layout = new QVBoxLayout();
	win->setLayout(layout);
	QPushButton* btn = new QPushButton(win);
	btn->setText("window");

	Widget* widget = new Widget();

	layout->addWidget(btn);
	layout->addWidget(widget);

	win->show();
	win->resize(800, 600);

	a.exec();

	
}

```

My environment is:

```auto
win10
vs 2019
vtk 9.0.3
qt 5.12.4

```

Firstly, I click on the vtkwidget, then I move the cursor to the `QPushButton`, the vtkwidget will be transparent. If I re-click on the vtkwidget, the vtkwidget will turn to be normal.

Any suggestion is appreciated!

---

<div class="post-metadata">

### Author: ![zhang-qiang-github](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhang-qiang-github/32/2519_2.png) [@zhang-qiang-github](https://discourse.vtk.org/u/zhang-qiang-github)
#### Post date: [December 29, 2021, 1:24am UTC](https://discourse.vtk.org/t/qvtkopenglnativewidget-turn-to-be-transparent-when-pick-actor/7445/2 "2021-12-29T01:24:28Z")

</div>

Answer by myself, this bug has been fixed in vtk 9.1.0.
