┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/private
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2012-06-08 16:39:13 +0200
committerPeter Penz <[email protected]>2012-06-08 16:40:01 +0200
commit98a4aa10ef09087ce6498d09461036cb0ab9cb4d (patch)
treea13278be9ce236be1b31b5fa0226fa6238ef6268 /src/kitemviews/private
parent0c206bda8e7d1de1f2b9d0d96ee6960d5d8640a7 (diff)
Inline renaming fixes
- Don't use an outdated KFileItem when renaming an item more than once - Use the same font as the view - Don't lose the focus when an editor-popup is shown BUG: 299327 BUG: 298883 BUG: 301253 FIXED-IN: 4.9.0
Diffstat (limited to 'src/kitemviews/private')
-rw-r--r--src/kitemviews/private/kitemlistroleeditor.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/kitemviews/private/kitemlistroleeditor.cpp b/src/kitemviews/private/kitemlistroleeditor.cpp
index 815da4c70..594b05338 100644
--- a/src/kitemviews/private/kitemlistroleeditor.cpp
+++ b/src/kitemviews/private/kitemlistroleeditor.cpp
@@ -29,11 +29,14 @@ KItemListRoleEditor::KItemListRoleEditor(QWidget *parent) :
{
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ setAcceptRichText(false);
document()->setDocumentMargin(0);
if (parent) {
parent->installEventFilter(this);
}
+
+ connect(this, SIGNAL(textChanged()), this, SLOT(autoAdjustSize()));
}
KItemListRoleEditor::~KItemListRoleEditor()
@@ -60,7 +63,7 @@ QByteArray KItemListRoleEditor::role() const
return m_role;
}
-bool KItemListRoleEditor::eventFilter(QObject* watched, QEvent* event)
+bool KItemListRoleEditor::eventFilter(QObject* watched, QEvent* event)
{
if (watched == parentWidget() && event->type() == QEvent::Resize) {
emit roleEditingFinished(m_index, m_role, toPlainText());
@@ -72,7 +75,10 @@ bool KItemListRoleEditor::eventFilter(QObject* watched, QEvent* event)
bool KItemListRoleEditor::event(QEvent* event)
{
if (event->type() == QEvent::FocusOut) {
- emit roleEditingFinished(m_index, m_role, toPlainText());
+ QFocusEvent* focusEvent = static_cast<QFocusEvent*>(event);
+ if (focusEvent->reason() != Qt::PopupFocusReason) {
+ emit roleEditingFinished(m_index, m_role, toPlainText());
+ }
}
return KTextEdit::event(event);
}
@@ -94,7 +100,6 @@ void KItemListRoleEditor::keyPressEvent(QKeyEvent* event)
}
KTextEdit::keyPressEvent(event);
- autoAdjustSize();
}
void KItemListRoleEditor::autoAdjustSize()