mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-18 18:38:51 +00:00
Revert "Workaround for Qt5.8 WebEngine (#92)"
This reverts commit 08e6e4d13c
.
This commit is contained in:
parent
08e6e4d13c
commit
0dc64f8eac
@ -9,20 +9,10 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui WebKit WebKitWidgets)
|
||||
|
||||
set(QT_USE_MODULES Core Widgets Gui)
|
||||
find_package(Qt5 REQUIRED COMPONENTS ${QT_USE_MODULES})
|
||||
if (Qt5_VERSION_MINOR GREATER 7)
|
||||
list(APPEND QT_USE_MODULES WebEngine WebEngineWidgets)
|
||||
message("Using QT5 WebEngine instead WebKit")
|
||||
add_definitions(-DUSE_WEBENGINE)
|
||||
find_package(Qt5 REQUIRED COMPONENTS ${QT_USE_MODULES})
|
||||
else (Qt5_VERSION_MINOR GREATER 7)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
list(APPEND QT_USE_MODULES WebKit WebKitWidgets)
|
||||
find_package(Qt5 REQUIRED COMPONENTS ${QT_USE_MODULES})
|
||||
endif(Qt5_VERSION_MINOR GREATER 7)
|
||||
|
||||
if(WIN32)
|
||||
# use radare2 libraries from submodule on windows
|
||||
@ -130,40 +120,13 @@ set(UI_FILES
|
||||
widgets/commentswidget.ui
|
||||
widgets/stringswidget.ui
|
||||
widgets/flagswidget.ui
|
||||
widgets/memwidget/memorywidget.ui
|
||||
widgets/sdbdock.ui
|
||||
dialogs/commentsdialog.ui
|
||||
widgets/sidebar.ui
|
||||
widgets/dashboard.ui
|
||||
dialogs/xrefsdialog.ui)
|
||||
|
||||
if (Qt5_VERSION_MINOR GREATER 7)
|
||||
list(APPEND UI_FILES webengine/widgets/memwidget/memorywidget.ui
|
||||
webengine/widgets/dashboard.ui)
|
||||
|
||||
set(UI_FILES_OUT "")
|
||||
|
||||
# Workaround for Qt 5.8
|
||||
# AutoUIC looking for ui files in the same directory as source code
|
||||
# files. This code directly calls uic for headers generation.
|
||||
foreach(it ${UI_FILES})
|
||||
message("Preprocessing uic: ${it}")
|
||||
get_filename_component(outfile ${it} NAME_WE)
|
||||
get_filename_component(infile ${it} ABSOLUTE)
|
||||
set(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
|
||||
add_custom_command(OUTPUT ${outfile}
|
||||
COMMAND ${Qt5Widgets_UIC_EXECUTABLE}
|
||||
ARGS ${ui_options} -o ${outfile} ${infile}
|
||||
MAIN_DEPENDENCY ${infile} VERBATIM)
|
||||
list(APPEND UI_FILES_OUT ${outfile})
|
||||
endforeach()
|
||||
|
||||
set(UI_FILES ${UI_FILES_OUT})
|
||||
|
||||
else (Qt5_VERSION_MINOR GREATER 7)
|
||||
list(APPEND UI_FILES widgets/memwidget/memorywidget.ui
|
||||
widgets/dashboard.ui)
|
||||
endif (Qt5_VERSION_MINOR GREATER 7)
|
||||
|
||||
|
||||
set(QRC_FILES resources.qrc)
|
||||
|
||||
|
||||
@ -174,5 +137,5 @@ add_definitions("-DAPP_VERSION=\"${IAITO_VERSION_FULL}\"")
|
||||
|
||||
|
||||
add_executable(iaito ${UI_FILES} ${QRC_FILES} ${SOURCE_FILES} ${HEADER_FILES})
|
||||
qt5_use_modules(iaito ${QT_USE_MODULES})
|
||||
qt5_use_modules(iaito Core Widgets Gui WebKit WebKitWidgets)
|
||||
target_link_libraries(iaito ${RADARE2_LIBRARIES})
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -11,16 +11,11 @@
|
||||
#include <QScrollBar>
|
||||
#include <QClipboard>
|
||||
#include <QShortcut>
|
||||
#include <QWebFrame>
|
||||
#include <QMenu>
|
||||
#include <QFont>
|
||||
#include <QUrl>
|
||||
|
||||
#if defined(USE_WEBENGINE)
|
||||
#include <QWebEnginePage>
|
||||
#else
|
||||
#include <QWebFrame>
|
||||
#endif
|
||||
|
||||
MemoryWidget::MemoryWidget(MainWindow *main) :
|
||||
QDockWidget(main),
|
||||
ui(new Ui::MemoryWidget)
|
||||
@ -71,10 +66,6 @@ MemoryWidget::MemoryWidget(MainWindow *main) :
|
||||
graph_bar->setVisible(false);
|
||||
|
||||
// Hide graph webview scrollbars
|
||||
|
||||
#if defined(USE_WEBENGINE)
|
||||
ui->graphWebView->page()->runJavaScript("document.body.style.overflow='hidden';");
|
||||
#else
|
||||
ui->graphWebView->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
|
||||
ui->graphWebView->page()->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
|
||||
|
||||
@ -85,7 +76,6 @@ MemoryWidget::MemoryWidget(MainWindow *main) :
|
||||
|
||||
// Debug console
|
||||
QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
|
||||
#endif
|
||||
|
||||
// Add margin to function name line edit
|
||||
ui->fcnNameEdit->setTextMargins(5, 0, 0, 0);
|
||||
@ -190,11 +180,7 @@ MemoryWidget::MemoryWidget(MainWindow *main) :
|
||||
connect(this->disasTextEdit->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(disasmScrolled()));
|
||||
connect(this->hexASCIIText->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(hexScrolled()));
|
||||
|
||||
#if defined(USE_WEBENGINE)
|
||||
connect(ui->graphWebView->page(), SIGNAL(loadFinished(bool)), this, SLOT(frameLoadFinished(bool)));
|
||||
#else
|
||||
connect(ui->graphWebView->page()->mainFrame(), SIGNAL(loadFinished(bool)), this, SLOT(frameLoadFinished(bool)));
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1421,11 +1407,7 @@ void MemoryWidget::create_graph(QString off) {
|
||||
ui->graphWebView->load(QUrl("qrc:/graph/html/graph/index.html#" + off));
|
||||
QString port = this->main->core->config("http.port");
|
||||
|
||||
#if defined(USE_WEBENGINE)
|
||||
ui->graphWebView->page()->runJavaScript(QString("r2.root=\"http://localhost:" + port + "\""));
|
||||
#else
|
||||
ui->graphWebView->page()->mainFrame()->evaluateJavaScript(QString("r2.root=\"http://localhost:" + port + "\""));
|
||||
#endif
|
||||
}
|
||||
|
||||
QString MemoryWidget::normalize_addr(QString addr) {
|
||||
@ -1770,11 +1752,7 @@ void MemoryWidget::frameLoadFinished(bool ok) {
|
||||
QSettings settings;
|
||||
if (settings.value("dark").toBool()) {
|
||||
QString js = "r2ui.graph_panel.render('dark');";
|
||||
#if defined(USE_WEBENGINE)
|
||||
ui->graphWebView->page()->runJavaScript(js, [](const QVariant &result){ qDebug() << result; });
|
||||
#else
|
||||
qDebug() << ui->graphWebView->page()->mainFrame()->evaluateJavaScript(js);
|
||||
#endif
|
||||
ui->graphWebView->page()->mainFrame()->evaluateJavaScript(js);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,16 +11,11 @@
|
||||
#include <QDockWidget>
|
||||
#include <QTreeWidget>
|
||||
#include <QTabWidget>
|
||||
#include <QWebView>
|
||||
#include <QUrl>
|
||||
#include <QPlainTextEdit>
|
||||
#include <QMouseEvent>
|
||||
|
||||
#if defined(USE_WEBENGINE)
|
||||
#include <QWebEngineView>
|
||||
#else
|
||||
#include <QWebView>
|
||||
#endif
|
||||
|
||||
class MainWindow;
|
||||
|
||||
namespace Ui {
|
||||
@ -44,13 +39,8 @@ public:
|
||||
QTreeWidget *xrefToTreeWidget_2;
|
||||
QTreeWidget *xreFromTreeWidget_2;
|
||||
QTabWidget *memTabWidget;
|
||||
#if defined(USE_WEBENGINE)
|
||||
QWebEngineView *graphWebView;
|
||||
QWebEngineView *histoWebView;
|
||||
#else
|
||||
QWebView *graphWebView;
|
||||
QWebView *histoWebView;
|
||||
#endif
|
||||
|
||||
Highlighter *highlighter;
|
||||
Highlighter *highlighter_5;
|
||||
|
Loading…
Reference in New Issue
Block a user