diff --git a/src/widgets/CommentsWidget.cpp b/src/widgets/CommentsWidget.cpp index 900b9e29..bab85c51 100644 --- a/src/widgets/CommentsWidget.cpp +++ b/src/widgets/CommentsWidget.cpp @@ -14,8 +14,7 @@ CommentsWidget::CommentsWidget(MainWindow *main, QWidget *parent) : { ui->setupUi(this); - ui->commentsTreeWidget->hideColumn(0); - ui->commentsTreeWidget->sortByColumn(3, Qt::AscendingOrder); + ui->commentsTreeWidget->sortByColumn(2, Qt::AscendingOrder); QTabBar *tabs = ui->tabWidget->tabBar(); tabs->setVisible(false); @@ -43,7 +42,6 @@ void CommentsWidget::on_commentsTreeWidget_itemDoubleClicked(QTreeWidgetItem *it // Get offset and name of item double clicked CommentDescription comment = item->data(0, Qt::UserRole).value(); CutterCore::getInstance()->seek(comment.offset); - //CutterCore::getInstance()->seek(comment.offset, comment.name, true); } void CommentsWidget::on_toolButton_clicked() @@ -118,10 +116,13 @@ void CommentsWidget::refreshTree() for (CommentDescription comment : comments) { - //this->main->add_debug_output(RAddressString(comment.offset)); QString fcn_name = CutterCore::getInstance()->cmdFunctionAt(comment.offset); - QTreeWidgetItem *item = qhelpers::appendRow(ui->commentsTreeWidget, RAddressString(comment.offset), fcn_name, comment.name); + QTreeWidgetItem *item = new QTreeWidgetItem(); + item->setText(0, RAddressString(comment.offset)); + item->setText(1, fcn_name); + item->setText(2, comment.name); item->setData(0, Qt::UserRole, QVariant::fromValue(comment)); + ui->commentsTreeWidget->addTopLevelItem(item); } qhelpers::adjustColumns(ui->commentsTreeWidget); diff --git a/src/widgets/CommentsWidget.ui b/src/widgets/CommentsWidget.ui index 635fe88a..23449609 100644 --- a/src/widgets/CommentsWidget.ui +++ b/src/widgets/CommentsWidget.ui @@ -222,35 +222,19 @@ border-top: 0px; QTreeWidget::item { - padding-left:10px; padding-top: 1px; padding-bottom: 1px; - border-left: 10px; -} - -QTreeWidget::item:selected -{ - background: gray; - color: white; -} - -QTreeWidget::item:hover -{ - background: rgb(242, 246, 248); - color: black; } QFrame::NoFrame + + 8 + true - - - Dummy - - Offset @@ -295,26 +279,8 @@ QTreeWidget::item:hover QTreeWidget::item { - padding-left:10px; padding-top: 1px; padding-bottom: 1px; - border-left: 10px; -} - -QTreeWidget::item:selected -{ - background: gray; - color: white; -} - -QTreeWidget::branch:selected -{ - background: gray; -} -QTreeWidget::item:hover -{ - background: rgb(242, 246, 248); - color: black; } QToolTip { diff --git a/src/widgets/EntrypointWidget.cpp b/src/widgets/EntrypointWidget.cpp index 275e80bc..76126418 100644 --- a/src/widgets/EntrypointWidget.cpp +++ b/src/widgets/EntrypointWidget.cpp @@ -19,12 +19,6 @@ EntrypointWidget::EntrypointWidget(MainWindow *main, QWidget *parent) : { ui->setupUi(this); - // Delegate - //CMyDelegate* delegate = new CMyDelegate(ui->importsTreeWidget); - //ui->importsTreeWidget->setItemDelegate(delegate); - - ui->entrypointTreeWidget->hideColumn(0); - setScrollMode(); connect(Core(), SIGNAL(refreshAll()), this, SLOT(fillEntrypoint())); @@ -37,8 +31,11 @@ void EntrypointWidget::fillEntrypoint() ui->entrypointTreeWidget->clear(); for (auto i : CutterCore::getInstance()->getAllEntrypoint()) { - QTreeWidgetItem *item = qhelpers::appendRow(ui->entrypointTreeWidget, RAddressString(i.vaddr), i.type); + QTreeWidgetItem *item = new QTreeWidgetItem(); + item->setText(0, RAddressString(i.vaddr)); + item->setText(1, i.type); item->setData(0, Qt::UserRole, QVariant::fromValue(i)); + ui->entrypointTreeWidget->addTopLevelItem(item); } qhelpers::adjustColumns(ui->entrypointTreeWidget, 0, 10); @@ -53,5 +50,4 @@ void EntrypointWidget::on_entrypointTreeWidget_itemDoubleClicked(QTreeWidgetItem { EntrypointDescription ep = item->data(0, Qt::UserRole).value(); CutterCore::getInstance()->seek(ep.vaddr); - //CutterCore::getInstance()->seek(ep.vaddr, ep.type, true); } diff --git a/src/widgets/EntrypointWidget.ui b/src/widgets/EntrypointWidget.ui index 1cee5a29..2ae7bde3 100644 --- a/src/widgets/EntrypointWidget.ui +++ b/src/widgets/EntrypointWidget.ui @@ -32,22 +32,8 @@ QTreeWidget::item { - padding-left:10px; padding-top: 1px; padding-bottom: 1px; - border-left: 10px; -} - -QTreeWidget::item:hover -{ - background: rgb(242, 246, 248); - color: black; -} - -QTreeWidget::item:selected -{ - background: gray; - color: white; } @@ -56,17 +42,15 @@ QTreeWidget::item:selected 0 + + 8 + true - 3 + 2 - - - 1 - - Address diff --git a/src/widgets/ExportsWidget.ui b/src/widgets/ExportsWidget.ui index 617d30e3..d66663a0 100644 --- a/src/widgets/ExportsWidget.ui +++ b/src/widgets/ExportsWidget.ui @@ -32,22 +32,8 @@ QTreeView::item { - padding-left:10px; padding-top: 1px; padding-bottom: 1px; - border-left: 10px; -} - -QTreeView::item:hover -{ - background: rgb(242, 246, 248); - color: black; -} - -QTreeView::item:selected -{ - background: gray; - color: white; } @@ -57,7 +43,7 @@ QTreeView::item:selected 0 - 0 + 8 true diff --git a/src/widgets/FlagsWidget.ui b/src/widgets/FlagsWidget.ui index 154c3002..438edb4d 100644 --- a/src/widgets/FlagsWidget.ui +++ b/src/widgets/FlagsWidget.ui @@ -35,22 +35,8 @@ QTreeView::item { - padding-left:10px; padding-top: 1px; padding-bottom: 1px; - border-left: 10px; -} - -QTreeView::item:hover -{ - background: rgb(242, 246, 248); - color: black; -} - -QTreeView::item:selected -{ - background: gray; - color: white; } @@ -60,7 +46,7 @@ QTreeView::item:selected true - 0 + 8 true diff --git a/src/widgets/FunctionsWidget.ui b/src/widgets/FunctionsWidget.ui index 39a94ae4..6ad53cc9 100644 --- a/src/widgets/FunctionsWidget.ui +++ b/src/widgets/FunctionsWidget.ui @@ -104,22 +104,8 @@ border-top: 0px; QTreeView::item { - padding-left:10px; - padding-top: 1px; - padding-bottom: 1px; - border-left: 10px; -} - -QTreeView::item:hover -{ - background: rgb(242, 246, 248); - color: black; -} - -QTreeView::item:selected -{ - background: gray; - color: white; + padding-top: 1px; + padding-bottom: 1px; } QToolTip @@ -140,7 +126,7 @@ QToolTip QAbstractScrollArea::AdjustToContents - 0 + 8 true @@ -187,30 +173,7 @@ QToolTip Qt::CustomContextMenu - QTreeView::item -{ - padding-left:10px; - padding-top: 1px; - padding-bottom: 1px; - border-left: 10px; -} - -QTreeView::item:selected -{ - background: gray; - color: white; -} - -QTreeView::branch:selected -{ - background: gray; -} -QTreeView::item:hover -{ - background: rgb(242, 246, 248); - color: black; -} - + QToolTip { background-color: #444; border: 3px solid #444; diff --git a/src/widgets/ImportsWidget.cpp b/src/widgets/ImportsWidget.cpp index f3faf4ae..b7130afe 100644 --- a/src/widgets/ImportsWidget.cpp +++ b/src/widgets/ImportsWidget.cpp @@ -39,12 +39,7 @@ ImportsWidget::ImportsWidget(MainWindow *main, QWidget *parent) : { ui->setupUi(this); - // Delegate - //CMyDelegate* delegate = new CMyDelegate(ui->importsTreeWidget); - //ui->importsTreeWidget->setItemDelegate(delegate); - - ui->importsTreeWidget->hideColumn(0); - ui->importsTreeWidget->sortByColumn(4, Qt::AscendingOrder); + ui->importsTreeWidget->sortByColumn(3, Qt::AscendingOrder); setScrollMode(); @@ -58,8 +53,13 @@ void ImportsWidget::fillImports() ui->importsTreeWidget->clear(); for (auto i : CutterCore::getInstance()->getAllImports()) { - QTreeWidgetItem *item = qhelpers::appendRow(ui->importsTreeWidget, RAddressString(i.plt), i.type, "", i.name); + QTreeWidgetItem *item = new QTreeWidgetItem(); + item->setText(0, RAddressString(i.plt)); + item->setText(1, i.type); + item->setText(2, ""); + item->setText(3, i.name); item->setData(0, Qt::UserRole, QVariant::fromValue(i)); + ui->importsTreeWidget->addTopLevelItem(item); } highlightUnsafe(); @@ -85,7 +85,7 @@ void ImportsWidget::highlightUnsafe() QList clist = ui->importsTreeWidget->findItems(banned, Qt::MatchRegExp, 4); foreach (QTreeWidgetItem *item, clist) { - item->setText(3, "Unsafe"); + item->setText(2, "Unsafe"); //item->setBackgroundColor(4, QColor(255, 129, 123)); //item->setForeground(4, Qt::white); item->setForeground(4, QColor(255, 129, 123)); diff --git a/src/widgets/ImportsWidget.ui b/src/widgets/ImportsWidget.ui index 820c03a5..8948a04e 100644 --- a/src/widgets/ImportsWidget.ui +++ b/src/widgets/ImportsWidget.ui @@ -32,22 +32,8 @@ QTreeWidget::item { - padding-left:10px; padding-top: 1px; padding-bottom: 1px; - border-left: 10px; -} - -QTreeWidget::item:hover -{ - background: rgb(242, 246, 248); - color: black; -} - -QTreeWidget::item:selected -{ - background: gray; - color: white; } @@ -56,14 +42,12 @@ QTreeWidget::item:selected 0 + + 8 + true - - - Dummy - - Address diff --git a/src/widgets/RelocsWidget.cpp b/src/widgets/RelocsWidget.cpp index 3dca79d9..36b472c7 100644 --- a/src/widgets/RelocsWidget.cpp +++ b/src/widgets/RelocsWidget.cpp @@ -14,8 +14,6 @@ RelocsWidget::RelocsWidget(MainWindow *main, QWidget *parent) : // Radare core found in: this->main = main; - ui->relocsTreeWidget->hideColumn(0); - setScrollMode(); connect(Core(), SIGNAL(refreshAll()), this, SLOT(fillTreeWidget())); @@ -38,8 +36,12 @@ void RelocsWidget::fillTreeWidget() for (auto i : CutterCore::getInstance()->getAllRelocs()) { - QTreeWidgetItem *item = qhelpers::appendRow(ui->relocsTreeWidget, RAddressString(i.vaddr), i.type, i.name); + QTreeWidgetItem *item = new QTreeWidgetItem(); + item->setText(0, RAddressString(i.vaddr)); + item->setText(1, i.type); + item->setText(2, i.name); item->setData(0, Qt::UserRole, QVariant::fromValue(i)); + ui->relocsTreeWidget->addTopLevelItem(item); } qhelpers::adjustColumns(ui->relocsTreeWidget); diff --git a/src/widgets/RelocsWidget.ui b/src/widgets/RelocsWidget.ui index 27ffb78d..15b5fed6 100644 --- a/src/widgets/RelocsWidget.ui +++ b/src/widgets/RelocsWidget.ui @@ -32,35 +32,19 @@ QTreeWidget::item { - padding-left:10px; padding-top: 1px; padding-bottom: 1px; - border-left: 10px; -} - -QTreeWidget::item:hover -{ - background: rgb(242, 246, 248); - color: black; -} - -QTreeWidget::item:selected -{ - background: gray; - color: white; } QFrame::NoFrame + + 8 + true - - - Dummy - - Address diff --git a/src/widgets/SdbDock.ui b/src/widgets/SdbDock.ui index 755e1a57..0723a445 100644 --- a/src/widgets/SdbDock.ui +++ b/src/widgets/SdbDock.ui @@ -61,7 +61,7 @@ - :/img/icons/arrow_right.png:/img/icons/arrow_right.png + :/img/icons/arrow_right.svg:/img/icons/arrow_right.svg @@ -79,7 +79,7 @@ - :/unlock:/unlock + :/img/icons/unlock_white.svg:/img/icons/unlock_white.svg true @@ -94,32 +94,10 @@ - QHeaderView::section { - color: drakgray; - padding: 3px; - padding-left: 10px; - background-color: rgb(232, 232, 232); - border: 2px solid white; -} - -QTreeWidget::item + QTreeWidget::item { - padding-left:10px; padding-top: 1px; padding-bottom: 1px; - border-left: 10px; -} - -QTreeWidget::item:hover -{ - background: rgb(242, 246, 248); - color: black; -} - -QTreeWidget::item:selected -{ - background: gray; - color: white; } @@ -132,7 +110,7 @@ QTreeWidget::item:selected 0 - 10 + 8 false diff --git a/src/widgets/SectionsWidget.cpp b/src/widgets/SectionsWidget.cpp index 0e730f3e..f5f75071 100644 --- a/src/widgets/SectionsWidget.cpp +++ b/src/widgets/SectionsWidget.cpp @@ -15,8 +15,6 @@ SectionsWidget::SectionsWidget(MainWindow *main, QWidget *parent) : setupViews(); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); - //setStyleSheet("QSplitter::handle:horizontal { width: 3px; } QSplitter::handle:vertical { height: 3px; }"); - //setStyleSheet("QSplitter::handle { height: 2px; background-color: rgb(255, 255, 255); image: url(:/img/icons/tabs.svg); }"); tree->sortByColumn(0, Qt::AscendingOrder); @@ -36,8 +34,6 @@ void SectionsWidget::refreshSections() fillSections(row++, section); } - //adjustColumns(sectionsWidget->tree); - //this->sectionsDock->sectionsWidget->adjustColumns(); qhelpers::adjustColumns(tree); } @@ -46,15 +42,12 @@ void SectionsWidget::setupViews() // Table view this->tree = new QTreeWidget; this->tree->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - //this->tree->setFont(QFont("Lucida Grande UI", 12)); - //this->tree->setFont(QFont("Courier New", 11)); this->tree->setIndentation(10); - //this->tree->setStyleSheet("QTreeWidget::item { padding-top: 1px; padding-bottom: 1px; padding-left:10px; border-left:10px;} QTreeWidget::item:selected { background: gray; color: white; } QTreeWidget::item:hover { background: rgb(242, 246, 248); color: black; }"); // Setup TreeWidget this->tree->setColumnCount(4); QList headers; - headers << "Name" << "Size" << "Address" << "End Address"; + headers << tr("Name") << tr("Size") << tr("Address") << tr("End Address"); this->tree->setHeaderLabels(headers); this->tree->setFrameShape(QFrame::NoFrame); diff --git a/src/widgets/SidebarWidget.ui b/src/widgets/SidebarWidget.ui index ba3d1cba..6cd89974 100644 --- a/src/widgets/SidebarWidget.ui +++ b/src/widgets/SidebarWidget.ui @@ -379,22 +379,8 @@ QTreeWidget::item { - padding-left:10px; padding-top: 1px; padding-bottom: 1px; - border-left: 10px; -} - -QTreeWidget::item:hover -{ - background: rgb(242, 246, 248); - color: black; -} - -QTreeWidget::item:selected -{ - background: gray; - color: white; } QToolTip { @@ -414,7 +400,7 @@ QToolTip { QAbstractItemView::ScrollPerPixel - 0 + 8 @@ -493,22 +479,8 @@ QToolTip { QTreeWidget::item { - padding-left:10px; padding-top: 1px; padding-bottom: 1px; - border-left: 10px; -} - -QTreeWidget::item:hover -{ - background: rgb(242, 246, 248); - color: black; -} - -QTreeWidget::item:selected -{ - background: gray; - color: white; } QToolTip { @@ -528,7 +500,7 @@ QToolTip { QAbstractItemView::ScrollPerPixel - 0 + 8 diff --git a/src/widgets/StringsWidget.cpp b/src/widgets/StringsWidget.cpp index 662e7b94..9af6e44b 100644 --- a/src/widgets/StringsWidget.cpp +++ b/src/widgets/StringsWidget.cpp @@ -14,11 +14,9 @@ StringsWidget::StringsWidget(MainWindow *main, QWidget *parent) : { ui->setupUi(this); - ui->stringsTreeWidget->hideColumn(0); - setScrollMode(); - ui->stringsTreeWidget->sortByColumn(2, Qt::AscendingOrder); + ui->stringsTreeWidget->sortByColumn(1, Qt::AscendingOrder); connect(Core(), SIGNAL(refreshAll()), this, SLOT(fillTreeWidget())); } @@ -29,8 +27,6 @@ void StringsWidget::on_stringsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item { Q_UNUSED(column); - // Get offset and name of item double clicked - // TODO: use this info to change disasm contents StringDescription str = item->data(0, Qt::UserRole).value(); CutterCore::getInstance()->seek(str.vaddr); } @@ -40,7 +36,13 @@ void StringsWidget::fillTreeWidget() ui->stringsTreeWidget->clear(); for (auto i : CutterCore::getInstance()->getAllStrings()) { - QTreeWidgetItem *item = qhelpers::appendRow(ui->stringsTreeWidget, RAddressString(i.vaddr), i.string); + QTreeWidgetItem *item = new QTreeWidgetItem(); + + item->setText(0, RAddressString(i.vaddr)); + item->setText(1, i.string); + + ui->stringsTreeWidget->insertTopLevelItem(0, item); + item->setData(0, Qt::UserRole, QVariant::fromValue(i)); } qhelpers::adjustColumns(ui->stringsTreeWidget); diff --git a/src/widgets/StringsWidget.ui b/src/widgets/StringsWidget.ui index af43235c..91b49625 100644 --- a/src/widgets/StringsWidget.ui +++ b/src/widgets/StringsWidget.ui @@ -38,22 +38,8 @@ QTreeWidget::item { - padding-left:10px; padding-top: 1px; padding-bottom: 1px; - border-left: 10px; -} - -QTreeWidget::item:hover -{ - background: rgb(242, 246, 248); - color: black; -} - -QTreeWidget::item:selected -{ - background: gray; - color: white; } @@ -62,14 +48,12 @@ QTreeWidget::item:selected 0 + + 8 + true - - - Dummy - - Address diff --git a/src/widgets/SymbolsWidget.cpp b/src/widgets/SymbolsWidget.cpp index 83cf115f..013e33b1 100644 --- a/src/widgets/SymbolsWidget.cpp +++ b/src/widgets/SymbolsWidget.cpp @@ -13,8 +13,7 @@ SymbolsWidget::SymbolsWidget(QWidget *parent) : { ui->setupUi(this); - ui->symbolsTreeWidget->hideColumn(0); - ui->symbolsTreeWidget->sortByColumn(3, Qt::AscendingOrder); + ui->symbolsTreeWidget->sortByColumn(2, Qt::AscendingOrder); setScrollMode(); @@ -38,12 +37,12 @@ void SymbolsWidget::fillSymbols() ui->symbolsTreeWidget->clear(); for (auto symbol : CutterCore::getInstance()->getAllSymbols()) { - QTreeWidgetItem *item = qhelpers::appendRow(ui->symbolsTreeWidget, - RAddressString(symbol.vaddr), - QString("%1 %2").arg(symbol.bind, symbol.type).trimmed(), - symbol.name); - + QTreeWidgetItem *item = new QTreeWidgetItem(); + item->setText(0, RAddressString(symbol.vaddr)); + item->setText(1, QString("%1 %2").arg(symbol.bind, symbol.type).trimmed()); + item->setText(2, symbol.name); item->setData(0, Qt::UserRole, QVariant::fromValue(symbol)); + ui->symbolsTreeWidget->addTopLevelItem(item); } qhelpers::adjustColumns(ui->symbolsTreeWidget); } diff --git a/src/widgets/SymbolsWidget.ui b/src/widgets/SymbolsWidget.ui index cd9321de..b73211bd 100644 --- a/src/widgets/SymbolsWidget.ui +++ b/src/widgets/SymbolsWidget.ui @@ -32,23 +32,10 @@ QTreeWidget::item { - padding-left:10px; padding-top: 1px; padding-bottom: 1px; - border-left: 10px; } - -QTreeWidget::item:hover -{ - background: rgb(242, 246, 248); - color: black; -} - -QTreeWidget::item:selected -{ - background: gray; - color: white; -} + QFrame::NoFrame @@ -56,14 +43,12 @@ QTreeWidget::item:selected 0 + + 8 + true - - - Dummy - - Address