Commit f867486c authored by Krzysztof Kurek's avatar Krzysztof Kurek Committed by Dmitry Kazakov

Clean up compilation log from deprecations

Bunch of misc commits that remove warnings about
deprecation in places where it doesn't affect code much.

https://invent.kde.org/kde/krita/merge_requests/150

Squashed commit of the following:

commit 10429761
Author: Krzysztof Kurek <krzysio.kurek@wp.pl>
Date:   Mon Sep 23 13:48:36 2019 +0000

    Remove a Qt5.13 function call

commit 232ac699
Author: Krzysztof Kurek <krzysio.kurek@pm.me>
Date:   Sat Sep 21 17:14:36 2019 +0200

    Remove a CXX specific flag from other targets

commit 6b71a3cc
Author: Krzysztof Kurek <krzysio.kurek@pm.me>
Date:   Sat Sep 21 17:12:34 2019 +0200

    Even more deprecation removal work

commit 9c4972ad
Author: Krzysztof Kurek <krzysio.kurek@pm.me>
Date:   Sat Sep 21 14:10:44 2019 +0200

    Revert some const-ref changes

    Also explicitly mark KisOptionInfo's copy-ctor as being present

commit f13ff926
Author: Krzysztof Kurek <krzysio.kurek@pm.me>
Date:   Fri Sep 20 01:15:47 2019 +0200

    A bunch more deprecation fixes

    Hopefully it all works... I don't have a second screen to test it thorough.

commit 95c1ee12
Author: Krzysztof Kurek <krzysio.kurek@pm.me>
Date:   Thu Sep 19 20:32:47 2019 +0200

    Get rid of a few implicit deprecation warnings

    Deleted some superfluous constructor definitions,
    explicitly declared operator= of SvgGraphicsContext as default but only for private usage.

commit 35d2f530
Author: Krzysztof Kurek <krzysio.kurek@pm.me>
Date:   Thu Sep 19 20:30:35 2019 +0200

    Simplify KisSwatch class

    Removes a warning about implicit deprecation
