You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
konversation/konversation/src/topiccombobox.cpp

51 lines
1.1 KiB

/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
*/
/*
begin: Don Nov 21 2002
copyright: (C) 2002 by Dario Abatianni
email: eisfuchs@tigress.com
*/
#include "topiccombobox.h"
TopicComboBox::TopicComboBox(TQWidget* parent) :
KComboBox(parent,"topic_combo_box")
{
connect(this,TQ_SIGNAL(activated(int)),this,TQ_SLOT(topicActivated(int)));
connect(this,TQ_SIGNAL(returnPressed(const TQString&)),this,TQ_SLOT(topicActivated(const TQString&)));
}
TopicComboBox::~TopicComboBox()
{
}
void TopicComboBox::topicActivated(const TQString& newTopic)
{
emit topicChanged(newTopic);
}
void TopicComboBox::topicActivated(int index)
{
emit topicChanged(text(index).section(' ',1));
}
void TopicComboBox::insertStringList(const TQStringList& list)
{
KComboBox::insertStringList(list);
setEditText(list[0].section(' ',1));
}
void TopicComboBox::wheelEvent(TQWheelEvent *ev)
{
ev->ignore();
}
#include "topiccombobox.moc"