[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: last accessed combobox
From:       Bram Schoenmakers <bramschoenmakers () kde ! nl>
Date:       2006-01-08 23:30:06
Message-ID: 200601090030.07970.bramschoenmakers () kde ! nl
[Download RAW message or body]

Op maandag 09 januari 2006 00:10, schreef Bram Biesbrouck:

Hi,

> oh, and another thing that is bothering me for some time now:
>
> I have a slot that is connected to the activated(String) signal of a
> KComboBox. Is there a way to get a reference to that combobox-object in
> this slot?
>
> Bram

Subclass it and add a new signal with a QString and a KComboBox as parameter. 

class MyCombo: public KComboBox
{
	...
protected slots:
	void slotActivated( QString * );

signals:
	void activated( QString, KComboBox * );
	...
}

MyCombo::MyCombo( ... )
: KComboBox( ... )
{
connect( this, SIGNAL( activated( QString ) ),   
SLOT( slotActivated( QString ) ) );
}

void MyCombo::slotActivated( QString s )
{
	emit activated( s, this )
}

// Kind regards,

-- 
Bram Schoenmakers
KDE Netherlands (www.kde.nl)

What is mind? No matter. What is matter? Never mind.
  (Punch, 1855)
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic