File indexing completed on 2023-11-26 10:44:13
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 void enterEvent(QEnterEvent *event) override; 0034 void leaveEvent(QEvent *event) override; 0035 void paintEvent(QPaintEvent *event) override; 0036 0037 private Q_SLOTS: 0038 void updateToolTip(); 0039 void updateCursor(); 0040 0041 private: 0042 QPixmap m_pixmap; 0043 }; 0044 0045 } // namespace KDEPrivate 0046 0047 #endif