Shyam
Shyam

Reputation: 881

How to receive mouse press event on clicking QTableWidget?

I'm having a table with 100 datas. I need to receive mouse press event while clicking on the table.

Here is the code:

ui->tableWidget->viewport()->installEventFilter(this);    


bool Dbtable::eventFilter(QObject *obj, QEvent *event)
{
    if(event->type() == QEvent::MouseButtonPress)
    {
        debugLog("# TABLE WIDGET IS PRESSED");
        return ;
    }
}

Now the table is not visible.

Could any one help me in solving this?

Upvotes: 1

Views: 1809

Answers (1)

andrea.marangoni
andrea.marangoni

Reputation: 1499

have you tried returning QWidget::eventFilter()

Upvotes: 1

Related Questions