You are not logged in.

1

Monday, July 12th 2010, 12:07pm

Complete Newbie - help required

Hi
I am completely new to QT
I am using VS2008 and have created a simple app that consists of a main window with a menu.
I created the main form with a menu using QT Designer.
I am having problems linking the menu items to methods in my code.
I have declared a slot in my header file -
public slots:
void OnOpen();
Then in my constructor I have
connect(ui.actionOpen,SIGNAL(triggered()),this,SLOT(on_open()));

The return value from this call is false.

Can anyone explain what I am doing wrong

TIA Graham

Junior

Professional

  • "Junior" is male

Posts: 1,613

Location: San Antonio, TX USA

Occupation: Senior Secure Systems Engineer

  • Send private message

2

Monday, July 12th 2010, 1:11pm

The connect slot name does not match the slot name you defined
OnOpen() != on_open()

Also when creating your own slot and signals you add in Q_OBJECT macro for qmake to generate the supporting moc files.

3

Monday, July 12th 2010, 2:19pm

DOH!!

Thanks