Example #1
0
// KTimeWidget/QTimeEdit provide nicer editing, but don't provide a combobox.
// Difficult to get all in one...
// But Qt-3.2 will offer QLineEdit::setMask, so a "99:99" mask would help.
KTimeEdit::KTimeEdit(QWidget *parent, QTime qt, const char *name)
    : QComboBox(true, parent, name)
{
    setInsertionPolicy(NoInsertion);
    setValidator(new KOTimeValidator(this));

    mTime = qt;

    //  mNoTimeString = i18n("No Time");
    //  insertItem( mNoTimeString );

    // Fill combo box with selection of times in localized format.
    QTime timeEntry(0, 0, 0);
    do
    {
        insertItem(KGlobal::locale()->formatTime(timeEntry));
        timeEntry = timeEntry.addSecs(60 * 15);
    }
    while(!timeEntry.isNull());
    // Add end of day.
    insertItem(KGlobal::locale()->formatTime(QTime(23, 59, 59)));

    updateText();
    setFocusPolicy(QWidget::StrongFocus);

    connect(this, SIGNAL(activated(int)), this, SLOT(active(int)));
    connect(this, SIGNAL(highlighted(int)), this, SLOT(hilit(int)));
    connect(this, SIGNAL(textChanged(const QString &)), this, SLOT(changedText()));
}
Example #2
0
QGo4CommandsHistory::QGo4CommandsHistory(QWidget* w, const char* name) :
    QComboBox(TRUE, w, name)
{
   setMaxCount(50);
   setInsertionPolicy(AtTop);
   setDuplicatesEnabled(FALSE);
   setAutoCompletion(TRUE);
   fiEnterPressed = 0;
}
Example #3
0
KFileFilterCombo::KFileFilterCombo(QWidget *parent, const char *name) : KComboBox(true, parent, name), d(new KFileFilterComboPrivate)
{
    setTrapReturnKey(true);
    setInsertionPolicy(NoInsertion);
    connect(this, SIGNAL(activated(int)), this, SIGNAL(filterChanged()));
    connect(this, SIGNAL(returnPressed()), this, SIGNAL(filterChanged()));
    connect(this, SIGNAL(filterChanged()), SLOT(slotFilterChanged()));
    m_allTypes = false;
}
HistoryField::HistoryField( QWidget* parent, const char* name = 0 ) : QComboBox( true, parent, name ), digraphEnabled( false ) {
    setDuplicatesEnabled( false );
    setInsertionPolicy( QComboBox::AtBottom );
    setAutoCompletion( true );
    installEventFilter( this );
}