Skip to content

Commit

Permalink
KSTChat: Fixed issues under Qt5.12
Browse files Browse the repository at this point in the history
  • Loading branch information
foldynl committed Sep 10, 2023
1 parent 25488ca commit 2879e6f
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions ui/KSTChatWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,17 +389,36 @@ void MessageDelegate::paint(QPainter *painter,
switch ( index.data(Qt::UserRole).toInt() )
{
case ChatMessageModel::MessageDirection::OUTGOING:
bgcolor = QColorConstants::LightGray;
bgcolor =
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QColorConstants::LightGray;
#else
QColor(Qt::lightGray);
#endif
break;
case ChatMessageModel::MessageDirection::INCOMING_TOYOU:
bgcolor = QColorConstants::Green;
bgcolor =
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QColorConstants::Green;
#else
QColor(Qt::green);
#endif
break;
case ChatMessageModel::MessageDirection::INCOMING_HIGHLIGHT:
bgcolor = QColorConstants::Red;
bgcolor =
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QColorConstants::Red;
#else
QColor(Qt::red);
#endif
break;
default:
bgcolor = QColorConstants::Cyan;

bgcolor =
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QColorConstants::Cyan;
#else
QColor(Qt::cyan);
#endif
}

// create chat bubble
Expand Down

0 comments on commit 2879e6f

Please sign in to comment.