fix targetlistwgt move

This commit is contained in:
jiegeaiai 2025-02-13 08:32:18 +08:00
parent 5aa674d1cd
commit 1eb2e44f26
6 changed files with 8 additions and 110 deletions

View File

@ -7,9 +7,9 @@
3.窗口1的Report和窗口2的Report Table 展示的是不是同样的内容如果是可以删除一个。需要在窗口1或2看的report时候通过窗口管理拖动实现。
解决方案
a、保留窗口2的Report Table
a、保留窗口2的Report Table (解决)
b、窗口2中的Report Table, 可以拖动变成dock模式添加到其他的窗口中
c、有缩放属性的控件鼠标都显示为双箭头
c、有缩放属性的控件鼠标都显示为双箭头 (解决)
d、所有的窗口表头可以采用拖动的形式调整列的位置
4.需要连续用到的操作、功能类似的放到一个大界面。这些不知道具体怎么分就需要讨论细分一下比如:
@ -37,5 +37,5 @@
c、所有窗口都用dock形式用户随意拖动放置到其他窗口中
d、窗口布局影响窗口位置
e、窗口会自动变大
f、report窗口能分离出来
f、report窗口能分离出来 (解决)

View File

@ -517,97 +517,81 @@
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="141"/>
<location filename="../ui/MainWindow.cpp" line="166"/>
<source>Target number</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="141"/>
<location filename="../ui/MainWindow.cpp" line="166"/>
<source>Signal-to-noise ratio</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="142"/>
<location filename="../ui/MainWindow.cpp" line="167"/>
<source>Azimuth line of sight</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="142"/>
<location filename="../ui/MainWindow.cpp" line="167"/>
<source>Pitch gaze angle</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="143"/>
<location filename="../ui/MainWindow.cpp" line="168"/>
<source>azimuth</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="143"/>
<location filename="../ui/MainWindow.cpp" line="168"/>
<source>Pitch angle</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="144"/>
<location filename="../ui/MainWindow.cpp" line="169"/>
<source>attribute</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="144"/>
<location filename="../ui/MainWindow.cpp" line="169"/>
<source>Doppler</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="145"/>
<location filename="../ui/MainWindow.cpp" line="170"/>
<source>course</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="145"/>
<location filename="../ui/MainWindow.cpp" line="170"/>
<source>Speed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="146"/>
<location filename="../ui/MainWindow.cpp" line="171"/>
<source>longitude</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="146"/>
<location filename="../ui/MainWindow.cpp" line="171"/>
<source>latitude</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="147"/>
<location filename="../ui/MainWindow.cpp" line="172"/>
<source>distance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="147"/>
<location filename="../ui/MainWindow.cpp" line="172"/>
<source>velocity</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="148"/>
<location filename="../ui/MainWindow.cpp" line="173"/>
<source>Radial dimensions</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="148"/>
<location filename="../ui/MainWindow.cpp" line="173"/>
<source>Target RCS</source>
<translation type="unfinished"></translation>
</message>
@ -617,27 +601,22 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="179"/>
<source>Report</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="188"/>
<location filename="../ui/MainWindow.cpp" line="163"/>
<source>Signal Indicator Lamp</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="195"/>
<location filename="../ui/MainWindow.cpp" line="170"/>
<source>ParamSetting</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="200"/>
<location filename="../ui/MainWindow.cpp" line="175"/>
<source>Matlab File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/MainWindow.cpp" line="205"/>
<location filename="../ui/MainWindow.cpp" line="180"/>
<source>name: 5year 0412</source>
<translation type="unfinished"></translation>
</message>
@ -1668,7 +1647,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/Table/targetlistwgt.cpp" line="65"/>
<location filename="../ui/Table/targetlistwgt.cpp" line="63"/>
<source>Data Table</source>
<translation type="unfinished"></translation>
</message>

View File

