使用内部资源减少占用

This commit is contained in:
寂静的羽夏 2022-08-23 12:56:55 +08:00
parent 54c35e8674
commit 7d71e45d6c
11 changed files with 14 additions and 23 deletions

View File

@ -1,4 +1,5 @@
#include "authordialog.h"
#include "../WingHexExplorer/wing-hex-explorer.sourcecode/WingHexExplorer/plugin/iwingplugin.h"
#include "ui_authordialog.h"
AuthorDialog::AuthorDialog(QWidget *parent)
@ -6,6 +7,7 @@ AuthorDialog::AuthorDialog(QWidget *parent)
ui->setupUi(this);
ui->retranslateUi(this);
auto txtb = ui->txtb;
ui->label->setPixmap(QPixmap(HOSTAUTHORPIMG));
txtb->setSearchPaths(
QStringList({":/WingElfParser", ":/WingElfParser/image"}));
txtb->setSource(QUrl("README.md"), QTextDocument::MarkdownResource);

View File

@ -25,9 +25,6 @@
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="sources.qrc">:/WingElfParser/image/author.jpg</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
@ -49,8 +46,6 @@
</property>
</widget>
</widget>
<resources>
<include location="sources.qrc"/>
</resources>
<resources/>
<connections/>
</ui>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 776 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -1,12 +1,7 @@
<RCC>
<qresource prefix="/WingElfParser">
<file>image/sponsor.png</file>
<file>image/setting.png</file>
<file>image/author.png</file>
<file>image/author.jpg</file>
<file>image/icon.png</file>
<file>image/analyse.png</file>
<file>image/sp.png</file>
<file>image/README.md</file>
</qresource>
</RCC>

View File

@ -1,10 +1,12 @@
#include "sponsordialog.h"
#include "../WingHexExplorer/wing-hex-explorer.sourcecode/WingHexExplorer/plugin/iwingplugin.h"
#include "ui_sponsordialog.h"
SponsorDialog::SponsorDialog(QWidget *parent)
: QDialog(parent), ui(new Ui::SponsorDialog) {
ui->setupUi(this);
ui->retranslateUi(this);
ui->label_2->setPixmap(QPixmap(SPONSORQRCODE));
}
SponsorDialog::~SponsorDialog() { delete ui; }

View File

@ -41,16 +41,11 @@
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="sources.qrc">:/WingElfParser/image/sp.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</widget>
<resources>
<include location="sources.qrc"/>
</resources>
<resources/>
<connections/>
</ui>

View File

@ -9,6 +9,7 @@
#include <elf.h>
#define ICONRES(name) QIcon(":/WingElfParser/image/" name ".png")
#define HOSTICONRES(name) QIcon(HOSTRESPIMG(name))
#define QTWI(parent, title, offset, len) \
p = new QTreeWidgetItem(parent, {title}); \
@ -62,14 +63,15 @@ bool WingElfPlugin::init(QList<WingPluginInfo> loadedplugin) {
menu->addSeparator();
PluginMenuAddItemIconAction(menu, tr("Setting"), ICONRES("setting"),
WingElfPlugin::on_setting);
PluginMenuAddItemIconLamba(menu, tr("Author"), ICONRES("author"), [=] {
PluginMenuAddItemIconLamba(menu, tr("Author"), HOSTICONRES("author"), [=] {
AuthorDialog d;
d.exec();
});
PluginMenuAddItemIconLamba(menu, tr("Sponsor"), ICONRES("sponsor"), [=] {
SponsorDialog d;
d.exec();
});
PluginMenuAddItemIconLamba(menu, tr("Sponsor"), HOSTICONRES("sponsor"),
[=] {
SponsorDialog d;
d.exec();
});
}
PluginMenuInitEnd();
@ -1034,7 +1036,7 @@ QMenu *WingElfPlugin::registerMenu() { return menu; }
void WingElfPlugin::registerDockWidget(
QMap<QDockWidget *, Qt::DockWidgetArea> &rdw) {
rdw.insert(dw, Qt::DockWidgetArea::BottomDockWidgetArea);
rdw.insert(dw, Qt::DockWidgetArea::NoDockWidgetArea);
}
QToolButton *WingElfPlugin::registerToolButton() { return tbtn; }