File indexing completed on 2024-12-08 12:21:43
0001 /* 0002 SPDX-FileCopyrightText: 2006 Peter Penz <peter.penz@gmx.at> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef KURLNAVIGATORTOGGLEBUTTON_P_H 0008 #define KURLNAVIGATORTOGGLEBUTTON_P_H 0009 0010 #include "kurlnavigatorbuttonbase_p.h" 0011 #include <QPixmap> 0012 0013 namespace KDEPrivate 0014 { 0015 /** 0016 * @brief Represents the button of the URL navigator to switch to 0017 * the editable mode. 0018 * 0019 * A cursor is shown when hovering the button. 0020 */ 0021 class KUrlNavigatorToggleButton : public KUrlNavigatorButtonBase 0022 { 0023 Q_OBJECT 0024 0025 public: 0026 explicit KUrlNavigatorToggleButton(KUrlNavigator *parent); 0027 ~KUrlNavigatorToggleButton() override; 0028 0029 /** @see QWidget::sizeHint() */ 0030 QSize sizeHint() const override; 0031 0032 protected: 0033 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 0034 void enterEvent(QEnterEvent *event) override; 0035 #else 0036 void enterEvent(QEvent *event) override; 0037 #endif 0038 void leaveEvent(QEvent *event) override; 0039 void paintEvent(QPaintEvent *event) override; 0040 0041 private Q_SLOTS: 0042 void updateToolTip(); 0043 void updateCursor(); 0044 0045 private: 0046 QPixmap m_pixmap; 0047 }; 0048 0049 } // namespace KDEPrivate 0050 0051 #endif