Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: [Wireshark-dev] QT wireshark problem no such slot

From: Alexis LE METAYER <alexis.lemetayer@xxxxxxxxx>
Date: Tue, 29 Sep 2015 16:21:03 +0200

Hi everyone,

I'm trying to modify the sources codes of wireshark QT but apparently I can't add new slots. I mean i added in main_windows.h my declaration,

void PingCouter();

in main_windows_slot.cpp my code

void MainWindow::PingCounter()
{

  plugin_test *test = new plugin_test(this);
  test->show();
}

and in main_windows.cpp my connect slot

  QAction *Ping_Counter = new QAction;
  connect(Ping_Counter, SIGNAL(triggered()), this, SLOT(PingCounter()));

I have no compilation errors but i have a runtime message :

  QObject::connect: No such slot MainWindow::PingCounter()
  QObject::connect:  (receiver name: 'MainWindow')

I watched in moc_main_windows.cpp to be sure that my slot was here but it is not. therefore i think there is a problem here but i don't know how to resolve this one.

thanks for your help