diff --git a/plugins/filetemplates/classidentifierpage.cpp b/plugins/filetemplates/classidentifierpage.cpp index 1709930b5..ff11ede3c 100644 --- a/plugins/filetemplates/classidentifierpage.cpp +++ b/plugins/filetemplates/classidentifierpage.cpp @@ -1,76 +1,74 @@ /* This file is part of KDevelop Copyright 2008 Hamish Rodda This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "classidentifierpage.h" #include "language/duchain/identifier.h" #include #include "ui_newclass.h" struct ClassIdentifierPagePrivate { ClassIdentifierPagePrivate() : classid(nullptr) { } Ui::NewClassDialog* classid; }; ClassIdentifierPage::ClassIdentifierPage(QWidget* parent) : QWidget(parent) , d(new ClassIdentifierPagePrivate()) { d->classid = new Ui::NewClassDialog; d->classid->setupUi(this); - d->classid->keditlistwidget->setContentsMargins(0, 0, 0, 0); - d->classid->keditlistwidget->layout()->setContentsMargins(0, 0, 0, 0); d->classid->keditlistwidget->lineEdit()->setPlaceholderText(i18n("Inheritance type and base class name")); d->classid->inheritanceLabel->setBuddy(d->classid->keditlistwidget->lineEdit()); connect(d->classid->identifierLineEdit, &QLineEdit::textChanged, this, &ClassIdentifierPage::checkIdentifier); emit isValid(false); } ClassIdentifierPage::~ClassIdentifierPage() { delete d->classid; delete d; } QString ClassIdentifierPage::identifier() const { return d->classid->identifierLineEdit->text(); } void ClassIdentifierPage::checkIdentifier() { emit isValid(!identifier().isEmpty()); } QStringList ClassIdentifierPage::inheritanceList() const { return d->classid->keditlistwidget->items(); } void ClassIdentifierPage::setInheritanceList (const QStringList& list) { d->classid->keditlistwidget->setItems(list); } diff --git a/plugins/filetemplates/testcasespage.cpp b/plugins/filetemplates/testcasespage.cpp index 8709e0af1..fb4580121 100644 --- a/plugins/filetemplates/testcasespage.cpp +++ b/plugins/filetemplates/testcasespage.cpp @@ -1,75 +1,73 @@ /* * This file is part of KDevelop * Copyright 2012 Miha Čančula * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "testcasespage.h" #include "ui_testcases.h" #include #include #include using namespace KDevelop; class KDevelop::TestCasesPagePrivate { public: Ui::TestCasesPage* ui; }; TestCasesPage::TestCasesPage(QWidget* parent, Qt::WindowFlags f) : QWidget (parent, f) , d(new TestCasesPagePrivate) { d->ui = new Ui::TestCasesPage(); d->ui->setupUi(this); d->ui->testCasesLabel->setBuddy(d->ui->keditlistwidget->lineEdit()); - d->ui->keditlistwidget->setContentsMargins(0, 0, 0, 0); - d->ui->keditlistwidget->layout()->setContentsMargins(0, 0, 0, 0); connect(d->ui->identifierLineEdit, &QLineEdit::textChanged, this, &TestCasesPage::identifierChanged); } TestCasesPage::~TestCasesPage() { delete d->ui; delete d; } QString TestCasesPage::name() const { return d->ui->identifierLineEdit->text(); } void TestCasesPage::setTestCases(const QStringList& testCases) { d->ui->keditlistwidget->setItems(testCases); } QStringList TestCasesPage::testCases() const { return d->ui->keditlistwidget->items(); } void TestCasesPage::identifierChanged(const QString& identifier) { emit isValid(!identifier.isEmpty()); }