From 8cbd09afd564a550bee8a641caf6b8ca3e3417c9 Mon Sep 17 00:00:00 2001 From: trafalgar Date: Thu, 22 Aug 2024 02:09:11 +0800 Subject: [PATCH] rename CefJsDialogType enum value --- include/QCefView.h | 6 +++--- src/QCefView.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/QCefView.h b/include/QCefView.h index 6a406d10..3469d1d8 100644 --- a/include/QCefView.h +++ b/include/QCefView.h @@ -64,9 +64,9 @@ class QCEFVIEW_EXPORT QCefView : public QWidget /// enum CefJsDialogType { - JSDIALOGTYPE_ALERT = 0, - JSDIALOGTYPE_CONFIRM, - JSDIALOGTYPE_PROMPT, + CefJsDialogTypeAlert = 0, + CefJsDialogTypeConfirm, + CefJsDialogTypePrompt }; Q_ENUM(CefJsDialogType) diff --git a/src/QCefView.cpp b/src/QCefView.cpp index a4fd0f7f..b7e7cbbc 100644 --- a/src/QCefView.cpp +++ b/src/QCefView.cpp @@ -340,15 +340,15 @@ QCefView::onJsDialog(const QString& originUrl, suppressMessage = false; QMessageBox::StandardButton button = QMessageBox::NoButton; - if (dialogType == QCefView::CefJsDialogType::JSDIALOGTYPE_ALERT) { + if (dialogType == QCefView::CefJsDialogType::CefJsDialogTypeAlert) { button = QMessageBox::warning(this, "Alert", messageText); callbackResult.first = true; callbackResult.second = ""; - } else if (dialogType == QCefView::CefJsDialogType::JSDIALOGTYPE_CONFIRM) { + } else if (dialogType == QCefView::CefJsDialogType::CefJsDialogTypeConfirm) { button = QMessageBox::question(this, "Confirm", messageText, QMessageBox::Yes | QMessageBox::No); callbackResult.first = button == QMessageBox::Yes; callbackResult.second = ""; - } else if (dialogType == QCefView::CefJsDialogType::JSDIALOGTYPE_PROMPT) { + } else if (dialogType == QCefView::CefJsDialogType::CefJsDialogTypePrompt) { bool ok = false; QString text = QInputDialog::getText(this, "Prompt", messageText, QLineEdit::Normal, defaultPromptText, &ok); if (ok) {