Edwin Rodríguez

Cast signal in new C++11 Qt connection


This is the template

static_cast<return_type(ClassName::*)(arg_type1, arg_type2)>

Example

static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::activated)

Full example

connect(ui->comboBox, 
        static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::activated),
        ps,
        &PlotSystem::requestPlotsAvailable);

2017 - Edwin Rodríguez