Contact cannot be a null ptr, and it is accessed before anyway. Disscussed with kedge.
[kdenetwork.git] / kppp / iplined.cpp
blob2e5bfc567e6ed8816ee41ddb089d211e38c2ee80
1 /*
2 * kPPP: A pppd front end for the KDE project
4 * $Id$
5 *
6 * Copyright (C) 1997 Bernd Johannes Wuebben
7 * wuebben@math.cornell.edu
9 * based on EzPPP:
10 * Copyright (C) 1997 Jay Painter
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with this program; if not, write to the Free
24 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 #include "iplined.h"
29 IPLineEdit::IPLineEdit( QWidget *parent, const char *name )
30 : KRestrictedLine(parent)
32 setValidChars(QString("0123456789."));
33 setObjectName(name);
34 setMaxLength(3 * 4 + 1 * 3);
37 QSize IPLineEdit::sizeHint() const {
38 QFontMetrics fm = fontMetrics();
40 QSize s;
41 s.setHeight(QLineEdit::sizeHint().height());
42 s.setWidth(fm.boundingRect("888.888.888.888XX").width());
43 return s;