27 #include <QApplication>
32 connect(
this, SIGNAL(onViewport()),
34 connect(
this, SIGNAL(onItem(Q3ListBoxItem*)),
49 viewport()->setCursor(Qt::PointingHandCursor);
61 viewport()->unsetCursor();
74 disconnect(
this, SIGNAL( mouseButtonClicked(
int, Q3ListBoxItem *,
76 this, SLOT( slotMouseButtonClicked(
int, Q3ListBoxItem *,
85 connect(
this, SIGNAL( mouseButtonClicked(
int, Q3ListBoxItem *,
87 this, SLOT( slotMouseButtonClicked(
int, Q3ListBoxItem *,
102 viewport()->unsetCursor();
115 Qt::KeyboardModifiers keybstate = QApplication::keyboardModifiers();
117 Q3ListBoxItem* previousItem = item( currentItem() );
122 if( (keybstate & Qt::ShiftModifier) ) {
123 bool block = signalsBlocked();
124 blockSignals(
true );
127 if( !(keybstate & Qt::ControlModifier) )
131 bool update = viewport()->updatesEnabled();
132 viewport()->setUpdatesEnabled(
false );
136 for (;it ; it = it->next() ) {
141 if ( !down && it == previousItem ) {
142 setSelected( previousItem, select );
145 setSelected( it, select );
148 blockSignals( block );
149 viewport()->setUpdatesEnabled( update );
150 triggerUpdate(
false );
152 emit selectionChanged();
154 if( selectionMode() == Q3ListBox::Single )
157 else if( (keybstate & Qt::ControlModifier) )
160 bool block = signalsBlocked();
161 blockSignals(
true );
166 blockSignals( block );
172 kDebug() <<
"That's not supposed to happen!!!!";
177 Qt::KeyboardModifiers keybstate = QApplication::keyboardModifiers();
182 if( !(
m_bUseSingle && ((keybstate & Qt::ShiftModifier) || (keybstate & Qt::ControlModifier)) ) ) {
197 if( e->key() == Qt::Key_Escape )
201 else if( e->key() == Qt::Key_F1 )
227 if( (selectionMode() == Extended) && (e->modifiers() & Qt::ShiftModifier) && !(e->modifiers() & Qt::ControlModifier) ) {
228 bool block = signalsBlocked();
229 blockSignals(
true );
233 blockSignals( block );
243 Q3ListBoxItem* item = itemAt( contentsToViewport( e->pos() ) );
253 void K3ListBox::slotMouseButtonClicked(
int btn, Q3ListBoxItem *item,
const QPoint &pos )
255 if( (btn == Qt::LeftButton) && item )
259 #include "k3listbox.moc"