@ -158,31 +158,6 @@ void MainWindow::InitUI() {
}
{
targetUI_ = new TargetListWgt;
//WorkSpaceManager::Get().SetTargetListWgt(targetUITable_);
QStringList headerLabels;
headerLabels << tr("Target number") << tr("Signal-to-noise ratio") //QString::fromLocal8Bit("目标编号") << QString::fromLocal8Bit("信噪比")
<< tr("Azimuth line of sight") << tr("Pitch gaze angle") // QString::fromLocal8Bit("方位视线角") << QString::fromLocal8Bit("俯仰视线角")
<< tr("azimuth") << tr("Pitch angle") // QString::fromLocal8Bit("方位角") << QString::fromLocal8Bit("俯仰角")
<< tr("attribute") << tr("Doppler") // QString::fromLocal8Bit("属性") << QString::fromLocal8Bit("多普勒")
<< tr("course") << tr("Speed") // QString::fromLocal8Bit("航向") << QString::fromLocal8Bit("航速")
<< tr("longitude") << tr("latitude") // QString::fromLocal8Bit("经度") << QString::fromLocal8Bit("纬度")
<< tr("distance") << tr("velocity") // QString::fromLocal8Bit("距离") << QString::fromLocal8Bit("速度")
<< tr("Radial dimensions") << tr("Target RCS"); // QString::fromLocal8Bit("径向尺寸") << QString::fromLocal8Bit("目标RCS");
targetUI_->SetHeader(headerLabels);
const QString reportPath = RecourceHelper::Get().GetBasePath() + "/workspace/Report.txt";
targetUI_->InitFile(reportPath, 50);
DockWidget* dataTableDock = new DockWidget(tr("Report"), 0);
// addDockWidget(pSettingUI->GetArea("TargetListWgt"), dataTableDock);
targetUI_->AttachDock(dataTableDock);
m_mapDockWidget.insert("TargetListWgt", dataTableDock);
}
const QString lampPath = RecourceHelper::Get().GetBasePath() + "/workspace/Lamp.txt";
DockWidget* signalIndicatorLampDock = new DockWidget(tr("Signal Indicator Lamp"), 0);

View File

@ -61,7 +61,6 @@ private:
class FitCurveDialog* fitYLgCurveDlg_{ nullptr };
class SurfaceDialog* surfaceDlg_{ nullptr };
class LayoutSettingUI* pSettingUI{ nullptr };
class TargetListWgt* targetUI_{ nullptr };
class TargetListWgt* targetUITable_{ nullptr };
class QTabWidget* tabWidget_{ nullptr };
class SignalIndicatorLampUI* signalIndicatorLampUI_{ nullptr };

View File

@ -37,8 +37,6 @@ TargetListWgt::TargetListWgt(QWidget * parent) : QWidget(parent) {
InitWgt();
m_bMoveWgt = false;
ui.lineEdit->setText("1");
ui.lineEdit_2->setText("1");
ui.spinBox_2->setValue(1);
@ -272,51 +270,6 @@ void TargetListWgt::timerEvent(QTimerEvent *event)
}
void TargetListWgt::mousePressEvent(QMouseEvent *event)
{
if (Qt::LeftButton == event->button())
{
m_bMoveWgt = true;
m_pStartPos =mapToGlobal(event->pos());
}
QWidget::mousePressEvent(event);
}
void TargetListWgt::mouseMoveEvent(QMouseEvent *event)
{
if (m_bMoveWgt)
{
QPoint mousePos = mapToGlobal(event->pos());
QPoint curPos = this->pos();
QPoint movePos = curPos + (mousePos - m_pStartPos);
this->move(movePos);
m_pStartPos = mousePos;
}
QWidget::mouseMoveEvent(event);
}
void TargetListWgt::mouseReleaseEvent(QMouseEvent *event)
{
if (Qt::LeftButton == event->button())
{
m_bMoveWgt = false;
}
QWidget::mouseReleaseEvent(event);
}
void TargetListWgt::closeEvent(QCloseEvent *event)
{
}
void TargetListWgt::UpdateTable(int iTime)
{
if (iTime < 1)

View File

@ -45,11 +45,6 @@ protected:
void timerEvent(QTimerEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void closeEvent(QCloseEvent *event);
void UpdateTable(int iTime);
protected slots:
@ -79,9 +74,6 @@ private:
int m_nBoundaryWth;
bool m_bMoveWgt; // 是否移动窗口
QPoint m_pStartPos; // 初始位置
QVariantList m_varRowDataList;
QString m_strFile;