forked from qt-creator/qt-creator
QmlDesigner: use current file to start preview
- Maybe we need a check if it is a qml file. Task-number: QDS-1299 Change-Id: I2b54514f311fb78d3508e588783c0d04c7a7bc0b Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -212,6 +212,11 @@ QString QmlMainFileAspect::mainScript() const
|
||||
return m_currentFileFilename;
|
||||
}
|
||||
|
||||
QString QmlMainFileAspect::currentFile() const
|
||||
{
|
||||
return m_currentFileFilename;
|
||||
}
|
||||
|
||||
void QmlMainFileAspect::changeCurrentFile(Core::IEditor *editor)
|
||||
{
|
||||
if (!editor)
|
||||
|
||||
@@ -46,6 +46,7 @@ class QmlBuildSystem;
|
||||
|
||||
class QMLPROJECTMANAGER_EXPORT QmlMainFileAspect : public ProjectExplorer::ProjectConfigurationAspect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QmlMainFileAspect(ProjectExplorer::Target *target);
|
||||
~QmlMainFileAspect() override;
|
||||
@@ -67,6 +68,7 @@ public:
|
||||
void setScriptSource(MainScriptSource source, const QString &settingsPath = QString());
|
||||
|
||||
QString mainScript() const;
|
||||
QString currentFile() const;
|
||||
void changeCurrentFile(Core::IEditor *editor = nullptr);
|
||||
bool isQmlFilePresent();
|
||||
QmlBuildSystem *qmlBuildSystem() const;
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace QmlProjectManager {
|
||||
class QmlProject;
|
||||
class QmlProjectItem;
|
||||
|
||||
class QmlBuildSystem : public ProjectExplorer::BuildSystem
|
||||
class QMLPROJECTMANAGER_EXPORT QmlBuildSystem : public ProjectExplorer::BuildSystem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user