Commit 4f783848 authored by Laurent Montel's avatar Laurent Montel 😁

Const'ref

parent bc478539
......@@ -51,7 +51,7 @@ void AbstractGfxScopeWidget::mouseReleaseEvent(QMouseEvent *event)
///// Slots /////
void AbstractGfxScopeWidget::slotRenderZoneUpdated(const QImage frame)
void AbstractGfxScopeWidget::slotRenderZoneUpdated(const QImage &frame)
{
QMutexLocker lock(&m_mutex);
m_scopeImage = frame.rgbSwapped();
......
......@@ -36,7 +36,7 @@ protected:
/** @brief Scope renderer. Must emit signalScopeRenderingFinished()
when calculation has finished, to allow multi-threading.
accelerationFactor hints how much faster than usual the calculation should be accomplished, if possible. */
virtual QImage renderGfxScope(uint accelerationFactor, const QImage) = 0;
virtual QImage renderGfxScope(uint accelerationFactor, const QImage &) = 0;
virtual QImage renderScope(uint accelerationFactor);
......@@ -50,13 +50,13 @@ public slots:
/** @brief Must be called when the active monitor has shown a new frame.
This slot must be connected in the implementing class, it is *not*
done in this abstract class. */
void slotRenderZoneUpdated(const QImage);
void slotRenderZoneUpdated(const QImage &);
protected slots:
virtual void slotAutoRefreshToggled(bool autoRefresh);
signals:
void signalFrameRequest(const QString widgetName);
void signalFrameRequest(const QString &widgetName);
};
......
......@@ -109,7 +109,7 @@ QImage Histogram::renderHUD(uint)
emit signalHUDRenderingFinished(0, 1);
return QImage();
}
QImage Histogram::renderGfxScope(uint accelFactor, const QImage qimage)
QImage Histogram::renderGfxScope(uint accelFactor, const QImage &qimage)
{
QTime start = QTime::currentTime();
start.start();
......
......@@ -43,7 +43,7 @@ private:
bool isScopeDependingOnInput() const;
bool isBackgroundDependingOnInput() const;
QImage renderHUD(uint accelerationFactor);
QImage renderGfxScope(uint accelerationFactor, const QImage);
QImage renderGfxScope(uint accelerationFactor, const QImage &);
QImage renderBackground(uint accelerationFactor);
Ui::Histogram_UI *ui;
......
......@@ -123,7 +123,7 @@ QImage RGBParade::renderHUD(uint)
return hud;
}
QImage RGBParade::renderGfxScope(uint accelerationFactor, const QImage qimage)
QImage RGBParade::renderGfxScope(uint accelerationFactor, const QImage &qimage)
{
QTime start = QTime::currentTime();
start.start();
......@@ -135,8 +135,23 @@ QImage RGBParade::renderGfxScope(uint accelerationFactor, const QImage qimage)
return parade;
}
QImage RGBParade::renderBackground(uint) { return QImage(); }
QImage RGBParade::renderBackground(uint)
{
return QImage();
}
bool RGBParade::isHUDDependingOnInput() const
{
return false;
}
bool RGBParade::isScopeDependingOnInput() const
{
return true;
}
bool RGBParade::isBackgroundDependingOnInput() const
{
return false;
}
bool RGBParade::isHUDDependingOnInput() const { return false; }
bool RGBParade::isScopeDependingOnInput() const { return true; }
bool RGBParade::isBackgroundDependingOnInput() const { return false; }
......@@ -47,7 +47,7 @@ private:
bool isBackgroundDependingOnInput() const;
QImage renderHUD(uint accelerationFactor);
QImage renderGfxScope(uint accelerationFactor, const QImage);
QImage renderGfxScope(uint accelerationFactor, const QImage &);
QImage renderBackground(uint accelerationFactor);
};
......
......@@ -138,7 +138,10 @@ Vectorscope::~Vectorscope()
delete ui;
}
QString Vectorscope::widgetName() const { return QString("Vectorscope"); }
QString Vectorscope::widgetName() const
{
return QLatin1String("Vectorscope");
}
void Vectorscope::readConfig()
{
......@@ -259,7 +262,7 @@ QImage Vectorscope::renderHUD(uint)
return hud;
}
QImage Vectorscope::renderGfxScope(uint accelerationFactor, const QImage qimage)
QImage Vectorscope::renderGfxScope(uint accelerationFactor, const QImage &qimage)
{
QTime start = QTime::currentTime();
QImage scope;
......
......@@ -41,7 +41,7 @@ protected:
///// Implemented methods /////
QRect scopeRect();
QImage renderHUD(uint accelerationFactor);
QImage renderGfxScope(uint accelerationFactor, const QImage);
QImage renderGfxScope(uint accelerationFactor, const QImage &);
QImage renderBackground(uint accelerationFactor);
bool isHUDDependingOnInput() const;
bool isScopeDependingOnInput() const;
......
......@@ -170,7 +170,7 @@ QImage Waveform::renderHUD(uint)
return hud;
}
QImage Waveform::renderGfxScope(uint accelFactor, const QImage qimage)
QImage Waveform::renderGfxScope(uint accelFactor, const QImage &qimage)
{
QTime start = QTime::currentTime();
start.start();
......
......@@ -52,7 +52,7 @@ private:
/// Implemented methods ///
QRect scopeRect();
QImage renderHUD(uint);
QImage renderGfxScope(uint, const QImage);
QImage renderGfxScope(uint, const QImage &);
QImage renderBackground(uint);
bool isHUDDependingOnInput() const;
bool isScopeDependingOnInput() const;
......
......@@ -40,12 +40,12 @@ public slots:
void slotGoToPrev();
protected:
virtual void paintEvent(QPaintEvent *event);
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseReleaseEvent(QMouseEvent *event);
virtual void mouseMoveEvent(QMouseEvent *event);
virtual void mouseDoubleClickEvent(QMouseEvent *event);
virtual void wheelEvent(QWheelEvent *event);
void paintEvent(QPaintEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseDoubleClickEvent(QMouseEvent *event);
void wheelEvent(QWheelEvent *event);
private:
int m_duration;
......
......@@ -58,8 +58,10 @@ void MyLabel::setImage(const QImage& img)
//virtual
void MyLabel::wheelEvent(QWheelEvent* event)
{
if (event->delta() > 0) emit seek(true);
else emit seek(false);
if (event->delta() > 0)
emit seek(true);
else
emit seek(false);
}
//virtual
......@@ -141,14 +143,14 @@ void StopmotionMonitor::slotMouseSeek(int /*eventDelta*/, bool /*fast*/)
StopmotionWidget::StopmotionWidget(MonitorManager *manager, const KUrl &projectFolder, const QList<QAction *> &actions, QWidget* parent) :
QDialog(parent)
, Ui::Stopmotion_UI()
, m_projectFolder(projectFolder)
, m_captureDevice(NULL)
, m_sequenceFrame(0)
, m_animatedIndex(-1)
, m_animate(false)
, m_manager(manager)
, m_monitor(new StopmotionMonitor(manager, this))
, Ui::Stopmotion_UI()
, m_projectFolder(projectFolder)
, m_captureDevice(NULL)
, m_sequenceFrame(0)
, m_animatedIndex(-1)
, m_animate(false)
, m_manager(manager)
, m_monitor(new StopmotionMonitor(manager, this))
{
//setAttribute(Qt::WA_DeleteOnClose);
//HACK: the monitor widget is hidden, it is just used to control the capturedevice from monitormanager
......@@ -707,8 +709,9 @@ void StopmotionWidget::slotCreateThumbs(const QImage &img, int ix)
QString StopmotionWidget::getPathForFrame(int ix, QString seqName)
{
if (seqName.isEmpty()) seqName = m_sequenceName;
return m_projectFolder.path(KUrl::AddTrailingSlash) + seqName + '_' + QString::number(ix).rightJustified(4, '0', false) + ".png";
if (seqName.isEmpty())
seqName = m_sequenceName;
return m_projectFolder.path(KUrl::AddTrailingSlash) + seqName + QLatin1Char('_') + QString::number(ix).rightJustified(4, '0', false) + QLatin1String(".png");
}
void StopmotionWidget::slotShowFrame(const QString& path)
......@@ -835,7 +838,8 @@ void StopmotionWidget::selectFrame(int ix)
{
frame_list->blockSignals(true);
QListWidgetItem* item = getFrameFromIndex(ix);
if (!item) return;
if (!item)
return;
frame_list->setCurrentItem(item);
frame_list->blockSignals(false);
}
......@@ -852,7 +856,9 @@ void StopmotionWidget::slotRemoveFrame()
{
if (frame_list->currentItem() == NULL) return;
QString path = frame_list->currentItem()->toolTip();
if (KMessageBox::questionYesNo(this, i18n("Delete frame %1 from disk?", path), i18n("Delete Frame")) != KMessageBox::Yes) return;
if (KMessageBox::questionYesNo(this, i18n("Delete frame %1 from disk?", path), i18n("Delete Frame")) != KMessageBox::Yes)
return;
QFile f(path);
if (f.remove()) {
QListWidgetItem* item = frame_list->takeItem(frame_list->currentRow());
......@@ -875,7 +881,8 @@ void StopmotionWidget::slotSwitchAnalyse(bool isOn)
void StopmotionWidget::slotSwitchMirror(bool isOn)
{
//KdenliveSettings::setAnalyse_stopmotion(isOn);
if (m_captureDevice) m_captureDevice->mirror(isOn);
if (m_captureDevice)
m_captureDevice->mirror(isOn);
}
......
......@@ -36,7 +36,7 @@ class MyLabel : public QLabel
{
Q_OBJECT
public:
MyLabel(QWidget* parent = 0);
explicit MyLabel(QWidget* parent = 0);
void setImage(const QImage &img);
protected:
......
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