File indexing completed on 2025-02-02 05:41:05
0001 // SPDX-License-Identifier: GPL-2.0-or-later 0002 // SPDX-FileCopyrightText: 2007 Dominik Seichter <domseichter@web.de> 0003 0004 #ifndef EXT_HISTORY_COMBO_H 0005 #define EXT_HISTORY_COMBO_H 0006 0007 #include <QTimer> 0008 #include <KHistoryComboBox> 0009 0010 /** A combobox with an item history, additional context 0011 * menu entries for KRename tokens and a delayed text input 0012 * signal which is only emitted after the user has typed 0013 * sevaral characters. 0014 */ 0015 class ExtHistoryCombo : public KHistoryComboBox 0016 { 0017 Q_OBJECT 0018 0019 public: 0020 /** 0021 * Create a new ExtHistoryCombo object with a parent and a name. 0022 * 0023 * @param parent Parent widget 0024 */ 0025 explicit ExtHistoryCombo(QWidget *parent); 0026 0027 /// Fix compilation, designer needs this method 0028 inline void insertItems(int, QStringList &list) 0029 { 0030 KHistoryComboBox::insertItems(list); 0031 } 0032 0033 void loadConfig(); 0034 void saveConfig(); 0035 0036 /** 0037 * select the current contents of the combobox. 0038 */ 0039 void selectAll(); 0040 0041 Q_SIGNALS: 0042 void delayedTextChanged(); 0043 0044 private Q_SLOTS: 0045 void slotTextChanged(); 0046 0047 private: 0048 QTimer m_timer; 0049 0050 }; 0051 0052 #endif /* EXT_HISTORY_COMBO_H */ 0053