File indexing completed on 2024-07-21 07:58:07

0001 /*
0002     SPDX-FileCopyrightText: 2011 Ilia Kats <ilia-kats@gmx.net>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #include "ipv6delegate.h"
0008 
0009 #include <QLineEdit>
0010 
0011 #include "simpleipv6addressvalidator.h"
0012 
0013 IpV6Delegate::IpV6Delegate(QObject *parent)
0014     : Delegate(parent)
0015 {
0016 }
0017 IpV6Delegate::~IpV6Delegate() = default;
0018 
0019 QWidget *IpV6Delegate::createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &) const
0020 {
0021     auto editor = new QLineEdit(parent);
0022     editor->setValidator(new SimpleIpV6AddressValidator(SimpleIpV6AddressValidator::Base, editor));
0023 
0024     return editor;
0025 }
0026 
0027 #include "moc_ipv6delegate.cpp"