X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fuisupport%2Fcolorbutton.cpp;h=f9a758717a229d20e21c97da1a85c9fc4fdf5e93;hb=7c0eb0111b70089f563ee793e2b52036b76ca643;hp=29327e8158f886962ba6c1699c7a17222ae8303b;hpb=04315f46a16fc3627218377071e008b6b9744992;p=quassel.git diff --git a/src/uisupport/colorbutton.cpp b/src/uisupport/colorbutton.cpp index 29327e81..f9a75871 100644 --- a/src/uisupport/colorbutton.cpp +++ b/src/uisupport/colorbutton.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2013 by the Quassel Project * + * Copyright (C) 2005-2018 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_KDE -# 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_KDE - QColor c = color(); - KColorDialog::getColor(c, this); -#else QColor c = QColorDialog::getColor(color(), this); -#endif - if (c.isValid()) { setColor(c); }