diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2009-04-21 23:02:16 (GMT) |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2009-04-21 23:02:16 (GMT) |
commit | e0dcc1dfec22f5625a363d8f207eb5bf061f6837 (patch) | |
tree | 9fb6aacf98e1078ccd0030eb3304863ec5e7a9ca /src | |
parent | 0ded26da02d0786b08e2bf52a7e68abf7c4c8701 (diff) | |
parent | 161f51a1167ea95414b88195f61753047ca4a708 (diff) | |
download | Qt-e0dcc1dfec22f5625a363d8f207eb5bf061f6837.zip Qt-e0dcc1dfec22f5625a363d8f207eb5bf061f6837.tar.gz Qt-e0dcc1dfec22f5625a363d8f207eb5bf061f6837.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.5
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/phonon/ds9/mediaobject.cpp | 27 | ||||
-rw-r--r-- | src/gui/dialogs/qfiledialog.cpp | 5 | ||||
-rw-r--r-- | src/gui/dialogs/qfilesystemmodel.h | 2 | ||||
-rw-r--r-- | src/gui/dialogs/qprintdialog_unix.cpp | 4 | ||||
-rw-r--r-- | src/gui/dialogs/qsidebar.cpp | 21 | ||||
-rw-r--r-- | src/gui/dialogs/qsidebar_p.h | 13 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 14 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 10 | ||||
-rw-r--r-- | src/gui/kernel/qt_mac.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qpainter.cpp | 4 | ||||
-rw-r--r-- | src/opengl/qpaintengine_opengl.cpp | 10 | ||||
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp | 130 | ||||
-rw-r--r-- | src/qt3support/dialogs/q3filedialog.cpp | 13 |
13 files changed, 197 insertions, 58 deletions
diff --git a/src/3rdparty/phonon/ds9/mediaobject.cpp b/src/3rdparty/phonon/ds9/mediaobject.cpp index 93a19b0..1d0b69d 100644 --- a/src/3rdparty/phonon/ds9/mediaobject.cpp +++ b/src/3rdparty/phonon/ds9/mediaobject.cpp @@ -519,6 +519,15 @@ namespace Phonon qSwap(m_graphs[0], m_graphs[1]); //swap the graphs + if (currentGraph()->mediaSource().type() != Phonon::MediaSource::Invalid && + catchComError(currentGraph()->renderResult())) { + setState(Phonon::ErrorState); + return; + } + + //we need to play the next media + play(); + //we tell the video widgets to switch now to the new source #ifndef QT_NO_PHONON_VIDEO for (int i = 0; i < m_videoWidgets.count(); ++i) { @@ -527,15 +536,6 @@ namespace Phonon #endif //QT_NO_PHONON_VIDEO emit currentSourceChanged(currentGraph()->mediaSource()); - - if (currentGraph()->isLoading()) { - //will simply tell that when loading is finished - //it should start the playback - play(); - } - - - emit metaDataChanged(currentGraph()->metadata()); if (nextGraph()->hasVideo() != currentGraph()->hasVideo()) { @@ -548,15 +548,6 @@ namespace Phonon #ifndef QT_NO_PHONON_MEDIACONTROLLER setTitles(currentGraph()->titles()); #endif //QT_NO_PHONON_MEDIACONTROLLER - - //this manages only gapless transitions - if (currentGraph()->mediaSource().type() != Phonon::MediaSource::Invalid) { - if (catchComError(currentGraph()->renderResult())) { - setState(Phonon::ErrorState); - } else { - play(); - } - } } Phonon::State MediaObject::state() const diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 9935a80..d786f3e 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -693,7 +693,10 @@ void QFileDialog::setVisible(bool visible) */ void QFileDialogPrivate::_q_goToUrl(const QUrl &url) { - QModelIndex idx = model->index(url.toLocalFile()); + //The shortcut in the side bar may have a parent that is not fetched yet (e.g. an hidden file) + //so we force the fetching + QFileSystemModelPrivate::QFileSystemNode *node = model->d_func()->node(url.toLocalFile(), true); + QModelIndex idx = model->d_func()->index(node); _q_enterDirectory(idx); } diff --git a/src/gui/dialogs/qfilesystemmodel.h b/src/gui/dialogs/qfilesystemmodel.h index 52ecaf9..995268b 100644 --- a/src/gui/dialogs/qfilesystemmodel.h +++ b/src/gui/dialogs/qfilesystemmodel.h @@ -158,6 +158,8 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_performDelayedSort()) Q_PRIVATE_SLOT(d_func(), void _q_fileSystemChanged(const QString &path, const QList<QPair<QString, QFileInfo> > &)) Q_PRIVATE_SLOT(d_func(), void _q_resolvedName(const QString &fileName, const QString &resolvedName)) + + friend class QFileDialogPrivate; }; inline bool QFileSystemModel::rmdir(const QModelIndex &aindex) const diff --git a/src/gui/dialogs/qprintdialog_unix.cpp b/src/gui/dialogs/qprintdialog_unix.cpp index 76c22d0..87a4e65 100644 --- a/src/gui/dialogs/qprintdialog_unix.cpp +++ b/src/gui/dialogs/qprintdialog_unix.cpp @@ -727,7 +727,9 @@ void QUnixPrintWidgetPrivate::updateWidget() widget.printers->removeItem(widget.printers->count()-1); // remove separator filePrintersAdded = false; } - if (printer && filePrintersAdded && printer->printerName().isEmpty()) { + if (printer && filePrintersAdded && (printer->outputFormat() != QPrinter::NativeFormat + || printer->printerName().isEmpty())) + { if (printer->outputFormat() == QPrinter::PdfFormat) widget.printers->setCurrentIndex(widget.printers->count() - 2); else if (printer->outputFormat() == QPrinter::PostScriptFormat) diff --git a/src/gui/dialogs/qsidebar.cpp b/src/gui/dialogs/qsidebar.cpp index 1bd2b7d..bfdb37e 100644 --- a/src/gui/dialogs/qsidebar.cpp +++ b/src/gui/dialogs/qsidebar.cpp @@ -55,6 +55,18 @@ QT_BEGIN_NAMESPACE +void QSideBarDelegate::initStyleOption(QStyleOptionViewItem *option, + const QModelIndex &index) const +{ + QStyledItemDelegate::initStyleOption(option,index); + QVariant value = index.data(QUrlModel::EnabledRole); + if (value.isValid()) { + //If the bookmark/entry is not enabled then we paint it in gray + if (!qvariant_cast<bool>(value)) + option->state &= ~QStyle::State_Enabled; + } +} + /*! QUrlModel lets you have indexes from a QFileSystemModel to a list. When QFileSystemModel changes them QUrlModel will automatically update. @@ -88,9 +100,6 @@ Qt::ItemFlags QUrlModel::flags(const QModelIndex &index) const if (index.data(Qt::DecorationRole).isNull()) flags &= ~Qt::ItemIsEnabled; - if (invalidUrls.contains(index.data(UrlRole).toUrl())) - flags &= ~Qt::ItemIsEnabled; - return flags; } @@ -193,6 +202,11 @@ void QUrlModel::setUrl(const QModelIndex &index, const QUrl &url, const QModelIn newName = QFileInfo(url.toLocalFile()).fileName(); if (!invalidUrls.contains(url)) invalidUrls.append(url); + //The bookmark is invalid then we set to false the EnabledRole + setData(index, false, EnabledRole); + } else { + //The bookmark is valid then we set to true the EnabledRole + setData(index, true, EnabledRole); } // Make sure that we have at least 32x32 images @@ -356,6 +370,7 @@ void QSidebar::init(QFileSystemModel *model, const QList<QUrl> &newUrls) urlModel = new QUrlModel(this); urlModel->setFileSystemModel(model); setModel(urlModel); + setItemDelegate(new QSideBarDelegate(this)); connect(selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), this, SLOT(clicked(const QModelIndex &))); diff --git a/src/gui/dialogs/qsidebar_p.h b/src/gui/dialogs/qsidebar_p.h index ecbbb37..56fd6d4 100644 --- a/src/gui/dialogs/qsidebar_p.h +++ b/src/gui/dialogs/qsidebar_p.h @@ -55,6 +55,7 @@ #include <qlistwidget.h> #include <qstandarditemmodel.h> +#include <qstyleditemdelegate.h> #include <qurl.h> #ifndef QT_NO_FILEDIALOG @@ -62,13 +63,23 @@ QT_BEGIN_NAMESPACE class QFileSystemModel; + +class QSideBarDelegate : public QStyledItemDelegate +{ + public: + QSideBarDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent) {} + void initStyleOption(QStyleOptionViewItem *option, + const QModelIndex &index) const; +}; + class Q_AUTOTEST_EXPORT QUrlModel : public QStandardItemModel { Q_OBJECT public: enum Roles { - UrlRole = Qt::UserRole + 1 + UrlRole = Qt::UserRole + 1, + EnabledRole = Qt::UserRole + 2 }; QUrlModel(QObject *parent = 0); diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index d1b8393..3e8d38f 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -3950,17 +3950,29 @@ bool QGraphicsItemPrivate::isProxyWidget() const */ void QGraphicsItem::update(const QRectF &rect) { - if ((rect.isEmpty() && !rect.isNull()) || d_ptr->discardUpdateRequest()) + if (rect.isEmpty() && !rect.isNull()) return; if (CacheMode(d_ptr->cacheMode) != NoCache) { QGraphicsItemCache *cache = d_ptr->extraItemCache(); + if (d_ptr->discardUpdateRequest(/* ignoreVisibleBit = */ false, + /* ignoreClipping = */ false, + /* ignoreDirtyBit = */ true)) { + return; + } + + // Invalidate cache. if (rect.isNull()) { cache->allExposed = true; cache->exposed.clear(); } else { cache->exposed.append(rect); } + // Only invalidate cache; item is already dirty. + if (d_ptr->dirty) + return; + } else if (d_ptr->discardUpdateRequest()) { + return; } // Effectively the same as updateHelper(rect); diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 9881960..13f70e5 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -697,12 +697,6 @@ void QGraphicsScenePrivate::_q_removeItemLater(QGraphicsItem *item) { Q_Q(QGraphicsScene); - if (QGraphicsItem *parent = item->d_func()->parent) { - parent->itemChange(QGraphicsItem::ItemChildRemovedChange, - qVariantFromValue<QGraphicsItem *>(item)); - parent->d_func()->children.removeAll(item); - } - // Clear focus on the item to remove any reference in the focusWidget // chain. item->clearFocus(); @@ -4896,9 +4890,11 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte if (newCacheIndent != deviceData->cacheIndent || deviceRect.size() != pix.size()) { QPoint diff = newCacheIndent - deviceData->cacheIndent; QPixmap newPix(deviceRect.size()); + // ### Investigate removing this fill (test with Plasma and + // graphicssystem raster). + newPix.fill(Qt::transparent); if (!pix.isNull()) { QPainter newPixPainter(&newPix); - newPixPainter.setCompositionMode(QPainter::CompositionMode_Source); newPixPainter.drawPixmap(-diff, pix); newPixPainter.end(); } diff --git a/src/gui/kernel/qt_mac.cpp b/src/gui/kernel/qt_mac.cpp index b1247e8..44e10a8 100644 --- a/src/gui/kernel/qt_mac.cpp +++ b/src/gui/kernel/qt_mac.cpp @@ -131,7 +131,7 @@ QColor qcolorForTheme(ThemeBrush brush) QColor qcolorForThemeTextColor(ThemeTextColor themeColor) { -#ifdef QT_OS_MAC32 +#ifdef Q_OS_MAC32 RGBColor c; GetThemeTextColor(themeColor, 32, true, &c); QColor color = QColor(c.red / 265, c.green / 256, c.blue / 256); diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 2fa6a56..ffb273e 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -1484,7 +1484,9 @@ void QPainter::initFrom(const QWidget *widget) d->state->bgBrush = pal.brush(widget->backgroundRole()); d->state->deviceFont = QFont(widget->font(), const_cast<QWidget*> (widget)); d->state->font = d->state->deviceFont; - if (d->engine) { + if (d->extended) { + d->extended->penChanged(); + } else if (d->engine) { d->engine->setDirty(QPaintEngine::DirtyPen); d->engine->setDirty(QPaintEngine::DirtyBrush); d->engine->setDirty(QPaintEngine::DirtyFont); diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index 88fd379..ec6e33b 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -3716,8 +3716,14 @@ void QOpenGLPaintEngine::drawRects(const QRectF *rects, int rectCount) d->disableClipping(); GLuint program = qt_gl_program_cache()->getProgram(d->drawable.context(), FRAGMENT_PROGRAM_MASK_TRAPEZOID_AA, 0, true); - QGLRectMaskGenerator maskGenerator(path, d->matrix, d->offscreen, program); - d->addItem(qt_mask_texture_cache()->getMask(maskGenerator, d)); + + if (d->matrix.type() >= QTransform::TxProject) { + QGLPathMaskGenerator maskGenerator(path, d->matrix, d->offscreen, program); + d->addItem(qt_mask_texture_cache()->getMask(maskGenerator, d)); + } else { + QGLRectMaskGenerator maskGenerator(path, d->matrix, d->offscreen, program); + d->addItem(qt_mask_texture_cache()->getMask(maskGenerator, d)); + } d->enableClipping(); } diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp index cd19f69..368b9f9 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp @@ -173,6 +173,22 @@ void QDirectFBKeyboardHandlerPrivate::readKeyboardData() Qt::KeyboardModifiers modifiers = Qt::NoModifier; + // Not implemented: + // if (input.modifiers & DIMM_SUPER) + // if (input.modifiers & DIMM_HYPER) + + if (!(input.flags & DIEF_KEYSYMBOL) || + !(input.flags & DIEF_KEYID) || + !(input.type & (DIET_KEYPRESS|DIET_KEYRELEASE))) + { + static bool first = true; + if (first) { + qWarning("QDirectFBKeyboardHandler - Getting unexpected non-keyboard related events"); + first = false; + } + break; + } + if (input.flags & DIEF_MODIFIERS) { if (input.modifiers & DIMM_SHIFT) modifiers |= Qt::ShiftModifier; @@ -185,31 +201,15 @@ void QDirectFBKeyboardHandlerPrivate::readKeyboardData() if (input.modifiers & DIMM_META) modifiers |= Qt::MetaModifier; } - // Not implemented: - // if (input.modifiers & DIMM_SUPER) - // if (input.modifiers & DIMM_HYPER) - if ( !(input.flags & DIEF_KEYSYMBOL) || - !(input.flags & DIEF_KEYID) || - !(input.type & (DIET_KEYPRESS | DIET_KEYRELEASE)) ) - { - static int warningCount = 0; - if (!warningCount) { - qWarning("QDirectFBKeyboardHandler - Getting unexpected non-keyboard related events"); - warningCount = 100; - } - else - warningCount--; - break; - } - bool press = input.type & DIET_KEYPRESS; + const bool press = input.type & DIET_KEYPRESS; DFBInputDeviceKeySymbol symbol = input.key_symbol; int unicode = -1; int keycode = 0; keycode = keymap()->value(symbol); - if (keycode == 0 && DFB_KEY_TYPE(symbol) == DIKT_UNICODE) + if (DFB_KEY_TYPE(symbol) == DIKT_UNICODE) unicode = symbol; if (unicode != -1 || keycode != 0) { @@ -314,6 +314,100 @@ KeyMap::KeyMap() insert(DIKS_DEAD_SEMIVOICED_SOUND , Qt::Key_Dead_Semivoiced_Sound); insert(DIKS_DEAD_TILDE , Qt::Key_Dead_Tilde); insert(DIKS_DEAD_VOICED_SOUND , Qt::Key_Dead_Voiced_Sound); + insert(DIKS_SPACE , Qt::Key_Space); + insert(DIKS_EXCLAMATION_MARK , Qt::Key_Exclam); + insert(DIKS_QUOTATION , Qt::Key_QuoteDbl); + insert(DIKS_NUMBER_SIGN , Qt::Key_NumberSign); + insert(DIKS_DOLLAR_SIGN , Qt::Key_Dollar); + insert(DIKS_PERCENT_SIGN , Qt::Key_Percent); + insert(DIKS_AMPERSAND , Qt::Key_Ampersand); + insert(DIKS_APOSTROPHE , Qt::Key_Apostrophe); + insert(DIKS_PARENTHESIS_LEFT , Qt::Key_ParenLeft); + insert(DIKS_PARENTHESIS_RIGHT , Qt::Key_ParenRight); + insert(DIKS_ASTERISK , Qt::Key_Asterisk); + insert(DIKS_PLUS_SIGN , Qt::Key_Plus); + insert(DIKS_COMMA , Qt::Key_Comma); + insert(DIKS_MINUS_SIGN , Qt::Key_Minus); + insert(DIKS_PERIOD , Qt::Key_Period); + insert(DIKS_SLASH , Qt::Key_Slash); + insert(DIKS_0 , Qt::Key_0); + insert(DIKS_1 , Qt::Key_1); + insert(DIKS_2 , Qt::Key_2); + insert(DIKS_3 , Qt::Key_3); + insert(DIKS_4 , Qt::Key_4); + insert(DIKS_5 , Qt::Key_5); + insert(DIKS_6 , Qt::Key_6); + insert(DIKS_7 , Qt::Key_7); + insert(DIKS_8 , Qt::Key_8); + insert(DIKS_9 , Qt::Key_9); + insert(DIKS_COLON , Qt::Key_Colon); + insert(DIKS_SEMICOLON , Qt::Key_Semicolon); + insert(DIKS_LESS_THAN_SIGN , Qt::Key_Less); + insert(DIKS_EQUALS_SIGN , Qt::Key_Equal); + insert(DIKS_GREATER_THAN_SIGN , Qt::Key_Greater); + insert(DIKS_QUESTION_MARK , Qt::Key_Question); + insert(DIKS_AT , Qt::Key_At); + insert(DIKS_CAPITAL_A , Qt::Key_A); + insert(DIKS_CAPITAL_B , Qt::Key_B); + insert(DIKS_CAPITAL_C , Qt::Key_C); + insert(DIKS_CAPITAL_D , Qt::Key_D); + insert(DIKS_CAPITAL_E , Qt::Key_E); + insert(DIKS_CAPITAL_F , Qt::Key_F); + insert(DIKS_CAPITAL_G , Qt::Key_G); + insert(DIKS_CAPITAL_H , Qt::Key_H); + insert(DIKS_CAPITAL_I , Qt::Key_I); + insert(DIKS_CAPITAL_J , Qt::Key_J); + insert(DIKS_CAPITAL_K , Qt::Key_K); + insert(DIKS_CAPITAL_L , Qt::Key_L); + insert(DIKS_CAPITAL_M , Qt::Key_M); + insert(DIKS_CAPITAL_N , Qt::Key_N); + insert(DIKS_CAPITAL_O , Qt::Key_O); + insert(DIKS_CAPITAL_P , Qt::Key_P); + insert(DIKS_CAPITAL_Q , Qt::Key_Q); + insert(DIKS_CAPITAL_R , Qt::Key_R); + insert(DIKS_CAPITAL_S , Qt::Key_S); + insert(DIKS_CAPITAL_T , Qt::Key_T); + insert(DIKS_CAPITAL_U , Qt::Key_U); + insert(DIKS_CAPITAL_V , Qt::Key_V); + insert(DIKS_CAPITAL_W , Qt::Key_W); + insert(DIKS_CAPITAL_X , Qt::Key_X); + insert(DIKS_CAPITAL_Y , Qt::Key_Y); + insert(DIKS_CAPITAL_Z , Qt::Key_Z); + insert(DIKS_SQUARE_BRACKET_LEFT , Qt::Key_BracketLeft); + insert(DIKS_BACKSLASH , Qt::Key_Backslash); + insert(DIKS_SQUARE_BRACKET_RIGHT , Qt::Key_BracketRight); + insert(DIKS_CIRCUMFLEX_ACCENT , Qt::Key_AsciiCircum); + insert(DIKS_UNDERSCORE , Qt::Key_Underscore); + insert(DIKS_SMALL_A , Qt::Key_A); + insert(DIKS_SMALL_B , Qt::Key_B); + insert(DIKS_SMALL_C , Qt::Key_C); + insert(DIKS_SMALL_D , Qt::Key_D); + insert(DIKS_SMALL_E , Qt::Key_E); + insert(DIKS_SMALL_F , Qt::Key_F); + insert(DIKS_SMALL_G , Qt::Key_G); + insert(DIKS_SMALL_H , Qt::Key_H); + insert(DIKS_SMALL_I , Qt::Key_I); + insert(DIKS_SMALL_J , Qt::Key_J); + insert(DIKS_SMALL_K , Qt::Key_K); + insert(DIKS_SMALL_L , Qt::Key_L); + insert(DIKS_SMALL_M , Qt::Key_M); + insert(DIKS_SMALL_N , Qt::Key_N); + insert(DIKS_SMALL_O , Qt::Key_O); + insert(DIKS_SMALL_P , Qt::Key_P); + insert(DIKS_SMALL_Q , Qt::Key_Q); + insert(DIKS_SMALL_R , Qt::Key_R); + insert(DIKS_SMALL_S , Qt::Key_S); + insert(DIKS_SMALL_T , Qt::Key_T); + insert(DIKS_SMALL_U , Qt::Key_U); + insert(DIKS_SMALL_V , Qt::Key_V); + insert(DIKS_SMALL_W , Qt::Key_W); + insert(DIKS_SMALL_X , Qt::Key_X); + insert(DIKS_SMALL_Y , Qt::Key_Y); + insert(DIKS_SMALL_Z , Qt::Key_Z); + insert(DIKS_CURLY_BRACKET_LEFT , Qt::Key_BraceLeft); + insert(DIKS_VERTICAL_BAR , Qt::Key_Bar); + insert(DIKS_CURLY_BRACKET_RIGHT , Qt::Key_BraceRight); + insert(DIKS_TILDE , Qt::Key_AsciiTilde); } #include "qdirectfbkeyboard.moc" diff --git a/src/qt3support/dialogs/q3filedialog.cpp b/src/qt3support/dialogs/q3filedialog.cpp index 4874b6d..1ec0cfc 100644 --- a/src/qt3support/dialogs/q3filedialog.cpp +++ b/src/qt3support/dialogs/q3filedialog.cpp @@ -631,6 +631,7 @@ public: protected: void keyPressEvent(QKeyEvent *e); void focusOutEvent(QFocusEvent *e); + void emitDoRename(); signals: void cancelRename(); @@ -1143,16 +1144,20 @@ void QRenameEdit::keyPressEvent(QKeyEvent *e) void QRenameEdit::focusOutEvent(QFocusEvent *) { - if (!doRenameAlreadyEmitted) { - doRenameAlreadyEmitted = true; - emit doRename(); - } + if (!doRenameAlreadyEmitted) + emitDoRename(); } void QRenameEdit::slotReturnPressed() { + emitDoRename(); +} + +void QRenameEdit::emitDoRename() +{ doRenameAlreadyEmitted = true; emit doRename(); + doRenameAlreadyEmitted = false; } /************************************************************************ |