Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
a44e33ac
Commit
a44e33ac
authored
15 years ago
by
Kai Koehne
Browse files
Options
Downloads
Patches
Plain Diff
Let one 'reset' the qmlviewer path in the config page by
just emptying it. Discussed with Nigel.
parent
10e07e01
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/qmlprojectmanager/qmlproject.cpp
+7
-20
7 additions, 20 deletions
src/plugins/qmlprojectmanager/qmlproject.cpp
src/plugins/qmlprojectmanager/qmlproject.h
+2
-1
2 additions, 1 deletion
src/plugins/qmlprojectmanager/qmlproject.h
with
9 additions
and
21 deletions
src/plugins/qmlprojectmanager/qmlproject.cpp
+
7
−
20
View file @
a44e33ac
...
...
@@ -343,7 +343,7 @@ QmlRunConfiguration::QmlRunConfiguration(QmlProject *pro)
+
Utils
::
SynchronousProcess
::
pathSeparator
()
+
QCoreApplication
::
applicationDirPath
()
;
m_qmlViewer
=
Utils
::
SynchronousProcess
::
locateBinary
(
searchPath
,
QLatin1String
(
"qmlviewer"
));
m_qmlViewer
DefaultPath
=
Utils
::
SynchronousProcess
::
locateBinary
(
searchPath
,
QLatin1String
(
"qmlviewer"
));
}
QmlRunConfiguration
::~
QmlRunConfiguration
()
...
...
@@ -357,8 +357,9 @@ QString QmlRunConfiguration::type() const
QString
QmlRunConfiguration
::
executable
()
const
{
// No need to verify if the QML Viewer exists. The console will tell us anyway when we try to launch it.
return
m_qmlViewer
;
if
(
!
m_qmlViewerCustomPath
.
isEmpty
())
return
m_qmlViewerCustomPath
;
return
m_qmlViewerDefaultPath
;
}
QmlRunConfiguration
::
RunMode
QmlRunConfiguration
::
runMode
()
const
...
...
@@ -469,7 +470,7 @@ void QmlRunConfiguration::setMainScript(const QString &scriptFile)
void
QmlRunConfiguration
::
onQmlViewerChanged
()
{
if
(
Utils
::
PathChooser
*
chooser
=
qobject_cast
<
Utils
::
PathChooser
*>
(
sender
()))
{
m_qmlViewer
=
chooser
->
path
();
m_qmlViewer
CustomPath
=
chooser
->
path
();
}
}
...
...
@@ -483,7 +484,7 @@ void QmlRunConfiguration::save(ProjectExplorer::PersistentSettingsWriter &writer
{
ProjectExplorer
::
LocalApplicationRunConfiguration
::
save
(
writer
);
writer
.
saveValue
(
QLatin1String
(
"qmlviewer"
),
m_qmlViewer
);
writer
.
saveValue
(
QLatin1String
(
"qmlviewer"
),
m_qmlViewer
CustomPath
);
writer
.
saveValue
(
QLatin1String
(
"qmlviewerargs"
),
m_qmlViewerArgs
);
writer
.
saveValue
(
QLatin1String
(
"mainscript"
),
m_scriptFile
);
}
...
...
@@ -492,24 +493,10 @@ void QmlRunConfiguration::restore(const ProjectExplorer::PersistentSettingsReade
{
ProjectExplorer
::
LocalApplicationRunConfiguration
::
restore
(
reader
);
m_qmlViewer
=
reader
.
restoreValue
(
QLatin1String
(
"qmlviewer"
)).
toString
();
m_qmlViewer
CustomPath
=
reader
.
restoreValue
(
QLatin1String
(
"qmlviewer"
)).
toString
();
m_qmlViewerArgs
=
reader
.
restoreValue
(
QLatin1String
(
"qmlviewerargs"
)).
toString
();
m_scriptFile
=
reader
.
restoreValue
(
QLatin1String
(
"mainscript"
)).
toString
();
if
(
m_qmlViewer
.
isEmpty
())
{
// first see if there is a bundled qmlviewer
#ifdef Q_OS_WIN32
const
QLatin1String
qmlViewerExe
(
"qmlviewer.exe"
);
#else
const
QLatin1String
qmlViewerExe
(
"qmlviewer"
);
#endif
const
QFileInfo
info
(
QCoreApplication
::
applicationDirPath
(),
qmlViewerExe
);
if
(
info
.
exists
()
&&
info
.
isExecutable
())
m_qmlViewer
=
info
.
absoluteFilePath
();
else
// if not, then try to locate it elsewhere
m_qmlViewer
=
Utils
::
SynchronousProcess
::
locateBinary
(
QLatin1String
(
"qmlviewer"
));
}
if
(
m_scriptFile
.
isEmpty
())
m_scriptFile
=
tr
(
"<Current File>"
);
}
...
...
This diff is collapsed.
Click to expand it.
src/plugins/qmlprojectmanager/qmlproject.h
+
2
−
1
View file @
a44e33ac
...
...
@@ -175,7 +175,8 @@ private:
private
:
QmlProject
*
m_project
;
QString
m_scriptFile
;
QString
m_qmlViewer
;
QString
m_qmlViewerCustomPath
;
QString
m_qmlViewerDefaultPath
;
QString
m_qmlViewerArgs
;
QLatin1String
m_type
;
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment