Changeset View
Changeset View
Standalone View
Standalone View
src/khistorycombobox.cpp
Show First 20 Lines • Show All 457 Lines • ▼ Show 20 Line(s) | |||||
458 | void KHistoryComboBoxPrivate::_k_simulateActivated(const QString &text) | 458 | void KHistoryComboBoxPrivate::_k_simulateActivated(const QString &text) | ||
459 | { | 459 | { | ||
460 | Q_Q(KHistoryComboBox); | 460 | Q_Q(KHistoryComboBox); | ||
461 | /* With the insertion policy NoInsert, which we use by default, | 461 | /* With the insertion policy NoInsert, which we use by default, | ||
462 | Qt doesn't emit activated on typed text if the item is not already there, | 462 | Qt doesn't emit activated on typed text if the item is not already there, | ||
463 | which is perhaps reasonable. Generate the signal ourselves if that's the case. | 463 | which is perhaps reasonable. Generate the signal ourselves if that's the case. | ||
464 | */ | 464 | */ | ||
465 | if ((q->insertPolicy() == q->NoInsert && q->findText(text, Qt::MatchFixedString | Qt::MatchCaseSensitive) == -1)) { | 465 | if ((q->insertPolicy() == q->NoInsert && q->findText(text, Qt::MatchFixedString | Qt::MatchCaseSensitive) == -1)) { | ||
466 | #if QT_DEPRECATED_SINCE(5, 15) || QT_VERSION < QT_VERSION_CHECK(5, 14, 0) | ||||
466 | emit q->activated(text); | 467 | emit q->activated(text); | ||
468 | #endif | ||||
469 | #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) | ||||
470 | emit q->textActivated(text); | ||||
471 | #endif | ||||
467 | } | 472 | } | ||
468 | 473 | | |||
469 | /* | 474 | /* | ||
470 | Qt also doesn't emit it if the box is full, and policy is not | 475 | Qt also doesn't emit it if the box is full, and policy is not | ||
471 | InsertAtCurrent | 476 | InsertAtCurrent | ||
472 | */ | 477 | */ | ||
473 | else if (q->insertPolicy() != q->InsertAtCurrent && q->count() >= q->maxCount()) { | 478 | else if (q->insertPolicy() != q->InsertAtCurrent && q->count() >= q->maxCount()) { | ||
479 | #if QT_DEPRECATED_SINCE(5, 15) || QT_VERSION < QT_VERSION_CHECK(5, 14, 0) | ||||
474 | emit q->activated(text); | 480 | emit q->activated(text); | ||
481 | #endif | ||||
482 | #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) | ||||
483 | emit q->textActivated(text); | ||||
484 | #endif | ||||
475 | } | 485 | } | ||
476 | } | 486 | } | ||
477 | 487 | | |||
478 | KPixmapProvider *KHistoryComboBox::pixmapProvider() const | 488 | KPixmapProvider *KHistoryComboBox::pixmapProvider() const | ||
479 | { | 489 | { | ||
480 | Q_D(const KHistoryComboBox); | 490 | Q_D(const KHistoryComboBox); | ||
481 | return d->pixmapProvider; | 491 | return d->pixmapProvider; | ||
482 | } | 492 | } | ||
Show All 9 Lines |