forked from qt-creator/qt-creator
Less QToolBars in editor tool bar.
This commit is contained in:
@@ -12,6 +12,17 @@ StyledBar::StyledBar(QWidget *parent)
|
|||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
setProperty("panelwidget", true);
|
setProperty("panelwidget", true);
|
||||||
|
setProperty("panelwidget_singlerow", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void StyledBar::setSingleRow(bool singleRow)
|
||||||
|
{
|
||||||
|
setProperty("panelwidget_singlerow", singleRow);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool StyledBar::isSingleRow() const
|
||||||
|
{
|
||||||
|
return property("panelwidget_singlerow").toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
void StyledBar::paintEvent(QPaintEvent *event)
|
void StyledBar::paintEvent(QPaintEvent *event)
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ class QTCREATOR_UTILS_EXPORT StyledBar : public QWidget
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
StyledBar(QWidget *parent = 0);
|
StyledBar(QWidget *parent = 0);
|
||||||
|
void setSingleRow(bool singleRow);
|
||||||
|
bool isSingleRow() const;
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent *event);
|
void paintEvent(QPaintEvent *event);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ public:
|
|||||||
QByteArray saveState() const { return QByteArray(); } // TODO
|
QByteArray saveState() const { return QByteArray(); } // TODO
|
||||||
bool restoreState(const QByteArray & /* state */) { return false; } // TODO
|
bool restoreState(const QByteArray & /* state */) { return false; } // TODO
|
||||||
|
|
||||||
QToolBar *toolBar() { return m_toolBar; }
|
QWidget *toolBar() { return m_toolBar; }
|
||||||
|
|
||||||
bool isTemporary() const { return false; }
|
bool isTemporary() const { return false; }
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
#include "openeditorsmodel.h"
|
#include "openeditorsmodel.h"
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/styledbar.h>
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
@@ -49,7 +50,6 @@
|
|||||||
#include <QtGui/QStackedWidget>
|
#include <QtGui/QStackedWidget>
|
||||||
#include <QtGui/QStyle>
|
#include <QtGui/QStyle>
|
||||||
#include <QtGui/QStyleOption>
|
#include <QtGui/QStyleOption>
|
||||||
#include <QtGui/QToolBar>
|
|
||||||
#include <QtGui/QToolButton>
|
#include <QtGui/QToolButton>
|
||||||
#include <QtGui/QMenu>
|
#include <QtGui/QMenu>
|
||||||
#include <QtGui/QClipboard>
|
#include <QtGui/QClipboard>
|
||||||
@@ -74,7 +74,7 @@ EditorView::EditorView(OpenEditorsModel *model, QWidget *parent) :
|
|||||||
m_editorList(new QComboBox),
|
m_editorList(new QComboBox),
|
||||||
m_closeButton(new QToolButton),
|
m_closeButton(new QToolButton),
|
||||||
m_lockButton(new QToolButton),
|
m_lockButton(new QToolButton),
|
||||||
m_defaultToolBar(new QToolBar(this)),
|
m_defaultToolBar(new QWidget(this)),
|
||||||
m_infoWidget(new QFrame(this)),
|
m_infoWidget(new QFrame(this)),
|
||||||
m_editorForInfoWidget(0),
|
m_editorForInfoWidget(0),
|
||||||
m_statusHLine(new QFrame(this)),
|
m_statusHLine(new QFrame(this)),
|
||||||
@@ -94,12 +94,7 @@ EditorView::EditorView(OpenEditorsModel *model, QWidget *parent) :
|
|||||||
m_editorList->setMaxVisibleItems(40);
|
m_editorList->setMaxVisibleItems(40);
|
||||||
m_editorList->setContextMenuPolicy(Qt::CustomContextMenu);
|
m_editorList->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
|
|
||||||
QToolBar *editorListToolBar = new QToolBar;
|
m_defaultToolBar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||||
|
|
||||||
editorListToolBar->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored);
|
|
||||||
editorListToolBar->addWidget(m_editorList);
|
|
||||||
|
|
||||||
m_defaultToolBar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
|
||||||
m_activeToolBar = m_defaultToolBar;
|
m_activeToolBar = m_defaultToolBar;
|
||||||
|
|
||||||
QHBoxLayout *toolBarLayout = new QHBoxLayout;
|
QHBoxLayout *toolBarLayout = new QHBoxLayout;
|
||||||
@@ -107,6 +102,7 @@ EditorView::EditorView(OpenEditorsModel *model, QWidget *parent) :
|
|||||||
toolBarLayout->setSpacing(0);
|
toolBarLayout->setSpacing(0);
|
||||||
toolBarLayout->addWidget(m_defaultToolBar);
|
toolBarLayout->addWidget(m_defaultToolBar);
|
||||||
m_toolBar->setLayout(toolBarLayout);
|
m_toolBar->setLayout(toolBarLayout);
|
||||||
|
m_toolBar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||||
|
|
||||||
m_lockButton->setAutoRaise(true);
|
m_lockButton->setAutoRaise(true);
|
||||||
m_lockButton->setProperty("type", QLatin1String("dockbutton"));
|
m_lockButton->setProperty("type", QLatin1String("dockbutton"));
|
||||||
@@ -115,23 +111,16 @@ EditorView::EditorView(OpenEditorsModel *model, QWidget *parent) :
|
|||||||
m_closeButton->setIcon(QIcon(":/core/images/closebutton.png"));
|
m_closeButton->setIcon(QIcon(":/core/images/closebutton.png"));
|
||||||
m_closeButton->setProperty("type", QLatin1String("dockbutton"));
|
m_closeButton->setProperty("type", QLatin1String("dockbutton"));
|
||||||
|
|
||||||
QToolBar *rightToolBar = new QToolBar;
|
|
||||||
rightToolBar->setLayoutDirection(Qt::RightToLeft);
|
|
||||||
rightToolBar->addWidget(m_closeButton);
|
|
||||||
rightToolBar->addWidget(m_lockButton);
|
|
||||||
|
|
||||||
QHBoxLayout *toplayout = new QHBoxLayout;
|
QHBoxLayout *toplayout = new QHBoxLayout;
|
||||||
toplayout->setSpacing(0);
|
toplayout->setSpacing(0);
|
||||||
toplayout->setMargin(0);
|
toplayout->setMargin(0);
|
||||||
toplayout->addWidget(editorListToolBar);
|
toplayout->addWidget(m_editorList);
|
||||||
toplayout->addWidget(m_toolBar, 1); // Custom toolbar stretches
|
toplayout->addWidget(m_toolBar, 1); // Custom toolbar stretches
|
||||||
toplayout->addWidget(rightToolBar);
|
toplayout->addWidget(m_lockButton);
|
||||||
|
toplayout->addWidget(m_closeButton);
|
||||||
|
|
||||||
QWidget *top = new QWidget;
|
Core::Utils::StyledBar *top = new Core::Utils::StyledBar;
|
||||||
QVBoxLayout *vlayout = new QVBoxLayout(top);
|
top->setLayout(toplayout);
|
||||||
vlayout->setSpacing(0);
|
|
||||||
vlayout->setMargin(0);
|
|
||||||
vlayout->addLayout(toplayout);
|
|
||||||
tl->addWidget(top);
|
tl->addWidget(top);
|
||||||
|
|
||||||
connect(m_editorList, SIGNAL(activated(int)), this, SLOT(listSelectionActivated(int)));
|
connect(m_editorList, SIGNAL(activated(int)), this, SLOT(listSelectionActivated(int)));
|
||||||
@@ -258,7 +247,7 @@ void EditorView::addEditor(IEditor *editor)
|
|||||||
m_container->addWidget(editor->widget());
|
m_container->addWidget(editor->widget());
|
||||||
m_widgetEditorMap.insert(editor->widget(), editor);
|
m_widgetEditorMap.insert(editor->widget(), editor);
|
||||||
|
|
||||||
QToolBar *toolBar = editor->toolBar();
|
QWidget *toolBar = editor->toolBar();
|
||||||
if (toolBar) {
|
if (toolBar) {
|
||||||
toolBar->setVisible(false); // will be made visible in setCurrentEditor
|
toolBar->setVisible(false); // will be made visible in setCurrentEditor
|
||||||
m_toolBar->layout()->addWidget(toolBar);
|
m_toolBar->layout()->addWidget(toolBar);
|
||||||
@@ -297,7 +286,7 @@ void EditorView::removeEditor(IEditor *editor)
|
|||||||
m_widgetEditorMap.remove(editor->widget());
|
m_widgetEditorMap.remove(editor->widget());
|
||||||
editor->widget()->setParent(0);
|
editor->widget()->setParent(0);
|
||||||
disconnect(editor, SIGNAL(changed()), this, SLOT(checkEditorStatus()));
|
disconnect(editor, SIGNAL(changed()), this, SLOT(checkEditorStatus()));
|
||||||
QToolBar *toolBar = editor->toolBar();
|
QWidget *toolBar = editor->toolBar();
|
||||||
if (toolBar != 0) {
|
if (toolBar != 0) {
|
||||||
if (m_activeToolBar == toolBar) {
|
if (m_activeToolBar == toolBar) {
|
||||||
m_activeToolBar = m_defaultToolBar;
|
m_activeToolBar = m_defaultToolBar;
|
||||||
@@ -375,7 +364,7 @@ void EditorView::updateEditorStatus(IEditor *editor)
|
|||||||
|
|
||||||
void EditorView::updateToolBar(IEditor *editor)
|
void EditorView::updateToolBar(IEditor *editor)
|
||||||
{
|
{
|
||||||
QToolBar *toolBar = editor->toolBar();
|
QWidget *toolBar = editor->toolBar();
|
||||||
if (!toolBar)
|
if (!toolBar)
|
||||||
toolBar = m_defaultToolBar;
|
toolBar = m_defaultToolBar;
|
||||||
if (m_activeToolBar == toolBar)
|
if (m_activeToolBar == toolBar)
|
||||||
|
|||||||
@@ -105,12 +105,12 @@ private:
|
|||||||
|
|
||||||
OpenEditorsModel *m_model;
|
OpenEditorsModel *m_model;
|
||||||
QWidget *m_toolBar;
|
QWidget *m_toolBar;
|
||||||
QToolBar *m_activeToolBar;
|
QWidget *m_activeToolBar;
|
||||||
QStackedWidget *m_container;
|
QStackedWidget *m_container;
|
||||||
QComboBox *m_editorList;
|
QComboBox *m_editorList;
|
||||||
QToolButton *m_closeButton;
|
QToolButton *m_closeButton;
|
||||||
QToolButton *m_lockButton;
|
QToolButton *m_lockButton;
|
||||||
QToolBar *m_defaultToolBar;
|
QWidget *m_defaultToolBar;
|
||||||
QString m_infoWidgetKind;
|
QString m_infoWidgetKind;
|
||||||
QFrame *m_infoWidget;
|
QFrame *m_infoWidget;
|
||||||
QLabel *m_infoWidgetLabel;
|
QLabel *m_infoWidgetLabel;
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public:
|
|||||||
|
|
||||||
virtual bool isTemporary() const = 0;
|
virtual bool isTemporary() const = 0;
|
||||||
|
|
||||||
virtual QToolBar *toolBar() = 0;
|
virtual QWidget *toolBar() = 0;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void changed();
|
void changed();
|
||||||
|
|||||||
@@ -314,10 +314,10 @@ void ManhattanStyle::polish(QWidget *widget)
|
|||||||
widget->removeEventFilter(d->style);
|
widget->removeEventFilter(d->style);
|
||||||
}
|
}
|
||||||
if (panelWidget(widget)) {
|
if (panelWidget(widget)) {
|
||||||
|
widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, true);
|
||||||
if (qobject_cast<QToolButton*>(widget)) {
|
if (qobject_cast<QToolButton*>(widget)) {
|
||||||
widget->setAttribute(Qt::WA_Hover);
|
widget->setAttribute(Qt::WA_Hover);
|
||||||
widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2);
|
widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2);
|
||||||
widget->setAttribute(Qt::WA_Hover);
|
|
||||||
}
|
}
|
||||||
else if (qobject_cast<QLineEdit*>(widget)) {
|
else if (qobject_cast<QLineEdit*>(widget)) {
|
||||||
widget->setAttribute(Qt::WA_Hover);
|
widget->setAttribute(Qt::WA_Hover);
|
||||||
@@ -325,8 +325,8 @@ void ManhattanStyle::polish(QWidget *widget)
|
|||||||
}
|
}
|
||||||
else if (qobject_cast<QLabel*>(widget))
|
else if (qobject_cast<QLabel*>(widget))
|
||||||
widget->setPalette(panelPalette(widget->palette()));
|
widget->setPalette(panelPalette(widget->palette()));
|
||||||
else if (qobject_cast<QToolBar*>(widget))
|
else if (qobject_cast<QToolBar*>(widget) || widget->property("panelwidget_singlerow").toBool())
|
||||||
widget->setMinimumHeight(StyleHelper::navigationWidgetHeight());
|
widget->setFixedHeight(StyleHelper::navigationWidgetHeight());
|
||||||
else if (qobject_cast<QStatusBar*>(widget))
|
else if (qobject_cast<QStatusBar*>(widget))
|
||||||
widget->setFixedHeight(StyleHelper::navigationWidgetHeight() + 2);
|
widget->setFixedHeight(StyleHelper::navigationWidgetHeight() + 2);
|
||||||
else if (qobject_cast<QComboBox*>(widget)) {
|
else if (qobject_cast<QComboBox*>(widget)) {
|
||||||
@@ -340,6 +340,7 @@ void ManhattanStyle::unpolish(QWidget *widget)
|
|||||||
{
|
{
|
||||||
d->style->unpolish(widget);
|
d->style->unpolish(widget);
|
||||||
if (panelWidget(widget)) {
|
if (panelWidget(widget)) {
|
||||||
|
widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, false);
|
||||||
if (qobject_cast<QTabBar*>(widget))
|
if (qobject_cast<QTabBar*>(widget))
|
||||||
widget->setAttribute(Qt::WA_Hover, false);
|
widget->setAttribute(Qt::WA_Hover, false);
|
||||||
else if (qobject_cast<QToolBar*>(widget))
|
else if (qobject_cast<QToolBar*>(widget))
|
||||||
|
|||||||
@@ -346,7 +346,7 @@ Core::IFile *EditorPrototype::file() const
|
|||||||
return callee()->file();
|
return callee()->file();
|
||||||
}
|
}
|
||||||
|
|
||||||
QToolBar* EditorPrototype::toolBar() const
|
QWidget* EditorPrototype::toolBar() const
|
||||||
{
|
{
|
||||||
return callee()->toolBar();
|
return callee()->toolBar();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ class EditorPrototype : public QObject, public QScriptable
|
|||||||
Q_PROPERTY(QString kind READ kind DESIGNABLE false SCRIPTABLE true STORED false)
|
Q_PROPERTY(QString kind READ kind DESIGNABLE false SCRIPTABLE true STORED false)
|
||||||
Q_PROPERTY(bool duplicateSupported READ duplicateSupported DESIGNABLE false SCRIPTABLE true STORED false)
|
Q_PROPERTY(bool duplicateSupported READ duplicateSupported DESIGNABLE false SCRIPTABLE true STORED false)
|
||||||
Q_PROPERTY(Core::IFile* file READ file DESIGNABLE false SCRIPTABLE true STORED false)
|
Q_PROPERTY(Core::IFile* file READ file DESIGNABLE false SCRIPTABLE true STORED false)
|
||||||
Q_PROPERTY(QToolBar* toolBar READ toolBar DESIGNABLE false SCRIPTABLE true STORED false)
|
Q_PROPERTY(QWidget* toolBar READ toolBar DESIGNABLE false SCRIPTABLE true STORED false)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
EditorPrototype(QObject *parent = 0);
|
EditorPrototype(QObject *parent = 0);
|
||||||
@@ -210,7 +210,7 @@ public:
|
|||||||
bool duplicateSupported() const;
|
bool duplicateSupported() const;
|
||||||
|
|
||||||
Core::IFile *file() const;
|
Core::IFile *file() const;
|
||||||
QToolBar* toolBar() const;
|
QWidget* toolBar() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
bool createNew(const QString &contents);
|
bool createNew(const QString &contents);
|
||||||
|
|||||||
@@ -640,7 +640,7 @@ void CPPEditor::createToolBar(CPPEditorEditable *editable)
|
|||||||
connect(m_semanticHighlighter, SIGNAL(changed(SemanticInfo)),
|
connect(m_semanticHighlighter, SIGNAL(changed(SemanticInfo)),
|
||||||
this, SLOT(updateSemanticInfo(SemanticInfo)));
|
this, SLOT(updateSemanticInfo(SemanticInfo)));
|
||||||
|
|
||||||
QToolBar *toolBar = editable->toolBar();
|
QToolBar *toolBar = static_cast<QToolBar*>(editable->toolBar());
|
||||||
QList<QAction*> actions = toolBar->actions();
|
QList<QAction*> actions = toolBar->actions();
|
||||||
QWidget *w = toolBar->widgetForAction(actions.first());
|
QWidget *w = toolBar->widgetForAction(actions.first());
|
||||||
static_cast<QHBoxLayout*>(w->layout())->insertWidget(0, m_methodCombo, 1);
|
static_cast<QHBoxLayout*>(w->layout())->insertWidget(0, m_methodCombo, 1);
|
||||||
|
|||||||
@@ -467,8 +467,8 @@ void FormEditorW::setupActions()
|
|||||||
|
|
||||||
QToolBar *FormEditorW::createEditorToolBar() const
|
QToolBar *FormEditorW::createEditorToolBar() const
|
||||||
{
|
{
|
||||||
QToolBar *rc = new QToolBar;
|
QToolBar *toolBar = new QToolBar;
|
||||||
rc->addSeparator();
|
toolBar->addSeparator();
|
||||||
Core::ActionManager *am = m_core->actionManager();
|
Core::ActionManager *am = m_core->actionManager();
|
||||||
const QStringList::const_iterator cend = m_toolActionIds.constEnd();
|
const QStringList::const_iterator cend = m_toolActionIds.constEnd();
|
||||||
for (QStringList::const_iterator it = m_toolActionIds.constBegin(); it != cend; ++it) {
|
for (QStringList::const_iterator it = m_toolActionIds.constBegin(); it != cend; ++it) {
|
||||||
@@ -476,11 +476,12 @@ QToolBar *FormEditorW::createEditorToolBar() const
|
|||||||
QTC_ASSERT(cmd, continue);
|
QTC_ASSERT(cmd, continue);
|
||||||
QAction *action = cmd->action();
|
QAction *action = cmd->action();
|
||||||
if (!action->icon().isNull()) // Simplify grid has no action yet
|
if (!action->icon().isNull()) // Simplify grid has no action yet
|
||||||
rc->addAction(action);
|
toolBar->addAction(action);
|
||||||
}
|
}
|
||||||
int size = rc->style()->pixelMetric(QStyle::PM_SmallIconSize);
|
int size = toolBar->style()->pixelMetric(QStyle::PM_SmallIconSize);
|
||||||
rc->setIconSize(QSize(size, size));
|
toolBar->setIconSize(QSize(size, size));
|
||||||
return rc;
|
toolBar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||||
|
return toolBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::ActionContainer *FormEditorW::createPreviewStyleMenu(Core::ActionManager *am,
|
Core::ActionContainer *FormEditorW::createPreviewStyleMenu(Core::ActionManager *am,
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ void FormWindowEditor::setDisplayName(const QString &title)
|
|||||||
m_displayName = title;
|
m_displayName = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
QToolBar *FormWindowEditor::toolBar()
|
QWidget *FormWindowEditor::toolBar()
|
||||||
{
|
{
|
||||||
if (!m_toolBar)
|
if (!m_toolBar)
|
||||||
m_toolBar = FormEditorW::instance()->createEditorToolBar();
|
m_toolBar = FormEditorW::instance()->createEditorToolBar();
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public:
|
|||||||
const char *kind() const;
|
const char *kind() const;
|
||||||
QString displayName() const;
|
QString displayName() const;
|
||||||
void setDisplayName(const QString &title);
|
void setDisplayName(const QString &title);
|
||||||
QToolBar *toolBar();
|
QWidget *toolBar();
|
||||||
QByteArray saveState() const;
|
QByteArray saveState() const;
|
||||||
bool restoreState(const QByteArray &state);
|
bool restoreState(const QByteArray &state);
|
||||||
virtual bool isTemporary() const { return false; }
|
virtual bool isTemporary() const { return false; }
|
||||||
|
|||||||
@@ -677,7 +677,7 @@ void ScriptEditor::createToolBar(ScriptEditorEditable *editable)
|
|||||||
|
|
||||||
connect(file(), SIGNAL(changed()), this, SLOT(updateFileName()));
|
connect(file(), SIGNAL(changed()), this, SLOT(updateFileName()));
|
||||||
|
|
||||||
QToolBar *toolBar = editable->toolBar();
|
QToolBar *toolBar = static_cast<QToolBar*>(editable->toolBar());
|
||||||
|
|
||||||
QList<QAction*> actions = toolBar->actions();
|
QList<QAction*> actions = toolBar->actions();
|
||||||
toolBar->insertWidget(actions.first(), m_methodCombo);
|
toolBar->insertWidget(actions.first(), m_methodCombo);
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
|
|||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
setFocusProxy(m_ui.findEdit);
|
setFocusProxy(m_ui.findEdit);
|
||||||
setProperty("topBorder", true);
|
setProperty("topBorder", true);
|
||||||
|
setSingleRow(false);
|
||||||
m_ui.findEdit->setAttribute(Qt::WA_MacShowFocusRect, false);
|
m_ui.findEdit->setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||||
m_ui.replaceEdit->setAttribute(Qt::WA_MacShowFocusRect, false);
|
m_ui.replaceEdit->setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||||
|
|
||||||
|
|||||||
@@ -384,7 +384,7 @@ void ScriptEditor::createToolBar(ScriptEditorEditable *editable)
|
|||||||
|
|
||||||
connect(file(), SIGNAL(changed()), this, SLOT(updateFileName()));
|
connect(file(), SIGNAL(changed()), this, SLOT(updateFileName()));
|
||||||
|
|
||||||
QToolBar *toolBar = editable->toolBar();
|
QToolBar *toolBar = static_cast<QToolBar*>(editable->toolBar());
|
||||||
|
|
||||||
QList<QAction*> actions = toolBar->actions();
|
QList<QAction*> actions = toolBar->actions();
|
||||||
QWidget *w = toolBar->widgetForAction(actions.first());
|
QWidget *w = toolBar->widgetForAction(actions.first());
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ public:
|
|||||||
const char *kind() const;
|
const char *kind() const;
|
||||||
QString displayName() const { return m_displayName; }
|
QString displayName() const { return m_displayName; }
|
||||||
void setDisplayName(const QString &title) { m_displayName = title; }
|
void setDisplayName(const QString &title) { m_displayName = title; }
|
||||||
QToolBar *toolBar() { return 0; }
|
QWidget *toolBar() { return 0; }
|
||||||
QByteArray saveState() const { return QByteArray(); }
|
QByteArray saveState() const { return QByteArray(); }
|
||||||
bool restoreState(const QByteArray &/*state*/) { return true; }
|
bool restoreState(const QByteArray &/*state*/) { return true; }
|
||||||
|
|
||||||
|
|||||||
@@ -4143,7 +4143,7 @@ BaseTextEditorEditable::~BaseTextEditorEditable()
|
|||||||
delete e;
|
delete e;
|
||||||
}
|
}
|
||||||
|
|
||||||
QToolBar *BaseTextEditorEditable::toolBar()
|
QWidget *BaseTextEditorEditable::toolBar()
|
||||||
{
|
{
|
||||||
return m_toolBar;
|
return m_toolBar;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -573,7 +573,7 @@ public:
|
|||||||
|
|
||||||
inline QByteArray saveState() const { return e->saveState(); }
|
inline QByteArray saveState() const { return e->saveState(); }
|
||||||
inline bool restoreState(const QByteArray &state) { return e->restoreState(state); }
|
inline bool restoreState(const QByteArray &state) { return e->restoreState(state); }
|
||||||
QToolBar *toolBar();
|
QWidget *toolBar();
|
||||||
|
|
||||||
// ITextEditor
|
// ITextEditor
|
||||||
int find(const QString &string) const;
|
int find(const QString &string) const;
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public:
|
|||||||
VCSBaseDiffEditorEditable(VCSBaseEditor *, const VCSBaseEditorParameters *type);
|
VCSBaseDiffEditorEditable(VCSBaseEditor *, const VCSBaseEditorParameters *type);
|
||||||
~VCSBaseDiffEditorEditable();
|
~VCSBaseDiffEditorEditable();
|
||||||
|
|
||||||
virtual QToolBar *toolBar() { return m_toolBar; }
|
virtual QWidget *toolBar() { return m_toolBar; }
|
||||||
QComboBox *diffFileBrowseComboBox() const { return m_diffFileBrowseComboBox; }
|
QComboBox *diffFileBrowseComboBox() const { return m_diffFileBrowseComboBox; }
|
||||||
|
|
||||||
bool isTemporary() const { return true; }
|
bool isTemporary() const { return true; }
|
||||||
|
|||||||
@@ -343,7 +343,7 @@ static QToolBar *createToolBar(const QWidget *someWidget, QAction *submitAction,
|
|||||||
return toolBar;
|
return toolBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
QToolBar *VCSBaseSubmitEditor::toolBar()
|
QWidget *VCSBaseSubmitEditor::toolBar()
|
||||||
{
|
{
|
||||||
if (!wantToolBar)
|
if (!wantToolBar)
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ public:
|
|||||||
virtual Core::IEditor *duplicate(QWidget * parent);
|
virtual Core::IEditor *duplicate(QWidget * parent);
|
||||||
virtual const char *kind() const;
|
virtual const char *kind() const;
|
||||||
|
|
||||||
virtual QToolBar *toolBar();
|
virtual QWidget *toolBar();
|
||||||
virtual QList<int> context() const;
|
virtual QList<int> context() const;
|
||||||
virtual QWidget *widget();
|
virtual QWidget *widget();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user