[Kde-bindings] [Bug 110194] QtRuby: connecting to protected and private slots always works

Richard Dale Richard_Dale at tipitina.demon.co.uk
Fri Aug 5 10:17:58 UTC 2005


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=110194         




------- Additional Comments From Richard_Dale tipitina demon co uk  2005-08-05 12:17 -------
On Friday 05 August 2005 10:16, Christian Loose wrote:
[bugs.kde.org quoted mail]
I tried this in C++ and it does exactly the same thing. This program gives no 
compile or runtime errors:

class TrySlots: public QMainWindow
{
    Q_OBJECT

public slots:
    void myPublicSlot();

protected slots:
    void myProtectedSlot();

private slots:
    void myPrivateSlot();
...

void TrySlots::myPublicSlot()
{
	printf("In myPublicSlot()\n");
}

void TrySlots::myProtectedSlot()
{
	printf("In myProtectedSlot()\n");
}

void TrySlots::myPrivateSlot()
{
	printf("In myPrivateSlot()\n");
}
...

    TrySlots * win = new TrySlots();
    QPushButton * b = new QPushButton(win);
    win->show();

    QObject::connect(b, SIGNAL(clicked()), mw, SLOT(myPublicSlot()));
    QObject::connect(b, SIGNAL(clicked()), mw, SLOT(myProtectedSlot())); 
    QObject::connect(b, SIGNAL(clicked()), mw, SLOT(myPrivateSlot()));

When I click the button, it outputs:

In myPublicSlot()
In myProtectedSlot()
In myPrivateSlot()

-- Richard



More information about the Kde-bindings mailing list