[Qt-interest] Creating a new slot with qtcreator
Svenn Are Bjerkem
svenn.bjerkem at googlemail.com
Fri Jun 19 01:57:07 CEST 2009
Hi,
I'm following "The independent Qt Tutorial" address book example on
http://www.digitalfanatics.org/projects/qt_tutorial/chapter07.html and
obviously this tutorial is using Qt Designer and an older version of
Qt, but I wanted to take the challenge to re-perform it in qtcreator.
Now I am a bit stuck on the part where the addContact() slot is
supposed to be created. From a search on google it looks as if there
is no way of defining a new slot the way Qt Designer does it in this
tutorial.
I use MainWindow instead of frmMain as qtcreator start with a set of
predefined file and class names, and I tried to create a new slot by
editing the MainWindow.h file and add
private slots:
void addContact();
void on_aAddContact_triggered();
in the hope that something would happen automagically behind the scene
when I saved the file. Alas, this did not happen. The selection boxes
in the signal and slot editor did not show any new slot that I could
connect to. Maybe I am supposed to put the code that would go into the
addContact() slot definition into on_aAddContact_triggered() instead.
I will do that, but maybe some of the more qtcreator savvy users could
shed some light on how qtcreator wants the user to use slots. Maybe
complete slot edit is a future feature of qtcreator.
--
Svenn
More information about the Qt-interest-old
mailing list