Commit bc9bd293 authored by Jonathan Marten's avatar Jonathan Marten
Browse files

Fix compile with Qt 5.13 and QT_DISABLE_DEPRECATED_BEFORE=0x060000

Differential Revision: https://phabricator.kde.org/D19353
parent d78d1558
......@@ -52,7 +52,7 @@ AddArchiveMailDialog::AddArchiveMailDialog(ArchiveMailInfo *info, QWidget *paren
QVBoxLayout *topLayout = new QVBoxLayout(this);
QGridLayout *mainLayout = new QGridLayout;
mainLayout->setMargin(0);
mainLayout->setContentsMargins(0, 0, 0, 0);
int row = 0;
......
......@@ -179,7 +179,7 @@ void ArchiveMailWidget::createOrUpdateItem(ArchiveMailInfo *info, ArchiveMailIte
item->setText(ArchiveMailWidget::LastArchiveDate, QLocale().toString(info->lastDateSaved(), QLocale::ShortFormat));
updateDiffDate(item, info);
} else {
item->setBackgroundColor(ArchiveMailWidget::NextArchive, Qt::green);
item->setBackground(ArchiveMailWidget::NextArchive, Qt::green);
}
item->setInfo(info);
}
......@@ -191,9 +191,9 @@ void ArchiveMailWidget::updateDiffDate(ArchiveMailItem *item, ArchiveMailInfo *i
item->setText(ArchiveMailWidget::NextArchive, i18np("Tomorrow", "%1 days", diff));
if (diff < 0) {
if (info->isEnabled()) {
item->setBackgroundColor(ArchiveMailWidget::NextArchive, Qt::red);
item->setBackground(ArchiveMailWidget::NextArchive, Qt::red);
} else {
item->setBackgroundColor(ArchiveMailWidget::NextArchive, Qt::lightGray);
item->setBackground(ArchiveMailWidget::NextArchive, Qt::lightGray);
}
} else {
item->setToolTip(ArchiveMailWidget::NextArchive, i18n("Archive will be done %1", QLocale().toString(diffDate, QLocale::ShortFormat)));
......
......@@ -68,7 +68,7 @@ FollowUpReminderInfoWidget::FollowUpReminderInfoWidget(QWidget *parent)
{
setObjectName(QStringLiteral("FollowUpReminderInfoWidget"));
QHBoxLayout *hbox = new QHBoxLayout(this);
hbox->setMargin(0);
hbox->setContentsMargins(0, 0, 0, 0);
mTreeWidget = new QTreeWidget(this);
mTreeWidget->setObjectName(QStringLiteral("treewidget"));
QStringList headers;
......@@ -143,10 +143,10 @@ void FollowUpReminderInfoWidget::createOrUpdateItem(FollowUpReminder::FollowUpRe
item->setText(AnswerWasReceived, answerWasReceived ? i18n("Received") : i18n("On hold"));
item->setData(0, AnswerItemFound, answerWasReceived);
if (answerWasReceived) {
item->setBackgroundColor(DeadLine, Qt::green);
item->setBackground(DeadLine, Qt::green);
} else {
if (info->followUpReminderDate() < QDate::currentDate()) {
item->setBackgroundColor(DeadLine, Qt::red);
item->setBackground(DeadLine, Qt::red);
}
}
#ifdef DEBUG_MESSAGE_ID
......
......@@ -82,7 +82,7 @@ FilterLogDialog::FilterLogDialog(QWidget *parent)
QVBoxLayout *pageVBoxLayout = new QVBoxLayout;
page->setLayout(pageVBoxLayout);
pageVBoxLayout->setMargin(0);
pageVBoxLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->addWidget(page);
mTextEdit = new KPIMTextEdit::PlainTextEditorWidget(new FilterLogTextEdit(this), page);
......@@ -167,7 +167,7 @@ FilterLogDialog::FilterLogDialog(QWidget *parent)
QWidget *hbox = new QWidget(page);
QHBoxLayout *hboxHBoxLayout = new QHBoxLayout;
hbox->setLayout(hboxHBoxLayout);
hboxHBoxLayout->setMargin(0);
hboxHBoxLayout->setContentsMargins(0, 0, 0, 0);
pageVBoxLayout->addWidget(hbox);
QLabel *logSizeLab = new QLabel(i18n("Log size limit:"), hbox);
hboxHBoxLayout->addWidget(logSizeLab);
......
......@@ -98,7 +98,7 @@ void AttachPropertyDialog::setAttachment(KTNEFAttach *attach)
mUI.mSize->setText(s);
QMimeDatabase db;
QMimeType mimetype = db.mimeTypeForName(attach->mimeTag());
QPixmap pix = loadRenderingPixmap(attach, qApp->palette().color(QPalette::Background));
QPixmap pix = loadRenderingPixmap(attach, qApp->palette().color(QPalette::Window));
if (!pix.isNull()) {
mUI.mIcon->setPixmap(pix);
} else {
......
......@@ -56,7 +56,7 @@ Attachment::Attachment(QTreeWidget *parent, KTNEFAttach *attach)
QMimeType mimeType = db.mimeTypeForName(mAttach->mimeTag());
setText(1, mimeType.comment());
QPixmap pix = AttachPropertyDialog::loadRenderingPixmap(attach, qApp->palette().color(QPalette::Background));
QPixmap pix = AttachPropertyDialog::loadRenderingPixmap(attach, qApp->palette().color(QPalette::Window));
if (!pix.isNull()) {
setIcon(0, pix);
} else {
......
......@@ -363,7 +363,7 @@ bool QWinMetaFile::paint(QPaintDevice *aTarget, bool absolute)
mObjHandleTab[ i ] = nullptr;
}
mPainter.resetMatrix();
mPainter.resetTransform();
mWinding = false;
mAbsoluteCoord = absolute;
......@@ -571,7 +571,8 @@ void QWinMetaFile::roundRect(long, short *parm)
yRnd = (parm[ 0 ] * 100) / (parm[ 2 ] - parm[ 4 ]);
}
mPainter.drawRoundRect(parm[ 5 ], parm[ 4 ], parm[ 3 ] - parm[ 5 ], parm[ 2 ] - parm[ 4 ], xRnd, yRnd);
mPainter.drawRoundedRect(parm[ 5 ], parm[ 4 ], parm[ 3 ] - parm[ 5 ], parm[ 2 ] - parm[ 4 ],
xRnd, yRnd, Qt::RelativeSize);
}
//-----------------------------------------------------------------------------
......@@ -803,12 +804,12 @@ void QWinMetaFile::dibBitBlt(long num, short *parm)
// wmf file allow negative width or height
mPainter.save();
if (parm[ 5 ] < 0) { // width < 0 => horizontal flip
QMatrix m(-1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F);
mPainter.setMatrix(m, true);
QTransform m(-1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F);
mPainter.setWorldTransform(m, true);
}
if (parm[ 4 ] < 0) { // height < 0 => vertical flip
QMatrix m(1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F);
mPainter.setMatrix(m, true);
QTransform m(1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F);
mPainter.setWorldTransform(m, true);
}
mPainter.drawImage(parm[ 7 ], parm[ 6 ], bmpSrc, parm[ 3 ], parm[ 2 ], parm[ 5 ], parm[ 4 ]);
mPainter.restore();
......@@ -831,12 +832,12 @@ void QWinMetaFile::dibStretchBlt(long num, short *parm)
// wmf file allow negative width or height
mPainter.save();
if (parm[ 7 ] < 0) { // width < 0 => horizontal flip
QMatrix m(-1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F);
mPainter.setMatrix(m, true);
QTransform m(-1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F);
mPainter.setWorldTransform(m, true);
}
if (parm[ 6 ] < 0) { // height < 0 => vertical flip
QMatrix m(1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F);
mPainter.setMatrix(m, true);
QTransform m(1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F);
mPainter.setWorldTransform(m, true);
}
bmpSrc = bmpSrc.copy(parm[ 5 ], parm[ 4 ], parm[ 3 ], parm[ 2 ]);
// TODO: scale the bitmap ( QImage::scale(parm[ 7 ], parm[ 6 ]) is actually too slow )
......@@ -859,12 +860,12 @@ void QWinMetaFile::stretchDib(long num, short *parm)
// wmf file allow negative width or height
mPainter.save();
if (parm[ 8 ] < 0) { // width < 0 => horizontal flip
QMatrix m(-1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F);
mPainter.setMatrix(m, true);
QTransform m(-1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F);
mPainter.setWorldTransform(m, true);
}
if (parm[ 7 ] < 0) { // height < 0 => vertical flip
QMatrix m(1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F);
mPainter.setMatrix(m, true);
QTransform m(1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F);
mPainter.setWorldTransform(m, true);
}
bmpSrc = bmpSrc.copy(parm[ 6 ], parm[ 5 ], parm[ 4 ], parm[ 3 ]);
// TODO: scale the bitmap ( QImage::scale(parm[ 8 ], parm[ 7 ]) is actually too slow )
......
......@@ -54,7 +54,7 @@ void CollectionTemplatesPage::init()
{
QVBoxLayout *topLayout = new QVBoxLayout(this);
QHBoxLayout *topItems = new QHBoxLayout;
topItems->setMargin(0);
topItems->setContentsMargins(0, 0, 0, 0);
topLayout->addLayout(topItems);
mCustom = new QCheckBox(i18n("&Use custom message templates in this folder"), this);
......
......@@ -218,7 +218,7 @@ void ConfigAgentDelegate::drawFocus(QPainter *painter, const QStyleOptionViewIte
o.state |= QStyle::State_KeyboardFocusChange;
QPalette::ColorGroup cg = (option.state & QStyle::State_Enabled) ? QPalette::Normal : QPalette::Disabled;
o.backgroundColor = option.palette.color(cg, (option.state & QStyle::State_Selected)
? QPalette::Highlight : QPalette::Background);
? QPalette::Highlight : QPalette::Window);
QApplication::style()->drawPrimitive(QStyle::PE_FrameFocusRect, &o, painter);
}
}
......
......@@ -390,7 +390,7 @@ LdapCompetionTab::LdapCompetionTab(QWidget *parent)
: ConfigModuleTab(parent)
{
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
mLdapConfigureWidget = new KLDAP::LdapConfigureWidget(this);
layout->addWidget(mLdapConfigureWidget);
......
......@@ -675,7 +675,7 @@ AppearancePageHeadersTab::AppearancePageHeadersTab(QWidget *parent)
if (dateDisplayConfig[i].dateDisplay == DateFormatter::Custom) {
QWidget *hbox = new QWidget(mDateDisplayBox);
QHBoxLayout *hboxHBoxLayout = new QHBoxLayout(hbox);
hboxHBoxLayout->setMargin(0);
hboxHBoxLayout->setContentsMargins(0, 0, 0, 0);
QRadioButton *radio = new QRadioButton(buttonLabel, hbox);
hboxHBoxLayout->addWidget(radio);
mDateDisplay->addButton(radio, dateDisplayConfig[i].dateDisplay);
......
......@@ -1215,7 +1215,7 @@ ComposerPageAutoCorrectionTab::ComposerPageAutoCorrectionTab(QWidget *parent)
{
QVBoxLayout *vlay = new QVBoxLayout(this);
vlay->setSpacing(0);
vlay->setMargin(0);
vlay->setContentsMargins(0, 0, 0, 0);
autocorrectionWidget = new PimCommon::AutoCorrectionWidget(this);
if (KMKernel::self()) {
autocorrectionWidget->setAutoCorrection(KMKernel::self()->composerAutoCorrection());
......@@ -1249,7 +1249,7 @@ ComposerPageAutoImageResizeTab::ComposerPageAutoImageResizeTab(QWidget *parent)
{
QVBoxLayout *vlay = new QVBoxLayout(this);
vlay->setSpacing(0);
vlay->setMargin(0);
vlay->setContentsMargins(0, 0, 0, 0);
autoResizeWidget = new MessageComposer::ImageScalingWidget(this);
vlay->addWidget(autoResizeWidget);
connect(autoResizeWidget, &MessageComposer::ImageScalingWidget::changed, this, &ConfigModuleTab::slotEmitChanged);
......
......@@ -20,7 +20,7 @@ ConfigModuleWithTabs::ConfigModuleWithTabs(QWidget *parent)
: ConfigModule(parent)
{
QVBoxLayout *vlay = new QVBoxLayout(this);
vlay->setMargin(0);
vlay->setContentsMargins(0, 0, 0, 0);
mTabWidget = new QTabWidget(this);
vlay->addWidget(mTabWidget);
}
......
......@@ -75,7 +75,7 @@ ArchiveFolderDialog::ArchiveFolderDialog(QWidget *parent)
topLayout->addWidget(mainWidget);
topLayout->addWidget(buttonBox);
QGridLayout *mainLayout = new QGridLayout(mainWidget);
mainLayout->setMargin(0);
mainLayout->setContentsMargins(0, 0, 0, 0);
int row = 0;
......
......@@ -55,7 +55,7 @@ AttachmentView::AttachmentView(MessageComposer::AttachmentModel *model, QWidget
{
mWidget = new QWidget();
QHBoxLayout *lay = new QHBoxLayout(mWidget);
lay->setMargin(0);
lay->setContentsMargins(0, 0, 0, 0);
mToolButton = new QToolButton;
connect(mToolButton, &QAbstractButton::toggled, this, &AttachmentView::slotShowHideAttchementList);
mToolButton->setIcon(QIcon::fromTheme(QStringLiteral("mail-attachment")));
......@@ -63,7 +63,7 @@ AttachmentView::AttachmentView(MessageComposer::AttachmentModel *model, QWidget
mToolButton->setCheckable(true);
lay->addWidget(mToolButton);
mInfoAttachment = new QLabel;
mInfoAttachment->setMargin(0);
mInfoAttachment->setContentsMargins(0, 0, 0, 0);
mInfoAttachment->setTextFormat(Qt::PlainText);
lay->addWidget(mInfoAttachment);
......
......@@ -281,7 +281,7 @@ KMComposerWin::KMComposerWin(const KMime::Message::Ptr &aMsg, bool lastSignState
mHeadersToEditorSplitter->setSizes(defaultSizes);
QVBoxLayout *v = new QVBoxLayout(mMainWidget);
v->setMargin(0);
v->setContentsMargins(0, 0, 0, 0);
v->addWidget(mHeadersToEditorSplitter);
KIdentityManagement::IdentityCombo *identity = new KIdentityManagement::IdentityCombo(kmkernel->identityManager(),
mHeadersArea);
......@@ -349,7 +349,7 @@ KMComposerWin::KMComposerWin(const KMime::Message::Ptr &aMsg, bool lastSignState
mCryptoStateIndicatorWidget->setShowAlwaysIndicator(KMailSettings::self()->showCryptoLabelIndicator());
QVBoxLayout *vbox = new QVBoxLayout(editorAndCryptoStateIndicators);
vbox->setMargin(0);
vbox->setContentsMargins(0, 0, 0, 0);
mPotentialPhishingEmailWarning = new PotentialPhishingEmailWarning(this);
connect(mPotentialPhishingEmailWarning, &PotentialPhishingEmailWarning::sendNow, this, &KMComposerWin::slotCheckSendNowStep2);
......
......@@ -30,7 +30,7 @@ PotentialPhishingDetailWidget::PotentialPhishingDetailWidget(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setMargin(0);
mainLayout->setContentsMargins(0, 0, 0, 0);
QLabel *lab = new QLabel(i18n("Select email to put in whitelist:"), this);
lab->setObjectName(QStringLiteral("label"));
mainLayout->addWidget(lab);
......
......@@ -30,7 +30,7 @@ CryptoStateIndicatorWidget::CryptoStateIndicatorWidget(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *hbox = new QHBoxLayout(this);
hbox->setMargin(0);
hbox->setContentsMargins(0, 0, 0, 0);
mSignatureStateIndicator = new QLabel(this);
mSignatureStateIndicator->setAlignment(Qt::AlignHCenter);
mSignatureStateIndicator->setTextFormat(Qt::PlainText);
......
......@@ -47,7 +47,7 @@ IdentityAddVcardDialog::IdentityAddVcardDialog(const QStringList &shadowIdentiti
mainLayout->addWidget(buttonBox);
QVBoxLayout *vlay = new QVBoxLayout(mainWidget);
vlay->setMargin(0);
vlay->setContentsMargins(0, 0, 0, 0);
mButtonGroup = new QButtonGroup(this);
mButtonGroup->setObjectName(QStringLiteral("buttongroup"));
......
......@@ -291,7 +291,7 @@ IdentityDialog::IdentityDialog(QWidget *parent)
mainLayout->addWidget(page);
mainLayout->addWidget(buttonBox);
QVBoxLayout *vlay = new QVBoxLayout(page);
vlay->setMargin(0);
vlay->setContentsMargins(0, 0, 0, 0);
mTabWidget = new QTabWidget(page);
mTabWidget->setObjectName(QStringLiteral("config-identity-tab"));
vlay->addWidget(mTabWidget);
......
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