• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop Property Editing Library
 

KDevelop Property Editing Library

  • lib
  • widgets
  • propeditor
qeditlistbox.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2000 David Faure <faure@kde.org>, Alexander Neundorf <neundorf@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef TQEDITLISTBOX_H
21 #define TQEDITLISTBOX_H
22 
23 #include <tqgroupbox.h>
24 #include <tqlistbox.h>
25 
26 class KLineEdit;
27 class TQComboBox;
28 class TQPushButton;
29 
43 class QEditListBoxPrivate;
44 
45 class QEditListBox : public TQGroupBox
46 {
47  Q_OBJECT
48 
49 
50  TQ_PROPERTY( TQStringList items READ items WRITE setItems )
51 
52 public:
53  // @since 3.1
54  class CustomEditor
55  {
56  public:
57  CustomEditor()
58  : m_representationWidget( 0L ),
59  m_lineEdit( 0L ) {}
60  CustomEditor( TQWidget *repWidget, KLineEdit *edit )
61  : m_representationWidget( repWidget ),
62  m_lineEdit( edit ) {}
63  CustomEditor( TQComboBox *combo );
64 
65  void setRepresentationWidget( TQWidget *repWidget ) {
66  m_representationWidget = repWidget;
67  }
68  void setLineEdit( KLineEdit *edit ) {
69  m_lineEdit = edit;
70  }
71 
72  virtual TQWidget *representationWidget() const {
73  return m_representationWidget;
74  }
75  virtual KLineEdit *lineEdit() const {
76  return m_lineEdit;
77  }
78 
79  protected:
80  TQWidget *m_representationWidget;
81  KLineEdit *m_lineEdit;
82  };
83 
84  public:
85 
90  enum Button { Add = 1, Remove = 2, UpDown = 4, All = Add|Remove|UpDown };
91 
104  QEditListBox(TQWidget *parent = 0, const char *name = 0,
105  bool checkAtEntering=false, int buttons = All );
112  QEditListBox(const TQString& title, TQWidget *parent = 0,
113  const char *name = 0, bool checkAtEntering=false,
114  int buttons = All );
115 
128  QEditListBox( const TQString& title,
129  const CustomEditor &customEditor,
130  TQWidget *parent = 0, const char *name = 0,
131  bool checkAtEntering = false, int buttons = All );
132 
133  virtual ~QEditListBox();
134 
138  TQListBox* listBox() const { return m_listBox; }
142  KLineEdit* lineEdit() const { return m_lineEdit; }
146  TQPushButton* addButton() const { return servNewButton; }
150  TQPushButton* removeButton() const { return servRemoveButton; }
154  TQPushButton* upButton() const { return servUpButton; }
158  TQPushButton* downButton() const { return servDownButton; }
159 
163  int count() const { return int(m_listBox->count()); }
167  void insertStringList(const TQStringList& list, int index=-1);
171  void insertStrList(const TQStrList* list, int index=-1);
175  void insertStrList(const TQStrList& list, int index=-1);
179  void insertStrList(const char ** list, int numStrings=-1, int index=-1);
183  void insertItem(const TQString& text, int index=-1) {m_listBox->insertItem(text,index);}
187  void clear();
191  TQString text(int index) const { return m_listBox->text(index); }
195  int currentItem() const;
199  TQString currentText() const { return m_listBox->currentText(); }
200 
204  TQStringList items() const;
205 
211  void setItems(const TQStringList& items);
212 
213  signals:
214  void changed();
215 
221  void added( const TQString & text );
222 
228  void removed( const TQString & text );
229 
230  protected slots:
231  //the names should be self-explaining
232  void moveItemUp();
233  void moveItemDown();
234  void addItem();
235  void removeItem();
236  void enableMoveButtons(int index);
237  void typedSomething(const TQString& text);
238 
239  private:
240  TQListBox *m_listBox;
241  TQPushButton *servUpButton, *servDownButton;
242  TQPushButton *servNewButton, *servRemoveButton;
243  KLineEdit *m_lineEdit;
244 
245  //this is called in both ctors, to avoid code duplication
246  void init( bool checkAtEntering, int buttons,
247  TQWidget *representationWidget = 0L );
248 
249  protected:
250  virtual void virtual_hook( int id, void* data );
251  private:
252  //our lovely private d-pointer
253  QEditListBoxPrivate *d;
254 };
255 
256 #endif

KDevelop Property Editing Library

Skip menu "KDevelop Property Editing Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

KDevelop Property Editing Library

Skip menu "KDevelop Property Editing Library"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for KDevelop Property Editing Library by doxygen 1.8.13
This website is maintained by Timothy Pearson.