Fix deprecation compile warnings

parent 5e4ef93e
Pipeline #14276 canceled with stage
......@@ -170,10 +170,8 @@ KeyframeWidget::KeyframeWidget(std::shared_ptr<AssetParameterModel> model, QMode
connect(m_buttonPrevious, &QAbstractButton::pressed, m_keyframeview, &KeyframeView::slotGoToPrev);
connect(m_buttonNext, &QAbstractButton::pressed, m_keyframeview, &KeyframeView::slotGoToNext);
//m_baseHeight = m_keyframeview->height() + m_selectType->defaultWidget()->sizeHint().height();
int tm = 0;
int bm = 0;
m_lay->getContentsMargins(nullptr, &tm, nullptr, &bm);
m_baseHeight = m_keyframeview->height() + m_toolbar->sizeHint().height() + 2 + tm + bm;
QMargins mrg = contentsMargins();
m_baseHeight = m_keyframeview->height() + m_toolbar->sizeHint().height() + 2 + mrg.top() + mrg.bottom();
setFixedHeight(m_baseHeight);
addParameter(index);
......
......@@ -95,7 +95,7 @@ void DragButton::mouseMoveEvent(QMouseEvent *event)
drag->setPixmap(defaultAction()->icon().pixmap(22, 22));
drag->setMimeData(mimeData);
m_dragging = true;
Qt::DropAction dropAction = drag->exec(Qt::CopyAction | Qt::MoveAction);
drag->exec(Qt::CopyAction | Qt::MoveAction);
// Disable / enable toolbutton to clear highlighted state because mouserelease is not triggered on drop end
setEnabled(false);
setEnabled(true);
......
......@@ -63,16 +63,16 @@ static void mlt_log_handler(void *service, int mlt_level, const char *format, va
if (service_name)
message = QString("[%1 %2 %3] ").arg(mlt_type).arg(service_name).arg(id);
else
message = QString().sprintf("[%s %p] ", mlt_type, service);
message = QString::asprintf("[%s %p] ", mlt_type, service);
if (resource)
message.append(QString("\"%1\" ").arg(resource));
message.append(QString().vsprintf(format, args));
message.append(QString::vasprintf(format, args));
message.replace('\n', "");
if (!strcmp(mlt_type, "filter")) {
pCore->processInvalidFilter(service_name, id, message);
}
} else {
message = QString().vsprintf(format, args);
message = QString::vasprintf(format, args);
message.replace('\n', "");
}
qDebug()<<"==========\n\nMLT ERROR:\n"<<message<<"\n";
......
......@@ -379,10 +379,8 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
spacer->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
m_toolbar->addWidget(spacer);*/
m_toolbar->addSeparator();
int tm = 0;
int bm = 0;
m_toolbar->getContentsMargins(nullptr, &tm, nullptr, &bm);
m_audioMeterWidget = new MonitorAudioLevel(m_toolbar->height() - tm - bm, this);
QMargins mrg = m_toolbar->contentsMargins();
m_audioMeterWidget = new MonitorAudioLevel(m_toolbar->height() - mrg.top() - mrg.bottom(), this);
m_toolbar->addWidget(m_audioMeterWidget);
if (!m_audioMeterWidget->isValid) {
KdenliveSettings::setMonitoraudio(0x01);
......
......@@ -52,9 +52,8 @@ int ElidedCheckBox::currentWidth() const
if (isVisible()) {
width = contentsRect().width() - (2 * iconSize().width());
} else {
int l, t, r, b;
getContentsMargins(&l, &t, &r, &b);
width = sizeHint().width() - l - r - (2 * iconSize().width());
QMargins mrg = contentsMargins();
width = sizeHint().width() - mrg.left() - mrg.right() - (2 * iconSize().width());
}
return width;
}
......
......@@ -140,9 +140,8 @@ QSize FlowLayout::minimumSize() const
int FlowLayout::doLayout(const QRect &rect, bool testOnly) const
{
int left, top, right, bottom;
getContentsMargins(&left, &top, &right, &bottom);
QRect effectiveRect = rect.adjusted(+left, +top, -right, -bottom);
QMargins mrg = contentsMargins();
QRect effectiveRect = rect.adjusted(mrg.left(), mrg.top(), -mrg.right(), -mrg.bottom());
int x = effectiveRect.x();
int y = effectiveRect.y();
int itemCount = 0;
......@@ -154,7 +153,7 @@ int FlowLayout::doLayout(const QRect &rect, bool testOnly) const
int columns = qMin(qFloor((double)rect.width() / min.width()), m_itemList.size());
columns = qMax(1, columns);
int realWidth = rect.width() / columns - horizontalSpacing();
int totalHeight = y - rect.y() + bottom + qCeil((double)m_itemList.size() / columns) * (realWidth + verticalSpacing());
int totalHeight = y - rect.y() + mrg.bottom() + qCeil((double)m_itemList.size() / columns) * (realWidth + verticalSpacing());
m_minimumSize = QSize(rect.width(), totalHeight);
if (testOnly) {
return totalHeight;
......
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