|
|
|
@ -424,7 +424,7 @@ void MessageView::updateBytesSectionSize() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MessageView::headerContextMenuEvent(const QPoint &pos) { |
|
|
|
|
QMenu *menu = new QMenu(this); |
|
|
|
|
QMenu menu(this); |
|
|
|
|
int cur_index = header()->logicalIndexAt(pos); |
|
|
|
|
|
|
|
|
|
QAction *action; |
|
|
|
@ -434,9 +434,9 @@ void MessageView::headerContextMenuEvent(const QPoint &pos) { |
|
|
|
|
|
|
|
|
|
// Hide show action
|
|
|
|
|
if (header()->isSectionHidden(logical_index)) { |
|
|
|
|
action = menu->addAction(tr(" %1").arg(column_name), [=]() { header()->showSection(logical_index); }); |
|
|
|
|
action = menu.addAction(tr(" %1").arg(column_name), [=]() { header()->showSection(logical_index); }); |
|
|
|
|
} else { |
|
|
|
|
action = menu->addAction(tr("✓ %1").arg(column_name), [=]() { header()->hideSection(logical_index); }); |
|
|
|
|
action = menu.addAction(tr("✓ %1").arg(column_name), [=]() { header()->hideSection(logical_index); }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Can't hide the name column
|
|
|
|
@ -450,7 +450,7 @@ void MessageView::headerContextMenuEvent(const QPoint &pos) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
menu->popup(header()->mapToGlobal(pos)); |
|
|
|
|
menu.exec(header()->mapToGlobal(pos)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
MessageViewHeader::MessageViewHeader(QWidget *parent) : QHeaderView(Qt::Horizontal, parent) { |
|
|
|
|