# define QCOL_H
# include & lt; QWidget>
# include & lt; QPainter>
# include & lt; QMouseEvent>
# include & lt; Math. H>
# include & lt; QMainWindow>
The class QCol: public QWidget
{
Q_OBJECT
Public:
QCol (QWidget * parent=0);
QSize minimumSizeHint () const;
QSize sizeHint () const;
~ QCol ();
Signals:
Void colorChanged (QColor);
Public slots:
Protected:
Void paintEvent (QPaintEvent *);
Void mousePressEvent (QMouseEvent *);
Void mouseMoveEvent (QMouseEvent *);
Void paintBorder ();
Void paintBar ();
Void paintValue ();
Void paintText ();
Private:
Double redY.
Double greenY.
Double blueY;
Double opY;
Double redyp;
Double greenyp;
Double blueyp;
Double opyp;
};
This is the header file, it is an RGB, I want to use another kind of signaling opened his, how to do ah
# endif//QCOL_H
CodePudding user response:
The connect signal, write this - in the groove function & gt; show();CodePudding user response:
If QCol is global, you can directly call QCol open QCol static method, need not use signal channel,CodePudding user response:
In the base class to write emitWrite the connect in QCol class
CodePudding user response: