Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 7ee43bac authored by Jonathan Marten's avatar Jonathan Marten

Fix compile with Qt 5.13 and QT_DISABLE_DEPRECATED_BEFORE=0x060000

Differential Revision: https://phabricator.kde.org/D19347
parent 3f932f72
......@@ -734,7 +734,7 @@ void AgendaView::init(const QDate &start, const QDate &end)
d->mSelectedDates = Private::generateDateList(start, end);
d->mGridLayout = new QGridLayout(this);
d->mGridLayout->setMargin(0);
d->mGridLayout->setContentsMargins(0, 0, 0, 0);
/* Create agenda splitter */
d->mSplitterAgenda = new QSplitter(Qt::Vertical, this);
......@@ -743,13 +743,13 @@ void AgendaView::init(const QDate &start, const QDate &end)
/* Create day name labels for agenda columns */
d->mTopDayLabelsFrame = new QFrame(d->mSplitterAgenda);
auto layout = new QHBoxLayout(d->mTopDayLabelsFrame);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(SPACING);
/* Create all-day agenda widget */
d->mAllDayFrame = new QFrame(d->mSplitterAgenda);
auto allDayFrameLayout = new QHBoxLayout(d->mAllDayFrame);
allDayFrameLayout->setMargin(0);
allDayFrameLayout->setContentsMargins(0, 0, 0, 0);
allDayFrameLayout->setSpacing(SPACING);
// Alignment and description widgets
......@@ -757,7 +757,7 @@ void AgendaView::init(const QDate &start, const QDate &end)
d->mTimeBarHeaderFrame = new QFrame(d->mAllDayFrame);
allDayFrameLayout->addWidget(d->mTimeBarHeaderFrame);
auto timeBarHeaderFrameLayout = new QHBoxLayout(d->mTimeBarHeaderFrame);
timeBarHeaderFrameLayout->setMargin(0);
timeBarHeaderFrameLayout->setContentsMargins(0, 0, 0, 0);
timeBarHeaderFrameLayout->setSpacing(0);
d->mDummyAllDayLeft = new QWidget(d->mAllDayFrame);
allDayFrameLayout->addWidget(d->mDummyAllDayLeft);
......@@ -772,7 +772,7 @@ void AgendaView::init(const QDate &start, const QDate &end)
/* Create the main agenda widget and the related widgets */
QWidget *agendaFrame = new QWidget(d->mSplitterAgenda);
QHBoxLayout *agendaLayout = new QHBoxLayout(agendaFrame);
agendaLayout->setMargin(0);
agendaLayout->setContentsMargins(0, 0, 0, 0);
agendaLayout->setSpacing(SPACING);
// Create agenda
......@@ -812,7 +812,7 @@ void AgendaView::init(const QDate &start, const QDate &end)
/* Create a frame at the bottom which may be used by decorations */
d->mBottomDayLabelsFrame = new QFrame(d->mSplitterAgenda);
layout = new QHBoxLayout(d->mBottomDayLabelsFrame);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(SPACING);
if (!d->mIsSideBySide) {
......@@ -1141,7 +1141,7 @@ void AgendaView::placeDecorations(DecorationList &decoList, const QDate &date, Q
labelBox->layout()->addWidget(decoHBox);
auto layout = new QHBoxLayout(decoHBox);
layout->setSpacing(0);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
decoHBox->setFrameShape(QFrame::StyledPanel);
decoHBox->setMinimumWidth(1);
......@@ -1177,7 +1177,7 @@ void AgendaView::createDayLabels(bool force)
static_cast<QBoxLayout *>(d->mTopDayLabelsFrame->layout())->setStretchFactor(d->mTopDayLabels,
1);
d->mLayoutTopDayLabels = new QHBoxLayout(d->mTopDayLabels);
d->mLayoutTopDayLabels->setMargin(0);
d->mLayoutTopDayLabels->setContentsMargins(0, 0, 0, 0);
d->mLayoutTopDayLabels->setSpacing(1);
// this spacer moves the day labels over to line up with the day columns
......@@ -1190,7 +1190,7 @@ void AgendaView::createDayLabels(bool force)
d->mLayoutTopDayLabels->addSpacerItem(spacer);
auto topWeekLabelBox = new QFrame(d->mTopDayLabels);
auto topWeekLabelBoxLayout = new QVBoxLayout(topWeekLabelBox);
topWeekLabelBoxLayout->setMargin(0);
topWeekLabelBoxLayout->setContentsMargins(0, 0, 0, 0);
topWeekLabelBoxLayout->setSpacing(0);
d->mLayoutTopDayLabels->addWidget(topWeekLabelBox);
if (d->mIsSideBySide) {
......@@ -1202,10 +1202,10 @@ void AgendaView::createDayLabels(bool force)
static_cast<QBoxLayout *>(d->mBottomDayLabelsFrame->layout())->setStretchFactor(
d->mBottomDayLabels, 1);
d->mLayoutBottomDayLabels = new QHBoxLayout(d->mBottomDayLabels);
d->mLayoutBottomDayLabels->setMargin(0);
d->mLayoutBottomDayLabels->setContentsMargins(0, 0, 0, 0);
auto bottomWeekLabelBox = new QFrame(d->mBottomDayLabels);
auto bottomWeekLabelBoxLayout = new QVBoxLayout(bottomWeekLabelBox);
bottomWeekLabelBoxLayout->setMargin(0);
bottomWeekLabelBoxLayout->setContentsMargins(0, 0, 0, 0);
bottomWeekLabelBoxLayout->setSpacing(0);
d->mLayoutBottomDayLabels->addWidget(bottomWeekLabelBox);
......@@ -1223,12 +1223,12 @@ void AgendaView::createDayLabels(bool force)
Q_FOREACH (const QDate &date, d->mSelectedDates) {
auto topDayLabelBox = new QFrame(d->mTopDayLabels);
auto topDayLabelBoxLayout = new QVBoxLayout(topDayLabelBox);
topDayLabelBoxLayout->setMargin(0);
topDayLabelBoxLayout->setContentsMargins(0, 0, 0, 0);
topDayLabelBoxLayout->setSpacing(0);
d->mLayoutTopDayLabels->addWidget(topDayLabelBox);
auto bottomDayLabelBox = new QFrame(d->mBottomDayLabels);
auto bottomDayLabelBoxLayout = new QVBoxLayout(bottomDayLabelBox);
bottomDayLabelBoxLayout->setMargin(0);
bottomDayLabelBoxLayout->setContentsMargins(0, 0, 0, 0);
bottomDayLabelBoxLayout->setSpacing(0);
d->mLayoutBottomDayLabels->addWidget(bottomDayLabelBox);
......@@ -1442,7 +1442,7 @@ void AgendaView::createTimeBarHeaders()
d->mTimeBarHeaderFrame->layout()->addWidget(label);
label->setFont(labelFont);
label->setAlignment(Qt::AlignBottom | Qt::AlignRight);
label->setMargin(0);
label->setContentsMargins(0, 0, 0, 0);
label->setWordWrap(true);
label->setToolTip(timeLabel->headerToolTip());
d->mTimeBarHeaders.append(label);
......
......@@ -51,7 +51,7 @@ TimeLabels::TimeLabels(const QTimeZone &zone, int rows, TimeLabelsZone *parent,
mCellHeight = mTimeLabelsZone->preferences()->hourSize() * 4;
setBackgroundRole(QPalette::Background);
setBackgroundRole(QPalette::Window);
mMousePos = new QFrame(this);
mMousePos->setLineWidth(1);
......
......@@ -38,7 +38,7 @@ TimeLabelsZone::TimeLabelsZone(QWidget *parent, const PrefsPtr &preferences, Age
, mParent(qobject_cast<AgendaView * >(parent))
{
mTimeLabelsLayout = new QHBoxLayout(this);
mTimeLabelsLayout->setMargin(0);
mTimeLabelsLayout->setContentsMargins(0, 0, 0, 0);
mTimeLabelsLayout->setSpacing(0);
init();
......
......@@ -52,7 +52,7 @@ JournalDateView::JournalDateView(const Akonadi::ETMCalendar::Ptr &calendar, QWid
, mChanger(nullptr)
{
auto layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
}
......
......@@ -41,11 +41,11 @@ JournalView::JournalView(QWidget *parent) : EventView(parent)
, mChanger(nullptr)
{
QVBoxLayout *topLayout = new QVBoxLayout(this);
topLayout->setMargin(0);
topLayout->setContentsMargins(0, 0, 0, 0);
mSA = new QScrollArea(this);
mCurrentWidget = new QWidget(mSA->viewport());
QVBoxLayout *mVBoxVBoxLayout = new QVBoxLayout(mCurrentWidget);
mVBoxVBoxLayout->setMargin(0);
mVBoxVBoxLayout->setContentsMargins(0, 0, 0, 0);
mSA->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
mSA->setWidgetResizable(true);
mSA->setWidget(mCurrentWidget);
......
......@@ -293,7 +293,7 @@ ListView::ListView(const Akonadi::ETMCalendar::Ptr &calendar, QWidget *parent, b
d->mTreeWidget->setRootIsDecorated(false);
QBoxLayout *layoutTop = new QVBoxLayout(this);
layoutTop->setMargin(0);
layoutTop->setContentsMargins(0, 0, 0, 0);
layoutTop->addWidget(d->mTreeWidget);
QObject::connect(d->mTreeWidget, QOverload<const QModelIndex &>::of(&QTreeWidget::doubleClicked), this,
......
......@@ -161,12 +161,12 @@ MonthView::MonthView(NavButtonsVisibility visibility, QWidget *parent)
{
QHBoxLayout *topLayout = new QHBoxLayout(this);
topLayout->addWidget(d->view);
topLayout->setMargin(0);
topLayout->setContentsMargins(0, 0, 0, 0);
if (visibility == Visible) {
QVBoxLayout *rightLayout = new QVBoxLayout();
rightLayout->setSpacing(0);
rightLayout->setMargin(0);
rightLayout->setContentsMargins(0, 0, 0, 0);
// push buttons to the bottom
rightLayout->addStretch(1);
......
......@@ -159,14 +159,14 @@ MultiAgendaView::MultiAgendaView(QWidget *parent)
{
QHBoxLayout *topLevelLayout = new QHBoxLayout(this);
topLevelLayout->setSpacing(0);
topLevelLayout->setMargin(0);
topLevelLayout->setContentsMargins(0, 0, 0, 0);
QFontMetrics fm(font());
int topLabelHeight = 2 * fm.height() + fm.lineSpacing();
QWidget *topSideBox = new QWidget(this);
QVBoxLayout *topSideBoxVBoxLayout = new QVBoxLayout(topSideBox);
topSideBoxVBoxLayout->setMargin(0);
topSideBoxVBoxLayout->setContentsMargins(0, 0, 0, 0);
QWidget *topSideSpacer = new QWidget(topSideBox);
topSideBoxVBoxLayout->addWidget(topSideSpacer);
......@@ -181,7 +181,7 @@ MultiAgendaView::MultiAgendaView(QWidget *parent)
QWidget *sideBox = new QWidget(d->mLeftSplitter);
QVBoxLayout *sideBoxVBoxLayout = new QVBoxLayout(sideBox);
sideBoxVBoxLayout->setMargin(0);
sideBoxVBoxLayout->setContentsMargins(0, 0, 0, 0);
// compensate for the frame the agenda views but not the timelabels have
QWidget *timeLabelTopAlignmentSpacer = new QWidget(sideBox);
......@@ -212,12 +212,12 @@ MultiAgendaView::MultiAgendaView(QWidget *parent)
topLevelLayout->addWidget(d->mScrollArea, 100);
d->mTopBox = new QWidget(d->mScrollArea->viewport());
QHBoxLayout *mTopBoxHBoxLayout = new QHBoxLayout(d->mTopBox);
mTopBoxHBoxLayout->setMargin(0);
mTopBoxHBoxLayout->setContentsMargins(0, 0, 0, 0);
d->mScrollArea->setWidget(d->mTopBox);
topSideBox = new QWidget(this);
topSideBoxVBoxLayout = new QVBoxLayout(topSideBox);
topSideBoxVBoxLayout->setMargin(0);
topSideBoxVBoxLayout->setContentsMargins(0, 0, 0, 0);
topSideSpacer = new QWidget(topSideBox);
topSideBoxVBoxLayout->addWidget(topSideSpacer);
......@@ -484,7 +484,7 @@ AgendaView *MultiAgendaView::Private::createView(const QString &title)
QWidget *box = new QWidget(mTopBox);
mTopBox->layout()->addWidget(box);
QVBoxLayout *layout = new QVBoxLayout(box);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(new ElidedLabel(title));
AgendaView *av = new AgendaView(q->preferences(),
q->startDateTime().date(),
......
......@@ -300,7 +300,7 @@ TodoView::TodoView(const EventViews::PrefsPtr &prefs, bool sidebarView, QWidget
}
QGridLayout *layout = new QGridLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
if (!mSidebarView) {
layout->addWidget(mQuickSearch, 0, 0, 1, 2);
}
......
......@@ -55,7 +55,7 @@ WhatsNextView::WhatsNextView(QWidget *parent)
connect(mView, &WhatsNextTextBrowser::showIncidence, this, &WhatsNextView::showIncidence);
QBoxLayout *topLayout = new QVBoxLayout(this);
topLayout->setMargin(0);
topLayout->setContentsMargins(0, 0, 0, 0);
topLayout->addWidget(mView);
}
......
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