This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

QT no such slot

0

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 mainwindows_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 mocmainwindows.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

asked 29 Sep ‘15, 06:43

Hystreal's gravatar image

Hystreal
6224
accept rate: 0%

edited 29 Sep ‘15, 06:49

grahamb's gravatar image

grahamb ♦
19.8k330206


2 Answers:

0

You should hop over to the developers mailing list, that's were we all hang out discussing these things. Come and join us.

answered 29 Sep '15, 06:50

Jaap's gravatar image

Jaap ♦
11.7k16101
accept rate: 14%

Any idea ?

i sent a mail to the developers mailing list but i have no feedback.

(02 Oct '15, 02:42) Hystreal

There was a response on the 30th, by Graham Bloice.

(16 Oct '15, 00:53) Jaap ♦

oh sorry i'm new on this, i thought that i'll receive an email. But now i don't know how to answer.

(16 Oct '15, 01:17) Hystreal

Have you actually used "Subscribing to Wireshark-dev"? or just dropped a mail to [email protected] ? In the former case you get echoed all discussion, in the later it's a one way street.

Anyways, you can always dig into the archive

(16 Oct '15, 04:31) Jaap ♦

Yes i used "subscribing to wireshark-dev", i found my post but i don't know how to answer. i mean i don't know if i have to send another mail or if there is an answer button?

(19 Oct '15, 01:07) Hystreal

0

Is "void PingCouter();" listed under a "slots:" section in main_window.h? The primary difference between slots and regular C++ member functions is that the "moc" utility adds slots to a function table. Without a defined slot, "connect" won't find an entry in the table.

answered 29 Sep '15, 09:22

Gerald%20Combs's gravatar image

Gerald Combs ♦♦
3.3k92258
accept rate: 24%

Yes it is in public slot section

(29 Sep '15, 09:24) Hystreal