diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 818aba8..a190c0a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,324 +1,324 @@ include(ECMPoQmTools) ecm_create_qm_loader(kwidgetsaddons_QM_LOADER kwidgetsaddons5_qt) qt5_add_resources(kwidgetsaddons_ICON_SRCS icons.qrc) set(kwidgetsaddons_SRCS kacceleratormanager.cpp kanimatedbutton.cpp kbusyindicatorwidget.cpp kcharselect.cpp kcharselectdata.cpp kcollapsiblegroupbox.cpp kcolorbutton.cpp kcolumnresizer.cpp kdatecombobox.cpp kdatepicker.cpp kdatetable.cpp kdatetimeedit.cpp kfontaction.cpp knewpasswordwidget.cpp fonthelpers.cpp kfontsizeaction.cpp kpopupframe.cpp kselectaction.cpp ktimecombobox.cpp kdragwidgetdecorator.cpp kdualaction.cpp kfontchooser.cpp kguiitem.cpp kled.cpp kmessagebox.cpp kmessagebox_p.cpp kmultitabbar.cpp kstandardguiitem.cpp kurllabel.cpp # Not good enough quality. Needs to use QUrl instead of QString and should not inherit QLabel, but hold it as a member instead. kcapacitybar.cpp kfontrequester.cpp kpassworddialog.cpp kruler.cpp kselector.cpp kxyselector.cpp kseparator.cpp ksqueezedtextlabel.cpp ktitlewidget.cpp ktoggleaction.cpp ktogglefullscreenaction.cpp kviewstateserializer.cpp kviewstatemaintainerbase.cpp keditlistwidget.cpp kcursor.cpp kratingwidget.cpp kratingpainter.cpp kactionselector.cpp kcolorcombo.cpp ktoolbarspaceraction.cpp kpixmapregionselectordialog.cpp kpixmapregionselectorwidget.cpp kactionmenu.cpp ktoolbarlabelaction.cpp ktoolbarpopupaction.cpp kpagedialog.cpp kpagemodel.cpp kpageview.cpp kpageview_p.cpp kpagewidget.cpp kpagewidgetmodel.cpp kassistantdialog.cpp kmessagewidget.cpp knewpassworddialog.cpp lineediturldropeventfilter.cpp kpasswordlineedit.cpp kpixmapsequence.cpp kpixmapsequenceoverlaypainter.cpp kpixmapsequencewidget.cpp kmimetypechooser.cpp kmimetypeeditor.cpp common_helpers.cpp ksplittercollapserbutton.cpp kstyleextensions.cpp ktooltipwidget.cpp ${kwidgetsaddons_QM_LOADER} ${kwidgetsaddons_ICON_SRCS} ) set(kwidgetsaddon_UI kdatetimeedit.ui knewpassworddialog.ui knewpasswordwidget.ui kpassworddialog.ui ) qt5_wrap_ui(kwidgetsaddons_SRCS ${kwidgetsaddon_UI} ) ecm_qt_declare_logging_category(kwidgetsaddons_SRCS HEADER loggingcategory.h IDENTIFIER KWidgetsAddonsLog CATEGORY_NAME kf5.kwidgetsaddons DEFAULT_SEVERITY Warning ) add_library(KF5WidgetsAddons ${kwidgetsaddons_SRCS}) add_library(KF5::WidgetsAddons ALIAS KF5WidgetsAddons) ecm_generate_export_header(KF5WidgetsAddons BASE_NAME KWidgetsAddons GROUP_BASE_NAME KF VERSION ${KF5_VERSION} DEPRECATED_BASE_VERSION 0 - DEPRECATION_VERSIONS 5.0 5.13 5.63 + DEPRECATION_VERSIONS 5.0 5.13 5.63 5.65 EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT} ) target_link_libraries(KF5WidgetsAddons PUBLIC Qt5::Widgets) target_include_directories(KF5WidgetsAddons INTERFACE "$") set_target_properties(KF5WidgetsAddons PROPERTIES VERSION ${KWIDGETSADDONS_VERSION_STRING} SOVERSION ${KWIDGETSADDONS_SOVERSION} EXPORT_NAME WidgetsAddons ) ecm_generate_headers(KWidgetsAddons_HEADERS HEADER_NAMES KAcceleratorManager KAnimatedButton KBusyIndicatorWidget KCharSelect KCollapsibleGroupBox KColorButton KColumnResizer KDateComboBox KDatePicker KDateTimeEdit KDragWidgetDecorator KDualAction KFontAction KFontChooser KFontSizeAction KGuiItem KLed KMessageBox KMessageBoxDontAskAgainInterface KMultiTabBar,KMultiTabBarButton,KMultiTabBarTab KNewPasswordWidget KPopupFrame KSelectAction KStandardGuiItem KTimeComboBox KUrlLabel KCapacityBar KFontRequester KPasswordDialog KRuler KSelector,KGradientSelector KTitleWidget KXYSelector KSeparator KSqueezedTextLabel KToggleAction KToggleFullScreenAction KViewStateSerializer KViewStateMaintainerBase KEditListWidget KCursor KRatingPainter KRatingWidget KActionSelector KColorCombo KActionMenu KToolBarLabelAction KToolBarPopupAction KToolBarSpacerAction KPageDialog KPageModel KPageView KPageWidget KPageWidgetModel,KPageWidgetItem KAssistantDialog KMessageWidget KNewPasswordDialog LineEditUrlDropEventFilter KPasswordLineEdit KPixmapSequence KPixmapSequenceOverlayPainter KPixmapSequenceWidget KPixmapRegionSelectorDialog KPixmapRegionSelectorWidget KMimeTypeChooser,KMimeTypeChooserDialog KMimeTypeEditor KMessageBoxNotifyInterface KSplitterCollapserButton KStyleExtensions KToolTipWidget REQUIRED_HEADERS KWidgetsAddons_HEADERS ) find_package(PythonModuleGeneration) if (PythonModuleGeneration_FOUND) ecm_generate_python_binding( TARGET KF5::WidgetsAddons PYTHONNAMESPACE PyKF5 MODULENAME KWidgetsAddons RULES_FILE "${CMAKE_SOURCE_DIR}/cmake/rules_PyKF5.py" SIP_DEPENDS QtWidgets/QtWidgetsmod.sip HEADERS kacceleratormanager.h kanimatedbutton.h kbusyindicatorwidget.h kcharselect.h kcollapsiblegroupbox.h kcolorbutton.h kcolumnresizer.h kdatecombobox.h kdatepicker.h kdatetimeedit.h kdragwidgetdecorator.h kdualaction.h kfontaction.h kfontchooser.h kfontsizeaction.h kguiitem.h kled.h kmessagebox.h kmessageboxdontaskagaininterface.h kmultitabbar.h knewpasswordwidget.h kpopupframe.h kselectaction.h kstandardguiitem.h ktimecombobox.h kurllabel.h kcapacitybar.h kfontrequester.h kpassworddialog.h kruler.h kselector.h ktitlewidget.h kxyselector.h kseparator.h ksqueezedtextlabel.h ktoggleaction.h ktogglefullscreenaction.h kviewstateserializer.h kviewstatemaintainerbase.h keditlistwidget.h kcursor.h kratingpainter.h kratingwidget.h kactionselector.h kcolorcombo.h kactionmenu.h ktoolbarlabelaction.h ktoolbarpopupaction.h ktoolbarspaceraction.h kpagedialog.h kpagemodel.h kpageview.h kpagewidget.h kpagewidgetmodel.h kassistantdialog.h kmessagewidget.h knewpassworddialog.h lineediturldropeventfilter.h kpasswordlineedit.h kpixmapsequence.h kpixmapsequenceoverlaypainter.h kpixmapsequencewidget.h kpixmapregionselectordialog.h kpixmapregionselectorwidget.h kmimetypechooser.h kmimetypeeditor.h kmessageboxnotifyinterface.h ksplittercollapserbutton.h kstyleextensions.h ) endif() install(TARGETS KF5WidgetsAddons EXPORT KF5WidgetsAddonsTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}) install(FILES ${KWidgetsAddons_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/kwidgetsaddons_export.h DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KWidgetsAddons COMPONENT Devel ) install(FILES kcharselect-data DESTINATION ${KDE_INSTALL_DATADIR_KF5}/kcharselect) if (BUILD_QCH) ecm_add_qch( KF5WidgetsAddons_QCH NAME KWidgetsAddons BASE_NAME KF5WidgetsAddons VERSION ${KF5_VERSION} ORG_DOMAIN org.kde SOURCES # using only public headers, to cover only public API ${KWidgetsAddons_HEADERS} MD_MAINPAGE "${CMAKE_SOURCE_DIR}/README.md" IMAGE_DIRS "${CMAKE_SOURCE_DIR}/docs/pics" LINK_QCHS Qt5Core_QCH Qt5Gui_QCH Qt5Widgets_QCH INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR} BLANK_MACROS KWIDGETSADDONS_EXPORT KWIDGETSADDONS_DEPRECATED_EXPORT KWIDGETSADDONS_DEPRECATED "KWIDGETSADDONS_DEPRECATED_VERSION(x, y, t)" TAGFILE_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR} QCH_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR} COMPONENT Devel ) endif() if(BUILD_DESIGNERPLUGIN) add_subdirectory(designer) endif() include(ECMGeneratePriFile) ecm_generate_pri_file(BASE_NAME KWidgetsAddons LIB_NAME KF5WidgetsAddons DEPS "widgets" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/KWidgetsAddons) install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) diff --git a/src/kurllabel.cpp b/src/kurllabel.cpp index 72c173c..3505243 100644 --- a/src/kurllabel.cpp +++ b/src/kurllabel.cpp @@ -1,338 +1,346 @@ // Copyright (C) 2000 Peter Putzer // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // This library 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 // Lesser General Public License for more details. // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA // 02110-1301 USA #include "kurllabel.h" #include #include #include #include class Q_DECL_HIDDEN KUrlLabel::Private { public: Private(const QString &_url, KUrlLabel *_parent) : parent(_parent), url(_url), tipText(url), linkColor(_parent->palette().color(QPalette::Active, QPalette::Link)), highlightedLinkColor(_parent->palette().color(QPalette::Active, QPalette::BrightText)), cursor(nullptr), textUnderlined(true), realUnderlined(true), useTips(false), useCursor(false), glowEnabled(true), floatEnabled(false), timer(new QTimer(parent)) { connect(timer, &QTimer::timeout, parent, [this]() { updateColor(); }); } ~Private() { } void updateColor() { timer->stop(); if (!(glowEnabled || floatEnabled) || !parent->rect().contains(parent->mapFromGlobal(QCursor::pos()))) { setLinkColor(linkColor); } } void setLinkColor(const QColor &color) { QPalette palette = parent->palette(); palette.setColor(QPalette::WindowText, color); parent->setPalette(palette); parent->update(); } KUrlLabel *parent; QString url; QString tipText; QColor linkColor; QColor highlightedLinkColor; QCursor *cursor; bool textUnderlined : 1; bool realUnderlined : 1; bool useTips : 1; bool useCursor : 1; bool glowEnabled : 1; bool floatEnabled : 1; QPixmap alternatePixmap; QPixmap realPixmap; QTimer *timer; }; KUrlLabel::KUrlLabel(const QString &url, const QString &text, QWidget *parent) : QLabel(!text.isNull() ? text : url, parent), d(new Private(url, this)) { setFont(font()); setCursor(QCursor(Qt::PointingHandCursor)); d->setLinkColor(d->linkColor); } KUrlLabel::KUrlLabel(QWidget *parent) : QLabel(parent), d(new Private(QString(), this)) { setFont(font()); setCursor(QCursor(Qt::PointingHandCursor)); d->setLinkColor(d->linkColor); } KUrlLabel::~KUrlLabel() { delete d; } void KUrlLabel::mouseReleaseEvent(QMouseEvent *event) { QLabel::mouseReleaseEvent(event); d->setLinkColor(d->highlightedLinkColor); d->timer->start(300); switch (event->button()) { case Qt::LeftButton: emit leftClickedUrl(); +#if KWIDGETSADDONS_BUILD_DEPRECATED_SINCE(5, 65) emit leftClickedUrl(d->url); +#endif break; case Qt::MidButton: emit middleClickedUrl(); +#if KWIDGETSADDONS_BUILD_DEPRECATED_SINCE(5, 65) emit middleClickedUrl(d->url); +#endif break; case Qt::RightButton: emit rightClickedUrl(); +#if KWIDGETSADDONS_BUILD_DEPRECATED_SINCE(5, 65) emit rightClickedUrl(d->url); +#endif break; default: break; } } void KUrlLabel::setFont(const QFont &font) { QFont newFont = font; newFont.setUnderline(d->textUnderlined); QLabel::setFont(newFont); } void KUrlLabel::setUnderline(bool on) { d->textUnderlined = on; setFont(font()); } void KUrlLabel::setUrl(const QString &url) { if (d->tipText == d->url) { // update the tip as well d->tipText = url; setUseTips(d->useTips); } d->url = url; } QString KUrlLabel::url() const { return d->url; } void KUrlLabel::setUseCursor(bool on, QCursor *cursor) { d->useCursor = on; d->cursor = cursor; if (on) { if (cursor) { setCursor(*cursor); } else { setCursor(QCursor(Qt::PointingHandCursor)); } } else { unsetCursor(); } } bool KUrlLabel::useCursor() const { return d->useCursor; } void KUrlLabel::setUseTips(bool on) { d->useTips = on; if (on) { setToolTip(d->tipText); } else { setToolTip(QString()); } } void KUrlLabel::setTipText(const QString &tipText) { d->tipText = tipText; setUseTips(d->useTips); } bool KUrlLabel::useTips() const { return d->useTips; } QString KUrlLabel::tipText() const { return d->tipText; } void KUrlLabel::setHighlightedColor(const QColor &color) { d->linkColor = color; if (!d->timer->isActive()) { d->setLinkColor(color); } } void KUrlLabel::setHighlightedColor(const QString &color) { setHighlightedColor(QColor(color)); } void KUrlLabel::setSelectedColor(const QColor &color) { d->highlightedLinkColor = color; if (d->timer->isActive()) { d->setLinkColor(color); } } void KUrlLabel::setSelectedColor(const QString &color) { setSelectedColor(QColor(color)); } void KUrlLabel::setGlowEnabled(bool glowEnabled) { d->glowEnabled = glowEnabled; } void KUrlLabel::setFloatEnabled(bool floatEnabled) { d->floatEnabled = floatEnabled; } bool KUrlLabel::isGlowEnabled() const { return d->glowEnabled; } bool KUrlLabel::isFloatEnabled() const { return d->floatEnabled; } void KUrlLabel::setAlternatePixmap(const QPixmap &pixmap) { d->alternatePixmap = pixmap; } const QPixmap *KUrlLabel::alternatePixmap() const { return &d->alternatePixmap; } void KUrlLabel::enterEvent(QEvent *event) { QLabel::enterEvent(event); if (!d->alternatePixmap.isNull() && pixmap()) { d->realPixmap = *pixmap(); setPixmap(d->alternatePixmap); } if (d->glowEnabled || d->floatEnabled) { d->timer->stop(); d->setLinkColor(d->highlightedLinkColor); d->realUnderlined = d->textUnderlined; if (d->floatEnabled) { setUnderline(true); } } - emit enteredUrl(); +#if KWIDGETSADDONS_BUILD_DEPRECATED_SINCE(5, 65) emit enteredUrl(d->url); +#endif } void KUrlLabel::leaveEvent(QEvent *event) { QLabel::leaveEvent(event); if (!d->alternatePixmap.isNull() && pixmap()) { setPixmap(d->realPixmap); } if ((d->glowEnabled || d->floatEnabled) && !d->timer->isActive()) { d->setLinkColor(d->linkColor); } setUnderline(d->realUnderlined); - emit leftUrl(); +#if KWIDGETSADDONS_BUILD_DEPRECATED_SINCE(5, 65) emit leftUrl(d->url); +#endif } bool KUrlLabel::event(QEvent *event) { if (event->type() == QEvent::PaletteChange) { /** * Use parentWidget() unless you are a toplevel widget, then try qAapp */ QPalette palette = parentWidget() ? parentWidget()->palette() : qApp->palette(); palette.setBrush(QPalette::Base, palette.brush(QPalette::Normal, QPalette::Window)); palette.setColor(QPalette::WindowText, this->palette().color(QPalette::Active, QPalette::WindowText)); setPalette(palette); d->linkColor = palette.color(QPalette::Active, QPalette::Link); d->updateColor(); return true; } else { return QLabel::event(event); } } #include "moc_kurllabel.cpp" diff --git a/src/kurllabel.h b/src/kurllabel.h index 4577c3f..fa168f5 100644 --- a/src/kurllabel.h +++ b/src/kurllabel.h @@ -1,360 +1,372 @@ /* This file is part of the KDE libraries Copyright (C) 1998 Kurt Granroth Copyright (C) 2000 Peter Putzer Copyright (C) 2005 Jarosław Staniek This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KURLLABEL_H #define KURLLABEL_H #include #include #include #include class QCursor; /** * @class KUrlLabel kurllabel.h KUrlLabel * * @short A drop-in replacement for QLabel that displays hyperlinks. * * KUrlLabel is a drop-in replacement for QLabel that handles text * in a fashion similar to how an HTML widget handles hyperlinks. The * text can be underlined (or not) and set to different colors. It * can also "glow" (cycle colors) when the mouse passes over it. * * KUrlLabel also provides signals for several events, including * the mouse leaving and entering the text area and all forms of * mouse clicking. * * By default KUrlLabel accepts focus. When focused, standard * focus rectangle is displayed as in HTML widget. * Pressing Enter key accepts the focused label. * * A typical usage would be something like so: * * \code * KUrlLabel *address = new KUrlLabel(this); * address->setText("My homepage"); * address->setUrl("http://www.home.com/~me"); * connect(address, SIGNAL(leftClickedUrl(const QString&)), * SLOT(processMyUrl(const QString&))); * \endcode * * In this example, the text "My homepage" would be displayed * as blue, underlined text. When the mouse passed over it, * it would "glow" red. When the user clicks on the text, the * signal leftClickedUrl() would be emitted with "http://www.home.com/~me" * as its argument. * * \image html kurllabel.png "KUrlLabel Widget" * * @author Kurt Granroth (Interface) * @author Peter Putzer (Rewrite) */ class KWIDGETSADDONS_EXPORT KUrlLabel : public QLabel { Q_OBJECT Q_PROPERTY(QString url READ url WRITE setUrl) Q_PROPERTY(QString tipText READ tipText WRITE setTipText) Q_PROPERTY(QPixmap alternatePixmap READ alternatePixmap WRITE setAlternatePixmap) Q_PROPERTY(bool glowEnabled READ isGlowEnabled WRITE setGlowEnabled) Q_PROPERTY(bool floatEnabled READ isFloatEnabled WRITE setFloatEnabled) Q_PROPERTY(bool useTips READ useTips WRITE setUseTips) Q_PROPERTY(bool useCursor READ useCursor WRITE setUseCursor) public: /** * Default constructor. * * Use setUrl() and setText() or QListView::setPixmap() * to set the resp. properties. */ explicit KUrlLabel(QWidget *parent = nullptr); /** * Convenience constructor. * * @param url is the URL emitted when the label is clicked. * @param text is the displayed string. If it's equal to QString() * the @p url will be used instead. * @param parent Passed to lower level constructor * * @p parent and @p name are passed to QLabel, which in turn passes * them further down */ explicit KUrlLabel(const QString &url, const QString &text = QString(), QWidget *parent = nullptr); /** * Destructs the label. */ ~KUrlLabel() override; /** * Returns the URL. */ QString url() const; /** * Returns the current tooltip text. */ QString tipText() const; /** * @return true if a tooltip will be displayed. * * @see setTipText() */ bool useTips() const; /** * @return true if the cursor will change while over the URL. * * @see setUseCursor () */ bool useCursor() const; /** * When this is on, the text will switch to the selected * color whenever the mouse passes over it. */ bool isGlowEnabled() const; /** * This feature is very similar to the "glow" feature in that the color of the * label switches to the selected color when the cursor passes * over it. In addition, underlining is turned on for as * long as the mouse is overhead. Note that if "glow" and * underlining are both already turned on, this feature * will have no visible effect. */ bool isFloatEnabled() const; /** * @return the alternate pixmap (may be a null pointer if none was set) */ const QPixmap *alternatePixmap() const; public Q_SLOTS: /** * Turns on or off the underlining. * * When this is on, the * text will be underlined. By default, it is @p true. */ void setUnderline(bool on = true); /** * Sets the URL for this label to @p url. * * @see url */ void setUrl(const QString &url); /** * Overridden for internal reasons; the API remains unaffected. */ virtual void setFont(const QFont &font); /** * Turns on or off the tool tip feature. * * When this is on, the URL will be displayed as a * tooltip whenever the mouse passes passes over it. * By default, it is @p false. */ void setUseTips(bool on = true); /** * Specifies what text to display when tooltips are turned on. * * If this is not used, the tip will default to the URL. * * @see setUseTips() */ void setTipText(const QString &tip); /** * Sets the highlight color. * * This is the default foreground * color (non-selected). By default, it is @p blue. */ void setHighlightedColor(const QColor &highcolor); /** * This is an overloaded version for convenience. * * @see setHighlightedColor() */ void setHighlightedColor(const QString &highcolor); /** * Sets the selected color. * * This is the color the text will change * to when either a mouse passes over it and "glow" mode is on or * when it is selected (clicked). By default, it is @p red. */ void setSelectedColor(const QColor &color); /** * This is an overloaded version for convenience. * * @see setSelectedColor() */ void setSelectedColor(const QString &color); /** * Turns the custom cursor feature on or off. * * When this is on, the cursor will change to a custom cursor * (default is a "pointing hand") whenever the cursor passes * over the label. By default, it is on. * * @param on whether a custom cursor should be displayed. * @param cursor the custom cursor. A null pointer indicates the default "hand cursor". */ void setUseCursor(bool on, QCursor *cursor = nullptr); /** * Turns on or off the "glow" feature. * * When this is on, the text will switch to the * selected color whenever the mouse * passes over it. By default, it is @p true. */ void setGlowEnabled(bool glow = true); /** * Turns on or off the "float" feature. * * This feature is very similar to the "glow" feature in * that the color of the label switches to the selected * color when the cursor passes over it. In addition, * underlining is turned on for as long as the mouse is overhead. * Note that if "glow" and underlining are both already turned * on, this feature will have no visible effect. * By default, it is @p false. */ void setFloatEnabled(bool do_float = true); /** * Sets the "alt" pixmap. * * This pixmap will be displayed when the * cursor passes over the label. The effect is similar to the * trick done with 'onMouseOver' in javascript. * * @see alternatePixmap() */ void setAlternatePixmap(const QPixmap &pixmap); Q_SIGNALS: +#if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 65) /** * Emitted when the mouse has passed over the label. * * @param url The URL for this label. + * @deprecated Since 5.65, use enteredUrl(); */ + KWIDGETSADDONS_DEPRECATED_VERSION(5, 65, "Use KUrlLabel::enteredUrl()") void enteredUrl(const QString &url); - +#endif /** * Emitted when the mouse has passed over the label. */ void enteredUrl(); - +#if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 65) /** * Emitted when the mouse is no longer over the label. * + * @deprecated Since 5.65, use leftUrl(); * @param url The URL for this label. */ + KWIDGETSADDONS_DEPRECATED_VERSION(5, 65, "Use KUrlLabel::leftUrl()") void leftUrl(const QString &url); +#endif /** * Emitted when the mouse is no longer over the label. */ void leftUrl(); - +#if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 65) /** * Emitted when the user clicked the left mouse button on this label. * * @param url The URL for this label. + * @deprecated Since 5.65, use leftClickedUrl(); */ + KWIDGETSADDONS_DEPRECATED_VERSION(5, 65, "Use KUrlLabel::leftClickedUrl()") void leftClickedUrl(const QString &url); - +#endif /** * Emitted when the user clicked the left mouse button on this label. */ void leftClickedUrl(); - +#if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 65) /** * Emitted when the user clicked the right mouse button on this label. * * @param url The URL for this label. + * @deprecated Since 5.65, use rightClickedUrl(); */ + KWIDGETSADDONS_DEPRECATED_VERSION(5, 65, "Use KUrlLabel::rightClickedUrl()") void rightClickedUrl(const QString &url); - +#endif /** * Emitted when the user clicked the right mouse button on this label. */ void rightClickedUrl(); - +#if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 65) /** * Emitted when the user clicked the middle mouse button on this label. * * @param url The URL for this label. + * @deprecated Since 5.65, use middleClickedUrl(const QString &url); */ + KWIDGETSADDONS_DEPRECATED_VERSION(5, 65, "Use KUrlLabel::middleClickedUrl()") void middleClickedUrl(const QString &url); - +#endif /** * Emitted when the user clicked the left mouse button on this label. */ void middleClickedUrl(); protected: /** * Overridden for internal reasons; the API remains unaffected. */ void mouseReleaseEvent(QMouseEvent *) override; /** * Overridden for internal reasons; the API remains unaffected. */ void enterEvent(QEvent *) override; /** * Overridden for internal reasons; the API remains unaffected. */ void leaveEvent(QEvent *) override; /** * Catch parent palette changes */ bool event(QEvent *) override; private: class Private; Private *const d; Q_PRIVATE_SLOT(d, void updateColor()) }; #endif