File indexing completed on 2024-05-12 16:41:07
0001 /******************************************************************************************** 0002 begin : Sunday Jun 27 2008 0003 copyright : (C) 2008 by Mathias Soeken (msoeken@informatik.uni-bremen.de) 0004 copyright : (C) 2005-2006 by Holger Danielsson (holger.danielsson@t-online.de) 0005 ********************************************************************************************/ 0006 0007 /*************************************************************************** 0008 * * 0009 * This program is free software; you can redistribute it and/or modify * 0010 * it under the terms of the GNU General Public License as published by * 0011 * the Free Software Foundation; either version 2 of the License, or * 0012 * (at your option) any later version. * 0013 * * 0014 ***************************************************************************/ 0015 0016 #include "selectcoloraction.h" 0017 0018 #include <QVBoxLayout> 0019 #include <QWidgetAction> 0020 0021 #include <QColorDialog> 0022 #include <QIcon> 0023 #include <KLocalizedString> 0024 #include <QMenu> 0025 #include <QPushButton> 0026 0027 namespace KileDialog { 0028 0029 SelectColorAction::SelectColorAction(const QIcon &icon, const QString &text, QWidget *parent) 0030 : QAction(icon, text, parent) 0031 { 0032 connect(this, &QAction::triggered, this, &SelectColorAction::showDialog); 0033 } 0034 0035 void SelectColorAction::showDialog() 0036 { 0037 QColor color = QColorDialog::getColor(); 0038 if (color.isValid()) { 0039 emit colorSelected(color); 0040 } 0041 } 0042 0043 }