Commit affbabbc 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/D19357
parent 3e87f985
......@@ -39,7 +39,7 @@ RichTextComposerWidget::RichTextComposerWidget(QWidget *parent)
, d(new KPIMTextEdit::RichTextComposerWidgetPrivate)
{
QHBoxLayout *layout = new QHBoxLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
d->richTextComposer = new KPIMTextEdit::RichTextComposer(this);
d->richTextComposer->setObjectName(QStringLiteral("richtextcomposer"));
RichTextEditorWidget *editorWidget = new RichTextEditorWidget(d->richTextComposer, this);
......
......@@ -47,7 +47,7 @@ public:
: q(qq)
{
QVBoxLayout *lay = new QVBoxLayout(q);
lay->setMargin(0);
lay->setContentsMargins(0, 0, 0, 0);
QHBoxLayout *hbox = new QHBoxLayout;
QLabel *lab = new QLabel(i18n("Image Location:"));
imageUrlRequester = new KUrlRequester;
......
......@@ -49,7 +49,7 @@ public:
mBorder->setSuffix(i18n(" px"));
QGridLayout *gridLayout = new QGridLayout;
gridLayout->setMargin(0);
gridLayout->setContentsMargins(0, 0, 0, 0);
gridLayout->addWidget(new QLabel(i18n("Rows:")), 0, 0);
gridLayout->addWidget(mRows, 0, 1);
......
......@@ -46,7 +46,7 @@ public:
QWidget *page = new QWidget(q);
QVBoxLayout *lay = new QVBoxLayout(page);
lay->setMargin(0);
lay->setContentsMargins(0, 0, 0, 0);
tableWidget = new InsertTableWidget;
lay->addWidget(tableWidget);
......
......@@ -36,8 +36,9 @@ TextReplaceWidget::TextReplaceWidget(QWidget *parent)
QHBoxLayout *lay = new QHBoxLayout(this);
QLabel *label = new QLabel(i18nc("Replace text", "Replace:"), this);
lay->addWidget(label);
const int marg = lay->margin();
lay->setContentsMargins(marg, 0, marg, 0);
const int marg1 = lay->contentsMargins().left();
const int marg2 = lay->contentsMargins().right();
lay->setContentsMargins(marg1, 0, marg2, 0);
mReplace = new QLineEdit(this);
mReplace->setClearButtonEnabled(true);
......@@ -71,8 +72,9 @@ TextFindWidget::TextFindWidget(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *lay = new QHBoxLayout(this);
const int marg = lay->margin();
lay->setContentsMargins(marg, 0, marg, 0);
const int marg1 = lay->contentsMargins().left();
const int marg2 = lay->contentsMargins().right();
lay->setContentsMargins(marg1, 0, marg2, 0);
QLabel *label = new QLabel(i18nc("Find text", "F&ind:"), this);
lay->addWidget(label);
......
......@@ -47,7 +47,7 @@ TextGoToLineWidget::TextGoToLineWidget(QWidget *parent)
, d(new KPIMTextEdit::TextGoToLineWidgetPrivate)
{
QHBoxLayout *hbox = new QHBoxLayout(this);
hbox->setMargin(2);
hbox->setContentsMargins(2, 2, 2, 2);
QToolButton *closeBtn = new QToolButton(this);
closeBtn->setIcon(QIcon::fromTheme(QStringLiteral("dialog-close")));
closeBtn->setIconSize(QSize(16, 16));
......
......@@ -186,7 +186,7 @@ void TextMessageIndicator::paintEvent(QPaintEvent * /* e */)
painter.setPen(Qt::black);
painter.setBrush(palette().color(QPalette::Window));
painter.translate(0.5, 0.5);
painter.drawRoundRect(1, 1, width() - 2, height() - 2, 1600 / width(), 1600 / height());
painter.drawRoundedRect(1, 1, width() - 2, height() - 2, 1600 / width(), 1600 / height(), Qt::RelativeSize);
// draw icon if present
if (!mSymbol.isNull()) {
......
......@@ -320,16 +320,16 @@ void PlainTextEditor::setReadOnly(bool readOnly)
d->customPalette = testAttribute(Qt::WA_SetPalette);
QPalette p = palette();
QColor color = p.color(QPalette::Disabled, QPalette::Background);
QColor color = p.color(QPalette::Disabled, QPalette::Window);
p.setColor(QPalette::Base, color);
p.setColor(QPalette::Background, color);
p.setColor(QPalette::Window, color);
setPalette(p);
} else {
if (d->customPalette && testAttribute(Qt::WA_SetPalette)) {
QPalette p = palette();
QColor color = p.color(QPalette::Normal, QPalette::Base);
p.setColor(QPalette::Base, color);
p.setColor(QPalette::Background, color);
p.setColor(QPalette::Window, color);
setPalette(p);
} else {
setPalette(QPalette());
......
......@@ -92,7 +92,7 @@ QString PlainTextEditorWidget::toPlainText() const
void PlainTextEditorWidget::init(PlainTextEditor *customEditor)
{
QVBoxLayout *lay = new QVBoxLayout(this);
lay->setMargin(0);
lay->setContentsMargins(0, 0, 0, 0);
d->mTextToSpeechWidget = new KPIMTextEdit::TextToSpeechWidget(this);
lay->addWidget(d->mTextToSpeechWidget);
if (customEditor) {
......
......@@ -399,16 +399,16 @@ void RichTextEditor::setReadOnly(bool readOnly)
d->customPalette = testAttribute(Qt::WA_SetPalette);
QPalette p = palette();
QColor color = p.color(QPalette::Disabled, QPalette::Background);
QColor color = p.color(QPalette::Disabled, QPalette::Window);
p.setColor(QPalette::Base, color);
p.setColor(QPalette::Background, color);
p.setColor(QPalette::Window, color);
setPalette(p);
} else {
if (d->customPalette && testAttribute(Qt::WA_SetPalette)) {
QPalette p = palette();
QColor color = p.color(QPalette::Normal, QPalette::Base);
p.setColor(QPalette::Base, color);
p.setColor(QPalette::Background, color);
p.setColor(QPalette::Window, color);
setPalette(p);
} else {
setPalette(QPalette());
......
......@@ -114,7 +114,7 @@ QString RichTextEditorWidget::toPlainText() const
void RichTextEditorWidget::init(RichTextEditor *customEditor)
{
QVBoxLayout *lay = new QVBoxLayout(this);
lay->setMargin(0);
lay->setContentsMargins(0, 0, 0, 0);
d->mTextToSpeechWidget = new KPIMTextEdit::TextToSpeechWidget(this);
lay->addWidget(d->mTextToSpeechWidget);
if (customEditor) {
......
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