mirror of
https://github.com/wh201906/Proxmark3GUI.git
synced 2026-07-14 22:55:32 +08:00
Replace QTabWidget with QDockWidget
dock it(√) doki(?)
This commit is contained in:
@@ -31,6 +31,7 @@ MainWindow::MainWindow(QWidget *parent):
|
||||
clientWorkingDir = new QDir;
|
||||
|
||||
util = new Util(this);
|
||||
Util::setUI(ui);
|
||||
mifare = new Mifare(ui, util, this);
|
||||
lf = new LF(ui, util, this);
|
||||
|
||||
@@ -64,6 +65,7 @@ void MainWindow::initUI() // will be called by main.app
|
||||
uiInit();
|
||||
signalInit();
|
||||
setState(false);
|
||||
dockInit();
|
||||
}
|
||||
|
||||
// ******************** basic functions ********************
|
||||
@@ -1288,3 +1290,30 @@ void MainWindow::on_LF_Op_sniffButton_clicked()
|
||||
lf->sniff();
|
||||
setState(true);
|
||||
}
|
||||
|
||||
void MainWindow::dockInit()
|
||||
{
|
||||
setDockNestingEnabled(true);
|
||||
QDockWidget* dock;
|
||||
QWidget* widget;
|
||||
int count = ui->funcTab->count();
|
||||
qDebug() << "dock count" << count;
|
||||
for(int i = 0; i < count; i++)
|
||||
{
|
||||
dock = new QDockWidget(ui->funcTab->tabText(0), this);
|
||||
qDebug() << "dock name" << ui->funcTab->tabText(0);
|
||||
dock->setFeatures(QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetMovable);// movable is necessary, otherwise the dock cannot be dragged
|
||||
dock->setAllowedAreas(Qt::BottomDockWidgetArea);
|
||||
widget = ui->funcTab->widget(0);
|
||||
dock->setWidget(widget);
|
||||
if(widget->objectName() == "rawTab")
|
||||
Util::setRawTab(dock, i);
|
||||
addDockWidget(Qt::BottomDockWidgetArea, dock);
|
||||
if(!dockList.isEmpty())
|
||||
tabifyDockWidget(dockList[0], dock);
|
||||
dockList.append(dock);
|
||||
}
|
||||
ui->funcTab->setVisible(false);
|
||||
dockList[0]->setVisible(true);
|
||||
dockList[0]->raise();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <QScrollBar>
|
||||
#include <QTimer>
|
||||
#include <QDateTime>
|
||||
#include <QDockWidget>
|
||||
|
||||
#include "common/myeventfilter.h"
|
||||
#include "common/pm3process.h"
|
||||
@@ -228,6 +229,8 @@ private:
|
||||
LF* lf;
|
||||
Util* util;
|
||||
|
||||
QList<QDockWidget*> dockList;
|
||||
|
||||
MF_trailerDecoderDialog* decDialog;
|
||||
|
||||
void signalInit();
|
||||
@@ -236,6 +239,7 @@ private:
|
||||
void setState(bool st);
|
||||
void saveClientPath(const QString& path);
|
||||
void onLFfreqConfChanged(int value, bool isCustomized);
|
||||
void dockInit();
|
||||
signals:
|
||||
void connectPM3(const QString& path, const QStringList args);
|
||||
void reconnectPM3();
|
||||
|
||||
+1
-1
@@ -130,7 +130,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="mifareTab">
|
||||
<attribute name="title">
|
||||
|
||||
Reference in New Issue
Block a user