ui: Fix Qt deprecation messages

Related: https://gitlab.com/wireshark/wireshark/-/issues/18358
This commit is contained in:
Pau Espin 2022-09-21 16:28:35 +02:00
parent 30b309d24c
commit 0c7e8ce9a5
3 changed files with 3 additions and 3 deletions

View File

@ -587,7 +587,7 @@ void AboutDialog::copyActionTriggered(bool copyRow)
int copyColumn = -1;
if (! copyRow)
{
QMenu * menu = qobject_cast<QMenu *>(sendingAction->parentWidget());
QMenu * menu = qobject_cast<QMenu *>(sendingAction->parent());
if (menu)
{
QPoint menuPosOnTable = tree->mapFromGlobal(menu->pos());

View File

@ -41,7 +41,7 @@ void ConversationAction::setPacketInfo(struct _packet_info *pinfo)
setEnabled(enable);
// If we're the "New Coloring Rule" item, enable or disable our parent menu.
QMenu *parent_submenu = qobject_cast<QMenu *>(parentWidget());
QMenu *parent_submenu = qobject_cast<QMenu *>(parent());
if (color_number_ < 0 || !parent_submenu) return;
parent_submenu->setEnabled(enable);
}

View File

@ -90,7 +90,7 @@ public:
}
void showUatDialog() {
UatDialog *uat_dlg = new UatDialog(parentWidget(), prefs_get_uat_value(pref_));
UatDialog *uat_dlg = new UatDialog(qobject_cast<QWidget *>(parent()), prefs_get_uat_value(pref_));
connect(uat_dlg, SIGNAL(destroyed(QObject*)), mainApp, SLOT(flushAppSignals()));
uat_dlg->setWindowModality(Qt::ApplicationModal);
uat_dlg->setAttribute(Qt::WA_DeleteOnClose);