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
2368252f
Commit
2368252f
authored
Aug 05, 2010
by
Thomas Hartmann
Browse files
QuickToolBar: proper check of types
We are checking the whole prototype chain now
parent
f414179b
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/components/easingpane/easingcontextpane.cpp
View file @
2368252f
...
...
@@ -114,12 +114,12 @@ EasingContextPane::~EasingContextPane()
}
bool
EasingContextPane
::
acceptsType
(
const
QString
&
type
Name
)
bool
EasingContextPane
::
acceptsType
(
const
QString
List
&
type
s
)
{
return
type
Name
.
contains
(
"NumberAnimation"
)
||
type
Name
.
contains
(
"PropertyAnimation"
)
||
type
Name
.
contains
(
"ColorAnimation"
)
||
type
Name
.
contains
(
"RotationAnimation"
);
return
type
s
.
contains
(
"NumberAnimation"
)
||
type
s
.
contains
(
"PropertyAnimation"
)
||
type
s
.
contains
(
"ColorAnimation"
)
||
type
s
.
contains
(
"RotationAnimation"
);
}
void
EasingContextPane
::
setProperties
(
QmlJS
::
PropertyReader
*
propertyReader
)
...
...
src/plugins/qmldesigner/components/easingpane/easingcontextpane.h
View file @
2368252f
...
...
@@ -33,7 +33,7 @@ public:
void
setGraphDisplayMode
(
GraphDisplayMode
newMode
);
void
startAnimation
();
bool
acceptsType
(
const
QString
&
);
bool
acceptsType
(
const
QString
List
&
);
signals:
void
propertyChanged
(
const
QString
&
,
const
QVariant
&
);
...
...
src/plugins/qmldesigner/components/propertyeditor/contextpanewidget.cpp
View file @
2368252f
...
...
@@ -266,7 +266,7 @@ void ContextPaneWidget::setPath(const QString &path)
}
bool
ContextPaneWidget
::
setType
(
const
QString
&
type
Name
)
bool
ContextPaneWidget
::
setType
(
const
QString
List
&
type
s
)
{
m_imageWidget
->
hide
();
m_borderImageWidget
->
hide
();
...
...
@@ -274,42 +274,42 @@ bool ContextPaneWidget::setType(const QString &typeName)
m_rectangleWidget
->
hide
();
m_easingWidget
->
hide
();
if
(
type
Name
.
contains
(
"Text"
))
{
if
(
type
s
.
contains
(
"Text"
))
{
m_currentWidget
=
m_textWidget
;
m_textWidget
->
show
();
m_textWidget
->
setStyleVisible
(
true
);
m_textWidget
->
setVerticalAlignmentVisible
(
true
);
if
(
type
Name
.
contains
(
"TextInput"
))
{
if
(
type
s
.
contains
(
"TextInput"
))
{
m_textWidget
->
setVerticalAlignmentVisible
(
false
);
m_textWidget
->
setStyleVisible
(
false
);
}
else
if
(
type
Name
.
contains
(
"TextEdit"
))
{
}
else
if
(
type
s
.
contains
(
"TextEdit"
))
{
m_textWidget
->
setStyleVisible
(
false
);
}
resize
(
sizeHint
());
return
true
;
}
if
(
m_easingWidget
->
acceptsType
(
type
Name
))
{
if
(
m_easingWidget
->
acceptsType
(
type
s
))
{
m_currentWidget
=
m_easingWidget
;
m_easingWidget
->
show
();
resize
(
sizeHint
());
return
true
;
}
if
(
type
Name
.
contains
(
"Rectangle"
))
{
if
(
type
s
.
contains
(
"Rectangle"
))
{
m_currentWidget
=
m_rectangleWidget
;
m_rectangleWidget
->
show
();
resize
(
sizeHint
());
return
true
;
}
if
(
type
Name
.
contains
(
"BorderImage"
))
{
if
(
type
s
.
contains
(
"BorderImage"
))
{
m_currentWidget
=
m_borderImageWidget
;
m_borderImageWidget
->
show
();
resize
(
sizeHint
());
return
true
;
}
if
(
type
Name
.
contains
(
"Image"
))
{
if
(
type
s
.
contains
(
"Image"
))
{
m_currentWidget
=
m_imageWidget
;
m_imageWidget
->
show
();
resize
(
sizeHint
());
...
...
@@ -318,10 +318,10 @@ bool ContextPaneWidget::setType(const QString &typeName)
return
false
;
}
bool
ContextPaneWidget
::
acceptsType
(
const
QString
&
type
Name
)
bool
ContextPaneWidget
::
acceptsType
(
const
QString
List
&
type
s
)
{
return
type
Name
.
contains
(
"Text"
)
||
m_easingWidget
->
acceptsType
(
type
Name
)
||
type
Name
.
contains
(
"Rectangle"
)
||
type
Name
.
contains
(
"Image"
);
return
type
s
.
contains
(
"Text"
)
||
m_easingWidget
->
acceptsType
(
type
s
)
||
type
s
.
contains
(
"Rectangle"
)
||
type
s
.
contains
(
"Image"
);
}
void
ContextPaneWidget
::
onTogglePane
()
...
...
src/plugins/qmldesigner/components/propertyeditor/contextpanewidget.h
View file @
2368252f
...
...
@@ -55,8 +55,8 @@ public:
BauhausColorDialog
*
colorDialog
();
void
setProperties
(
QmlJS
::
PropertyReader
*
propertyReader
);
void
setPath
(
const
QString
&
path
);
bool
setType
(
const
QString
&
type
Name
);
bool
acceptsType
(
const
QString
&
type
Name
);
bool
setType
(
const
QString
List
&
type
s
);
bool
acceptsType
(
const
QString
List
&
type
s
);
QWidget
*
currentWidget
()
const
{
return
m_currentWidget
;
}
public
slots
:
...
...
src/plugins/qmldesigner/qmlcontextpane.cpp
View file @
2368252f
...
...
@@ -90,8 +90,6 @@ void QmlContextPane::apply(TextEditor::BaseTextEditorEditable *editor, Document:
scopeObject
=
scopeObject
->
prototype
(
lookupContext
->
context
());
}
//qDebug() << prototypes;
setEnabled
(
doc
->
isParsedCorrectly
());
m_editor
=
editor
;
contextWidget
()
->
setParent
(
editor
->
widget
()
->
parentWidget
());
...
...
@@ -134,7 +132,7 @@ void QmlContextPane::apply(TextEditor::BaseTextEditorEditable *editor, Document:
rect
.
moveTo
(
reg
.
boundingRect
().
topLeft
());
reg
=
reg
.
intersect
(
rect
);
if
(
contextWidget
()
->
acceptsType
(
name
))
{
if
(
contextWidget
()
->
acceptsType
(
prototypes
))
{
m_node
=
0
;
PropertyReader
propertyReader
(
doc
,
initializer
);
QTextCursor
tc
(
editor
->
editor
()
->
document
());
...
...
@@ -147,7 +145,7 @@ void QmlContextPane::apply(TextEditor::BaseTextEditorEditable *editor, Document:
offset
=
QPoint
(
400
-
reg
.
boundingRect
().
width
()
+
10
,
0
);
QPoint
p3
=
editor
->
editor
()
->
mapToParent
(
editor
->
editor
()
->
viewport
()
->
mapToParent
(
reg
.
boundingRect
().
topRight
())
+
offset
);
p2
.
setX
(
p1
.
x
());
contextWidget
()
->
setType
(
name
);
contextWidget
()
->
setType
(
prototypes
);
if
(
!
update
)
contextWidget
()
->
activate
(
p3
,
p1
,
p2
);
else
...
...
@@ -224,7 +222,6 @@ void QmlContextPane::setProperty(const QString &propertyName, const QVariant &va
int
line
=
-
1
;
int
endLine
;
Rewriter
::
BindingType
bindingType
=
Rewriter
::
ScriptBinding
;
if
(
stringValue
.
contains
(
"{"
)
&&
stringValue
.
contains
(
"}"
))
...
...
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