Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

A question on QT 4 Slots

Name: Anonymous 2011-05-24 23:54

Okay, about a year or two ago when I wasn't as knowledgable about programming, I was tinkering with QT 4 to make a program that made binary decisions. Enter two strings in two separate QLineEdit child widgets, hit a button and the computer goes through 19 calls of rand() to find out which one to choose. All parts I found to work except the slots never fucking connected. Kept throwing a runtime error saying no slot existed. Today after looking back at my code and wanting to actually get into QT programming seriously, I still can't figure out why the fuck it isn't working.

Can anyone here who knows QT4 find out why the fuck the slot doesn't connect in this code?

mainwindow.hpp
http://pastebin.com/RSVjkzKV
mainwindow.cpp
http://pastebin.com/PRK1XvGt
And main.cpp was just this:
http://pastebin.com/nU12MMBs

Name: Anonymous 2011-05-25 0:22

The signature of a signal must match the signature of the receiving slot. (In fact a slot may have a shorter signature than the signal it receives because it can ignore extra arguments.)

i.e. clicked(void) should connect to a MakeDecision(void)

Name: Anonymous 2011-05-25 1:02

>>2

So how the fuck is one supposed to pass arguments to a slot when clicked() can't take arguments? And why the fuck wasn't that part explicitly mentioned in any of the documentation about signals and slots?

Name: Nambla_dot_org_rules_you 2011-05-25 2:12

>>3
You're a fucking moron. Stop playing with your dads computer and go back to your barbie dolls.

Name: Anonymous 2011-05-25 2:13

>>4

Stop being a namefag and don't post if you can't answer a fucking question.

Name: Nambla_dot_org_rules_you 2011-05-25 2:17

>>5
Get lost you autistic jew.

Name: Anonymous 2011-05-25 2:44

Why are you doing 19 calls to rand (3)?

Name: Anonymous 2011-05-25 4:33

Try connecting a penis to the slot in question.

Name: Anonymous 2011-05-25 7:44

>>4,6
fuck off and die you fucking faggot

Name: Anonymous 2011-05-25 8:01

>>3
create slot MakeDecision(void) in which you will read the values of foo and bar and call private method MakeDecision(foo, bar);
keep foo and bar as private members of MainWindow.

mainwindow.hpp
http://pastebin.com/tfMqaW02
mainwindow.cpp
http://pastebin.com/s9nC3C2q

Name: Anonymous 2011-05-25 8:03

>>10
uhmm, there's an error in mainwindow.hpp, there should be void Make_Decision(QString, QString); in private section instead of void Make_Decision();

Name: Anonymous 2011-05-25 13:37

>>11
nice dubs get

Name: Anonymous 2011-05-25 14:05

>>12

OP here, go back to /b/

Name: Anonymous 2011-05-25 14:40

>>13
OOP here, (new GetBacker (>>12)).getBack("/b/");

Name: Anonymous 2011-05-25 14:53

>>14
you mena
(new GetBacker (>>12))->getBack("/b/");

Name: Anonymous 2011-05-25 15:29

>>14
FP here, getBack >>12 $ boar*** Exception: stack overflow

Name: Anonymous 2011-05-25 17:25

>>16
echo PARENTHESES YOU IDIOT | banner | sed s/\#/\(\)/

Don't change these.
Name: Email:
Entire Thread Thread List