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
e952d309
Commit
e952d309
authored
Feb 26, 2010
by
Lasse Holmstedt
Browse files
Fixed resource file issue with Qt Designer and switching to edit mode while debugging
parent
ec5952c5
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/designmode.cpp
View file @
e952d309
...
...
@@ -186,10 +186,9 @@ void DesignMode::currentEditorChanged(Core::IEditor *editor)
if
(
!
mimeEditorAvailable
)
setEnabled
(
false
);
if
((
!
mimeEditorAvailable
&&
core
->
modeManager
()
->
currentMode
()
==
this
)
||
!
modeActivated
)
if
(
!
mimeEditorAvailable
&&
core
->
modeManager
()
->
currentMode
()
==
this
)
{
// switch back to edit mode
// switch back to edit mode
- we don't want to be here
core
->
modeManager
()
->
activateMode
(
Constants
::
MODE_EDIT
);
}
...
...
src/plugins/designer/cpp/formclasswizard.cpp
View file @
e952d309
...
...
@@ -96,7 +96,7 @@ Core::GeneratedFiles FormClassWizard::generateFiles(const QWizard *w, QString *e
// UI
Core
::
GeneratedFile
uiFile
(
formFileName
);
uiFile
.
setContents
(
params
.
uiTemplate
());
uiFile
.
setEditorId
(
QLatin1String
(
Constants
::
FORM
EDITOR_ID
));
uiFile
.
setEditorId
(
QLatin1String
(
Constants
::
DESIGNER_XML_
EDITOR_ID
));
QString
source
,
header
;
Designer
::
FormClassWizardGenerationParameters
generationParameters
;
...
...
src/plugins/designer/formwindoweditor.cpp
View file @
e952d309
...
...
@@ -144,6 +144,7 @@ void FormWindowEditor::setFile(Core::IFile *file)
}
m_file
=
file
;
m_formWindow
->
setFileName
(
file
->
fileName
());
if
(
m_file
)
{
connect
(
m_file
,
SIGNAL
(
changed
()),
this
,
SIGNAL
(
changed
()));
...
...
@@ -185,6 +186,9 @@ bool FormWindowEditor::createNew(const QString &contents)
if
(
qdesigner_internal
::
FormWindowBase
*
fw
=
qobject_cast
<
qdesigner_internal
::
FormWindowBase
*>
(
m_formWindow
))
fw
->
setDesignerGrid
(
qdesigner_internal
::
FormWindowBase
::
defaultDesignerGrid
());
initializeResources
();
return
true
;
}
...
...
@@ -216,31 +220,42 @@ bool FormWindowEditor::open(const QString &fileName /*= QString()*/)
return
false
;
m_formWindow
->
setDirty
(
false
);
ProjectExplorer
::
ProjectExplorerPlugin
*
pe
=
ProjectExplorer
::
ProjectExplorerPlugin
::
instance
();
ProjectExplorer
::
SessionManager
*
session
=
pe
->
session
();
m_sessionNode
=
session
->
sessionNode
();
m_sessionWatcher
=
new
ProjectExplorer
::
NodesWatcher
();
connect
(
m_sessionWatcher
,
SIGNAL
(
filesAdded
()),
this
,
SLOT
(
updateResources
()));
connect
(
m_sessionWatcher
,
SIGNAL
(
filesRemoved
()),
this
,
SLOT
(
updateResources
()));
connect
(
m_sessionWatcher
,
SIGNAL
(
foldersAdded
()),
this
,
SLOT
(
updateResources
()));
connect
(
m_sessionWatcher
,
SIGNAL
(
foldersRemoved
()),
this
,
SLOT
(
updateResources
()));
m_sessionNode
->
registerWatcher
(
m_sessionWatcher
);
if
(
qdesigner_internal
::
FormWindowBase
*
fw
=
qobject_cast
<
qdesigner_internal
::
FormWindowBase
*>
(
m_formWindow
))
{
QtResourceSet
*
rs
=
fw
->
resourceSet
();
m_originalUiQrcPaths
=
rs
->
activeQrcPaths
();
}
initializeResources
(
fileName
);
emit
opened
(
fileName
);
updateResources
();
setDisplayName
(
fi
.
fileName
());
QDesignerFormWindowManagerInterface
*
fwm
=
FormEditorW
::
instance
()
->
designerEditor
()
->
formWindowManager
();
fwm
->
setActiveFormWindow
(
m_formWindow
);
}
setDisplayName
(
fi
.
fileName
());
return
true
;
}
void
FormWindowEditor
::
initializeResources
(
const
QString
&
fileName
/*= QString()*/
)
{
ProjectExplorer
::
ProjectExplorerPlugin
*
pe
=
ProjectExplorer
::
ProjectExplorerPlugin
::
instance
();
ProjectExplorer
::
SessionManager
*
session
=
pe
->
session
();
m_sessionNode
=
session
->
sessionNode
();
m_sessionWatcher
=
new
ProjectExplorer
::
NodesWatcher
();
connect
(
m_sessionWatcher
,
SIGNAL
(
filesAdded
()),
this
,
SLOT
(
updateResources
()));
connect
(
m_sessionWatcher
,
SIGNAL
(
filesRemoved
()),
this
,
SLOT
(
updateResources
()));
connect
(
m_sessionWatcher
,
SIGNAL
(
foldersAdded
()),
this
,
SLOT
(
updateResources
()));
connect
(
m_sessionWatcher
,
SIGNAL
(
foldersRemoved
()),
this
,
SLOT
(
updateResources
()));
m_sessionNode
->
registerWatcher
(
m_sessionWatcher
);
if
(
qdesigner_internal
::
FormWindowBase
*
fw
=
qobject_cast
<
qdesigner_internal
::
FormWindowBase
*>
(
m_formWindow
))
{
QtResourceSet
*
rs
=
fw
->
resourceSet
();
m_originalUiQrcPaths
=
rs
->
activeQrcPaths
();
}
if
(
!
fileName
.
isEmpty
())
emit
opened
(
fileName
);
updateResources
();
QDesignerFormWindowManagerInterface
*
fwm
=
FormEditorW
::
instance
()
->
designerEditor
()
->
formWindowManager
();
fwm
->
setActiveFormWindow
(
m_formWindow
);
emit
changed
();
return
true
;
}
void
FormWindowEditor
::
updateResources
()
...
...
src/plugins/designer/formwindoweditor.h
View file @
e952d309
...
...
@@ -113,6 +113,8 @@ private slots:
void
updateResources
();
private:
void
initializeResources
(
const
QString
&
fileName
=
QString
());
QWidget
*
m_containerWidget
;
QString
m_displayName
;
QList
<
int
>
m_context
;
...
...
src/plugins/designer/formwizard.cpp
View file @
e952d309
...
...
@@ -66,6 +66,6 @@ Core::GeneratedFiles FormWizard::generateFiles(const QWizard *w,
Core
::
GeneratedFile
file
(
fileName
);
file
.
setContents
(
formTemplate
);
file
.
setEditorId
(
QLatin1String
(
Constants
::
FORM
EDITOR_ID
));
file
.
setEditorId
(
QLatin1String
(
Constants
::
DESIGNER_XML_
EDITOR_ID
));
return
Core
::
GeneratedFiles
()
<<
file
;
}
src/plugins/qmldesigner/qmldesignerplugin.cpp
View file @
e952d309
...
...
@@ -204,6 +204,7 @@ void BauhausPlugin::createDesignModeWidget()
Core
::
Constants
::
PASTE
,
m_context
->
context
());
command
->
setDefaultKeySequence
(
QKeySequence
::
Paste
);
editMenu
->
addAction
(
command
,
Core
::
Constants
::
G_EDIT_COPYPASTE
);
Core
::
ModeManager
*
modeManager
=
creatorCore
->
modeManager
();
command
=
actionManager
->
registerAction
(
m_mainWidget
->
selectAllAction
(),
Core
::
Constants
::
SELECTALL
,
m_context
->
context
());
...
...
@@ -218,7 +219,8 @@ void BauhausPlugin::createDesignModeWidget()
m_mainWidget
->
addAction
(
deleteAction
);
Core
::
ModeManager
*
modeManager
=
creatorCore
->
modeManager
();
connect
(
m_editorManager
,
SIGNAL
(
currentEditorChanged
(
Core
::
IEditor
*
)),
this
,
SLOT
(
updateEditor
(
Core
::
IEditor
*
)));
connect
(
modeManager
,
SIGNAL
(
currentModeChanged
(
Core
::
IMode
*
)),
this
,
SLOT
(
modeChanged
(
Core
::
IMode
*
)));
...
...
@@ -228,6 +230,16 @@ void BauhausPlugin::createDesignModeWidget()
}
void
BauhausPlugin
::
updateEditor
(
Core
::
IEditor
*
editor
)
{
Core
::
ICore
*
creatorCore
=
Core
::
ICore
::
instance
();
if
(
editor
->
id
()
==
QmlJSEditor
::
Constants
::
C_QMLJSEDITOR_ID
&&
creatorCore
->
modeManager
()
->
currentMode
()
==
m_designMode
)
{
m_mainWidget
->
showEditor
(
editor
);
}
}
void
BauhausPlugin
::
modeChanged
(
Core
::
IMode
*
mode
)
{
if
(
mode
==
m_designMode
)
{
...
...
@@ -236,7 +248,6 @@ void BauhausPlugin::modeChanged(Core::IMode *mode)
}
else
{
if
(
m_isActive
)
{
m_isActive
=
false
;
m_mainWidget
->
showEditor
(
0
);
}
}
...
...
src/plugins/qmldesigner/qmldesignerplugin.h
View file @
e952d309
...
...
@@ -84,6 +84,7 @@ private slots:
void
modeChanged
(
Core
::
IMode
*
mode
);
void
textEditorsClosed
(
QList
<
Core
::
IEditor
*>
editors
);
void
updateActions
(
Core
::
IEditor
*
editor
);
void
updateEditor
(
Core
::
IEditor
*
editor
);
private:
void
createDesignModeWidget
();
...
...
Write
Preview
Markdown
is supported
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