libyui-qt
Loading...
Searching...
No Matches
YQComboBox.h
1/*
2 Copyright (C) 2000-2012 Novell, Inc
3 This library is free software; you can redistribute it and/or modify
4 it under the terms of the GNU Lesser General Public License as
5 published by the Free Software Foundation; either version 2.1 of the
6 License, or (at your option) version 3.0 of the License. This library
7 is distributed in the hope that it will be useful, but WITHOUT ANY
8 WARRANTY; without even the implied warranty of MERCHANTABILITY or
9 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10 License for more details. You should have received a copy of the GNU
11 Lesser General Public License along with this library; if not, write
12 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13 Floor, Boston, MA 02110-1301 USA
14*/
15
16
17/*-/
18
19 File: YQComboBox.h
20
21 Author: Stefan Hundhammer <shundhammer@suse.de>
22
23/-*/
24
25
26#ifndef YQComboBox_h
27#define YQComboBox_h
28
29#include <QFrame>
30#include <yui/YComboBox.h>
31
32class YQWidgetCaption;
33class QComboBox;
35
36
37class YQComboBox : public QFrame, public YComboBox
38{
39 Q_OBJECT
40
41public:
45 YQComboBox( YWidget * parent, const std::string & label, bool editable );
46
51
58 virtual void addItem( YItem * item );
59
65 virtual void deleteAllItems();
66
72 virtual void setLabel( const std::string & label );
73
79 virtual void setValidChars( const std::string & validChars );
80
86 virtual void setInputMaxLength( int numberOfChars );
87
92 bool isValidText( const QString & txt ) const;
93
99 virtual void setEnabled( bool enabled );
100
106 virtual int preferredWidth();
107
113 virtual int preferredHeight();
114
120 virtual void setSize( int newWidth, int newHeight );
121
125 virtual bool setKeyboardFocus();
126
127
128protected slots:
129
134 void slotSelected( int i );
135
141 void textChanged( QString );
142
143
144protected:
145
153 virtual std::string text();
154
164 virtual void setText( const std::string & newText );
165
166
167 //
168 // Data members
169 //
170
171 YQWidgetCaption * _caption;
172 QComboBox * _qt_comboBox;
173 QY2CharValidator * _validator;
174};
175
176
177#endif // YQLabel_h
Definition QY2CharValidator.h:35
Definition YQComboBox.h:38
virtual void addItem(YItem *item)
Definition YQComboBox.cc:140
virtual int preferredWidth()
Definition YQComboBox.cc:252
virtual void setText(const std::string &newText)
Definition YQComboBox.cc:117
virtual void setLabel(const std::string &label)
Definition YQComboBox.cc:172
void slotSelected(int i)
Definition YQComboBox.cc:224
virtual void setSize(int newWidth, int newHeight)
Definition YQComboBox.cc:264
virtual int preferredHeight()
Definition YQComboBox.cc:258
virtual std::string text()
Definition YQComboBox.cc:111
virtual bool setKeyboardFocus()
Definition YQComboBox.cc:278
bool isValidText(const QString &txt) const
Definition YQComboBox.cc:212
virtual void deleteAllItems()
Definition YQComboBox.cc:163
virtual void setInputMaxLength(int numberOfChars)
Definition YQComboBox.cc:245
virtual void setEnabled(bool enabled)
Definition YQComboBox.cc:270
void textChanged(QString)
Definition YQComboBox.cc:238
virtual void setValidChars(const std::string &validChars)
Definition YQComboBox.cc:179
~YQComboBox()
Definition YQComboBox.cc:105
Definition YQWidgetCaption.h:39