Commit 5b5ca0e6 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

No need for intermediate QWidget, deploy UI directly on ConfigPage

parent 5d78e22c
......@@ -97,11 +97,8 @@ void QtHelpConfigEditDialog::accept()
QtHelpConfig::QtHelpConfig(QtHelpPlugin* plugin, QWidget *parent)
: KDevelop::ConfigPage(plugin, nullptr, parent)
{
QVBoxLayout * l = new QVBoxLayout( this );
QWidget* w = new QWidget;
m_configWidget = new Ui::QtHelpConfigUI;
m_configWidget->setupUi( w );
m_configWidget->setupUi(this);
m_configWidget->addButton->setIcon(QIcon::fromTheme("list-add"));
connect(m_configWidget->addButton, &QPushButton::clicked, this, &QtHelpConfig::add);
......@@ -134,7 +131,6 @@ QtHelpConfig::QtHelpConfig(QtHelpPlugin* plugin, QWidget *parent)
i18n("The command \"qmake -query\" could not provide a path to a QtHelp file (QCH)."));
m_configWidget->loadQtDocsCheckBox->setVisible(false);
}
l->addWidget(w);
reset();
}
......
......@@ -23,8 +23,6 @@
#include "sessionsettings.h"
#include <QVBoxLayout>
#include "sessionconfig.h"
#include "ui_sessionsettings.h"
......@@ -32,12 +30,7 @@ SessionSettings::SessionSettings(QWidget* parent)
: ConfigPage(nullptr, SessionConfig::self(), parent)
, m_settings(new Ui::SessionSettings)
{
auto l = new QVBoxLayout(this);
auto w = new QWidget(this);
m_settings->setupUi(w);
l->addWidget(w);
m_settings->setupUi(this);
}
void SessionSettings::reset()
......
......@@ -20,8 +20,6 @@
#include "cmakebuilderpreferences.h"
#include <QVBoxLayout>
#include <interfaces/icore.h>
#include <interfaces/iplugincontroller.h>
......@@ -33,11 +31,8 @@
CMakeBuilderPreferences::CMakeBuilderPreferences(KDevelop::IPlugin* plugin, QWidget* parent)
: KDevelop::ConfigPage(plugin, CMakeBuilderSettings::self(), parent)
{
QVBoxLayout* l = new QVBoxLayout( this );
QWidget* w = new QWidget;
m_prefsUi = new Ui::CMakeBuilderPreferences;
m_prefsUi->setupUi( w );
l->addWidget( w );
m_prefsUi->setupUi(this);
#ifdef Q_OS_WIN
m_prefsUi->kcfg_cmakeExe->setFilter("*.exe");
......
......@@ -20,8 +20,6 @@
#include "makebuilderpreferences.h"
#include <QVBoxLayout>
#include <util/environmentgrouplist.h>
#include "ui_makeconfig.h"
......@@ -32,17 +30,14 @@ using namespace KDevelop;
MakeBuilderPreferences::MakeBuilderPreferences(IPlugin* plugin, const ProjectConfigOptions& options, QWidget* parent)
: ProjectConfigPage<MakeBuilderSettings>(plugin, options, parent)
{
QVBoxLayout* l = new QVBoxLayout( this );
QWidget* w = new QWidget;
m_prefsUi = new Ui::MakeConfig;
m_prefsUi->setupUi( w );
m_prefsUi->setupUi(this);
connect(m_prefsUi->makeBinary, &KUrlRequester::textChanged,
this, &MakeBuilderPreferences::changed);
connect(m_prefsUi->makeBinary, &KUrlRequester::urlSelected,
this, &MakeBuilderPreferences::changed);
connect(m_prefsUi->configureEnvironment, &EnvironmentConfigureButton::environmentConfigured,
this, &MakeBuilderPreferences::changed);
l->addWidget( w );
m_prefsUi->configureEnvironment->setSelectionWidget( m_prefsUi->kcfg_environmentProfile );
}
......
......@@ -20,8 +20,6 @@
#include "ninjabuilderpreferences.h"
#include <QVBoxLayout>
#include <kpluginfactory.h>
#include <kpluginloader.h>
#include <util/environmentgrouplist.h>
......@@ -37,11 +35,8 @@ NinjaBuilderPreferences::NinjaBuilderPreferences(IPlugin* plugin,
QWidget* parent)
: ProjectConfigPage<NinjaBuilderSettings>(plugin, options, parent)
{
QVBoxLayout* l = new QVBoxLayout( this );
QWidget* w = new QWidget;
m_prefsUi = new Ui::NinjaConfig;
m_prefsUi->setupUi( w );
l->addWidget( w );
m_prefsUi->setupUi(this);
connect(m_prefsUi->configureEnvironment, &EnvironmentConfigureButton::environmentConfigured,
this, &NinjaBuilderPreferences::changed);
......
......@@ -22,7 +22,6 @@
#include "qmakebuilderpreferences.h"
#include <QIcon>
#include <QVBoxLayout>
#include <QDebug>
#include <kio/deletejob.h>
......@@ -46,11 +45,8 @@ QMakeBuilderPreferences::QMakeBuilderPreferences(KDevelop::IPlugin* plugin,
: KDevelop::ConfigPage(plugin, nullptr, parent)
, m_project(options.project)
{
auto l = new QVBoxLayout(this);
auto w = new QWidget;
m_prefsUi = new Ui::QMakeConfig;
m_prefsUi->setupUi(w);
m_prefsUi->setupUi(this);
// display icons instead of text
m_prefsUi->addButton->setIcon(QIcon::fromTheme("list-add"));
......@@ -63,7 +59,6 @@ QMakeBuilderPreferences::QMakeBuilderPreferences(KDevelop::IPlugin* plugin,
groupBoxLayout->addWidget(m_chooserUi);
m_chooserUi->kcfg_buildDir->setEnabled(false); // build directory MUST NOT be changed here
l->addWidget(w);
connect(m_chooserUi, &QMakeBuildDirChooser::changed, this, &QMakeBuilderPreferences::changed);
connect(m_chooserUi, &QMakeBuildDirChooser::changed, this, &QMakeBuilderPreferences::validate);
......
......@@ -51,11 +51,8 @@ using namespace KDevelop;
CMakePreferences::CMakePreferences(IPlugin* plugin, const ProjectConfigOptions& options, QWidget* parent)
: ConfigPage(plugin, nullptr, parent), m_project(options.project), m_currentModel(nullptr)
{
QVBoxLayout* l = new QVBoxLayout( this );
QWidget* w = new QWidget;
m_prefsUi = new Ui::CMakeBuildSettings;
m_prefsUi->setupUi( w );
l->addWidget( w );
m_prefsUi->setupUi(this);
m_prefsUi->addBuildDir->setIcon(QIcon::fromTheme( "list-add" ));
m_prefsUi->removeBuildDir->setIcon(QIcon::fromTheme( "list-remove" ));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment