void ChatPage::fillPreview(QListWidget *listWidget, QComboBox *comboBox, QTextBrowser *textBrowser) { QListWidgetItem *item = listWidget->currentItem(); if (item) { ChatStyleInfo info = item->data(Qt::UserRole).value<ChatStyleInfo>(); setPreviewMessages(info.stylePath, comboBox->currentText(), textBrowser); } else { textBrowser->clear(); } }
void ChatPage::fillPreview(QComboBox *listWidget, QComboBox *comboBox, QTextBrowser *textBrowser) { ChatStyleInfo info = listWidget->itemData(listWidget->currentIndex(),Qt::UserRole).value<ChatStyleInfo>(); setPreviewMessages(info.stylePath, comboBox->currentText(), textBrowser); }