Replaced deprecated QColorDialog::getRgba by QColorDialog::getColor

This commit is contained in:
thunder2 2025-07-21 23:28:21 +02:00
parent 990f4dbf09
commit bdae3b35b4
3 changed files with 9 additions and 12 deletions

View file

@ -1507,10 +1507,9 @@ void ChatWidget::on_markButton_clicked(bool bValue)
void ChatWidget::chooseColor()
{
bool ok;
QRgb color = QColorDialog::getRgba(currentColor.rgba(), &ok, window());
if (ok) {
currentColor = QColor(color);
QColor color = QColorDialog::getColor(currentColor, window(), "", QColorDialog::ShowAlphaChannel);
if (color.isValid()) {
currentColor = color;
PeerSettings->setPrivateChatColor(chatId, currentColor.name());
colorChanged();
setColorAndFont(false);

View file

@ -686,10 +686,9 @@ void ChatPage::on_cbSearch_WithoutLimit_toggled(bool checked)
void ChatPage::on_btSearch_FoundColor_clicked()
{
bool ok;
QRgb color = QColorDialog::getRgba(rgbChatSearchFoundColor, &ok, window());
if (ok) {
rgbChatSearchFoundColor=color;
QColor color = QColorDialog::getColor(QColor::fromRgba(rgbChatSearchFoundColor), window(), "", QColorDialog::ShowAlphaChannel);
if (color.isValid()) {
rgbChatSearchFoundColor = color.rgba();
QPixmap pix(24, 24);
pix.fill(color);
ui.btSearch_FoundColor->setIcon(pix);

View file

@ -123,10 +123,9 @@ void NewTag::textChanged(const QString &text)
void NewTag::setTagColor()
{
bool ok;
QRgb color = QColorDialog::getRgba(m_Color, &ok, this);
if (ok) {
m_Color = color;
QColor color = QColorDialog::getColor(QColor::fromRgba(m_Color), this, "", QColorDialog::ShowAlphaChannel);
if (color.isValid()) {
m_Color = color.rgba();
showColor (m_Color);
}
}