diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-09-03 18:33:12 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-09-03 18:45:48 +0200 |
commit | fa330c109dcf3399b5fdc27b188c0bafbb6e6016 (patch) | |
tree | e9e96d7f507404e4936ef681f03630aa1e3affae /utils/themeeditor/gui/skindocument.cpp | |
parent | ff38666a19b09169b1a7cf1f0eda20374bc390de (diff) | |
download | rockbox-fa330c109dcf3399b5fdc27b188c0bafbb6e6016.tar.gz rockbox-fa330c109dcf3399b5fdc27b188c0bafbb6e6016.zip |
themeeditor: Make it compile with current Qt5.
- Replace use of obsolete members with their replacements.
- Fix type issue that requires explicitly creating the right object now.
- Update project file to work with Qt5.
Change-Id: I3af2b1520796e977e58c0a01e165c77c469a23b9
Diffstat (limited to 'utils/themeeditor/gui/skindocument.cpp')
-rw-r--r-- | utils/themeeditor/gui/skindocument.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/utils/themeeditor/gui/skindocument.cpp b/utils/themeeditor/gui/skindocument.cpp index 1ee6b6e7ee..807478807d 100644 --- a/utils/themeeditor/gui/skindocument.cpp +++ b/utils/themeeditor/gui/skindocument.cpp | |||
@@ -197,14 +197,14 @@ void SkinDocument::settingsChanged() | |||
197 | QSettings settings; | 197 | QSettings settings; |
198 | settings.beginGroup("SkinDocument"); | 198 | settings.beginGroup("SkinDocument"); |
199 | 199 | ||
200 | QColor fg = settings.value("fgColor", Qt::black).value<QColor>(); | 200 | QColor fg = settings.value("fgColor", QColor(Qt::black)).value<QColor>(); |
201 | QColor bg = settings.value("bgColor", Qt::white).value<QColor>(); | 201 | QColor bg = settings.value("bgColor", QColor(Qt::white)).value<QColor>(); |
202 | QPalette palette; | 202 | QPalette palette; |
203 | palette.setColor(QPalette::All, QPalette::Base, bg); | 203 | palette.setColor(QPalette::All, QPalette::Base, bg); |
204 | palette.setColor(QPalette::All, QPalette::Text, fg); | 204 | palette.setColor(QPalette::All, QPalette::Text, fg); |
205 | editor->setPalette(palette); | 205 | editor->setPalette(palette); |
206 | 206 | ||
207 | QColor highlight = settings.value("errorColor", Qt::red).value<QColor>(); | 207 | QColor highlight = settings.value("errorColor", QColor(Qt::red)).value<QColor>(); |
208 | editor->setErrorColor(highlight); | 208 | editor->setErrorColor(highlight); |
209 | 209 | ||
210 | /* Setting the font */ | 210 | /* Setting the font */ |
@@ -227,7 +227,7 @@ void SkinDocument::cursorChanged() | |||
227 | QTextCursor line = editor->textCursor(); | 227 | QTextCursor line = editor->textCursor(); |
228 | line.movePosition(QTextCursor::StartOfLine); | 228 | line.movePosition(QTextCursor::StartOfLine); |
229 | line.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); | 229 | line.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); |
230 | skin_parse(line.selectedText().toAscii()); | 230 | skin_parse(line.selectedText().toLatin1()); |
231 | if(skin_error_line() > 0) | 231 | if(skin_error_line() > 0) |
232 | parseStatus = tr("Error on line ") + | 232 | parseStatus = tr("Error on line ") + |
233 | QString::number(line.blockNumber() + 1) | 233 | QString::number(line.blockNumber() + 1) |
@@ -263,7 +263,7 @@ void SkinDocument::codeChanged() | |||
263 | 263 | ||
264 | editor->clearErrors(); | 264 | editor->clearErrors(); |
265 | parseStatus = model->changeTree(editor->document()-> | 265 | parseStatus = model->changeTree(editor->document()-> |
266 | toPlainText().toAscii()); | 266 | toPlainText().toLatin1()); |
267 | 267 | ||
268 | treeInSync = true; | 268 | treeInSync = true; |
269 | emit antiSync(false); | 269 | emit antiSync(false); |
@@ -294,7 +294,7 @@ void SkinDocument::codeChanged() | |||
294 | rest.removeSelectedText(); | 294 | rest.removeSelectedText(); |
295 | base += skin_error_line(); | 295 | base += skin_error_line(); |
296 | 296 | ||
297 | skin_parse(doc.toPlainText().toAscii()); | 297 | skin_parse(doc.toPlainText().toLatin1()); |
298 | 298 | ||
299 | if(skin_error_line() > 0) | 299 | if(skin_error_line() > 0) |
300 | editor->addError(base + skin_error_line()); | 300 | editor->addError(base + skin_error_line()); |
@@ -338,7 +338,7 @@ void SkinDocument::save() | |||
338 | } | 338 | } |
339 | 339 | ||
340 | fout.open(QFile::WriteOnly); | 340 | fout.open(QFile::WriteOnly); |
341 | fout.write(editor->document()->toPlainText().toAscii()); | 341 | fout.write(editor->document()->toPlainText().toLatin1()); |
342 | fout.close(); | 342 | fout.close(); |
343 | 343 | ||
344 | saved = editor->document()->toPlainText(); | 344 | saved = editor->document()->toPlainText(); |
@@ -372,7 +372,7 @@ void SkinDocument::saveAs() | |||
372 | 372 | ||
373 | QFile fout(fileName); | 373 | QFile fout(fileName); |
374 | fout.open(QFile::WriteOnly); | 374 | fout.open(QFile::WriteOnly); |
375 | fout.write(editor->document()->toPlainText().toAscii()); | 375 | fout.write(editor->document()->toPlainText().toLatin1()); |
376 | fout.close(); | 376 | fout.close(); |
377 | 377 | ||
378 | saved = editor->document()->toPlainText(); | 378 | saved = editor->document()->toPlainText(); |