|
@@ -1075,6 +1075,16 @@ void TransmitterSwitch::setCardSize()
|
|
|
// LH_WRITE_LOG_DEBUG(QString("卡片大小:%1*%2").arg(cardWidth).arg(cardHeight));
|
|
|
}
|
|
|
|
|
|
+/* 计算并设置提示文本的位置 */
|
|
|
+void TransmitterSwitch::setTipTextPos()
|
|
|
+{
|
|
|
+ if(m_tipText != nullptr)
|
|
|
+ {
|
|
|
+ QPoint pos = ui->label_Tip->mapTo(this, QPoint(0, 0));
|
|
|
+ m_tipText->move(pos.x() - m_tipText->width(), pos.y() + 32 );
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/* 事件过滤器 */
|
|
|
bool TransmitterSwitch::eventFilter(QObject *watched, QEvent *event)
|
|
|
{
|
|
@@ -1097,11 +1107,7 @@ bool TransmitterSwitch::eventFilter(QObject *watched, QEvent *event)
|
|
|
void TransmitterSwitch::resizeEvent(QResizeEvent *event)
|
|
|
{
|
|
|
/* 设置提示文本的位置 */
|
|
|
- // if(m_tipText != nullptr)
|
|
|
- // {
|
|
|
- // QPoint pos = ui->label_Tip->mapTo(this, ui->label_Tip->pos());
|
|
|
- // m_tipText->move(pos.x() + 2, pos.y() + 2 );
|
|
|
- // }
|
|
|
+ setTipTextPos();
|
|
|
|
|
|
setCardSize();
|
|
|
|
|
@@ -1112,6 +1118,7 @@ void TransmitterSwitch::resizeEvent(QResizeEvent *event)
|
|
|
void TransmitterSwitch::showEvent(QShowEvent *event)
|
|
|
{
|
|
|
/* 设置提示文本的位置 */
|
|
|
+ setTipTextPos();
|
|
|
|
|
|
setCardSize();
|
|
|
|