You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
475 lines
16 KiB
475 lines
16 KiB
#include "point2dWidget.h"
|
|
//Pedico https://www.youtube.com/watch?v=LqXiSBt_DNo
|
|
|
|
point2DWidget::point2DWidget(QWidget *parent, uint8_t Mode): QWidget(parent){
|
|
m_pParent = parent;
|
|
m_pAnimationTimer = NULL;
|
|
m_nX = 0;
|
|
m_nY = 0;
|
|
m_nlX = 0;
|
|
m_nlY = 0;
|
|
m_bPointSize = 5;
|
|
m_bHandleLength = 20;
|
|
m_bBannerWidth = 100;
|
|
m_nMaxX = 0xFFFFFFFF;
|
|
m_nMaxY = 0xFFFFFFFF;
|
|
m_bStyle = Mode;
|
|
m_bMode = 1;
|
|
m_bNSteps = 5;
|
|
m_bLabelHeight = 0;
|
|
m_bDirection = 0;
|
|
m_bAutoHide = false;
|
|
m_bRoundPoint = true;
|
|
m_pPenColor = QColor(255,255,0,255);
|
|
m_pBrushColor = QColor(255, 255, 0, 255);
|
|
m_pTextColor = QColor(0, 0, 0, 255);
|
|
m_pFont.setPointSize(7);
|
|
m_pFont.setBold(true);
|
|
m_pFont.setItalic(false);
|
|
m_pFont.setWeight(75);
|
|
setFont(m_pFont);
|
|
QFontMetrics fm(m_pFont);
|
|
m_LineHeight = fm.height();
|
|
};
|
|
|
|
point2DWidget::~point2DWidget(){
|
|
hide();
|
|
};
|
|
|
|
void point2DWidget::create(uint32_t x, uint32_t y, char *labelLine1, char *labelLine2, char *labelLine3){
|
|
hide();
|
|
m_nX = x;
|
|
m_nY = y;
|
|
m_bLabelHeight = 0;
|
|
QFontMetrics fm(m_pFont);
|
|
m_LineHeight = fm.height();
|
|
int pixelsWideMax = 0;
|
|
if( labelLine1 != NULL ){
|
|
sprintf( m_cLabel[0], "%s", labelLine1 );
|
|
m_bLabelHeight++;
|
|
if( fm.width(labelLine1) > pixelsWideMax ) pixelsWideMax = fm.width(labelLine1)+4;
|
|
};
|
|
if( labelLine2 != NULL ){
|
|
sprintf( m_cLabel[1], "%s", labelLine2 );
|
|
m_bLabelHeight++;
|
|
if( (fm.width(labelLine2)+4) > pixelsWideMax ) pixelsWideMax = fm.width(labelLine2)+4;
|
|
};
|
|
if( labelLine3 != NULL ){
|
|
sprintf( m_cLabel[2], "%s", labelLine3 );
|
|
m_bLabelHeight++;
|
|
if( (fm.width(labelLine3)+4) > pixelsWideMax ) pixelsWideMax = fm.width(labelLine3)+4;
|
|
};
|
|
if( m_bLabelHeight ){
|
|
m_bBannerWidth = pixelsWideMax;
|
|
if( m_nY < ( m_nMaxY / 3 ) ){
|
|
if( m_nX < ( m_nMaxX / 3 ) ){
|
|
m_bDirection = 1;
|
|
} else if( m_nX > ( ( m_nMaxX >> 1 ) + m_nMaxX / 3 ) ){
|
|
m_bDirection = 2;
|
|
} else {
|
|
m_bDirection = 3;
|
|
};
|
|
} else if( m_nY > ( ( m_nMaxY >> 1 ) + m_nMaxY / 3 ) ){
|
|
if( m_nX < ( m_nMaxX / 3 ) ){
|
|
m_bDirection = 4;
|
|
} else if( m_nX > ( ( m_nMaxX >> 1 ) + m_nMaxX / 3 ) ){
|
|
m_bDirection = 5;
|
|
} else {
|
|
m_bDirection = 6;
|
|
};
|
|
} else {
|
|
if( m_nX < ( m_nMaxX / 3 ) ){
|
|
m_bDirection = 7;
|
|
} else if( m_nX > ( ( m_nMaxX >> 1 ) + m_nMaxX / 3 ) ){
|
|
m_bDirection = 8;
|
|
} else {
|
|
//m_bDirection = 9;
|
|
m_bDirection = 1 + (7*rand())/RAND_MAX;
|
|
};
|
|
};
|
|
//m_bDirection = 5;
|
|
switch( m_bDirection ){
|
|
case 1:
|
|
//Down ... Right
|
|
setGeometry(
|
|
m_nX - m_bPointSize,
|
|
m_nY - m_bPointSize,
|
|
m_bBannerWidth + ( m_bPointSize << 1 ) + m_bHandleLength,
|
|
m_bPointSize + m_bHandleLength + ( m_LineHeight * m_bLabelHeight )
|
|
);
|
|
m_nlX = m_bPointSize;
|
|
m_nlY = m_bPointSize;
|
|
break;
|
|
case 2:
|
|
//Down ... Left
|
|
setGeometry(
|
|
m_nX - ( m_bBannerWidth + ( m_bPointSize << 1 ) + m_bHandleLength ) + m_bPointSize,
|
|
m_nY - m_bPointSize,
|
|
m_bBannerWidth + ( m_bPointSize << 1 ) + m_bHandleLength,
|
|
m_bPointSize + m_bHandleLength + ( m_LineHeight * m_bLabelHeight )
|
|
);
|
|
m_nlX = m_bBannerWidth + m_bHandleLength + m_bPointSize;
|
|
m_nlY = m_bPointSize;
|
|
break;
|
|
case 3:
|
|
//Down ... Center
|
|
setGeometry(
|
|
m_nX - ( m_bBannerWidth >> 1 ),
|
|
m_nY - m_bPointSize,
|
|
m_bBannerWidth + 4,
|
|
m_bPointSize + m_bHandleLength + ( m_LineHeight * m_bLabelHeight )
|
|
);
|
|
m_nlX = m_bBannerWidth >> 1;
|
|
m_nlY = m_bPointSize;
|
|
break;
|
|
case 4:
|
|
//Up ... Right
|
|
setGeometry(
|
|
m_nX - m_bPointSize,
|
|
m_nY - m_bHandleLength - ( m_LineHeight * m_bLabelHeight ),
|
|
m_bBannerWidth + ( m_bPointSize << 1 ) + m_bHandleLength,
|
|
m_bPointSize + m_bHandleLength + ( m_LineHeight * m_bLabelHeight )
|
|
);
|
|
m_nlX = m_bPointSize;
|
|
m_nlY = m_bHandleLength + ( m_LineHeight * m_bLabelHeight );
|
|
break;
|
|
case 5:
|
|
//Up ... Left
|
|
setGeometry(
|
|
m_nX - ( m_bBannerWidth + ( m_bPointSize << 1 ) + m_bHandleLength ) + m_bPointSize,
|
|
m_nY - m_bHandleLength - ( m_LineHeight * m_bLabelHeight ),
|
|
m_bBannerWidth + ( m_bPointSize << 1 ) + m_bHandleLength,
|
|
m_bPointSize + m_bHandleLength + ( m_LineHeight * m_bLabelHeight )
|
|
);
|
|
m_nlX = m_bBannerWidth + m_bHandleLength + m_bPointSize;
|
|
m_nlY = m_bHandleLength + ( m_LineHeight * m_bLabelHeight );
|
|
break;
|
|
case 6:
|
|
//Up ... Center
|
|
setGeometry(
|
|
m_nX - ( m_bBannerWidth >> 1 ),
|
|
m_nY - ( m_bHandleLength + ( m_LineHeight * m_bLabelHeight )),
|
|
m_bBannerWidth + 4,
|
|
m_bPointSize + m_bHandleLength + ( m_LineHeight * m_bLabelHeight )
|
|
);
|
|
m_nlX = m_bBannerWidth >> 1;
|
|
m_nlY = ( m_bHandleLength + ( m_LineHeight * m_bLabelHeight ));
|
|
break;
|
|
case 7:
|
|
//Middle ... Right
|
|
setGeometry(
|
|
m_nX - m_bPointSize,
|
|
m_nY - m_bPointSize-8,
|
|
m_bBannerWidth + m_bPointSize + m_bHandleLength,
|
|
m_LineHeight * m_bLabelHeight + 4
|
|
);
|
|
m_nlX = m_bPointSize;
|
|
m_nlY = (( m_LineHeight * m_bLabelHeight ) >> 1 ) + 2;
|
|
break;
|
|
case 8:
|
|
//Middle ... Left
|
|
setGeometry(
|
|
m_nX - m_bBannerWidth - m_bHandleLength,
|
|
m_nY - m_bPointSize-8,
|
|
m_bBannerWidth + m_bPointSize + m_bHandleLength,
|
|
m_LineHeight * m_bLabelHeight + 4
|
|
);
|
|
m_nlX = m_bBannerWidth + m_bHandleLength;
|
|
m_nlY = (( m_LineHeight * m_bLabelHeight ) >> 1 ) + 2;
|
|
break;
|
|
//case 9: setGeometry(m_nX-50, m_nY - 50, 100, 100); break;//Middle ... Center
|
|
};
|
|
} else {
|
|
m_bDirection = 0;
|
|
};
|
|
m_bMode = 0;
|
|
m_nAuxCounter = 0;
|
|
if( m_bAutoHide ) m_nAutohideCounter = m_nAutoHideInterval;
|
|
if( m_pAnimationTimer == NULL ){
|
|
m_pAnimationTimer = new QTimer();
|
|
if ( m_pAnimationTimer != NULL){
|
|
connect(m_pAnimationTimer, &QTimer::timeout, this, &point2DWidget::handleTimer);
|
|
};
|
|
};
|
|
if ( m_pAnimationTimer != NULL){
|
|
//connect(m_pAnimationTimer, &QTimer::timeout, this, &point2DWidget::handleTimer);
|
|
//if( m_pAnimationTimer->isActive() ) m_pAnimationTimer->stop();
|
|
m_pAnimationTimer->start(25);
|
|
};
|
|
show();
|
|
};
|
|
void point2DWidget::setAutoHide( bool ah, uint32_t interval){
|
|
m_bAutoHide = ah;
|
|
m_nAutohideCounter = m_nAutoHideInterval = interval;
|
|
};
|
|
void point2DWidget::setMaxValues(uint32_t x, uint32_t y){
|
|
m_nMaxX = x;
|
|
m_nMaxY = y;
|
|
};
|
|
|
|
void point2DWidget::paintEvent(QPaintEvent*){
|
|
QPainter p(this);
|
|
p.setPen(m_pPenColor);
|
|
p.setBrush(m_pPenColor);
|
|
switch(m_bMode){
|
|
case 0:
|
|
//expand Point
|
|
m_nAuxCounter++;
|
|
if(m_bRoundPoint){
|
|
p.drawEllipse(m_nlX - (m_nAuxCounter >> 1), m_nlY - (m_nAuxCounter >> 1), m_nAuxCounter, m_nAuxCounter);
|
|
}else{
|
|
p.drawRect(m_nlX - (m_nAuxCounter >> 1), m_nlY - (m_nAuxCounter >> 1), m_nAuxCounter, m_nAuxCounter);
|
|
};
|
|
if (m_nAuxCounter == m_bPointSize) {
|
|
if( m_bLabelHeight ){
|
|
m_nAuxCounter = m_bNSteps;
|
|
m_bMode = 4;
|
|
} else {
|
|
m_nAuxCounter = 0;
|
|
m_bMode = 5;
|
|
if( m_bAutoHide ) m_nAutohideCounter = m_nAutoHideInterval;
|
|
};
|
|
};
|
|
break;
|
|
case 4:
|
|
//expand Box;
|
|
m_nAuxCounter--;
|
|
if(m_bRoundPoint){
|
|
p.drawEllipse(m_nlX - (m_bPointSize >> 1), m_nlY - (m_bPointSize >> 1), m_bPointSize, m_bPointSize);
|
|
}else{
|
|
p.drawRect(m_nlX - (m_bPointSize >> 1), m_nlY - (m_bPointSize >> 1), m_bPointSize, m_bPointSize);
|
|
};
|
|
switch( m_bDirection ){
|
|
case 1:
|
|
p.drawLine(m_nlX, m_nlY, m_nlX + m_bHandleLength, m_nlY + m_bHandleLength);
|
|
p.setBrush(m_pBrushColor);
|
|
p.drawRect(
|
|
m_nlX + m_bHandleLength,
|
|
m_nlY + m_bHandleLength - (( m_LineHeight * m_bLabelHeight ) >> 1 ),
|
|
(m_bBannerWidth - (m_bBannerWidth *m_nAuxCounter / m_bNSteps)),
|
|
m_LineHeight * m_bLabelHeight
|
|
);
|
|
break;
|
|
case 2:
|
|
p.drawLine(m_nlX, m_nlY, m_nlX - m_bHandleLength, m_nlY + m_bHandleLength);
|
|
p.setBrush(m_pBrushColor);
|
|
p.drawRect(
|
|
m_nlX - m_bHandleLength - (m_bBannerWidth - (m_bBannerWidth *m_nAuxCounter / m_bNSteps)),
|
|
m_nlY + m_bHandleLength - (( m_LineHeight * m_bLabelHeight ) >> 1 ),
|
|
(m_bBannerWidth - (m_bBannerWidth *m_nAuxCounter / m_bNSteps)),
|
|
m_LineHeight * m_bLabelHeight
|
|
);
|
|
break;
|
|
case 3:
|
|
p.drawLine(m_nlX, m_nlY, m_nlX, m_nlY + m_bHandleLength);
|
|
p.setBrush(m_pBrushColor);
|
|
p.drawRect(
|
|
m_nlX - ((m_bBannerWidth - (m_bBannerWidth *m_nAuxCounter / m_bNSteps)) >> 1 ),
|
|
m_nlY + m_bHandleLength,
|
|
(m_bBannerWidth - (m_bBannerWidth *m_nAuxCounter / m_bNSteps)),
|
|
m_LineHeight * m_bLabelHeight
|
|
);
|
|
break;
|
|
case 4:
|
|
p.drawLine(m_nlX, m_nlY, m_nlX + m_bHandleLength, m_nlY - m_bHandleLength);
|
|
p.setBrush(m_pBrushColor);
|
|
p.drawRect(
|
|
m_nlX + m_bHandleLength,
|
|
m_nlY - m_bHandleLength - (( m_LineHeight * m_bLabelHeight ) >> 1 ),
|
|
(m_bBannerWidth - (m_bBannerWidth *m_nAuxCounter / m_bNSteps)),
|
|
m_LineHeight * m_bLabelHeight
|
|
);
|
|
break;
|
|
case 5:
|
|
p.drawLine(m_nlX, m_nlY, m_nlX - m_bHandleLength, m_nlY - m_bHandleLength);
|
|
p.setBrush(m_pBrushColor);
|
|
p.drawRect(
|
|
m_nlX - m_bHandleLength - (m_bBannerWidth - (m_bBannerWidth *m_nAuxCounter / m_bNSteps)),
|
|
m_nlY - m_bHandleLength - (( m_LineHeight * m_bLabelHeight ) >> 1 ),
|
|
(m_bBannerWidth - (m_bBannerWidth *m_nAuxCounter / m_bNSteps)),
|
|
m_LineHeight * m_bLabelHeight
|
|
);
|
|
break;
|
|
case 6:
|
|
p.drawLine(m_nlX, m_nlY, m_nlX, m_nlY - m_bHandleLength);
|
|
p.setBrush(m_pBrushColor);
|
|
p.drawRect(
|
|
m_nlX - ((m_bBannerWidth - (m_bBannerWidth *m_nAuxCounter / m_bNSteps)) >> 1 ),
|
|
m_nlY - m_bHandleLength - (m_LineHeight * m_bLabelHeight),
|
|
(m_bBannerWidth - (m_bBannerWidth *m_nAuxCounter / m_bNSteps)),
|
|
m_LineHeight * m_bLabelHeight
|
|
);
|
|
break;
|
|
case 7:
|
|
p.drawLine(m_nlX, m_nlY, m_nlX+m_bHandleLength+m_bBannerWidth, m_nlY );
|
|
p.setBrush(m_pBrushColor);
|
|
p.drawRect(
|
|
m_nlX + m_bHandleLength,
|
|
m_nlY - (((m_LineHeight * m_bLabelHeight) - ((m_LineHeight * m_bLabelHeight) *m_nAuxCounter / m_bNSteps)) >> 1 ),
|
|
m_bBannerWidth,
|
|
(m_LineHeight * m_bLabelHeight) - ((m_LineHeight * m_bLabelHeight) *m_nAuxCounter / m_bNSteps)
|
|
);
|
|
break;
|
|
case 8:
|
|
p.drawLine(m_nlX, m_nlY, m_nlX-m_bHandleLength-m_bBannerWidth, m_nlY );
|
|
p.setBrush(m_pBrushColor);
|
|
p.drawRect(
|
|
m_nlX - m_bHandleLength - m_bBannerWidth,
|
|
m_nlY - (((m_LineHeight * m_bLabelHeight) - ((m_LineHeight * m_bLabelHeight) *m_nAuxCounter / m_bNSteps)) >> 1 ),
|
|
m_bBannerWidth,
|
|
(m_LineHeight * m_bLabelHeight) - ((m_LineHeight * m_bLabelHeight) *m_nAuxCounter / m_bNSteps)
|
|
);
|
|
break;
|
|
};
|
|
if (m_nAuxCounter == 0){
|
|
m_bMode = 5;
|
|
if( m_bAutoHide ) m_nAutohideCounter = m_nAutoHideInterval;
|
|
};
|
|
break;
|
|
default:
|
|
//draw static
|
|
p.setBrush(m_pBrushColor);
|
|
if(m_bRoundPoint){
|
|
p.drawEllipse(m_nlX - (m_bPointSize >> 1), m_nlY - (m_bPointSize >> 1), m_bPointSize, m_bPointSize);
|
|
}else{
|
|
p.drawRect(m_nlX - (m_bPointSize >> 1), m_nlY - (m_bPointSize >> 1), m_bPointSize, m_bPointSize);
|
|
};
|
|
if( m_bLabelHeight ){
|
|
switch( m_bDirection ){
|
|
case 1:
|
|
p.drawLine(m_nlX, m_nlY, m_nlX + m_bHandleLength, m_nlY + m_bHandleLength);
|
|
p.drawRect(
|
|
m_nlX + m_bHandleLength,
|
|
m_nlY + m_bHandleLength- (( m_LineHeight * m_bLabelHeight ) >> 1 ),
|
|
m_bBannerWidth,
|
|
m_LineHeight * m_bLabelHeight
|
|
);
|
|
p.setBrush(QColor(0, 0, 0, 0));
|
|
p.setPen(m_pTextColor);
|
|
for( int index = 0; index < m_bLabelHeight; index++ ){
|
|
p.drawText( m_nlX + m_bHandleLength + 3, m_nlY + m_bHandleLength - 2 - (( m_LineHeight * m_bLabelHeight ) >> 1 ) + (index+1) * m_LineHeight, m_cLabel[index] );
|
|
};
|
|
break;
|
|
case 2:
|
|
p.drawLine(m_nlX, m_nlY, m_nlX - m_bHandleLength, m_nlY + m_bHandleLength);
|
|
p.drawRect(
|
|
m_nlX - m_bHandleLength - m_bBannerWidth,
|
|
m_nlY + m_bHandleLength - (( m_LineHeight * m_bLabelHeight ) >> 1 ),
|
|
m_bBannerWidth,
|
|
m_LineHeight * m_bLabelHeight
|
|
);
|
|
p.setBrush(QColor(0, 0, 0, 0));
|
|
p.setPen(m_pTextColor);
|
|
for( int index = 0; index < m_bLabelHeight; index++ ){
|
|
p.drawText( m_nlX - m_bHandleLength - m_bBannerWidth + 3, m_nlY + m_bHandleLength - 2 - (( m_LineHeight * m_bLabelHeight ) >> 1 ) + (index+1) * m_LineHeight, m_cLabel[index] );
|
|
};
|
|
break;
|
|
case 3:
|
|
p.drawLine(m_nlX, m_nlY, m_nlX, m_nlY + m_bHandleLength);
|
|
p.drawRect(
|
|
m_nlX - ( m_bBannerWidth >> 1 ),
|
|
m_nlY + m_bHandleLength,
|
|
m_bBannerWidth,
|
|
m_LineHeight * m_bLabelHeight
|
|
);
|
|
p.setBrush(QColor(0, 0, 0, 0));
|
|
p.setPen(m_pTextColor);
|
|
for( int index = 0; index < m_bLabelHeight; index++ ){
|
|
p.drawText( m_nlX - ( m_bBannerWidth >> 1 ) + 3, m_nlY + m_bHandleLength - 2 + (index+1) * m_LineHeight, m_cLabel[index] );
|
|
};
|
|
break;
|
|
case 4:
|
|
p.drawLine(m_nlX, m_nlY, m_nlX + m_bHandleLength, m_nlY - m_bHandleLength);
|
|
p.drawRect(
|
|
m_nlX + m_bHandleLength,
|
|
m_nlY - m_bHandleLength- (( m_LineHeight * m_bLabelHeight ) >> 1 ),
|
|
m_bBannerWidth,
|
|
m_LineHeight * m_bLabelHeight
|
|
);
|
|
p.setBrush(QColor(0, 0, 0, 0));
|
|
p.setPen(m_pTextColor);
|
|
for( int index = 0; index < m_bLabelHeight; index++ ){
|
|
p.drawText( m_nlX + m_bHandleLength + 3, m_nlY - m_bHandleLength - 2 - (( m_LineHeight * m_bLabelHeight ) >> 1 ) + (index+1) * m_LineHeight, m_cLabel[index] );
|
|
};
|
|
break;
|
|
case 5:
|
|
p.drawLine(m_nlX, m_nlY, m_nlX - m_bHandleLength, m_nlY - m_bHandleLength);
|
|
p.drawRect(
|
|
m_nlX - m_bHandleLength - m_bBannerWidth,
|
|
m_nlY - m_bHandleLength - (( m_LineHeight * m_bLabelHeight ) >> 1 ),
|
|
m_bBannerWidth,
|
|
m_LineHeight * m_bLabelHeight
|
|
);
|
|
p.setBrush(QColor(0, 0, 0, 0));
|
|
p.setPen(m_pTextColor);
|
|
for( int index = 0; index < m_bLabelHeight; index++ ){
|
|
p.drawText( m_nlX - m_bHandleLength - m_bBannerWidth + 3, m_nlY - m_bHandleLength - 2 - (( m_LineHeight * m_bLabelHeight ) >> 1 ) + (index+1) * m_LineHeight, m_cLabel[index] );
|
|
};
|
|
break;
|
|
case 6:
|
|
p.drawLine(m_nlX, m_nlY, m_nlX, m_nlY - m_bHandleLength);
|
|
p.drawRect(
|
|
m_nlX - ( m_bBannerWidth >> 1 ),
|
|
m_nlY - m_bHandleLength - (m_LineHeight * m_bLabelHeight),
|
|
m_bBannerWidth,
|
|
m_LineHeight * m_bLabelHeight
|
|
);
|
|
p.setBrush(QColor(0, 0, 0, 0));
|
|
p.setPen(m_pTextColor);
|
|
for( int index = 0; index < m_bLabelHeight; index++ ){
|
|
p.drawText( m_nlX - ( m_bBannerWidth >> 1 ) + 3, m_nlY - m_bHandleLength - 2 - (index) * m_LineHeight, m_cLabel[index] );
|
|
};
|
|
break;
|
|
case 7:
|
|
p.drawLine(m_nlX, m_nlY, m_nlX+m_bHandleLength, m_nlY );
|
|
p.drawRect(
|
|
m_nlX + m_bHandleLength,
|
|
m_nlY - ((m_LineHeight * m_bLabelHeight) >> 1 ),
|
|
m_bBannerWidth,
|
|
(m_LineHeight * m_bLabelHeight)
|
|
);
|
|
p.setBrush(QColor(0, 0, 0, 0));
|
|
p.setPen(m_pTextColor);
|
|
for( int index = 0; index < m_bLabelHeight; index++ ){
|
|
p.drawText( 3+m_bHandleLength+m_bPointSize, ( index + 1 ) * m_LineHeight, m_cLabel[index] );
|
|
};
|
|
break;
|
|
case 8:
|
|
p.drawLine(m_nlX, m_nlY, m_nlX-m_bHandleLength-m_bBannerWidth, m_nlY );
|
|
p.drawRect(
|
|
m_nlX - m_bHandleLength - m_bBannerWidth,
|
|
m_nlY - ((m_LineHeight * m_bLabelHeight) >> 1 ),
|
|
m_bBannerWidth,
|
|
(m_LineHeight * m_bLabelHeight)
|
|
);
|
|
p.setBrush(QColor(0, 0, 0, 0));
|
|
p.setPen(m_pTextColor);
|
|
for( int index = 0; index < m_bLabelHeight; index++ ){
|
|
p.drawText( 3, ( index + 1 ) * m_LineHeight, m_cLabel[index] );
|
|
};
|
|
break;
|
|
};
|
|
};
|
|
break;
|
|
};
|
|
//p.setPen(Qt::red);
|
|
//p.drawPoint(m_nlX, m_nlY);
|
|
//p.setBrush(QColor(0, 0, 0, 0));
|
|
//p.drawRect( 0, 0, width()-1, height()-1);
|
|
};
|
|
|
|
void point2DWidget::handleTimer(){
|
|
if( m_bMode == 5 ){
|
|
if( m_bAutoHide ){
|
|
if( m_nAutohideCounter > 0 ){
|
|
m_nAutohideCounter--;
|
|
update();
|
|
} else {
|
|
m_pAnimationTimer->stop();
|
|
hide();
|
|
};
|
|
} else m_pAnimationTimer->stop();
|
|
} else {
|
|
update();
|
|
};
|
|
};
|