forked from qt-creator/qt-creator
QmlDesigner: Fix warnings about deprecated function
TableView.modelIndex function was deprecated in Qt 6.4.3 and replaced with TableView.index function. Change-Id: I65638c002015c556a78ce6341ebcb3ce6448e825 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -19,7 +19,7 @@ Item {
|
|||||||
// Array of supported externally dropped files that trigger custom import process
|
// Array of supported externally dropped files that trigger custom import process
|
||||||
property var dropComplexExtFiles: []
|
property var dropComplexExtFiles: []
|
||||||
|
|
||||||
readonly property int qtVersion6_4: rootView.qtVersionIs6_4()
|
readonly property int qtVersion: rootView.qtVersion()
|
||||||
property bool __searchBoxEmpty: true
|
property bool __searchBoxEmpty: true
|
||||||
|
|
||||||
AssetsContextMenu {
|
AssetsContextMenu {
|
||||||
|
@@ -309,8 +309,11 @@ TreeView {
|
|||||||
{
|
{
|
||||||
// The modelIndex() function exists since 6.3. In Qt 6.3, this modelIndex() function was a
|
// The modelIndex() function exists since 6.3. In Qt 6.3, this modelIndex() function was a
|
||||||
// member of the TreeView, while in Qt6.4 it was moved to TableView. In Qt 6.4, the order of
|
// member of the TreeView, while in Qt6.4 it was moved to TableView. In Qt 6.4, the order of
|
||||||
// the arguments was changed.
|
// the arguments was changed, and in Qt 6.5 the order was changed again. Due to this mess,
|
||||||
if (assetsRoot.qtVersion6_4)
|
// the whole function was deprecated in Qt 6.4.3 and replaced with index() function.
|
||||||
|
if (assetsRoot.qtVersion >= 0x060403)
|
||||||
|
return root.index(row, 0)
|
||||||
|
else if (assetsRoot.qtVersion >= 0x060400)
|
||||||
return root.modelIndex(0, row)
|
return root.modelIndex(0, row)
|
||||||
else
|
else
|
||||||
return root.modelIndex(row, 0)
|
return root.modelIndex(row, 0)
|
||||||
|
@@ -202,9 +202,9 @@ QString AssetsLibraryWidget::showInGraphicalShellMsg() const
|
|||||||
return Core::FileUtils::msgGraphicalShellAction();
|
return Core::FileUtils::msgGraphicalShellAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AssetsLibraryWidget::qtVersionIs6_4() const
|
int AssetsLibraryWidget::qtVersion() const
|
||||||
{
|
{
|
||||||
return QT_VERSION_MAJOR == 6 && QT_VERSION_MINOR == 4;
|
return QT_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssetsLibraryWidget::addTextures(const QStringList &filePaths)
|
void AssetsLibraryWidget::addTextures(const QStringList &filePaths)
|
||||||
|
@@ -78,7 +78,7 @@ public:
|
|||||||
|
|
||||||
Q_INVOKABLE QSet<QString> supportedAssetSuffixes(bool complex);
|
Q_INVOKABLE QSet<QString> supportedAssetSuffixes(bool complex);
|
||||||
Q_INVOKABLE void openEffectMaker(const QString &filePath);
|
Q_INVOKABLE void openEffectMaker(const QString &filePath);
|
||||||
Q_INVOKABLE bool qtVersionIs6_4() const;
|
Q_INVOKABLE int qtVersion() const;
|
||||||
Q_INVOKABLE void invalidateThumbnail(const QString &id);
|
Q_INVOKABLE void invalidateThumbnail(const QString &id);
|
||||||
Q_INVOKABLE QSize imageSize(const QString &id);
|
Q_INVOKABLE QSize imageSize(const QString &id);
|
||||||
Q_INVOKABLE QString assetFileSize(const QString &id);
|
Q_INVOKABLE QString assetFileSize(const QString &id);
|
||||||
|
Reference in New Issue
Block a user