X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fcolorbutton.cpp;h=c4e0c715c4fb58af54d756aa38844213cee9364e;hp=fae61703c7cee680913ccf6764f0490b5a6a42ed;hb=HEAD;hpb=1cb02004ee5973b89368bd84f234d4652794690d diff --git a/src/uisupport/colorbutton.cpp b/src/uisupport/colorbutton.cpp index fae61703..1b1ccf38 100644 --- a/src/uisupport/colorbutton.cpp +++ b/src/uisupport/colorbutton.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 by the Quassel Project * + * Copyright (C) 2005-2022 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -20,24 +20,19 @@ #include "colorbutton.h" +#include #include #include #include -#ifdef HAVE_KDE4 -# include -#else -# include -#endif - -ColorButton::ColorButton(QWidget *parent) : QToolButton(parent) +ColorButton::ColorButton(QWidget* parent) + : QToolButton(parent) { setText(""); - connect(this, SIGNAL(clicked()), SLOT(chooseColor())); + connect(this, &QAbstractButton::clicked, this, &ColorButton::chooseColor); } - -void ColorButton::setColor(const QColor &color) +void ColorButton::setColor(const QColor& color) { _color = color; QPixmap pixmap(QSize(32, 32)); @@ -47,22 +42,14 @@ void ColorButton::setColor(const QColor &color) emit colorChanged(color); } - QColor ColorButton::color() const { return _color; } - void ColorButton::chooseColor() { -#ifdef HAVE_KDE4 - QColor c = color(); - KColorDialog::getColor(c, this); -#else QColor c = QColorDialog::getColor(color(), this); -#endif - if (c.isValid()) { setColor(c); }