Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
c94382b8
Commit
c94382b8
authored
Aug 09, 2010
by
Alessandro Portale
Browse files
Polishing the optional QMLINSPECTOR inclusion a bit
parent
6c56fcf5
Changes
4
Hide whitespace changes
Inline
Side-by-side
share/qtcreator/templates/qmlapp/app.pro
View file @
c94382b8
...
...
@@ -19,13 +19,13 @@ OTHER_FILES = qml/app/app.qml
#
TARGETUID3
#
symbian
:
TARGET
.
UID3
=
0
xE1111234
#
QMLJSINSPECTOR
#
#
DEFINES
+=
Q_QML_JS_
INSPECTOR
contains
(
DEFINES
,
Q_QML_JS_
INSPECTOR
)
{
#
QMLJSINSPECTOR_LIB_PATH
#
INSPECTOR_LIBRARY_PATH
=
$$
PWD
/../../../../
share
/
qtcreator
/
qmljsdebugge
r
include
(
$$
INSPECTOR_LIBRARY_PATH
/
qmljsdebugger
-
lib
.
pri
)
}
#
Define
to
enable
the
Qml
Inspector
in
debug
mode
#
QML
INSPECTOR
#
#
DEFINES
+=
QML
INSPECTOR
#
Path
to
the
Qml
Inspector
sources
,
which
are
shipped
with
Qt
Creato
r
#
QMLINSPECTOR_PATH
#
QMLINSPECTOR_PATH
=
$$
PWD
/../../
qmljsdebugger
#
Edit
the
code
below
on
your
own
risk
.
...
...
@@ -35,6 +35,8 @@ SOURCES += cpp/main.cpp cpp/qmlapplicationview.cpp
HEADERS
+=
cpp
/
qmlapplicationview
.
h
INCLUDEPATH
+=
cpp
contains
(
DEFINES
,
QMLINSPECTOR
)
:
CONFIG
(
debug
,
debug
|
release
)
:
include
(
$$
QMLINSPECTOR_PATH
/
qmljsdebugger
-
lib
.
pri
)
symbian
{
ICON
=
cpp
/
symbianicon
.
svg
contains
(
DEFINES
,
ORIENTATIONLOCK
)
:
LIBS
+=
-
lavkon
-
leikcore
-
leiksrv
-
lcone
...
...
@@ -84,7 +86,6 @@ symbian {
copydeploymentfolders
.
commands
=
$$
copyCommand
first
.
depends
=
$
(
first
)
copydeploymentfolders
QMAKE_EXTRA_TARGETS
+=
first
copydeploymentfolders
message
(
$$
copyCommand
)
}
}
else
{
#
linux
!
isEqual
(
PWD
,
$$
OUT_PWD
)
{
...
...
share/qtcreator/templates/qmlapp/cpp/qmlapplicationview.cpp
View file @
c94382b8
...
...
@@ -21,7 +21,7 @@ class QmlApplicationViewPrivate
};
QmlApplicationView
::
QmlApplicationView
(
const
QString
&
mainQmlFile
,
QWidget
*
parent
)
:
#ifdef Q
_QML_JS_
INSPECTOR
#ifdef Q
ML
INSPECTOR
QmlViewer
::
QDeclarativeDesignView
(
parent
)
#else
QDeclarativeView
(
parent
)
...
...
src/plugins/qmlprojectmanager/wizards/qmlstandaloneapp.cpp
View file @
c94382b8
...
...
@@ -140,11 +140,7 @@ QString QmlStandaloneApp::path(Path path, Location location) const
const
QString
qmlRootFolder
=
QLatin1String
(
"qml/"
)
+
(
useExistingMainQml
()
?
m_mainQmlFile
.
dir
().
dirName
()
:
m_projectName
)
+
QLatin1Char
(
'/'
);
#ifdef CREATORLESSTEST
const
QString
sourceRoot
=
QLatin1String
(
":/qmlproject/wizards/templates/"
);
#else // CREATORLESSTEST
const
QString
sourceRoot
=
Core
::
ICore
::
instance
()
->
resourcePath
()
+
QLatin1String
(
"/templates/qmlapp/"
);
#endif // CREATORLESSTEST
const
QString
templatesRoot
(
templatesRoot
());
const
QString
cppSourceSubDir
=
QLatin1String
(
"cpp/"
);
const
QString
cppTargetSubDir
=
cppSourceSubDir
;
const
QString
qmlExtension
=
QLatin1String
(
".qml"
);
...
...
@@ -157,13 +153,13 @@ QString QmlStandaloneApp::path(Path path, Location location) const
switch
(
location
)
{
case
Source
:
{
switch
(
path
)
{
case
MainQml
:
return
source
Root
+
QLatin1String
(
"qml/app/app.qml"
);
case
AppProfile
:
return
source
Root
+
QLatin1String
(
"app.pro"
);
case
MainCpp
:
return
source
Root
+
cppSourceSubDir
+
mainCpp
;
case
AppViewerCpp
:
return
source
Root
+
cppSourceSubDir
+
appViewCpp
;
case
AppViewerH
:
return
source
Root
+
cppSourceSubDir
+
appViewH
;
case
MainQml
:
return
templates
Root
+
QLatin1String
(
"qml/app/app.qml"
);
case
AppProfile
:
return
templates
Root
+
QLatin1String
(
"app.pro"
);
case
MainCpp
:
return
templates
Root
+
cppSourceSubDir
+
mainCpp
;
case
AppViewerCpp
:
return
templates
Root
+
cppSourceSubDir
+
appViewCpp
;
case
AppViewerH
:
return
templates
Root
+
cppSourceSubDir
+
appViewH
;
case
SymbianSvgIcon
:
return
!
m_symbianSvgIcon
.
isEmpty
()
?
m_symbianSvgIcon
:
source
Root
+
cppSourceSubDir
+
symbianIcon
;
:
templates
Root
+
cppSourceSubDir
+
symbianIcon
;
default:
qFatal
(
errorMessage
);
}
}
...
...
@@ -260,6 +256,7 @@ QByteArray QmlStandaloneApp::generateProFile(const QString *errorMessage) const
{
Q_UNUSED
(
errorMessage
)
const
QChar
comment
=
QLatin1Char
(
'#'
);
QFile
proFile
(
path
(
AppProfile
,
Source
));
proFile
.
open
(
QIODevice
::
ReadOnly
);
Q_ASSERT
(
proFile
.
isOpen
());
...
...
@@ -290,16 +287,16 @@ QByteArray QmlStandaloneApp::generateProFile(const QString *errorMessage) const
uncommentNextLine
=
true
;
}
else
if
(
line
.
contains
(
QLatin1String
(
"# NETWORKACCESS"
))
&&
!
m_networkEnabled
)
{
uncommentNextLine
=
true
;
}
else
if
(
line
.
contains
(
QLatin1String
(
"# Q_QML_JS_INSPECTOR"
)))
{
}
else
if
(
line
.
contains
(
QLatin1String
(
"# QMLINSPECTOR_PATH"
)))
{
valueOnNextLine
=
qmlInspectorSourcesRoot
();
}
else
if
(
line
.
contains
(
QLatin1String
(
"# QMLINSPECTOR"
)))
{
// ### disabled for now; figure out the private headers problem first.
//uncommentNextLine = true;
}
else
if
(
line
.
contains
(
QLatin1String
(
"# QMLJSINSPECTOR_LIB_PATH"
)))
{
valueOnNextLine
=
Core
::
ICore
::
instance
()
->
resourcePath
()
+
QLatin1String
(
"/qmljsdebugger"
);
}
// Remove all marker comments
if
(
line
.
trimmed
().
startsWith
(
QLatin1Char
(
'#'
)
)
&&
line
.
trimmed
().
endsWith
(
QLatin1Char
(
'#'
)
))
if
(
line
.
trimmed
().
startsWith
(
comment
)
&&
line
.
trimmed
().
endsWith
(
comment
))
continue
;
if
(
!
valueOnNextLine
.
isEmpty
())
{
...
...
@@ -310,7 +307,7 @@ QByteArray QmlStandaloneApp::generateProFile(const QString *errorMessage) const
}
if
(
uncommentNextLine
)
{
out
<<
QLatin1String
(
"#"
)
<<
line
<<
endl
;
out
<<
comment
<<
line
<<
endl
;
uncommentNextLine
=
false
;
continue
;
}
...
...
@@ -321,6 +318,16 @@ QByteArray QmlStandaloneApp::generateProFile(const QString *errorMessage) const
}
#ifndef CREATORLESSTEST
QString
QmlStandaloneApp
::
templatesRoot
()
{
return
Core
::
ICore
::
instance
()
->
resourcePath
()
+
QLatin1String
(
"/templates/qmlapp/"
);
}
QString
QmlStandaloneApp
::
qmlInspectorSourcesRoot
()
{
return
Core
::
ICore
::
instance
()
->
resourcePath
()
+
QLatin1String
(
"/qmljsdebugger"
);
}
static
Core
::
GeneratedFile
generateFileCopy
(
const
QString
&
source
,
const
QString
&
target
,
bool
openEditor
=
false
)
...
...
src/plugins/qmlprojectmanager/wizards/qmlstandaloneapp.h
View file @
c94382b8
...
...
@@ -97,6 +97,8 @@ public:
private:
QByteArray
generateMainCpp
(
const
QString
*
errorMessage
)
const
;
QByteArray
generateProFile
(
const
QString
*
errorMessage
)
const
;
static
QString
templatesRoot
();
static
QString
qmlInspectorSourcesRoot
();
QString
m_projectName
;
QFileInfo
m_projectPath
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment