新增颜色拾取器

This commit is contained in:
feiyangqingyun
2019-10-15 16:13:10 +08:00
parent 534c165c16
commit e33f7818b4
5 changed files with 277 additions and 1 deletions

55
colorwidget/colorwidget.h Normal file
View File

@@ -0,0 +1,55 @@
#ifndef COLORWIDGET_H
#define COLORWIDGET_H
#include <QWidget>
class QGridLayout;
class QVBoxLayout;
class QLabel;
class QLineEdit;
#ifdef quc
#if (QT_VERSION < QT_VERSION_CHECK(5,7,0))
#include <QtDesigner/QDesignerExportWidget>
#else
#include <QtUiPlugin/QDesignerExportWidget>
#endif
class QDESIGNER_WIDGET_EXPORT ColorWidget : public QWidget
#else
class ColorWidget : public QWidget
#endif
{
Q_OBJECT
public:
static ColorWidget *Instance();
explicit ColorWidget(QWidget *parent = 0);
~ColorWidget();
protected:
void mousePressEvent(QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *);
private:
static ColorWidget *instance;
QClipboard *cp;
bool pressed;
QTimer *timer;
QGridLayout *gridLayout;
QVBoxLayout *verticalLayout;
QLabel *labColor;
QLabel *label;
QLabel *labWeb;
QLineEdit *txtWeb;
QLabel *labRgb;
QLineEdit *txtRgb;
QLabel *labPoint;
QLineEdit *txtPoint;
private Q_SLOTS:
void showColorValue();
};
#endif // COLORWIDGET_H