]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kstandarditemlistwidget.h
Build with QT_NO_KEYWORDS
[dolphin.git] / src / kitemviews / kstandarditemlistwidget.h
index b13c303bc173f43b151e1757c080eb6102f960ab..1c3c61c3831ca18d1732ce9a0f2b7e48776ba754 100644 (file)
@@ -1,28 +1,14 @@
-/***************************************************************************
- *   Copyright (C) 2012 by Peter Penz <peter.penz19@gmail.com>             *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
- ***************************************************************************/
+/*
+ * SPDX-FileCopyrightText: 2012 Peter Penz <peter.penz19@gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
 
 #ifndef KSTANDARDITEMLISTWIDGET_H
 #define KSTANDARDITEMLISTWIDGET_H
 
 #include "dolphin_export.h"
-
-#include <kitemviews/kitemlistwidget.h>
+#include "kitemviews/kitemlistwidget.h"
 
 #include <QPixmap>
 #include <QPointF>
@@ -81,7 +67,7 @@ protected:
 };
 
 /**
- * @brief Itemlist widget implementation for KStandardItemView and KStandardItemModel.
+ * @brief Itemlist widget implementation for KStandardItemListView and KStandardItemModel.
  */
 class DOLPHIN_EXPORT KStandardItemListWidget : public KItemListWidget
 {
@@ -185,10 +171,16 @@ protected:
     void hideEvent(QHideEvent* event) override;
     bool event(QEvent *event) override;
 
-public slots:
+    struct TextInfo
+    {
+        QPointF pos;
+        QStaticText staticText;
+    };
+
+public Q_SLOTS:
     void finishRoleEditing();
 
-private slots:
+private Q_SLOTS:
     void slotCutItemsChanged();
     void slotRoleEditingCanceled(const QByteArray& role, const QVariant& value);
     void slotRoleEditingFinished(const QByteArray& role, const QVariant& value);
@@ -210,6 +202,8 @@ private:
 
     QRectF roleEditingRect(const QByteArray &role) const;
 
+    QString elideRightKeepExtension(const QString &text, int elidingWidth) const;
+
     /**
      * Closes the role editor and returns the focus back
      * to the KItemListContainer.
@@ -231,6 +225,9 @@ private:
      */
     static qreal columnPadding(const KItemListStyleOption& option);
 
+protected:
+    QHash<QByteArray, TextInfo*> m_textInfo; // PlacesItemListWidget needs to access this
+
 private:
     bool m_isCut;
     bool m_isHidden;
@@ -251,13 +248,6 @@ private:
     QRectF m_iconRect;          // Cache for KItemListWidget::iconRect()
     QPixmap m_hoverPixmap;      // Cache for modified m_pixmap when hovering the item
 
-    struct TextInfo
-    {
-        QPointF pos;
-        QStaticText staticText;
-    };
-    QHash<QByteArray, TextInfo*> m_textInfo;
-
     QRectF m_textRect;
 
     QList<QByteArray> m_sortedVisibleRoles;