Commit 463be3b3 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

not necessary to call setLayout => use parent directly

parent 868af91b
Pipeline #176180 failed with stage
in 4 minutes and 8 seconds
......@@ -24,7 +24,7 @@ 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 mainLayout = new QVBoxLayout(this);
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
connect(buttonBox, &QDialogButtonBox::accepted, this, &calculator::accept);
......
......@@ -50,8 +50,7 @@ ElementDataViewer::ElementDataViewer(QWidget *parent)
setWindowTitle(i18nc("@title:window", "Plot Data"));
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Help|QDialogButtonBox::Close);
auto mainWidget = new QWidget(this);
auto mainLayout = new QVBoxLayout;
setLayout(mainLayout);
auto mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(mainWidget);
connect(buttonBox, &QDialogButtonBox::accepted, this, &ElementDataViewer::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &ElementDataViewer::reject);
......
......@@ -77,8 +77,7 @@ ExportDialog::ExportDialog(QWidget * parent)
qCDebug(KALZIUM_LOG) << "ExportDialog::ExportDialog";
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel|QDialogButtonBox::Help, this);
auto mainWidget = new QWidget(this);
auto mainLayout = new QVBoxLayout;
setLayout(mainLayout);
auto mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(mainWidget);
auto user1Button = new QPushButton;
buttonBox->addButton(user1Button, QDialogButtonBox::ActionRole);
......
......@@ -28,8 +28,7 @@ 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;
setLayout(mainLayout);
auto mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(mainWidget);
connect(buttonBox, &QDialogButtonBox::rejected, this, &IsotopeTableDialog::reject);
mainLayout->addWidget(buttonBox);
......
......@@ -182,13 +182,13 @@ void KalziumDataObject::loadIconSet()
//FIXME in case we ever get more than one theme we need
//a settings-dialog where we can select the different iconsets...
const QString setname = QStringLiteral("school");
QString pathname = QStandardPaths::locate(
const QString pathname = QStandardPaths::locate(
QStandardPaths::AppLocalDataLocation, "data/iconsets/" + setname + '/',
QStandardPaths::LocateDirectory);
QSvgRenderer renderer;
for (int i = 0; i < m_numOfElements; ++i) {
QString filename = pathname + QString::number(i + 1) + ".svg";
const QString filename = pathname + QString::number(i + 1) + ".svg";
renderer.load(filename);
QPixmap pix(40, 40);
......@@ -197,7 +197,7 @@ void KalziumDataObject::loadIconSet()
renderer.render(&p);
Element *e = ElementList.at(i);
QString esymbol = e->dataAsString(ChemicalDataObject::symbol);
const QString esymbol = e->dataAsString(ChemicalDataObject::symbol);
p.drawText(0,0,40,40, Qt::AlignCenter | Qt::TextWordWrap, esymbol);
p.end();
......
......@@ -171,7 +171,7 @@ void KalziumUtils::populateUnitCombobox(QComboBox *comboBox, const QList<int> &u
QString unitString;
foreach (int unit, unitList) {
for (int unit : unitList) {
unitString = KUnitConversion::Converter().unit(KUnitConversion::UnitId(unit)).description();
unitString.append(" (");
unitString.append(KUnitConversion::Converter().unit(KUnitConversion::UnitId(unit)).symbol());
......
......@@ -24,8 +24,7 @@ RSDialog::RSDialog(QWidget* parent) : QDialog(parent)
setWindowTitle(i18nc("@title:window", "Risks/Security Phrases"));
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Help|QDialogButtonBox::Close, this);
auto mainWidget = new QWidget(this);
auto mainLayout = new QVBoxLayout;
setLayout(mainLayout);
auto mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(mainWidget);
connect(buttonBox, &QDialogButtonBox::rejected, this, &RSDialog::reject);
mainLayout->addWidget(buttonBox);
......
......@@ -63,7 +63,7 @@ void SpectrumViewImpl::fillPeakList()
double peakWavelength = peak->wavelengthToUnit(Prefs::spectrumWavelengthUnit());
QStringList row = QStringList() << QString::number(peakWavelength)
const QStringList row = QStringList() << QString::number(peakWavelength)
<< QString::number(peak->intensity);
items.append(new QTreeWidgetItem((QTreeWidget*)nullptr, row));
......
......@@ -21,7 +21,6 @@ TableInfoWidget::TableInfoWidget(QWidget *parent) : QWidget(parent)
auto la = new QHBoxLayout(this);
la->addWidget(m_tableType);
setLayout(la);
}
void TableInfoWidget::setTableType(int type)
......
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