parent 0d45094f
......@@ -64,7 +64,7 @@ if (APPLE)
endif()
if (CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9 AND NOT WIN32)
add_definitions(-Wno-suggest-override -Wextra)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-suggest-override> -Wextra)
endif()
######################
......
......@@ -81,6 +81,8 @@ public:
bool autoFillMarkers {false};
KoSvgTextProperties textProperties;
private:
SvgGraphicsContext& operator=(const SvgGraphicsContext &gc) = default; ///< used by copy constructor, shouldn't be public
};
#endif // SVGGRAPHICCONTEXT_H
......@@ -229,10 +229,6 @@ private:
struct KoSvgCharChunkFormat : public QTextCharFormat
{
KoSvgCharChunkFormat() {}
KoSvgCharChunkFormat(const KoSvgCharChunkFormat &rhs) : QTextCharFormat(rhs) {}
KoSvgCharChunkFormat(const QTextCharFormat &rhs) : QTextCharFormat(rhs) {}
enum SvgCharProperty {
TextAnchor = UserProperty + 1,
AssociatedShape
......
......@@ -18,19 +18,8 @@
#include "kis_name_server.h"
KisNameServer::KisNameServer(qint32 seed)
{
m_generator = seed;
}
KisNameServer::KisNameServer(const KisNameServer &rhs)
: m_generator(rhs.m_generator)
{
}
KisNameServer::~KisNameServer()
{
}
KisNameServer::KisNameServer(qint32 seed) : m_generator(seed)
{ }
qint32 KisNameServer::currentSeed() const
{
......
......@@ -18,15 +18,13 @@
#ifndef KIS_NAMESERVER_H_
#define KIS_NAMESERVER_H_
#include <QString>
#include <QtGlobal>
#include <kritaimage_export.h>
class KRITAIMAGE_EXPORT KisNameServer
{
public:
KisNameServer(qint32 seed = 1);
KisNameServer(const KisNameServer &rhs);
~KisNameServer();
qint32 number();
qint32 currentSeed() const;
......
......@@ -21,16 +21,9 @@
#include "KisSwatch.h"
KisSwatch::KisSwatch()
: m_spotColor(false)
, m_valid(false)
{ }
KisSwatch::KisSwatch(const KoColor &color, const QString &name)
: m_color(color)
, m_name(name)
, m_spotColor(false)
, m_valid(true)
{ }
......@@ -57,15 +50,3 @@ void KisSwatch::setSpotColor(bool spotColor)
m_spotColor = spotColor;
m_valid = true;
}
KisSwatch &KisSwatch::operator =(const KisSwatch &source)
{
if (&source == this)
return *this;
m_color = source.m_color;
m_id = source.m_id;
m_name = source.m_name;
m_spotColor = source.m_spotColor;
m_valid = source.m_valid;
return *this;
}
......@@ -29,7 +29,7 @@
class KRITAPIGMENT_EXPORT KisSwatch
{
public:
KisSwatch();
KisSwatch() = default;
KisSwatch(const KoColor &color, const QString &name = QString());
public:
......@@ -52,14 +52,12 @@ public:
return m_color == rhs.m_color && m_name == rhs.m_name;
}
KisSwatch &operator =(const KisSwatch &source);
private:
KoColor m_color;
QString m_name;
QString m_id;
bool m_spotColor;
bool m_valid;
bool m_spotColor {false};
bool m_valid {false};
};
#endif // KISSWATCH_H
......@@ -2668,11 +2668,7 @@ void KisMainWindow::initializeGeometry()
QByteArray geom = QByteArray::fromBase64(cfg.readEntry("ko_geometry", QByteArray()));
if (!restoreGeometry(geom)) {
const int scnum = QApplication::desktop()->screenNumber(parentWidget());
QRect desk = QApplication::desktop()->availableGeometry(scnum);
// if the desktop is virtual then use virtual screen size
if (QApplication::desktop()->isVirtualDesktop()) {
desk = QApplication::desktop()->availableGeometry(QApplication::desktop()->screen(scnum));
}
QRect desk = QGuiApplication::screens().at(scnum)->availableVirtualGeometry();
quint32 x = desk.x();
quint32 y = desk.y();
......
......@@ -1084,13 +1084,7 @@ void KisCanvas2::slotConfigChanged()
// the coordinates should be able to work around this.
// FIXME: We should change to associate the display profiles with the screen
// model and serial number instead. See https://bugs.kde.org/show_bug.cgi?id=407498
QScreen *canvasScreen = this->canvasWidget()->window()->windowHandle()->screen();
QPoint canvasScreenCenter = canvasScreen->geometry().center();
int canvasScreenNumber = QApplication::desktop()->screenNumber(canvasScreenCenter);
if (canvasScreenNumber == -1) {
// Fall back to the old way of getting the screenNumber
canvasScreenNumber = QApplication::desktop()->screenNumber(this->canvasWidget());
}
int canvasScreenNumber = QApplication::desktop()->screenNumber(this->canvasWidget());
if (canvasScreenNumber != -1) {
setDisplayProfile(cfg.displayProfile(canvasScreenNumber));
} else {
......
......@@ -525,7 +525,7 @@ ColorSettingsTab::ColorSettingsTab(QWidget *parent, const char *name)
connect(m_page->bnAddColorProfile, SIGNAL(clicked()), SLOT(installProfile()));
QFormLayout *monitorProfileGrid = new QFormLayout(m_page->monitorprofileholder);
for(int i = 0; i < QApplication::desktop()->screenCount(); ++i) {
for(int i = 0; i < QGuiApplication::screens().count(); ++i) {
QLabel *lbl = new QLabel(i18nc("The number of the screen", "Screen %1:", i + 1));
m_monitorProfileLabels << lbl;
KisSqueezedComboBox *cmb = new KisSqueezedComboBox();
......@@ -543,7 +543,7 @@ ColorSettingsTab::ColorSettingsTab(QWidget *parent, const char *name)
refillMonitorProfiles(KoID("RGBA"));
for(int i = 0; i < QApplication::desktop()->screenCount(); ++i) {
for(int i = 0; i < QApplication::screens().count(); ++i) {
if (m_monitorProfileWidgets[i]->contains(cfg.monitorProfile(i))) {
m_monitorProfileWidgets[i]->setCurrent(cfg.monitorProfile(i));
}
......@@ -615,7 +615,7 @@ void ColorSettingsTab::installProfile()
KisConfig cfg(true);
refillMonitorProfiles(KoID("RGBA"));
for(int i = 0; i < QApplication::desktop()->screenCount(); ++i) {
for(int i = 0; i < QApplication::screens().count(); ++i) {
if (m_monitorProfileWidgets[i]->contains(cfg.monitorProfile(i))) {
m_monitorProfileWidgets[i]->setCurrent(cfg.monitorProfile(i));
}
......@@ -629,8 +629,8 @@ void ColorSettingsTab::toggleAllowMonitorProfileSelection(bool useSystemProfile)
if (useSystemProfile) {
QStringList devices = KisColorManager::instance()->devices();
if (devices.size() == QApplication::desktop()->screenCount()) {
for(int i = 0; i < QApplication::desktop()->screenCount(); ++i) {
if (devices.size() == QApplication::screens().count()) {
for(int i = 0; i < QApplication::screens().count(); ++i) {
m_monitorProfileWidgets[i]->clear();
QString monitorForScreen = cfg.monitorForScreen(i, devices[i]);
Q_FOREACH (const QString &device, devices) {
......@@ -646,7 +646,7 @@ void ColorSettingsTab::toggleAllowMonitorProfileSelection(bool useSystemProfile)
else {
refillMonitorProfiles(KoID("RGBA"));
for(int i = 0; i < QApplication::desktop()->screenCount(); ++i) {
for(int i = 0; i < QApplication::screens().count(); ++i) {
if (m_monitorProfileWidgets[i]->contains(cfg.monitorProfile(i))) {
m_monitorProfileWidgets[i]->setCurrent(cfg.monitorProfile(i));
}
......@@ -691,7 +691,7 @@ void ColorSettingsTab::setDefault()
void ColorSettingsTab::refillMonitorProfiles(const KoID & colorSpaceId)
{
for (int i = 0; i < QApplication::desktop()->screenCount(); ++i) {
for (int i = 0; i < QApplication::screens().count(); ++i) {
m_monitorProfileWidgets[i]->clear();
}
......@@ -703,13 +703,13 @@ void ColorSettingsTab::refillMonitorProfiles(const KoID & colorSpaceId)
Q_FOREACH (const KoColorProfile *profile, profileList.values()) {
//qDebug() << "Profile" << profile->name() << profile->isSuitableForDisplay() << csf->defaultProfile();
if (profile->isSuitableForDisplay()) {
for (int i = 0; i < QApplication::desktop()->screenCount(); ++i) {
for (int i = 0; i < QApplication::screens().count(); ++i) {
m_monitorProfileWidgets[i]->addSqueezedItem(profile->name());
}
}
}
for (int i = 0; i < QApplication::desktop()->screenCount(); ++i) {
for (int i = 0; i < QApplication::screens().count(); ++i) {
m_monitorProfileLabels[i]->setText(i18nc("The number of the screen", "Screen %1:", i + 1));
m_monitorProfileWidgets[i]->setCurrent(KoColorSpaceRegistry::instance()->defaultProfileForColorSpace(colorSpaceId.id()));
}
......@@ -1657,7 +1657,7 @@ bool KisDlgPreferences::editPreferences()
// Color settings
cfg.setUseSystemMonitorProfile(dialog->m_colorSettings->m_page->chkUseSystemMonitorProfile->isChecked());
for (int i = 0; i < QApplication::desktop()->screenCount(); ++i) {
for (int i = 0; i < QApplication::screens().count(); ++i) {
if (dialog->m_colorSettings->m_page->chkUseSystemMonitorProfile->isChecked()) {
int currentIndex = dialog->m_colorSettings->m_monitorProfileWidgets[i]->currentIndex();
QString monitorid = dialog->m_colorSettings->m_monitorProfileWidgets[i]->itemData(currentIndex).toString();
......
......@@ -29,9 +29,7 @@
struct KRITAUI_EXPORT KisOptionInfo
{
KisOptionInfo()
: option(0)
{}
KisOptionInfo() = default;
KisOptionInfo(KisPaintOpOption* o, int i, const QString &label)
: label(label)
......@@ -39,14 +37,10 @@ struct KRITAUI_EXPORT KisOptionInfo
, index(i)
{}
KisOptionInfo(const KisOptionInfo& info)
: label(info.label)
, option(info.option)
, index(info.index)
{}
KisOptionInfo(const KisOptionInfo &) = default;
QString label;
KisPaintOpOption *option;
KisPaintOpOption *option {nullptr};
int index;
};
......
......@@ -45,6 +45,7 @@
#include "kis_assert.h"
#include <QRegularExpression>
#include <QSettings>
#include <QScreen>
#ifndef GL_RENDERER
# define GL_RENDERER 0x1F01
......@@ -208,7 +209,7 @@ void KisOpenGL::initialize()
if (openGLCheckResult->vendorString().toUpper().contains("NVIDIA")) {
g_needsPixmapCacheWorkaround = true;
const QRect screenSize = QApplication::desktop()->screenGeometry();
const QRect screenSize = QGuiApplication::primaryScreen()->availableGeometry();
const int minCacheSize = 20 * 1024;
const int cacheSize = 2048 + 2 * 4 * screenSize.width() * screenSize.height() / 1024; //KiB
......
......@@ -139,8 +139,8 @@ bool KisOpenGLImageTextures::imageCanShareTextures()
KisConfig cfg(true);
if (cfg.useOcio()) return false;
if (KisPart::instance()->mainwindowCount() == 1) return true;
if (qApp->desktop()->screenCount() == 1) return true;
for (int i = 1; i < qApp->desktop()->screenCount(); i++) {
if (QGuiApplication::screens().count() == 1) return true;
for (int i = 1; i < QGuiApplication::screens().count(); i++) {
if (cfg.displayProfile(i) != cfg.displayProfile(i - 1)) {
return false;
}
......
......@@ -28,6 +28,7 @@
#include <QThreadPool>
#include <QApplication>
#include <QDesktopWidget>
#include <QScreen>
#include <Eigen/Core>
......@@ -345,7 +346,7 @@ void KisToolFreehand::continueAlternateAction(KoPointerEvent *event, AlternateAc
QPointF offset = actualWidgetPosition - lastWidgetPosition;
KisCanvas2 *canvas2 = dynamic_cast<KisCanvas2 *>(canvas());
QRect screenRect = QApplication::desktop()->screenGeometry();
QRect screenRect = QGuiApplication::primaryScreen()->availableVirtualGeometry();
qreal scaleX = 0;
qreal scaleY = 0;
......
......@@ -90,14 +90,14 @@ void KisMemoryReportButton::paintEvent(QPaintEvent *e)
currentBytes.setWidth(int(ratioCur*totalWidth));
painter.setOpacity(0.5);
painter.drawRoundRect(currentBytes, 2, 2);
painter.drawRoundedRect(currentBytes, 2, 2);
if (m_imgbytes<m_curbytes) {
QRect imageSize = area;
imageSize.setWidth(int((qreal(m_imgbytes)/qreal(m_maxbytes))*totalWidth));
painter.setOpacity(1.0);
painter.drawRoundRect(imageSize, 2, 2);
painter.drawRoundedRect(imageSize, 2, 2);
}
QPushButton::paintEvent(e);
......
......@@ -61,7 +61,7 @@ public:
arrowBitmap.fill(Qt::transparent);
QPainter p(&arrowBitmap);
p.setPen(dialogParent->palette().foreground().color());
p.setPen(dialogParent->palette().window().color());
// arrow pointing left
p.drawLine(0, 3, 7, 3);
......@@ -321,7 +321,7 @@ void KoDualColorButton::mouseMoveEvent( QMouseEvent *event )
KColorMimeData::createDrag( d->tmpSelection == Foreground ?
getColorFromDisplayRenderer(d->foregroundColor) :
getColorFromDisplayRenderer(d->backgroundColor),
this )->start();
this )->exec();
d->dragFlag = true;
}
}
......
......@@ -62,7 +62,7 @@ void KisIconWidget::paintEvent(QPaintEvent *event)
p.setClipRegion(clipRegion);
p.setClipping(true);
p.setBrush(this->palette().background());
p.setBrush(this->palette().window());
p.drawRect(QRect(0, 0, cw, ch));
if (m_resource && !m_resource->image().isNull()) {
QImage img = QImage(iconWidth, iconHeight, QImage::Format_ARGB32);
......
......@@ -87,7 +87,7 @@ void KisGradientSlider::paintEvent(QPaintEvent *e)
const int gradientHeight = qRound((double)wHeight / 7.0 * 2);
QPainter p1(this);
p1.fillRect(rect(), palette().background());
p1.fillRect(rect(), palette().window());
p1.setPen(Qt::black);
p1.drawRect(MARGIN, MARGIN, wWidth, height() - 2 * MARGIN - HANDLE_SIZE);
......
......@@ -66,7 +66,7 @@ void KisGradientSliderWidget::paintEvent(QPaintEvent* pe)
{
QWidget::paintEvent(pe);
QPainter painter(this);
painter.fillRect(rect(), palette().background());
painter.fillRect(rect(), palette().window());
painter.setPen(Qt::black);
painter.drawRect(MARGIN, MARGIN, width() - 2 * MARGIN, height() - 2 * MARGIN - HANDLE_SIZE);
if (m_autogradientResource) {
......
......@@ -554,22 +554,23 @@ static QRect screenRect(QWidget *widget, int screen)
{
QDesktopWidget *desktop = QApplication::desktop();
KConfig gc("kdeglobals", KConfig::NoGlobals);
auto screens = QGuiApplication::screens();
KConfigGroup cg(&gc, "Windows");
if (desktop->isVirtualDesktop() &&
if (QApplication::primaryScreen()->virtualSiblings().count() &&
cg.readEntry("XineramaEnabled", true) &&
cg.readEntry("XineramaPlacementEnabled", true)) {
if (screen < 0 || screen >= desktop->numScreens()) {
if (screen < 0 || screen >= screens.count()) {
if (screen == -1) {
screen = desktop->primaryScreen();
return QGuiApplication::primaryScreen()->availableVirtualGeometry();
} else if (screen == -3) {
screen = desktop->screenNumber(QCursor::pos());
return QGuiApplication::screenAt(QCursor::pos())->availableVirtualGeometry();
} else {
screen = desktop->screenNumber(widget);
}
}
return desktop->availableGeometry(screen);
return QGuiApplication::screens().at(screen)->availableVirtualGeometry();
} else {
return desktop->geometry();
}
......
......@@ -109,7 +109,7 @@ QSize KoItemToolTip::sizeHint() const
void KoItemToolTip::paintEvent(QPaintEvent*)
{
QPainter p(this);
p.initFrom(this);
p.begin(this);
d->document->drawContents(&p, rect());
p.drawRect(0, 0, width() - 1, height() - 1);
}
......
......@@ -33,6 +33,7 @@
#include <QTimer>
#include <QMenu>
#include <QAction>
#include <QScreen>
#include <klocalizedstring.h>
#include <WidgetsDebug.h>
......@@ -46,7 +47,7 @@
static int buttonSize(int screen)
{
QRect rc = qApp->desktop()->screenGeometry(screen);
QRect rc = QGuiApplication::screens().at(screen)->availableGeometry();
if (rc.width() <= 1024) {
return 12;
}
......
......@@ -250,7 +250,7 @@ void KisColorButton::paintEvent(QPaintEvent *)
QStyleOptionFocusRect focusOpt;
focusOpt.init(this);
focusOpt.rect = focusRect;
focusOpt.backgroundColor = palette().background().color();
focusOpt.backgroundColor = palette().window().color();
style->drawPrimitive(QStyle::PE_FrameFocusRect, &focusOpt, &painter, this);
}
}
......@@ -314,7 +314,7 @@ void KisColorButton::mouseMoveEvent(QMouseEvent *e)
{
if ((e->buttons() & Qt::LeftButton) &&
(e->pos() - d->mPos).manhattanLength() > QApplication::startDragDistance()) {
_k_createDrag(color(), this)->start();
_k_createDrag(color(), this)->exec();
setDown(false);
}
}
......
......@@ -134,7 +134,7 @@ QIcon loadIcon(const QString &name)
bool useDarkIcons() {
QColor background = qApp->palette().background().color();
QColor background = qApp->palette().window().color();
return background.value() > 100;
}
......
......@@ -110,7 +110,7 @@ qlonglong KMainWindowInterface::winId()
void KMainWindowInterface::grabWindowToClipBoard()
{
QClipboard *clipboard = QApplication::clipboard();
clipboard->setPixmap(QPixmap::grabWidget(m_MainWindow));
clipboard->setPixmap(m_MainWindow->grab());
}
#include "moc_kmainwindowiface_p.cpp"
......@@ -1204,7 +1204,7 @@ void KToolBar::mouseMoveEvent(QMouseEvent *event)
drag->setMimeData(mimeData);
Qt::DropAction dropAction = drag->start(Qt::MoveAction);
Qt::DropAction dropAction = drag->exec(Qt::MoveAction);
if (dropAction == Qt::MoveAction)
// Only remove from this toolbar if it was moved to another toolbar
......
......@@ -33,6 +33,7 @@
#include <QStandardPaths>
#include "kis_document_aware_spin_box_unit_manager.h"
#include <QScreen>
DlgBugInfo::DlgBugInfo(QWidget *parent)
: KoDialog(parent)
......@@ -101,8 +102,7 @@ DlgBugInfo::DlgBugInfo(QWidget *parent)
QFontMetrics fm = m_page->txtBugInfo->fontMetrics();
int target_height = fm.height() * info.split('\n').size() + wheight;
QDesktopWidget dw;
QRect screen_rect = dw.availableGeometry(dw.primaryScreen());
QRect screen_rect = QGuiApplication::primaryScreen()->availableGeometry();
resize(m_page->size().width(), target_height > screen_rect.height() ? screen_rect.height() : target_height);
......
......@@ -122,13 +122,13 @@ void KoVariable::paint(QPainter &painter, QPaintDevice *pd, const QTextDocument
QFont font(format.font(), pd);
QTextLayout layout(d->value, font, pd);
layout.setCacheEnabled(true);
QList<QTextLayout::FormatRange> layouts;
QVector<QTextLayout::FormatRange> layouts;
QTextLayout::FormatRange range;
range.start = 0;
range.length = d->value.length();
range.format = format;
layouts.append(range);
layout.setAdditionalFormats(layouts);
layout.setFormats(layouts);
QTextOption option(Qt::AlignLeft | Qt::AlignAbsolute);
if (object.isValid()) {
......
......@@ -834,8 +834,8 @@ bool KoTextLayoutArea::layoutBlock(FrameIterator *cursor)
if (cursor->lineTextStart == -1) {
// first remove any drop-caps related formatting that's already there in the layout.
// we'll do it all afresh now.
QList<QTextLayout::FormatRange> formatRanges = layout->additionalFormats();
for (QList< QTextLayout::FormatRange >::Iterator iter = formatRanges.begin();
QVector<QTextLayout::FormatRange> formatRanges = layout->formats();
for (QVector< QTextLayout::FormatRange >::Iterator iter = formatRanges.begin();
iter != formatRanges.end(); ) {
if (iter->format.boolProperty(DropCapsAdditionalFormattingId)) {
iter = formatRanges.erase(iter);
......@@ -843,8 +843,8 @@ bool KoTextLayoutArea::layoutBlock(FrameIterator *cursor)
++iter;
}
}
if (formatRanges.count() != layout->additionalFormats().count())
layout->setAdditionalFormats(formatRanges);
if (formatRanges.count() != layout->formats().count())
layout->setFormats(formatRanges);
bool dropCaps = pStyle.dropCaps();
int dropCapsLength = pStyle.dropCapsLength();
int dropCapsLines = pStyle.dropCapsLines();
......@@ -935,7 +935,7 @@ bool KoTextLayoutArea::layoutBlock(FrameIterator *cursor)
dropCapsFormatRange.start = 0;
dropCapsFormatRange.length = dropCapsLength;
formatRanges.append(dropCapsFormatRange);
layout->setAdditionalFormats(formatRanges);
layout->setFormats(formatRanges);
d->dropCapsNChars = dropCapsLength;
dropCapsAffectsNMoreLines = (d->dropCapsNChars > 0) ? dropCapsLines : 0;
......
......@@ -161,7 +161,7 @@ void EffectItemBase::mousePressEvent(QGraphicsSceneMouseEvent *event)
QDrag *drag = new QDrag(event->widget());
drag->setMimeData(data);
drag->start();
drag->exec();
}
void EffectItemBase::dragMoveEvent(QGraphicsSceneDragDropEvent *event)
......
......@@ -103,7 +103,7 @@ void BasicXMLSyntaxHighlighter::setRegexes()
void BasicXMLSyntaxHighlighter::setFormats()
{
KConfigGroup cfg(KSharedConfig::openConfig(), "SvgTextTool");
QColor background = cfg.readEntry("colorEditorBackground", qApp->palette().background().color());
QColor background = cfg.readEntry("colorEditorBackground", qApp->palette().window().color());
m_xmlKeywordFormat.setForeground(cfg.readEntry("colorKeyword", QColor(background.value() < 100 ? Qt::cyan : Qt::blue)));
m_xmlKeywordFormat.setFontWeight(cfg.readEntry("BoldKeyword", true) ? QFont::Bold : QFont::Normal);
......
......@@ -784,7 +784,7 @@ void SvgTextEditor::setSettings()
textSettings.radioBoth->setChecked(true);
}
QColor background = cfg.readEntry("colorEditorBackground", qApp->palette().background().color());
QColor background = cfg.readEntry("colorEditorBackground", qApp->palette().window().color());
textSettings.colorEditorBackground->setColor(background);
textSettings.colorEditorForeground->setColor(cfg.readEntry("colorEditorForeground", qApp->palette().text().color()));
......@@ -1011,7 +1011,7 @@ void SvgTextEditor::applySettings()
QPalette palette = m_textEditorWidget.svgTextEdit->palette();
QColor background = cfg.readEntry("colorEditorBackground", qApp->palette().background().color());
QColor background = cfg.readEntry("colorEditorBackground", qApp->palette().window().color());
palette.setBrush(QPalette::Active, QPalette::Background, QBrush(background));
m_textEditorWidget.richTextEdit->setStyleSheet(QString("background-color:%1").arg(background.name()));
m_textEditorWidget.svgStylesEdit->setStyleSheet(QString("background-color:%1").arg(background.name()));
......
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