Commit 868af91b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

auto * -> auto

parent 10df1d7d
Pipeline #176174 failed with stage
in 2 minutes and 57 seconds
......@@ -52,7 +52,7 @@ double Spectrum::maxPeak(const int unit)
Spectrum* Spectrum::adjustToWavelength(double min, double max)
{
auto *spec = new Spectrum();
auto spec = new Spectrum();
for (peak *p : std::as_const(m_peaklist)) {
if (p->wavelength >= min || p->wavelength <= max) {
......
......@@ -16,7 +16,7 @@ int main(int argc, char *argv[])
return 1;
}
auto * parser = new IsotopeParser();
auto parser = new IsotopeParser();
QFile xmlFile(argv[1]);
QXmlInputSource source(&xmlFile);
......
......@@ -16,7 +16,7 @@ int main(int argc, char *argv[])
return 1;
}
auto *parser = new SpectrumParser();
auto parser = new SpectrumParser();
QFile xmlFile(argv[1]);
QXmlInputSource source(&xmlFile);
......
......@@ -17,7 +17,7 @@ int main(int argc, char *argv[])
return 1;
}
auto * parser = new ElementSaxParser();
auto parser = new ElementSaxParser();
QFile xmlFile(argv[1]);
QXmlInputSource source(&xmlFile);
......
......@@ -22,9 +22,9 @@
calculator::calculator(QWidget *parent) : QDialog(parent)
{
setWindowTitle(i18nc("@title:window", "Chemical Calculator"));
auto *buttonBox = new QDialogButtonBox(QDialogButtonBox::Help|QDialogButtonBox::Close, this);
auto *mainWidget = new QWidget(this);
auto *mainLayout = new QVBoxLayout;
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Help|QDialogButtonBox::Close, this);
auto mainWidget = new QWidget(this);
auto mainLayout = new QVBoxLayout;
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
connect(buttonBox, &QDialogButtonBox::accepted, this, &calculator::accept);
......
......@@ -66,9 +66,9 @@ void titrationCalculator::plot()
uid.kplotwidget->removeAllPlotObjects();
uid.kplotwidget->setLimits(xmin, xmax, ymin, ymax); //now I need to set the limits of the plot
auto *kpor = new KPlotObject(Qt::red,KPlotObject::Lines);
auto *kpog = new KPlotObject(Qt::green, KPlotObject::Lines);
auto *kpob = new KPlotObject(Qt::blue, KPlotObject::Lines);
auto kpor = new KPlotObject(Qt::red,KPlotObject::Lines);
auto kpog = new KPlotObject(Qt::green, KPlotObject::Lines);
auto kpob = new KPlotObject(Qt::blue, KPlotObject::Lines);
redplot = QStringLiteral("<polyline points=\"");
greenplot = QStringLiteral("<polyline points=\"");
blueplot = QStringLiteral("<polyline points=\"");
......@@ -470,20 +470,20 @@ void titrationCalculator::on_actionNew_triggered()
{
//set all the table cells as empty ("")
for (int i = 0; i < uid.tableWidget->rowCount(); ++i) {
auto *titem = new QTableWidgetItem;
auto titem = new QTableWidgetItem;
titem->setText(QLatin1String(""));
uid.tableWidget->setItem(i, 0, titem);
auto *titemo = new QTableWidgetItem;
auto titemo = new QTableWidgetItem;
titemo->setText(QLatin1String(""));
uid.tableWidget->setItem(i, 1, titemo);
}
uid.xaxis->setText(QLatin1String(""));
uid.yaxis->setText(QLatin1String(""));
for (int i = 0; i < uid.tableWidget_2->rowCount(); ++i) {
auto *titem = new QTableWidgetItem;
auto titem = new QTableWidgetItem;
titem->setText(QLatin1String(""));
uid.tableWidget_2->setItem(i, 0, titem);
auto *titemo = new QTableWidgetItem;
auto titemo = new QTableWidgetItem;
titemo->setText(QLatin1String(""));
uid.tableWidget_2->setItem(i, 1, titemo);
}
......
......@@ -43,11 +43,11 @@ DetailedInfoDlg::DetailedInfoDlg(int el, QWidget *parent) : KPageDialog(parent),
buttonBox()->addButton(QDialogButtonBox::Help);
const QString nextButtonIconSource = (layoutDirection() == Qt::LeftToRight) ? "arrow-right" : "arrow-left";
auto *nextButton = new QPushButton(QIcon::fromTheme(nextButtonIconSource), i18nc("Next element", "Next"), this);
auto nextButton = new QPushButton(QIcon::fromTheme(nextButtonIconSource), i18nc("Next element", "Next"), this);
nextButton->setToolTip(i18n("Goes to the next element"));
const QString prevButtonIconSource = (layoutDirection() == Qt::LeftToRight) ? "arrow-left" : "arrow-right";
auto *prevButton = new QPushButton(QIcon::fromTheme(prevButtonIconSource), i18nc("Previous element", "Previous"), this);
auto prevButton = new QPushButton(QIcon::fromTheme(prevButtonIconSource), i18nc("Previous element", "Previous"), this);
prevButton->setToolTip(i18n("Goes to the previous element"));
buttonBox()->addButton(prevButton, QDialogButtonBox::ActionRole);
......@@ -122,9 +122,9 @@ QTextBrowser* DetailedInfoDlg::addHTMLTab(const QString& title, const QString& i
KPageWidgetItem *item = addPage(frame, title);
item->setHeader(icontext);
item->setIcon(QIcon::fromTheme(iconname));
auto *layout = new QVBoxLayout(frame);
auto layout = new QVBoxLayout(frame);
layout->setContentsMargins(0, 0, 0, 0);
auto *browser = new QTextBrowser(frame);
auto browser = new QTextBrowser(frame);
browser->setOpenExternalLinks(true);
layout->addWidget(browser);
return browser;
......@@ -1487,11 +1487,11 @@ void DetailedInfoDlg::createContent()
m_htmlpages[QStringLiteral("new")] = addHTMLTab(i18n("Data Overview"), i18n("Data Overview"), QStringLiteral("applications-science"));
// atomic model tab
auto *m_pModelTab = new QWidget(this);
auto m_pModelTab = new QWidget(this);
item = addPage(m_pModelTab, i18n("Atom Model"));
item->setHeader(i18n("Atom Model"));
item->setIcon(QIcon::fromTheme(QStringLiteral("orbits")));
auto *modelLayout = new QVBoxLayout(m_pModelTab);
auto modelLayout = new QVBoxLayout(m_pModelTab);
modelLayout->setContentsMargins(0, 0, 0, 0);
wOrbits = new OrbitsWidget(m_pModelTab);
modelLayout->addWidget(wOrbits);
......@@ -1501,11 +1501,11 @@ void DetailedInfoDlg::createContent()
m_htmlpages[QStringLiteral("misc")] = addHTMLTab(i18n("Miscellaneous"), i18n("Miscellaneous"), QStringLiteral("misc"));
// spectrum widget tab
auto *m_pSpectrumTab = new QWidget(this);
auto m_pSpectrumTab = new QWidget(this);
item = addPage(m_pSpectrumTab, i18n("Spectrum"));
item->setHeader(i18n("Spectrum"));
item->setIcon(QIcon::fromTheme(QStringLiteral("spectrum")));
auto *spectrumLayout = new QVBoxLayout(m_pSpectrumTab);
auto spectrumLayout = new QVBoxLayout(m_pSpectrumTab);
spectrumLayout->setContentsMargins(0, 0, 0, 0);
m_spectrumStack = new QStackedWidget(m_pSpectrumTab);
spectrumLayout->addWidget(m_spectrumStack);
......
......@@ -48,9 +48,9 @@ ElementDataViewer::ElementDataViewer(QWidget *parent)
m_xData(new AxisData(AxisData::X))
{
setWindowTitle(i18nc("@title:window", "Plot Data"));
auto *buttonBox = new QDialogButtonBox(QDialogButtonBox::Help|QDialogButtonBox::Close);
auto *mainWidget = new QWidget(this);
auto *mainLayout = new QVBoxLayout;
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Help|QDialogButtonBox::Close);
auto mainWidget = new QWidget(this);
auto mainLayout = new QVBoxLayout;
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
connect(buttonBox, &QDialogButtonBox::accepted, this, &ElementDataViewer::accept);
......
......@@ -75,12 +75,12 @@ ExportDialog::ExportDialog(QWidget * parent)
: QDialog(parent),m_outputStream(nullptr)
{
qCDebug(KALZIUM_LOG) << "ExportDialog::ExportDialog";
auto *buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel|QDialogButtonBox::Help, this);
auto *mainWidget = new QWidget(this);
auto *mainLayout = new QVBoxLayout;
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel|QDialogButtonBox::Help, this);
auto mainWidget = new QWidget(this);
auto mainLayout = new QVBoxLayout;
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
auto *user1Button = new QPushButton;
auto user1Button = new QPushButton;
buttonBox->addButton(user1Button, QDialogButtonBox::ActionRole);
connect(buttonBox, &QDialogButtonBox::accepted, this, &ExportDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &ExportDialog::reject);
......@@ -118,8 +118,8 @@ ExportDialog::~ExportDialog()
void ExportDialog::populateElementList()
{
// Add descriptive headers
auto *header1 = new QListWidgetItem(i18n("Elements"));
auto *header2 = new QListWidgetItem(i18n("Properties"));
auto header1 = new QListWidgetItem(i18n("Elements"));
auto header2 = new QListWidgetItem(i18n("Properties"));
header1->setFlags(Qt::ItemIsEnabled);
header2->setFlags(Qt::ItemIsEnabled);
QFont font;
......@@ -131,7 +131,7 @@ void ExportDialog::populateElementList()
// Add elements
foreach (Element *element, KalziumDataObject::instance()->ElementList) {
auto *entry = new ElementListEntry(element);
auto entry = new ElementListEntry(element);
ui.elementListWidget->addItem(entry);
}
......
......@@ -131,7 +131,7 @@ void IsotopeItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
return;
}
auto *scene2 = static_cast<IsotopeScene*>(scene());
auto scene2 = static_cast<IsotopeScene*>(scene());
scene2->updateContextHelp(this);
}
......@@ -142,6 +142,6 @@ void IsotopeItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
return;
}
auto *scene2 = static_cast<IsotopeScene*>(scene());
auto scene2 = static_cast<IsotopeScene*>(scene());
scene2->updateContextHelp(this);
}
......@@ -70,7 +70,7 @@ void IsotopeScene::drawIsotopes()
x = (i->nucleons() - elementNumber) * m_itemSize;
}
auto *item = new IsotopeItem(i, x, y, m_itemSize,m_itemSize);
auto item = new IsotopeItem(i, x, y, m_itemSize,m_itemSize);
m_isotopeGroup->addToGroup(item);
}
}
......
......@@ -26,9 +26,9 @@
IsotopeTableDialog::IsotopeTableDialog(QWidget* parent) : QDialog(parent)
{
setWindowTitle(i18nc("@title:window", "Isotope Table"));
auto *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
auto *mainWidget = new QWidget(this);
auto *mainLayout = new QVBoxLayout;
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
auto mainWidget = new QWidget(this);
auto mainLayout = new QVBoxLayout;
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
connect(buttonBox, &QDialogButtonBox::rejected, this, &IsotopeTableDialog::reject);
......@@ -56,7 +56,7 @@ IsotopeTableDialog::IsotopeTableDialog(QWidget* parent) : QDialog(parent)
items << qMakePair(i18nc("Unknown Decay", "unknown"), QColor(Qt::darkGray));
foreach (const legendPair &pair, items) {
auto *item = new LegendItem(pair);
auto item = new LegendItem(pair);
ui.infoWidget->layout()->addWidget(item);
}
ui.infoWidget->setMinimumWidth(150);
......
......@@ -74,16 +74,16 @@ Kalzium::Kalzium() : KXmlGuiWindow(nullptr)
// reading the elements from file
KalziumDataObject::instance();
auto *newsearch = new Search();
auto newsearch = new Search();
KalziumDataObject::instance()->setSearch(newsearch);
// Main pse-Table Tablewidget
auto *pseTempWidget = new QWidget(this);
auto *layout = new QVBoxLayout(pseTempWidget);
auto pseTempWidget = new QWidget(this);
auto layout = new QVBoxLayout(pseTempWidget);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(2);
auto *searchWidget = new SearchWidget(pseTempWidget);
auto searchWidget = new SearchWidget(pseTempWidget);
searchWidget->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum));
// Creating the periodic table
......@@ -325,7 +325,7 @@ void Kalzium::slotGlossary()
dir = QFileInfo(dir).absolutePath();
QString picturepath = dir + "/bg.jpg";
QUrl u = QUrl::fromLocalFile(dir + "/knowledge.xml");
auto *g = new Glossary(u);
auto g = new Glossary(u);
g->setName(i18n("Knowledge"));
g->setBackgroundPicture(picturepath);
m_glossarydlg->addGlossary(g, true);
......@@ -506,7 +506,7 @@ void Kalzium::slotShowExportDialog()
void Kalzium::setupStatusBar()
{
auto *statusBar = new QStatusBar(this);
auto statusBar = new QStatusBar(this);
setStatusBar(statusBar);
m_elementInfo = new QLabel(QLatin1String(""));
......
......@@ -39,7 +39,7 @@ KalziumDataObject* KalziumDataObject::instance()
KalziumDataObject::KalziumDataObject()
{
// reading elements
auto * parser = new ElementSaxParser();
auto parser = new ElementSaxParser();
QFile xmlFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("libkdeedu/data/elements.xml")));
QXmlInputSource source(&xmlFile);
......@@ -54,7 +54,7 @@ KalziumDataObject::KalziumDataObject()
delete parser;
//read the spectra
auto * spectrumparser = new SpectrumParser();
auto spectrumparser = new SpectrumParser();
QFile xmlSpFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("libkdeedu/data/spectra.xml")));
QXmlInputSource spsource(&xmlSpFile);
......@@ -69,7 +69,7 @@ KalziumDataObject::KalziumDataObject()
delete spectrumparser;
// reading isotopes
auto * isoparser = new IsotopeParser();
auto isoparser = new IsotopeParser();
QFile xmlIsoFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("libkdeedu/data/isotopes.xml")));
QXmlInputSource isosource(&xmlIsoFile);
......
......@@ -224,7 +224,7 @@ QList<GlossaryItem*> Glossary::readItems(QDomDocument &itemDocument)
const uint num = itemList.count();
for (uint i = 0; i < num; ++i) {
reflist.clear();
auto *item = new GlossaryItem();
auto item = new GlossaryItem();
itemElement = itemList.item(i).toElement();
......@@ -309,12 +309,12 @@ GlossaryDialog::GlossaryDialog(QWidget *parent) : QDialog(parent), d(new Private
//be used call Glossary::setBackgroundPicture().
d->m_htmlbasestring = QStringLiteral("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html><body%1>");
auto *main = new QWidget(this);
auto *vbox = new QVBoxLayout(main);
auto main = new QWidget(this);
auto vbox = new QVBoxLayout(main);
setLayout(vbox);
vbox->setContentsMargins(0, 0, 0, 0);
auto *hbox = new QHBoxLayout();
auto hbox = new QHBoxLayout();
d->m_search = new KTreeWidgetSearchLine(main);
d->m_search->setObjectName(QStringLiteral("search-line"));
......@@ -322,7 +322,7 @@ GlossaryDialog::GlossaryDialog(QWidget *parent) : QDialog(parent), d(new Private
vbox->addLayout(hbox);
setFocusProxy(d->m_search);
auto *vs = new QSplitter(main);
auto vs = new QSplitter(main);
vbox->addWidget(vs);
d->m_glosstree = new QTreeWidget(vs);
......@@ -355,7 +355,7 @@ GlossaryDialog::GlossaryDialog(QWidget *parent) : QDialog(parent), d(new Private
}
});
auto *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
connect(buttonBox, &QDialogButtonBox::rejected, this, &GlossaryDialog::reject);
buttonBox->button(QDialogButtonBox::Close)->setDefault(true);
vbox->addWidget(buttonBox);
......@@ -391,7 +391,7 @@ QTreeWidgetItem* GlossaryDialog::Private::createItem(const GlossaryInfo& gi) con
{
Glossary *glossary = gi.glossary;
bool folded = gi.folded;
auto *main = new QTreeWidgetItem();
auto main = new QTreeWidgetItem();
main->setText(0, glossary->name());
main->setFlags(Qt::ItemIsEnabled);
foreach (GlossaryItem *item, glossary->itemlist()) {
......@@ -446,7 +446,7 @@ void GlossaryDialog::Private::itemActivated(QTreeWidgetItem * item, int column)
return;
}
auto *glosstreeitem = static_cast<GlossaryTreeItem *>(item);
auto glosstreeitem = static_cast<GlossaryTreeItem *>(item);
GlossaryItem *glossitem = glosstreeitem->glossaryItem();
QString html;
QString bg_picture = glosstreeitem->glossary()->backgroundPicture();
......
......@@ -107,7 +107,7 @@ void LegendWidget::updateLegendItemLayout(const QList<legendPair>& list)
m_legendItemList.clear();
auto * layout = new QGridLayout(this);
auto layout = new QGridLayout(this);
layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0);
......@@ -115,7 +115,7 @@ void LegendWidget::updateLegendItemLayout(const QList<legendPair>& list)
int y = 0;
foreach (const legendPair &pair, list) {
auto *item = new LegendItem(pair, this);
auto item = new LegendItem(pair, this);
m_legendItemList.append(item);
if ((m_dockArea == Qt::BottomDockWidgetArea || m_dockArea == Qt::TopDockWidgetArea)) {
......@@ -176,7 +176,7 @@ bool LegendWidget::isElementMatch(int element, QColor &color){
LegendItem::LegendItem(const QPair<QString, QColor>& pair, LegendWidget * parent)
{
auto *ItemLayout = new QHBoxLayout(this);
auto ItemLayout = new QHBoxLayout(this);
ItemLayout->setContentsMargins(0, 0, 0, 0);
if (pair.second.isValid()) {
......@@ -188,14 +188,14 @@ LegendItem::LegendItem(const QPair<QString, QColor>& pair, LegendWidget * parent
QPixmap LegendPixmap(20, height());
LegendPixmap.fill(pair.second);
auto * LabelPixmap = new QLabel(this);
auto LabelPixmap = new QLabel(this);
LabelPixmap->setPixmap(LegendPixmap);
ItemLayout->addWidget(LabelPixmap);
setFrameShape(QFrame::StyledPanel);
setFrameShadow(QFrame::Sunken);
}
auto * LegendLabel = new QLabel(this);
auto LegendLabel = new QLabel(this);
LegendLabel->setText(pair.first);
ItemLayout->addWidget(LegendLabel);
......
......@@ -47,7 +47,7 @@ OrbitsWidget::OrbitsWidget(QWidget *parent) : QWidget(parent)
{
m_electronConf = new QLabel(this);
m_electronConf->setIndent(20);
auto *layout = new QVBoxLayout(m_electronConf);
auto layout = new QVBoxLayout(m_electronConf);
setLayout(layout);
if (hulllist.count() == 0) {
......
......@@ -66,8 +66,8 @@ void PeriodicTableScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
item->data(0).toInt() > 0) {
Element* pointedElement = KalziumDataObject::instance()->element(item->data(0).toInt());
auto *drag = new QDrag(event->widget());
auto *mimeData = new QMimeData;
auto drag = new QDrag(event->widget());
auto mimeData = new QMimeData;
mimeData->setText(pointedElement->dataAsString(ChemicalDataObject::name));
drag->setMimeData(mimeData);
......
......@@ -60,7 +60,7 @@ QList<ElementItem*> PeriodicTableView::createElementItems() const
KalziumElementProperty *elProperty = KalziumElementProperty::instance();
foreach (int intElement, pseTables::instance()->getTabletype(0)->elements()) {
auto *item = new ElementItem(elProperty, intElement);
auto item = new ElementItem(elProperty, intElement);
connect(elProperty, &KalziumElementProperty::propertyChanged, item, &ElementItem::redraw);
m_tableScene->addItem(item);
......@@ -149,7 +149,7 @@ bool PeriodicTableView::event(QEvent *e)
void PeriodicTableView::generateSvg(const QString& filename)
{
auto *svgGen = new QSvgGenerator();
auto svgGen = new QSvgGenerator();
svgGen->setFileName(filename);
QPainter painter;
......
......@@ -13,7 +13,7 @@ StateSwitcher::StateSwitcher(QStateMachine *machine)
void StateSwitcher::addState(QState *state, QAbstractAnimation *animation, const int &id)
{
auto *trans = new StateSwitchTransition(id);
auto trans = new StateSwitchTransition(id);
trans->setTargetState(state);
addTransition(trans);
trans->addAnimation(animation);
......
Supports Markdown
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