Skip to content
GitLab
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
bdea4309
Commit
bdea4309
authored
Nov 25, 2010
by
Marco Bubke
Browse files
QmlDesigner: Fix warnings
parent
58ab0020
Changes
9
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
View file @
bdea4309
...
...
@@ -472,7 +472,7 @@ void StatesEditorView::selectedNodesChanged(const QList<ModelNode> &/*selectedNo
}
QPixmap
StatesEditorView
::
renderState
(
int
i
)
QPixmap
StatesEditorView
::
renderState
(
int
/*i*/
)
{
return
QPixmap
();
...
...
src/plugins/qmldesigner/designercore/include/nodeinstanceserverinterface.h
View file @
bdea4309
...
...
@@ -41,7 +41,7 @@ public:
virtual
void
changeState
(
const
ChangeStateCommand
&
command
)
=
0
;
virtual
void
addImport
(
const
AddImportCommand
&
command
)
=
0
;
virtual
void
setBlockUpdates
(
bool
block
)
{}
virtual
void
setBlockUpdates
(
bool
/*
block
*/
)
{}
static
void
registerCommands
();
};
...
...
src/plugins/qmldesigner/designercore/include/nodeinstanceview.h
View file @
bdea4309
...
...
@@ -102,8 +102,6 @@ public:
NodeInstance
instanceForId
(
qint32
id
)
const
;
bool
hasInstanceForId
(
qint32
id
)
const
;
void
render
(
QPainter
*
painter
,
const
QRectF
&
target
=
QRectF
(),
const
QRectF
&
source
=
QRect
(),
Qt
::
AspectRatioMode
aspectRatioMode
=
Qt
::
KeepAspectRatio
);
QRectF
sceneRect
()
const
;
void
setBlockUpdates
(
bool
block
);
...
...
src/plugins/qmldesigner/designercore/instances/componentnodeinstance.cpp
View file @
bdea4309
...
...
@@ -50,7 +50,7 @@ QDeclarativeComponent *ComponentNodeInstance::component() const
ComponentNodeInstance
::
Pointer
ComponentNodeInstance
::
create
(
QObject
*
object
)
{
QDeclarativeComponent
*
component
=
component
=
qobject_cast
<
QDeclarativeComponent
*>
(
object
);
QDeclarativeComponent
*
component
=
qobject_cast
<
QDeclarativeComponent
*>
(
object
);
if
(
component
==
0
)
throw
InvalidNodeInstanceException
(
__LINE__
,
__FUNCTION__
,
__FILE__
);
...
...
@@ -69,23 +69,24 @@ bool ComponentNodeInstance::hasContent() const
void
ComponentNodeInstance
::
setPropertyVariant
(
const
QString
&
name
,
const
QVariant
&
value
)
{
// if (name == "__component_data") {
// QByteArray data(value.toByteArray());
// QByteArray imports;
// foreach(const Import &import, nodeInstanceServer()->imports()) {
// imports.append(import.toString(true).toLatin1());
// }
// data.prepend(imports);
// component()->setData(data, nodeInstanceView()->model()->fileUrl());
// }
// if (component()->isError()) {
// qDebug() << value;
// foreach(const QDeclarativeError &error, component()->errors())
// qDebug() << error;
// }
if
(
name
==
"__component_data"
)
{
QByteArray
data
(
value
.
toByteArray
());
QByteArray
importArray
;
foreach
(
const
QString
&
import
,
nodeInstanceServer
()
->
imports
())
{
importArray
.
append
(
import
.
toUtf8
());
}
data
.
prepend
(
importArray
);
component
()
->
setData
(
data
,
nodeInstanceServer
()
->
fileUrl
());
}
if
(
component
()
->
isError
())
{
qDebug
()
<<
value
;
foreach
(
const
QDeclarativeError
&
error
,
component
()
->
errors
())
qDebug
()
<<
error
;
}
}
...
...
src/plugins/qmldesigner/designercore/instances/createscenecommand.cpp
View file @
bdea4309
...
...
@@ -6,12 +6,12 @@ CreateSceneCommand::CreateSceneCommand()
{
}
QDataStream
&
operator
<<
(
QDataStream
&
out
,
const
CreateSceneCommand
&
command
)
QDataStream
&
operator
<<
(
QDataStream
&
out
,
const
CreateSceneCommand
&
/*
command
*/
)
{
return
out
;
}
QDataStream
&
operator
>>
(
QDataStream
&
in
,
CreateSceneCommand
&
command
)
QDataStream
&
operator
>>
(
QDataStream
&
in
,
CreateSceneCommand
&
/*
command
*/
)
{
return
in
;
}
...
...
src/plugins/qmldesigner/designercore/instances/nodeinstanceserver.cpp
View file @
bdea4309
...
...
@@ -234,6 +234,8 @@ void NodeInstanceServer::addImport(const AddImportCommand &command)
if
(
!
command
.
alias
().
isEmpty
())
importStatement
+=
" as "
+
command
.
alias
();
m_importList
.
append
(
importStatement
);
QDeclarativeComponent
importComponent
(
engine
(),
0
);
QString
componentString
=
QString
(
"import Qt 4.7
\n
%1
\n
Item{}
\n
"
).
arg
(
importStatement
);
...
...
@@ -616,6 +618,11 @@ ValuesChangedCommand NodeInstanceServer::createValuesChangedCommand(const QVecto
return
ValuesChangedCommand
(
valueVector
);
}
QStringList
NodeInstanceServer
::
imports
()
const
{
return
m_importList
;
}
void
NodeInstanceServer
::
notifyPropertyChange
(
qint32
instanceid
,
const
QString
&
propertyName
)
{
if
(
hasInstanceForId
(
instanceid
))
...
...
src/plugins/qmldesigner/designercore/instances/nodeinstanceserver.h
View file @
bdea4309
...
...
@@ -3,6 +3,7 @@
#include
<QUrl>
#include
<QVector>
#include
<QStringList>
#include
<nodeinstanceserverinterface.h>
#include
"servernodeinstance.h"
...
...
@@ -73,6 +74,8 @@ public:
void
notifyPropertyChange
(
qint32
instanceid
,
const
QString
&
propertyName
);
QStringList
imports
()
const
;
public
slots
:
void
refreshLocalFileProperty
(
const
QString
&
path
);
void
emitParentChanged
(
QObject
*
child
);
...
...
@@ -120,6 +123,7 @@ private:
int
m_timer
;
bool
m_slowRenderTimer
;
QVector
<
InstancePropertyPair
>
m_changedPropertyList
;
QStringList
m_importList
;
};
}
...
...
src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp
View file @
bdea4309
...
...
@@ -691,21 +691,6 @@ void NodeInstanceView::removeRecursiveChildRelationship(const ModelNode &removed
removeInstanceNodeRelationship
(
removedNode
);
}
void
NodeInstanceView
::
render
(
QPainter
*
painter
,
const
QRectF
&
target
,
const
QRectF
&
source
,
Qt
::
AspectRatioMode
aspectRatioMode
)
{
// if (m_graphicsView) {
// painter->save();
// painter->setRenderHint(QPainter::Antialiasing, true);
// painter->setRenderHint(QPainter::TextAntialiasing, true);
// painter->setRenderHint(QPainter::SmoothPixmapTransform, true);
// painter->setRenderHint(QPainter::HighQualityAntialiasing, true);
// painter->setRenderHint(QPainter::NonCosmeticDefaultPen, true);
// m_graphicsView->scene()->render(painter, target, source, aspectRatioMode);
// painter->restore();
// }
}
QRectF
NodeInstanceView
::
sceneRect
()
const
{
if
(
rootNodeInstance
().
isValid
())
...
...
src/plugins/qmldesigner/designercore/instances/objectnodeinstance.cpp
View file @
bdea4309
...
...
@@ -938,16 +938,6 @@ int ObjectNodeInstance::penWidth() const
return
0
;
}
static
bool
metaObjectHasNotPropertyName
(
NodeInstanceMetaObject
*
metaObject
,
const
QString
&
propertyName
)
{
for
(
int
i
=
0
;
i
<
metaObject
->
count
();
i
++
)
{
if
(
metaObject
->
name
(
i
)
==
propertyName
)
return
false
;
}
return
true
;
}
void
ObjectNodeInstance
::
createDynamicProperty
(
const
QString
&
name
,
const
QString
&
/*typeName*/
)
{
if
(
m_metaObject
==
0
)
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment