removed some junk code #121

This commit is contained in:
mrexodia 2017-04-10 14:12:42 +02:00
parent 400f6be164
commit e18899b9c8
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8

View File

@ -106,10 +106,7 @@ MemoryWidget::MemoryWidget(MainWindow *main) :
ui->actionSeparate_bytes->setDisabled(true); ui->actionSeparate_bytes->setDisabled(true);
ui->actionRight_align_bytes->setDisabled(true); ui->actionRight_align_bytes->setDisabled(true);
// Event filter to intercept double clicks in the textbox (TODO: this does not work!) // Event filter to intercept double clicks in the textbox
ui->disasTextEdit_2->setMouseTracking(true);
ui->disasTextEdit_2->viewport()->setMouseTracking(true);
ui->disasTextEdit_2->installEventFilter(this);
ui->disasTextEdit_2->viewport()->installEventFilter(this); ui->disasTextEdit_2->viewport()->installEventFilter(this);
// Set Splitter stretch factor // Set Splitter stretch factor
@ -1766,11 +1763,6 @@ void MemoryWidget::resizeEvent(QResizeEvent *event)
bool MemoryWidget::eventFilter(QObject *obj, QEvent *event) bool MemoryWidget::eventFilter(QObject *obj, QEvent *event)
{ {
if(event->type() == QEvent::MouseButtonDblClick || event->type() == QEvent::MouseButtonPress)
QMessageBox::information(this, "double", "double");
qDebug() << "MemoryWidget::eventFilter";
qDebug() << obj;
qDebug() << event;
if ((obj == ui->disasTextEdit_2 || obj == ui->disasTextEdit_2->viewport()) && event->type() == QEvent::MouseButtonDblClick) if ((obj == ui->disasTextEdit_2 || obj == ui->disasTextEdit_2->viewport()) && event->type() == QEvent::MouseButtonDblClick)
{ {
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event); QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
@ -1778,7 +1770,8 @@ bool MemoryWidget::eventFilter(QObject *obj, QEvent *event)
QTextCursor cursor = ui->disasTextEdit_2->cursorForPosition(QPoint(mouseEvent->x(), mouseEvent->y())); QTextCursor cursor = ui->disasTextEdit_2->cursorForPosition(QPoint(mouseEvent->x(), mouseEvent->y()));
cursor.select(QTextCursor::LineUnderCursor); cursor.select(QTextCursor::LineUnderCursor);
QString lastline = cursor.selectedText(); QString lastline = cursor.selectedText();
QString ele = lastline.split(" ", QString::SkipEmptyParts)[0]; auto eles = lastline.split(" ", QString::SkipEmptyParts);
QString ele = eles.isEmpty() ? "" : eles[0];
if (ele.contains("0x")) if (ele.contains("0x"))
{ {
QString jump = ""; QString jump = "";