minor fixes
authorAlexey Chernobaev <achernobaev@dev.rtsoft.ru>
Thu, 15 Mar 2018 18:34:49 +0000 (21:34 +0300)
committerAlexey Chernobaev <achernobaev@dev.rtsoft.ru>
Thu, 15 Mar 2018 18:34:49 +0000 (21:34 +0300)
src/analyze/gui/chartmodel.cpp
src/analyze/gui/chartwidget.cpp
src/analyze/gui/histogrammodel.cpp

index faf49bb6c27f0794e8695e3c211117373d5a82bf..31beec32a032d8e2618ab7296ff742526d96185b 100644 (file)
 #include <KLocalizedString>
 #endif
 
-#include <algorithm>
+#include "util.h"
 
 #include <QBrush>
 #include <QDebug>
 #include <QPen>
 
-#include "util.h"
+#include <algorithm>
 
 namespace {
 QColor colorForColumn(int column, int columnCount)
index 34877be4551a8a7cfd6578d2b0bff45cec7bc660..6a590235d4af996e596d25a0cc2de9b4be0cf3f8 100644 (file)
@@ -127,6 +127,7 @@ ChartWidget::ChartWidget(QWidget* parent)
 
 ChartWidget::~ChartWidget() = default;
 
+#ifdef QWT_FOUND
 void ChartWidget::createActions()
 {
     m_resetZoomAction = new QAction(i18n("Reset Zoom and Pan"), this);
@@ -170,6 +171,7 @@ void ChartWidget::createActions()
 #endif
     setFocusPolicy(Qt::StrongFocus);
 }
+#endif
 
 void ChartWidget::setModel(ChartModel* model, bool minimalMode)
 {
index f4bc064bb8cc4e7570fef409126a866f0bafbb0a..d231e94470ccc0e868b6ae02dcda85ffb5932934 100644 (file)
@@ -31,6 +31,8 @@
 #include <KLocalizedString>
 #endif
 
+#include "util.h"
+
 #include <QBrush>
 #include <QColor>
 #include <QPen>
@@ -86,12 +88,17 @@ QVariant HistogramModel::data(const QModelIndex& index, int role) const
         if (!column.location) {
             return {};
         }
+        QString tooltip;
         if (!column.location->file.isEmpty()) {
-            return i18n("%1 allocations from %2 at %3:%4 in %5", column.allocations, column.location->function,
-                        column.location->file, column.location->line, column.location->module);
+            tooltip = i18n("%1 allocations from %2 at %3:%4 in %5", column.allocations, column.location->function,
+                            column.location->file, column.location->line, column.location->module);
+        }
+        else
+        {
+            tooltip = i18n("%1 allocations from %2 in %3", column.allocations, column.location->function,
+                           column.location->module);
         }
-        return i18n("%1 allocations from %2 in %3", column.allocations, column.location->function,
-                    column.location->module);
+        return Util::wrapLabel(tooltip, 96);
     }
     return column.allocations;
 }