00001 /* 00002 * kPPP: A pppd front end for the KDE project 00003 * 00004 * $Id: iplined.cpp,v 1.2 2003/08/09 17:14:55 kergoth Exp $ 00005 * 00006 * Copyright (C) 1997 Bernd Johannes Wuebben 00007 * wuebben@math.cornell.edu 00008 * 00009 * based on EzPPP: 00010 * Copyright (C) 1997 Jay Painter 00011 * 00012 * This library is free software; you can redistribute it and/or 00013 * modify it under the terms of the GNU Library General Public 00014 * License as published by the Free Software Foundation; either 00015 * version 2 of the License, or (at your option) any later version. 00016 * 00017 * This library is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 * Library General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU Library General Public 00023 * License along with this program; if not, write to the Free 00024 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00025 */ 00026 00027 #include "iplined.h" 00028 00029 IPLineEdit::IPLineEdit( QWidget *parent, const char *name ) 00030 : QLineEdit(parent, name )//, "0123456789.") 00031 { 00032 setMaxLength(3 * 4 + 1 * 3); 00033 } 00034 00035 QSize IPLineEdit::sizeHint() const { 00036 QFontMetrics fm = fontMetrics(); 00037 00038 QSize s; 00039 s.setHeight(QLineEdit::sizeHint().height()); 00040 s.setWidth(fm.boundingRect("888.888.888.888XX").width()); 00041 return s; 00042 }
1.4.2