Commit 0c054bed authored by Kai Koehne's avatar Kai Koehne

QmlProject: Let user select Qt version to use

Allow the user to choose which Qt version to use for running
a .qmlproject.

Reviewed-by: dt
parent 20f796ee
......@@ -34,7 +34,7 @@ namespace Constants {
const char * const QML_RC_ID = "QmlProjectManager.QmlRunConfiguration";
const char * const QML_RC_DISPLAY_NAME = QT_TRANSLATE_NOOP("QmlProjectManager::Internal::QmlRunConfiguration", "QML Viewer");
const char * const QML_VIEWER_KEY = "QmlProjectManager.QmlRunConfiguration.QDeclarativeViewer";
const char * const QML_VIEWER_QT_KEY = "QmlProjectManager.QmlRunConfiguration.QtVersion";
const char * const QML_VIEWER_ARGUMENTS_KEY = "QmlProjectManager.QmlRunConfiguration.QDeclarativeViewerArguments";
const char * const QML_VIEWER_TARGET_ID = "QmlProjectManager.QmlTarget";
const char * const QML_VIEWER_TARGET_DISPLAY_NAME = "QML Viewer";
......
......@@ -42,12 +42,15 @@ namespace Core {
class IEditor;
}
namespace Qt4ProjectManager {
class QtVersion;
}
namespace QmlProjectManager {
namespace Internal {
class QmlProjectTarget;
class QmlProjectRunConfigurationFactory;
}
const char * const CURRENT_FILE = QT_TRANSLATE_NOOP("QmlManager", "<Current File>");
......@@ -67,8 +70,8 @@ public:
bool isEnabled(ProjectExplorer::BuildConfiguration *bc) const;
bool qmlObserverAvailable() const;
QString viewerPath() const;
QString observerPath() const;
QStringList viewerArguments() const;
QString workingDirectory() const;
......@@ -87,42 +90,42 @@ private slots:
void updateEnabled();
void onViewerChanged();
void onQtVersionSelectionChanged();
void onViewerArgsChanged();
void useCppDebuggerToggled(bool toggled);
void useQmlDebuggerToggled(bool toggled);
void qmlDebugServerPortChanged(uint port);
void updateQtVersions();
void manageQtVersions();
protected:
QString viewerDefaultPath() const;
QmlProjectRunConfiguration(Internal::QmlProjectTarget *parent, QmlProjectRunConfiguration *source);
virtual bool fromMap(const QVariantMap &map);
void setEnabled(bool value);
private:
void ctor();
static bool isValidVersion(Qt4ProjectManager::QtVersion *version);
// absolute path to current file (if being used)
QString m_currentFileFilename;
// absolute path to selected main script (if being used)
QString m_mainScriptFilename;
int m_qtVersionId;
QString m_scriptFile;
QString m_qmlViewerCustomPath;
QString m_qmlViewerArgs;
QStringListModel *m_fileListModel;
// weakpointer is used to make sure we don't try to manipulate
// widget which was deleted already, as can be the case here.
QWeakPointer<QLabel> m_qmlViewerExecutable;
QWeakPointer<QComboBox> m_qtVersionComboBox;
QWeakPointer<QComboBox> m_fileListCombo;
Internal::QmlProjectTarget *m_projectTarget;
bool m_usingCurrentFile;
bool m_isEnabled;
mutable bool m_qmlObserverAvailable;
};
} // namespace QmlProjectManager
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment