```
//oneLed.h
#pragma once

#include<QPushButton>

class oneLed :public QPushButton
{
    Q_OBJECT

public:
    oneLed(QWidget* parent = 0);
protected:
    void doPainting();
};

```

---

```
#include"oneLed.h"
#include<QPainter>
oneLed::oneLed(QWidget* parent)
    :QPushButton(parent)
{
    connect(this, &QPushButton::clicked, this, &oneLed::doPainting);
}

void oneLed::doPainting()
{
        QPainter painter(this);
        //painter.setRenderHint(QPainter::Antialiasing);
        painter.setPen(QPen(QBrush("#888"), 1));
        painter.setBrush(QBrush(QColor("#888")));
        painter.drawEllipse(0, 0, this->width(), this->height());
        //painter.drawEllipse(0, 0, 30, 30);

}

```

---

```
//main.cpp
#include"oneLed.h"
#include <QtWidgets/QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    oneLed w;
    w.resize(100, 500);
    w.show();
    return a.exec();
}

```

I want to achieve the following effect:
When I clicked on the oneLed object, A circle appears at the position of the oneled object. When I click on the oneLed object again, the circle disappears.

But in fact when I click on the oneLed object, the circle doesn't appear.