diff --git a/OMEdit/OMEditGUI/LibraryWidget.cpp b/OMEdit/OMEditGUI/LibraryWidget.cpp index 4b2c5070e58..65703a663eb 100644 --- a/OMEdit/OMEditGUI/LibraryWidget.cpp +++ b/OMEdit/OMEditGUI/LibraryWidget.cpp @@ -1017,7 +1017,7 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QChar nl = QLatin1Char('\n'); for (int i = 0; i < text.count(); ++i) if (text.at(i) == nl) - text[i] = QChar::LineSeparator; + text[i] = QChar::Nbsp; } displayRect = textRectangle(painter, option.rect, opt.font, text); } @@ -1048,7 +1048,7 @@ QSize ItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelInd { QSize size = QItemDelegate::sizeHint(option, index); //Set very small height. A minimum apperantly stops at resonable size. - size.rheight() = qMax(22, size.rheight()); //pixels + size.rheight() = 22; //pixels return size; } diff --git a/OMEdit/OMEditGUI/ProblemsWidget.cpp b/OMEdit/OMEditGUI/ProblemsWidget.cpp index c28c4af32fc..c62b3c3ef1f 100644 --- a/OMEdit/OMEditGUI/ProblemsWidget.cpp +++ b/OMEdit/OMEditGUI/ProblemsWidget.cpp @@ -233,12 +233,12 @@ Problem::Problem(ProblemsWidget *pParent) setHeaderLabels(labels); setContextMenuPolicy(Qt::CustomContextMenu); // create actions + mpSelectAllAction = new QAction(tr("Select All"), this); + mpSelectAllAction->setStatusTip(tr("Selects all the Problems")); + connect(mpSelectAllAction, SIGNAL(triggered()), SLOT(selectAllProblems())); mpCopyAction = new QAction(QIcon(":/Resources/icons/copy.png"), tr("Copy"), this); mpCopyAction->setStatusTip(tr("Copy the Problem")); connect(mpCopyAction, SIGNAL(triggered()), SLOT(copyProblems())); - mpCopyAllAction = new QAction(tr("Copy All"), this); - mpCopyAllAction->setStatusTip(tr("Copy All the Problems")); - connect(mpCopyAllAction, SIGNAL(triggered()), SLOT(copyAllProblems())); mpRemoveAction = new QAction(QIcon(":/Resources/icons/delete.png"), tr("Remove"), this); mpRemoveAction->setStatusTip(tr("Remove the Problem")); connect(mpRemoveAction, SIGNAL(triggered()), SLOT(removeProblems())); @@ -258,15 +258,21 @@ void Problem::showContextMenu(QPoint point) { item->setSelected(true); QMenu menu(this); + menu.addAction(mpSelectAllAction); menu.addAction(mpCopyAction); - menu.addAction(mpCopyAllAction); - menu.addSeparator(); menu.addAction(mpRemoveAction); point.setY(point.y() + adjust); menu.exec(mapToGlobal(point)); } } +//! Selects all the problems. +//! Slot activated when mpSelectAllAction triggered signal is raised. +void Problem::selectAllProblems() +{ + selectAll(); +} + //! Copy the selected problems to the clipboard. //! Slot activated when mpCopyAction triggered signal is raised. void Problem::copyProblems() @@ -283,25 +289,6 @@ void Problem::copyProblems() QApplication::clipboard()->setText(textToCopy); } -//! Copy all the problems to the clipboard. -//! Slot activated when mpCopyAllAction triggered signal is raised. -void Problem::copyAllProblems() -{ - QString textToCopy; - QTreeWidgetItemIterator it(this); - while (*it) - { - ProblemItem *pProblemItem = dynamic_cast(*it); - textToCopy.append(pProblemItem->text(0)).append("\t"); - textToCopy.append(pProblemItem->text(1)).append("\t"); - textToCopy.append(pProblemItem->text(2)).append("\t"); - textToCopy.append(pProblemItem->text(3)).append("\t"); - textToCopy.append(pProblemItem->text(4)).append("\n"); - ++it; - } - QApplication::clipboard()->setText(textToCopy); -} - //! Removes the selected problems. //! Slot activated when mpRemoveAction triggered signal is raised. void Problem::removeProblems() diff --git a/OMEdit/OMEditGUI/ProblemsWidget.h b/OMEdit/OMEditGUI/ProblemsWidget.h index 6a9d2594f0a..210c231dbb6 100644 --- a/OMEdit/OMEditGUI/ProblemsWidget.h +++ b/OMEdit/OMEditGUI/ProblemsWidget.h @@ -79,8 +79,8 @@ class Problem : public QTreeWidget { Q_OBJECT private: + QAction *mpSelectAllAction; QAction *mpCopyAction; - QAction *mpCopyAllAction; QAction *mpRemoveAction; public: Problem(ProblemsWidget *pParent); @@ -88,8 +88,8 @@ class Problem : public QTreeWidget ProblemsWidget *mpMessageWidget; private slots: void showContextMenu(QPoint point); + void selectAllProblems(); void copyProblems(); - void copyAllProblems(); void removeProblems(); protected: virtual void keyPressEvent(QKeyEvent *event);