diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 29b7f6cd11cd85556e65f032cbb6343969691d9e..4491e71480f125d94a48f25c2ac59d75a96f97e9 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -275,7 +275,8 @@ void CPPEditor::createToolBar(CPPEditorEditable *editable) QToolBar *toolBar = editable->toolBar(); QList<QAction*> actions = toolBar->actions(); - toolBar->insertWidget(actions.first(), m_methodCombo); + QWidget *w = toolBar->widgetForAction(actions.first()); + static_cast<QHBoxLayout*>(w->layout())->insertWidget(0, m_methodCombo, 1); } int CPPEditor::previousBlockState(QTextBlock block) const diff --git a/src/plugins/qtscripteditor/qtscripteditor.cpp b/src/plugins/qtscripteditor/qtscripteditor.cpp index 16244140235b81ce336357f01bb943d1c5370f28..47f7386ba7572fb3bff6806c091f77f5a6d9f8a1 100644 --- a/src/plugins/qtscripteditor/qtscripteditor.cpp +++ b/src/plugins/qtscripteditor/qtscripteditor.cpp @@ -52,8 +52,9 @@ #include <QtCore/QTimer> #include <QtCore/QtDebug> -#include <QtGui/QMenu> #include <QtGui/QComboBox> +#include <QtGui/QHBoxLayout> +#include <QtGui/QMenu> enum { UPDATE_DOCUMENT_DEFAULT_INTERVAL = 100 @@ -386,7 +387,8 @@ void ScriptEditor::createToolBar(ScriptEditorEditable *editable) QToolBar *toolBar = editable->toolBar(); QList<QAction*> actions = toolBar->actions(); - toolBar->insertWidget(actions.first(), m_methodCombo); + QWidget *w = toolBar->widgetForAction(actions.first()); + static_cast<QHBoxLayout*>(w->layout())->insertWidget(0, m_methodCombo, 1); } void ScriptEditor::contextMenuEvent(QContextMenuEvent *e) diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index c5e8703df4f86a959531705da07bea1fa37f9a5c..6b7f51194f16536639b5411004191c55e2064f43 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -4096,6 +4096,7 @@ BaseTextEditorEditable::BaseTextEditorEditable(BaseTextEditor *editor) QWidget *w = new QWidget; l->setMargin(0); l->setContentsMargins(5, 0, 5, 0); + l->addStretch(0); l->addWidget(m_cursorPositionLabel); w->setLayout(l);