Signals | Public Member Functions

Seeker Class Reference

Item finding tool used in SeekerWidget. More...

#include <baseeditor.h>

Inheritance diagram for Seeker:
Inheritance graph
[legend]
Collaboration diagram for Seeker:
Collaboration graph
[legend]

List of all members.

Signals

void found (const QModelIndex &index)

Public Member Functions

 Seeker (QWidget *parent=0)
void setModel (QAbstractItemModel *model)
void setCompletionColumn (const int &column)
SeekerWidgetwidget () const

Detailed Description

Item finding tool used in SeekerWidget.

I wanted to implement it with a expandable group box. Unfortunately, standard Qt library doesn't provide one. It's also not that difficult to write one from scratch, but it looked clumsy on first try. Eventualy I used one from the KDE framework. It's still a bit clumsy, but it's the best I could find.


Constructor & Destructor Documentation

Seeker::Seeker ( QWidget parent = 0  ) 

                                        : KExpandableGroupBox("Search for record", parent)
{
    setWidget(new SeekerWidget(this));
    connect(widget()->completer(), SIGNAL(activated(QModelIndex)),
            this, SLOT(onCompletionActivation(QModelIndex)));
}


Member Function Documentation

void Seeker::found ( const QModelIndex index  )  [signal]
void Seeker::setCompletionColumn ( const int &  column  ) 

{
    widget()->completer()->setCompletionColumn(column);
}

void Seeker::setModel ( QAbstractItemModel model  ) 

Referenced by MappedBaseEditor::MappedBaseEditor().

{
    widget()->completer()->setModel(model);
    connect(model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
            this, SLOT(updateColumnBox()));
    connect(model, SIGNAL(modelReset()),
            this, SLOT(updateColumnBox()));
    updateColumnBox();
}

SeekerWidget * Seeker::widget (  )  const
Returns:
the widget contained
See also:
setWidget()

Reimplemented from KExpandableGroupBox.

Referenced by Seeker(), setCompletionColumn(), and setModel().

{
    return dynamic_cast<SeekerWidget*>(KExpandableGroupBox::widget());
}


The documentation for this class was generated from the following files: