From afa35608dc803eef0ec6c3c9ecc7fe9dc4f0f774 Mon Sep 17 00:00:00 2001
From: Chen Yifeng <648616375@qq.com>
Date: Tue, 30 Jul 2024 18:45:00 +0800
Subject: [PATCH 1/6] this should fix #452
---
DockWidget/CameraControlDockWidget.cpp | 37 +++++++++++++++++++-------
DockWidget/CameraControlDockWidget.h | 1 +
2 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/DockWidget/CameraControlDockWidget.cpp b/DockWidget/CameraControlDockWidget.cpp
index b653d063..afe8a498 100644
--- a/DockWidget/CameraControlDockWidget.cpp
+++ b/DockWidget/CameraControlDockWidget.cpp
@@ -237,21 +237,15 @@ void CameraControlDockWidget::ClearListView()
}
}
+
///
-/// Be called the listview is clicked and a limitator is selected.
+/// Update all those spinboxes values and max/min properties by using the Room size and the limitator properties.
///
-///
-/// Reference of the selected QModelIndex from the listview.
-///
-void CameraControlDockWidget::on_CameraLimitators_listView_clicked(const QModelIndex &index)
+void CameraControlDockWidget::UpdateSpinboxesByListviewItemID(int item_id)
{
- IsSavingData = false;
- ui->ExistingLimitators_groupBox->setEnabled(false);
std::vector currentCameraLimitators =
currentRoom->GetCameraControlRecords();
- int linenum = index.row();
- SelectedLimitator = linenum;
- LevelComponents::__CameraControlRecord *currentLimitator = currentCameraLimitators[linenum];
+ LevelComponents::__CameraControlRecord *currentLimitator = currentCameraLimitators[item_id];
int currentLimitatorTypeid =
(currentLimitator->ChangeValueOffset == 0xFF ? -1 : currentLimitator->ChangeValueOffset);
ui->CameraLimitatorTypePicker_comboBox->setCurrentIndex(currentLimitatorTypeid + 1);
@@ -290,6 +284,21 @@ void CameraControlDockWidget::on_CameraLimitators_listView_clicked(const QModelI
ui->TriggerBlockPositionY_spinBox->setEnabled(false);
}
SetCurrentLimitator(); // only used to set maximums for all the spinboxes
+}
+
+///
+/// Be called the listview is clicked and a limitator is selected.
+///
+///
+/// Reference of the selected QModelIndex from the listview.
+///
+void CameraControlDockWidget::on_CameraLimitators_listView_clicked(const QModelIndex &index)
+{
+ IsSavingData = false;
+ ui->ExistingLimitators_groupBox->setEnabled(false);
+ int linenum = index.row();
+ SelectedLimitator = linenum;
+ UpdateSpinboxesByListviewItemID(linenum);
ui->ExistingLimitators_groupBox->setEnabled(true);
IsSavingData = true;
}
@@ -513,6 +522,14 @@ void CameraControlDockWidget::on_UseCameraLimitators_radioButton_clicked(bool ch
// Rerender graphicview in MainWindow
singleton->RenderScreenElementsLayersUpdate((unsigned int) -1, -1);
+
+ // Now we select the first item in the listview as default
+ IsSavingData = false;
+ ui->ExistingLimitators_groupBox->setEnabled(false);
+ SelectedLimitator = 0;
+ UpdateSpinboxesByListviewItemID(0);
+ ui->ExistingLimitators_groupBox->setEnabled(true);
+ IsSavingData = true;
}
singleton->SetUnsavedChanges(true);
diff --git a/DockWidget/CameraControlDockWidget.h b/DockWidget/CameraControlDockWidget.h
index ba6de290..8c493c63 100644
--- a/DockWidget/CameraControlDockWidget.h
+++ b/DockWidget/CameraControlDockWidget.h
@@ -30,6 +30,7 @@ class CameraControlDockWidget : public QDockWidget
int CurrentRoomHeight = 0;
bool IsSavingData = false;
void SetCurrentLimitator();
+ void UpdateSpinboxesByListviewItemID(int item_id);
void SetListviewItemText(int row);
void PaintListView();
void ClearListView();
From d4604e844b0224fb1427b8e29de80ceab365c984 Mon Sep 17 00:00:00 2001
From: Chen Yifeng <648616375@qq.com>
Date: Tue, 30 Jul 2024 19:05:54 +0800
Subject: [PATCH 2/6] update workflow
---
.github/workflows/main.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 206abd29..bace5122 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -17,18 +17,18 @@ jobs:
os: [windows-latest, macOS-latest, ubuntu-latest]
steps:
- name: Download Submodules
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
submodules: true
- name: Install Python 3.X version
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: 'x64'
- name: Install Qt
- uses: jurplel/install-qt-action@v3
+ uses: jurplel/install-qt-action@v4
with:
version: 6.4.2
From 0930c8907d9a7c0d0d6a0734cb084584b2d94d1e Mon Sep 17 00:00:00 2001
From: Chen Yifeng <648616375@qq.com>
Date: Tue, 30 Jul 2024 20:28:21 +0800
Subject: [PATCH 3/6] Add Qt 6 build folder to the git ignore file
---
.gitignore | 3 +++
1 file changed, 3 insertions(+)
diff --git a/.gitignore b/.gitignore
index 70f33b77..ad9c75fa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -69,3 +69,6 @@ vgcore.*
.vscode
*.aps
*.rc
+
+# Qt 6 build folder
+build/
From 5e2816de24abdad8e7f0daa67ed6895ba9473354 Mon Sep 17 00:00:00 2001
From: Chen Yifeng <648616375@qq.com>
Date: Sun, 1 Sep 2024 20:45:34 +0800
Subject: [PATCH 4/6] let's try again to fly without architecture: 'x64'
---
.github/workflows/main.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index bace5122..4b55da1c 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -25,7 +25,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.10'
- architecture: 'x64'
+ # architecture: 'x64'
- name: Install Qt
uses: jurplel/install-qt-action@v4
From d94b6e9fa917a9ada4b8d477a16699ce18ac35e9 Mon Sep 17 00:00:00 2001
From: Chen Yifeng <648616375@qq.com>
Date: Sun, 1 Sep 2024 20:58:34 +0800
Subject: [PATCH 5/6] fly without installing python before installing qt
---
.github/workflows/main.yml | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 4b55da1c..832de1c8 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -21,12 +21,13 @@ jobs:
with:
submodules: true
- - name: Install Python 3.X version
- uses: actions/setup-python@v5
- with:
- python-version: '3.10'
+ # - name: Install Python 3.X version
+ # uses: actions/setup-python@v5
+ # with:
+ # python-version: '3.10'
# architecture: 'x64'
+ # they put setup python logic inside install-qt-action
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
From 72e649e4e52c8c2995e371ff7597cf6a9c52674d Mon Sep 17 00:00:00 2001
From: Chen Yifeng <648616375@qq.com>
Date: Sun, 1 Sep 2024 21:05:12 +0800
Subject: [PATCH 6/6] fly by try fixing path allocation logic
---
.github/workflows/main.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 832de1c8..8dc41a40 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -40,7 +40,7 @@ jobs:
- name: Build WL4Editor on Windows
if: startsWith(matrix.os, 'windows')
run: |
- dir %Qt6_Dir%/lib/cmake
+ dir %QT_ROOT_DIR%/lib/cmake
qmake WL4Editor.pro
nmake debug
shell: cmd
@@ -48,7 +48,7 @@ jobs:
- name: Build WL4Editor on *nix
if: (!startsWith(matrix.os, 'windows'))
run: |
- ls "$Qt6_DIR/lib/cmake"
+ ls "${QT_ROOT_DIR}/lib/cmake"
qmake WL4Editor.pro
make
shell: bash