Skip to content

Commit c75bfd2

Browse files
authored
Fix deprecated Qt constants (#1041)
Replacing deprecated Qt constants with the supported alternatives.
1 parent 0cd97a6 commit c75bfd2

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

Engine/FileSystemModel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ FileSystemModel::data(const QModelIndex &index,
842842
data = item->fileExtension();
843843
break;
844844
case DateModified:
845-
data = item->getLastModified().toString(Qt::LocalDate);
845+
data = QLocale().toString(item->getLastModified(), QLocale::ShortFormat);
846846
break;
847847
default:
848848
break;

Engine/StandardPaths.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ load(const wchar_t *libraryName,
110110
// This code is windows-only anyway, but this is here for consistency with other parts of the source
111111
const QChar pathSep = QChar::fromLatin1(':');
112112
# endif
113-
searchOrder << PATH.split(pathSep, QString::SkipEmptyParts);
113+
searchOrder << PATH.split(pathSep, Qt::SkipEmptyParts);
114114
}
115115
QString fileName = QString::fromWCharArray(libraryName);
116116
fileName.append( QLatin1String(".dll") );
@@ -317,7 +317,7 @@ StandardPaths::writableLocation(StandardLocationEnum type)
317317
path = QStandardPaths::HomeLocation;
318318
break;
319319
case StandardPaths::eStandardLocationData:
320-
path = QStandardPaths::DataLocation;
320+
path = QStandardPaths::AppLocalDataLocation;
321321
break;
322322
case StandardPaths::eStandardLocationCache:
323323
path = QStandardPaths::CacheLocation;

Gui/KnobGuiFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ KnobGuiFile::updateGUI(int /*dimension*/)
226226

227227
QString tt = toolTip();
228228
tt.append( QString::fromUtf8("\n\nLast modified: ") );
229-
tt.append( dateTime.toString(Qt::SystemLocaleShortDate) );
229+
tt.append( QLocale().toString(dateTime, QLocale::ShortFormat));
230230
_lineEdit->setToolTip(tt);
231231
}
232232
}

Gui/NodeViewerContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ addSpacer(QBoxLayout* layout)
242242
line->setFrameShape(QFrame::VLine);
243243
line->setFrameShadow(QFrame::Raised);
244244
QPalette palette;
245-
palette.setColor(QPalette::Foreground, Qt::black);
245+
palette.setColor(QPalette::WindowText, Qt::black);
246246
line->setPalette(palette);
247247
layout->addWidget(line);
248248
layout->addSpacing( TO_DPIX(5) );

Gui/QtColorTriangle.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ void QtColorTriangle::genBackground()
215215
// Create an image of the same size as the contents rect.
216216
bg = QImage(contentsRect().size(), QImage::Format_RGB32);
217217
QPainter p(&bg);
218-
p.setRenderHint(QPainter::HighQualityAntialiasing);
218+
p.setRenderHint(QPainter::Antialiasing);
219219
p.fillRect(bg.rect(), palette().mid());
220220

221221
QConicalGradient gradient(bg.rect().center(), 90);

Gui/TableModelView.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,12 @@ class TableItem
159159

160160
inline QColor backgroundColor() const
161161
{
162-
return qvariant_cast<QColor>( data(Qt::BackgroundColorRole) );
162+
return qvariant_cast<QColor>( data(Qt::BackgroundRole) );
163163
}
164164

165165
inline void setBackgroundColor(const QColor &color)
166166
{
167-
setData(Qt::BackgroundColorRole, color);
167+
setData(Qt::BackgroundRole, color);
168168
}
169169

170170
inline QBrush background() const
@@ -179,12 +179,12 @@ class TableItem
179179

180180
inline QColor textColor() const
181181
{
182-
return qvariant_cast<QColor>( data(Qt::TextColorRole) );
182+
return qvariant_cast<QColor>( data(Qt::ForegroundRole) );
183183
}
184184

185185
inline void setTextColor(const QColor &color)
186186
{
187-
setData(Qt::TextColorRole, color);
187+
setData(Qt::ForegroundRole, color);
188188
}
189189

190190
inline QBrush foreground() const

Gui/TextRenderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ TextRendererPrivate::createCharacter(QChar c)
179179
image.fill(Qt::transparent);
180180
QPainter painter;
181181
painter.begin(&image);
182-
painter.setRenderHints(QPainter::HighQualityAntialiasing
182+
painter.setRenderHints(QPainter::Antialiasing
183183
| QPainter::TextAntialiasing);
184184
painter.setFont(_font);
185185
painter.setPen(Qt::white);

Gui/ViewerTab.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ addSpacer(QBoxLayout* layout)
9191
line->setFrameShadow(QFrame::Raised);
9292
//line->setObjectName("LayoutSeparator");
9393
QPalette palette;
94-
palette.setColor(QPalette::Foreground, Qt::black);
94+
palette.setColor(QPalette::WindowText, Qt::black);
9595
line->setPalette(palette);
9696
layout->addWidget(line);
9797
layout->addSpacing(5);

0 commit comments

Comments
 (0)