Commit 2ddb6304 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use Q_EMIT

parent 9cf5a717
......@@ -16,7 +16,7 @@ Element::Element()
QVariant Element::dataAsVariant(ChemicalDataObject::BlueObelisk type) const
{
foreach (const ChemicalDataObject &o, dataList) {
for (const ChemicalDataObject &o : std::as_const(dataList)) {
if (o.type() == type) {
return o.value();
}
......
......@@ -94,7 +94,7 @@ void DetailedInfoDlg::setElement(int el)
m_element = element;
m_elementNumber = el;
emit elementChanged(m_elementNumber);
Q_EMIT elementChanged(m_elementNumber);
reloadContent();
......
......@@ -110,7 +110,7 @@ void GradientWidgetImpl::doubleToSlider(double doubleVar)
gradient_slider->blockSignals(false);
emit gradientValueChanged(doubleVar);
Q_EMIT gradientValueChanged(doubleVar);
setNewValue(doubleVar);
}
......@@ -127,7 +127,7 @@ void GradientWidgetImpl::intToSpinbox(int var)
gradient_spinbox->blockSignals(false);
emit gradientValueChanged(doublevar);
Q_EMIT gradientValueChanged(doublevar);
setNewValue(doublevar);
}
......
......@@ -31,7 +31,7 @@ IsotopeScene::~IsotopeScene()
void IsotopeScene::updateContextHelp(IsotopeItem * item)
{
emit itemSelected(item);
Q_EMIT itemSelected(item);
}
void IsotopeScene::drawIsotopes()
......
......@@ -33,7 +33,7 @@ void IsotopeView::resizeEvent(QResizeEvent *event)
void IsotopeView::mouseMoveEvent(QMouseEvent *event)
{
QPolygonF visibleSceneRect = mapToScene(viewport()->rect());
emit visibleSceneRectChanged(visibleSceneRect);
Q_EMIT visibleSceneRectChanged(visibleSceneRect);
QGraphicsView::mouseMoveEvent(event);
}
......@@ -60,10 +60,10 @@ void IsotopeView::wheelEvent(QWheelEvent *event)
if (oldZoomLevel != m_zoomLevel) {
factor = m_zoomLevel / oldZoomLevel;
scale(factor, factor);
emit zoomLevelChanged(m_zoomLevel);
Q_EMIT zoomLevelChanged(m_zoomLevel);
}
QPolygonF visibleSceneRect = mapToScene(viewport()->rect());
emit visibleSceneRectChanged(visibleSceneRect);
Q_EMIT visibleSceneRectChanged(visibleSceneRect);
event->accept();
}
......@@ -83,8 +83,8 @@ void IsotopeView::setZoom(double zoom)
factor = m_zoomLevel / oldZoomLevel;
scale(factor,factor);
emit zoomLevelChanged(m_zoomLevel);
Q_EMIT zoomLevelChanged(m_zoomLevel);
QPolygonF visibleSceneRect = mapToScene(viewport()->rect());
emit visibleSceneRectChanged(visibleSceneRect);
Q_EMIT visibleSceneRectChanged(visibleSceneRect);
}
......@@ -434,7 +434,7 @@ void Kalzium::slotSwitchtoTable(int index)
void Kalzium::slotSwitchtoNumeration(int index)
{
emit numerationChanged(index);
Q_EMIT numerationChanged(index);
Prefs::setNumeration(index);
Prefs::self()->save();
}
......
......@@ -347,7 +347,7 @@ GlossaryDialog::GlossaryDialog(QWidget *parent) : QDialog(parent), d(new Private
// force the item to be selected
this->d->m_glosstree->setCurrentItem(*it);
// display its content
emit this->d->itemActivated((*it), 0);
Q_EMIT this->d->itemActivated((*it), 0);
break;
} else {
++it;
......
......@@ -136,7 +136,7 @@ void LegendWidget::updateLegendItemLayout(const QList<legendPair>& list)
void LegendWidget::legendItemAction(QColor color)
{
emit resetElementMatch();
Q_EMIT resetElementMatch();
if (color.operator==(QColor())) {
return;
......@@ -144,7 +144,7 @@ void LegendWidget::legendItemAction(QColor color)
for (int element = 1; element <= 118; ++element) {
if (isElementMatch(element, color)) {
emit elementMatched(element);
Q_EMIT elementMatched(element);
}
}
}
......@@ -203,13 +203,13 @@ LegendItem::LegendItem(const QPair<QString, QColor>& pair, QWidget * parent)
void LegendItem::enterEvent(QEvent* event)
{
emit legenItemHoovered(legendItemColor);
Q_EMIT legenItemHoovered(legendItemColor);
QWidget::enterEvent(event);
}
void LegendItem::leaveEvent(QEvent* event)
{
emit legenItemHoovered(QColor());
Q_EMIT legenItemHoovered(QColor());
QWidget::leaveEvent(event);
}
......@@ -175,8 +175,8 @@ void OrbitsWidget::setElementNumber(int num)
o = hulllist[Elemno - 1];
}
foreach (const QString& str, o.split(' ', QString::SkipEmptyParts))
numOfElectrons.append(str.toInt());
foreach (const QString& str, o.split(' ', Qt::SkipEmptyParts))
numOfElectrons.append(str.toInt());
m_electronConf->setMinimumWidth(width());
// setting the electronic configuration in the label.
......
......@@ -51,7 +51,7 @@ void PeriodicTableScene::mousePressEvent(QGraphicsSceneMouseEvent *event)
if (item->data(0).toInt() > 0 && item->data(0).toInt() < 119) {
m_eventPos = event->scenePos();
} else {
emit freeSpaceClick();
Q_EMIT freeSpaceClick();
}
QGraphicsScene::mousePressEvent(event);
......@@ -102,7 +102,7 @@ void PeriodicTableScene::slotMouseover()
if (item->data(0).toInt() > 0 && item->data(0).toInt() < 119) {
int num = item->data(0).toInt();
if ((num > 0) && (num != m_prevHoverElement)) {
emit elementHovered(num);
Q_EMIT elementHovered(num);
}
m_prevHoverElement = num;
}
......@@ -117,7 +117,7 @@ void PeriodicTableScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
QGraphicsItem *item = QGraphicsScene::itemAt(event->scenePos(), QTransform());
if (item->data(0).toInt() > 0 && item->data(0).toInt() < 119) {
emit(elementChanged(item->data(0).toInt()));
Q_EMIT(elementChanged(item->data(0).toInt()));
}
QGraphicsScene::mouseReleaseEvent(event);
}
......
......@@ -66,7 +66,7 @@ void Search::doSearch(const QString& text, SearchKind kind)
}
if (newresults != m_foundElements) {
m_foundElements = newresults;
emit searchChanged();
Q_EMIT searchChanged();
}
}
......@@ -78,6 +78,6 @@ void Search::resetSearch()
m_foundElements.clear();
m_isActive = false;
emit searchReset();
Q_EMIT searchReset();
}
......@@ -105,7 +105,7 @@ void SpectrumViewImpl::setUnit()
Prefs::self()->save();
qDebug() << "Unit changed: " << m_lengthUnit->getCurrentUnitId();
emit settingsChanged();
Q_EMIT settingsChanged();
fillPeakList();
}
......
......@@ -266,7 +266,7 @@ void SpectrumWidget::setBorders(double left, double right)
m_endValue = right;
//round the startValue down and the endValue up
emit bordersChanged(int(m_startValue + 0.5), int(m_endValue + 0.5));
Q_EMIT bordersChanged(int(m_startValue + 0.5), int(m_endValue + 0.5));
update();
}
......@@ -336,7 +336,7 @@ void SpectrumWidget::findPeakFromMouseposition(double wavelength)
}
if (foundWavelength) {
emit peakSelected(peak);
Q_EMIT peakSelected(peak);
}
}
......
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