forked from qt-creator/qt-creator
Do not use deprecated Qt functionality.
Replace all* remaining deprecated Qt 4 functions with their Qt 5 counterparts. This means we no longer need to define the QT_DISABLE_DEPRECATED_BEFORE macro. This patch is relatively small because most source-compatible changes of this kind have been done before. * The one exception is the QmlDesigner, which uses QWeakPointer in a deprecated way all over the place. Change-Id: Id4b839c6685f3b5bdf2b89137f95231758ec53c7 Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -76,11 +76,6 @@ ExampleSetModel::ExampleSetModel(ExamplesListModel *examplesModel, QObject *pare
|
||||
QStandardItemModel(parent),
|
||||
examplesModel(examplesModel)
|
||||
{
|
||||
QHash<int, QByteArray> roleNames;
|
||||
roleNames[Qt::UserRole + 1] = "text";
|
||||
roleNames[Qt::UserRole + 2] = "QtId";
|
||||
roleNames[Qt::UserRole + 3] = "extraSetIndex";
|
||||
setRoleNames(roleNames);
|
||||
}
|
||||
|
||||
void ExampleSetModel::update()
|
||||
@@ -195,31 +190,20 @@ int ExampleSetModel::getExtraExampleSetIndex(int i) const
|
||||
return variant.toInt();
|
||||
}
|
||||
|
||||
QHash<int, QByteArray> ExampleSetModel::roleNames() const
|
||||
{
|
||||
QHash<int, QByteArray> roleNames;
|
||||
roleNames[Qt::UserRole + 1] = "text";
|
||||
roleNames[Qt::UserRole + 2] = "QtId";
|
||||
roleNames[Qt::UserRole + 3] = "extraSetIndex";
|
||||
return roleNames;
|
||||
}
|
||||
|
||||
ExamplesListModel::ExamplesListModel(QObject *parent) :
|
||||
QAbstractListModel(parent),
|
||||
m_exampleSetModel(new ExampleSetModel(this, this)),
|
||||
m_selectedExampleSetIndex(-1)
|
||||
{
|
||||
QHash<int, QByteArray> roleNames;
|
||||
roleNames[Name] = "name";
|
||||
roleNames[ProjectPath] = "projectPath";
|
||||
roleNames[ImageUrl] = "imageUrl";
|
||||
roleNames[Description] = "description";
|
||||
roleNames[DocUrl] = "docUrl";
|
||||
roleNames[FilesToOpen] = "filesToOpen";
|
||||
roleNames[MainFile] = "mainFile";
|
||||
roleNames[Tags] = "tags";
|
||||
roleNames[Difficulty] = "difficulty";
|
||||
roleNames[Type] = "type";
|
||||
roleNames[HasSourceCode] = "hasSourceCode";
|
||||
roleNames[Dependencies] = "dependencies";
|
||||
roleNames[IsVideo] = "isVideo";
|
||||
roleNames[VideoUrl] = "videoUrl";
|
||||
roleNames[VideoLength] = "videoLength";
|
||||
roleNames[Platforms] = "platforms";
|
||||
roleNames[IsHighlighted] = "isHighlighted";
|
||||
setRoleNames(roleNames);
|
||||
|
||||
// read extra example sets settings
|
||||
QSettings *settings = Core::ICore::settings();
|
||||
QStringList list = settings->value(QLatin1String("Help/InstalledExamples"),
|
||||
@@ -698,6 +682,29 @@ QVariant ExamplesListModel::data(const QModelIndex &index, int role) const
|
||||
}
|
||||
}
|
||||
|
||||
QHash<int, QByteArray> ExamplesListModel::roleNames() const
|
||||
{
|
||||
QHash<int, QByteArray> roleNames;
|
||||
roleNames[Name] = "name";
|
||||
roleNames[ProjectPath] = "projectPath";
|
||||
roleNames[ImageUrl] = "imageUrl";
|
||||
roleNames[Description] = "description";
|
||||
roleNames[DocUrl] = "docUrl";
|
||||
roleNames[FilesToOpen] = "filesToOpen";
|
||||
roleNames[MainFile] = "mainFile";
|
||||
roleNames[Tags] = "tags";
|
||||
roleNames[Difficulty] = "difficulty";
|
||||
roleNames[Type] = "type";
|
||||
roleNames[HasSourceCode] = "hasSourceCode";
|
||||
roleNames[Dependencies] = "dependencies";
|
||||
roleNames[IsVideo] = "isVideo";
|
||||
roleNames[VideoUrl] = "videoUrl";
|
||||
roleNames[VideoLength] = "videoLength";
|
||||
roleNames[Platforms] = "platforms";
|
||||
roleNames[IsHighlighted] = "isHighlighted";
|
||||
return roleNames;
|
||||
}
|
||||
|
||||
void ExamplesListModel::update()
|
||||
{
|
||||
updateQtVersions();
|
||||
|
||||
Reference in New Issue
Block a user