代码拉取完成,页面将自动刷新
#ifndef CONVERSION_H
#define CONVERSION_H
#include "shapecontroller.h"
#include <QSet>
#include <QLabel>
QString rgbToString(QRgb rgb);
QRgb stringToRgb(const QString &argb);
class Convertor : public QLabel
{
Q_OBJECT
public:
Convertor(QWidget *parent = 0);
~Convertor();
void clear();
bool track() { return m_track; }
void setTrack(bool track) { m_track = track; emit trackChanged(track); }
void setImage(const QImage &image);
void setShape(ShapeController::Shape shape) { m_shapeController.setShape(shape); }
bool convertColorSet(QRgb to_argb); //转换combobox内的颜色
bool convertSelectBoxToColor(QRgb to_argb); //转换选择框框内的颜色
bool convertToColor(QRgb from_argb, QRgb to_argb); //将from_argb转换到to_argb
bool hasSelectBox() { return m_hasSelectBox; }
QSet<QString> getColorSet() const { return m_colorSet; }
protected:
void paintEvent(QPaintEvent *event) override;
void dragEnterEvent(QDragEnterEvent *event) override;
void dragMoveEvent(QDragMoveEvent *event) override;
void dragLeaveEvent(QDragLeaveEvent *event) override;
void dropEvent(QDropEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
signals:
void finished();
void trackChanged(bool arg);
void selectBoxChanged();
void currentColorChanged(const QString &argb);
private:
bool m_track;
bool m_hasSelectBox;
QImage m_image;
QSet<QString> m_colorSet;
ShapeController m_shapeController;
};
#endif // CONVERSION_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。