Commit e2dfc13a authored by Alberto Villa's avatar Alberto Villa

reindent

svn path=/trunk/kdenlive/; revision=4290
parent 3944c03a
......@@ -84,7 +84,7 @@ RenderJob::RenderJob(bool erase, bool usekuiserver, const QString &renderer, con
connect(m_renderProcess, SIGNAL(stateChanged(QProcess::ProcessState)), this, SLOT(slotCheckProcess(QProcess::ProcessState)));
//connect(m_renderProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(slotIsOver(int, QProcess::ExitStatus)));
m_renderProcess->setReadChannel(QProcess::StandardError);
m_enablelog = (getenv("KDENLIVE_RENDER_LOG") != NULL);
if (m_enablelog) {
// Create a log of every render process.
......
......@@ -42,7 +42,7 @@
class KoSliderComboContainer : public QMenu
{
public:
KoSliderComboContainer(KoSliderCombo *parent) : QMenu(parent ), m_parent(parent) {}
KoSliderComboContainer(KoSliderCombo *parent) : QMenu(parent), m_parent(parent) {}
protected:
virtual void mousePressEvent(QMouseEvent *e);
......@@ -57,14 +57,15 @@ void KoSliderComboContainer::mousePressEvent(QMouseEvent *e)
opt.subControls = QStyle::SC_All;
opt.activeSubControls = QStyle::SC_ComboBoxArrow;
QStyle::SubControl sc = style()->hitTestComplexControl(QStyle::CC_ComboBox, &opt,
m_parent->mapFromGlobal(e->globalPos()),
m_parent);
m_parent->mapFromGlobal(e->globalPos()),
m_parent);
if (sc == QStyle::SC_ComboBoxArrow)
setAttribute(Qt::WA_NoMouseReplay);
QMenu::mousePressEvent(e);
}
class KoSliderCombo::KoSliderComboPrivate {
class KoSliderCombo::KoSliderComboPrivate
{
public:
KoSliderCombo *thePublic;
QValidator *m_validator;
......@@ -86,8 +87,8 @@ public:
};
KoSliderCombo::KoSliderCombo(QWidget *parent)
: QComboBox(parent)
,d(new KoSliderComboPrivate())
: QComboBox(parent)
, d(new KoSliderComboPrivate())
{
d->thePublic = this;
d->minimum = 0.0;
......@@ -155,14 +156,14 @@ QSize KoSliderCombo::minimumSizeHint() const
void KoSliderCombo::KoSliderComboPrivate::showPopup()
{
if(firstShowOfSlider) {
if (firstShowOfSlider) {
container->show(); //show container a bit early so the slider can be layout'ed
firstShowOfSlider = false;
}
QStyleOptionSlider opt;
opt.init(slider);
opt.maximum=256;
opt.maximum = 256;
opt.sliderPosition = opt.sliderValue = slider->value();
int hdlPos = thePublic->style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle).center().x();
......@@ -202,17 +203,16 @@ void KoSliderCombo::hideEvent(QHideEvent *)
void KoSliderCombo::changeEvent(QEvent *e)
{
switch (e->type())
{
case QEvent::EnabledChange:
if (!isEnabled())
d->hidePopup();
break;
case QEvent::PaletteChange:
d->container->setPalette(palette());
break;
default:
break;
switch (e->type()) {
case QEvent::EnabledChange:
if (!isEnabled())
d->hidePopup();
break;
case QEvent::PaletteChange:
d->container->setPalette(palette());
break;
default:
break;
}
QComboBox::changeEvent(e);
}
......@@ -238,26 +238,24 @@ void KoSliderCombo::mousePressEvent(QMouseEvent *e)
opt.subControls = QStyle::SC_All;
opt.editable = true;
QStyle::SubControl sc = style()->hitTestComplexControl(QStyle::CC_ComboBox, &opt, e->pos(),
this);
if (sc == QStyle::SC_ComboBoxArrow && !d->container->isVisible())
{
this);
if (sc == QStyle::SC_ComboBoxArrow && !d->container->isVisible()) {
d->showPopup();
}
else
} else
QComboBox::mousePressEvent(e);
}
void KoSliderCombo::keyPressEvent(QKeyEvent *e)
{
if (e->key() == Qt::Key_Up) setValue(value() + d->slider->singleStep() * (maximum() - minimum()) / 256 + 0.5);
else if (e->key() == Qt::Key_Down) setValue(value() - d->slider->singleStep() * (maximum() - minimum()) / 256 - 0.5);
if (e->key() == Qt::Key_Up) setValue(value() + d->slider->singleStep() *(maximum() - minimum()) / 256 + 0.5);
else if (e->key() == Qt::Key_Down) setValue(value() - d->slider->singleStep() *(maximum() - minimum()) / 256 - 0.5);
else QComboBox::keyPressEvent(e);
}
void KoSliderCombo::wheelEvent(QWheelEvent *e)
{
if (e->delta() > 0) setValue(value() + d->slider->singleStep() * (maximum() - minimum()) / 256 + 0.5);
else setValue(value() - d->slider->singleStep() * (maximum() - minimum()) / 256 - 0.5);
if (e->delta() > 0) setValue(value() + d->slider->singleStep() *(maximum() - minimum()) / 256 + 0.5);
else setValue(value() - d->slider->singleStep() *(maximum() - minimum()) / 256 - 0.5);
}
void KoSliderCombo::KoSliderComboPrivate::lineEditFinished()
......@@ -271,7 +269,7 @@ void KoSliderCombo::KoSliderComboPrivate::lineEditFinished()
void KoSliderCombo::KoSliderComboPrivate::sliderValueChanged(int slidervalue)
{
thePublic->setEditText(KGlobal::locale()->formatNumber(minimum + (maximum - minimum)*slidervalue/256, decimals));
thePublic->setEditText(KGlobal::locale()->formatNumber(minimum + (maximum - minimum)*slidervalue / 256, decimals));
qreal value = thePublic->currentText().toDouble();
emit thePublic->valueChanged(value, false);
......@@ -322,9 +320,9 @@ void KoSliderCombo::setMaximum(qreal max)
void KoSliderCombo::setValue(qreal value)
{
if(value < d->minimum)
if (value < d->minimum)
value = d->minimum;
if(value > d->maximum)
if (value > d->maximum)
value = d->maximum;
setEditText(KGlobal::locale()->formatNumber(value, d->decimals));
d->slider->blockSignals(true);
......
......@@ -28,13 +28,13 @@
*
* KoSliderCombo combines a numerical input and a dropdown slider in a way that takes up as
* little screen space as possible.
*
*
* It allows the user to either enter a floating point value or quickly set the value using a slider
*
*
* One signal is emitted when the value changes. The signal is even emitted when the slider
* is moving. The second argument of the signal however tells you if the value is final or not. A
* final value is produced by entering a value numerically or by releasing the slider.
*
*
* The input of the numerical line edit is constrained to numbers and decimal signs.
*/
class KoSliderCombo : public QComboBox
......@@ -49,7 +49,7 @@ public:
*
* @param parent parent QWidget
*/
KoSliderCombo(QWidget *parent=0);
KoSliderCombo(QWidget *parent = 0);
/**
* Destructor
......@@ -93,9 +93,9 @@ public:
*/
void setMaximum(qreal max);
/**
* The value shown.
*/
/**
* The value shown.
*/
qreal value() const;
virtual QSize minimumSizeHint() const; ///< reimplemented from QComboBox
......@@ -103,11 +103,11 @@ public:
public slots:
/**
* Sets the value.
* The value actually set is forced to be within the legal range: minimum <= value <= maximum
* @param value the new value
*/
/**
* Sets the value.
* The value actually set is forced to be within the legal range: minimum <= value <= maximum
* @param value the new value
*/
void setValue(qreal value);
signals:
......
......@@ -267,7 +267,7 @@ TitleWidget::TitleWidget(KUrl url, Timecode tc, QString projectTitlePath, Render
zDown->setDefaultAction(m_zDown);
m_zTop = new QAction(KIcon("kdenlive-zindex-top"), QString(), this);
// TODO mbt 1414: Shortcut should change z index only if
// TODO mbt 1414: Shortcut should change z index only if
// cursor is NOT in a text field ...
//m_zTop->setShortcut(Qt::Key_Home);
m_zTop->setToolTip(i18n("Raise object to top"));
......@@ -1771,9 +1771,9 @@ void TitleWidget::setXml(QDomDocument doc)
x.rotatez = rotlist[2].toDouble();
// Try to adjust zoom
t.rotate(x.rotatex * (-1), Qt::XAxis);
t.rotate(x.rotatey * (-1), Qt::YAxis);
t.rotate(x.rotatez * (-1), Qt::ZAxis);
t.rotate(x.rotatex *(-1), Qt::XAxis);
t.rotate(x.rotatey *(-1), Qt::YAxis);
t.rotate(x.rotatez *(-1), Qt::ZAxis);
x.scalex = t.m11();
x.scaley = t.m22();
} else {
......
......@@ -169,7 +169,7 @@ private:
void deleteAnimInfoText();
qreal maxZIndex();
/**
/**
* \brief Get the minimum/maximum z index value of items.
* \param maxBound true: Use maximum z index. false: Use minimum
* \param intersectingOnly Only considers the items intersecting with
......
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