forked from qt-creator/qt-creator
QmlDesigner: fix convert warnings
Change-Id: I1689ba3517b85a02be3a582040b39377bc11be84 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -39,7 +39,7 @@ ZoomAction::ZoomAction(QObject *parent)
|
||||
|
||||
}
|
||||
|
||||
double ZoomAction::zoomLevel() const
|
||||
float ZoomAction::zoomLevel() const
|
||||
{
|
||||
return m_zoomLevel;
|
||||
}
|
||||
@@ -63,9 +63,9 @@ void ZoomAction::resetZoomLevel()
|
||||
emit reseted();
|
||||
}
|
||||
|
||||
void ZoomAction::setZoomLevel(double zoomLevel)
|
||||
void ZoomAction::setZoomLevel(float zoomLevel)
|
||||
{
|
||||
m_zoomLevel = qBound(0.1, zoomLevel, 16.0);
|
||||
m_zoomLevel = qBound(0.1f, zoomLevel, 16.0f);
|
||||
emit zoomLevelChanged(m_zoomLevel);
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ void ZoomAction::emitZoomLevelChanged(int index)
|
||||
return;
|
||||
|
||||
const QModelIndex modelIndex(m_comboBoxModel.data()->index(index, 0));
|
||||
setZoomLevel(m_comboBoxModel.data()->data(modelIndex, Qt::UserRole).toDouble());
|
||||
setZoomLevel(m_comboBoxModel.data()->data(modelIndex, Qt::UserRole).toFloat());
|
||||
}
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
||||
@@ -42,7 +42,7 @@ class QMLDESIGNERCORE_EXPORT ZoomAction : public QWidgetAction
|
||||
public:
|
||||
ZoomAction(QObject *parent);
|
||||
|
||||
double zoomLevel() const;
|
||||
float zoomLevel() const;
|
||||
|
||||
void zoomIn();
|
||||
void zoomOut();
|
||||
@@ -50,9 +50,9 @@ public:
|
||||
|
||||
protected:
|
||||
QWidget *createWidget(QWidget *parent) override;
|
||||
void setZoomLevel(double zoomLevel);
|
||||
void setZoomLevel(float zoomLevel);
|
||||
signals:
|
||||
void zoomLevelChanged(double zoom);
|
||||
void zoomLevelChanged(float zoom);
|
||||
void indexChanged(int);
|
||||
void reseted();
|
||||
|
||||
@@ -61,7 +61,7 @@ private:
|
||||
|
||||
private:
|
||||
QPointer<QAbstractItemModel> m_comboBoxModel;
|
||||
double m_zoomLevel;
|
||||
float m_zoomLevel;
|
||||
int m_currentComboBoxIndex;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user