Skip to content

Commit

Permalink
Upgrade to Qt6 (#21)
Browse files Browse the repository at this point in the history
Update to Qt6 and migrate from Travis to GitHub Workflows.
  • Loading branch information
FreddyFunk authored Feb 25, 2024
1 parent 9513fb8 commit 928c060
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 77 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build

on:
push:
branches:
- "**"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libgl1-mesa-dev qt6-base-dev
- name: Checkout code
uses: actions/checkout@v2

- name: Configure and build
run: |
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/home/runner/work/access/build/ext_install
make -j8
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -328,3 +328,8 @@ ASALocalRun/

# MFractors (Xamarin productivity tool) working folder
.mfractor/

# Local Builds
build/
out/
**/CMakeSettings.json
65 changes: 0 additions & 65 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)

find_package(Qt5 COMPONENTS REQUIRED Core Gui Widgets Concurrent)
find_package(Qt6 COMPONENTS REQUIRED Core Gui Widgets Concurrent OpenGL OpenGLWidgets)

add_executable(VDS
main.cpp
Expand Down Expand Up @@ -65,7 +65,7 @@ set(RESOURCE_FILES
qt_resources/resources.qrc
qt_resources/stylesheets/style.qss)

qt5_wrap_ui(UI_HDRS ${UI_FILES})
qt6_wrap_ui(UI_HDRS ${UI_FILES})

target_sources(VDS
PRIVATE
Expand All @@ -76,7 +76,7 @@ target_sources(VDS

replicate_directory_structure(VDS)

target_link_libraries(VDS PRIVATE vdtk_lib Threads::Threads Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Concurrent)
target_link_libraries(VDS PRIVATE vdtk_lib Threads::Threads Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Concurrent Qt6::OpenGL Qt6::OpenGLWidgets)


# set C++ language standard to c++17
Expand Down
2 changes: 1 addition & 1 deletion src/fileio/import_binary_slices_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ void DialogImportBinarySlices::setupSectionSpacing() {
m_labelSpacing->setText(QString("Spacing in cm:"));

// TODO: account float precision
m_validatorSpacing = new QRegExpValidator(QRegExp("[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?"));
m_validatorSpacing = new QRegularExpressionValidator(QRegularExpression("[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?"));

m_textSpacingX = new QLineEdit;
m_textSpacingX->setPlaceholderText(QString("X-Dimension"));
Expand Down
2 changes: 1 addition & 1 deletion src/fileio/import_binary_slices_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public slots:
QLineEdit* m_textSpacingX;
QLineEdit* m_textSpacingY;
QLineEdit* m_textSpacingZ;
QRegExpValidator* m_validatorSpacing;
QRegularExpressionValidator* m_validatorSpacing;

// File Import Order Preview
QGroupBox* m_groupFileImportPreview;
Expand Down
2 changes: 1 addition & 1 deletion src/fileio/import_raw_3D_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ void DialogImportRAW3D::setupSectionSpacing() {
m_labelSpacing->setText(QString("Spacing in cm:"));

// TODO: account float precision
m_validatorSpacing = new QRegExpValidator(QRegExp("[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?"));
m_validatorSpacing = new QRegularExpressionValidator(QRegularExpression("[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?"));

m_textSpacingX = new QLineEdit;
m_textSpacingX->setPlaceholderText(QString("X-Dimension"));
Expand Down
2 changes: 1 addition & 1 deletion src/fileio/import_raw_3D_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public slots:
QLineEdit* m_textSpacingX;
QLineEdit* m_textSpacingY;
QLineEdit* m_textSpacingZ;
QRegExpValidator* m_validatorSpacing;
QRegularExpressionValidator* m_validatorSpacing;

// OK and Cancel
QGroupBox* m_groupOKAndCancel;
Expand Down
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <QSurfaceFormat>
#include <QThread>
#include <QFile>
#include <QtWidgets/QApplication>

int main(int argc, char* argv[]) {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/resize_volume_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void DialogResizeVolumeData::setupSectionmetaDataOriginal() {
void DialogResizeVolumeData::setupSectionMetaDataNew() {
// Validators
m_validatorSize = new QIntValidator(0, std::numeric_limits<int>::max(), this);
m_validatorSpacing = new QRegExpValidator(QRegExp("[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?"));
m_validatorSpacing = new QRegularExpressionValidator(QRegularExpression("[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?"));

// Size
m_labelMetaDataNewSizeX = new QLabel;
Expand Down
2 changes: 1 addition & 1 deletion src/tools/resize_volume_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public slots:
QLabel* m_labelMetaDataNewSpacingY;
QLabel* m_labelMetaDataNewSpacingZ;
QIntValidator* m_validatorSize;
QRegExpValidator* m_validatorSpacing;
QRegularExpressionValidator* m_validatorSpacing;

// Interpolation Method
QGroupBox* m_groupInterpolationMethod;
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/slice_view_GL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void SliceViewGL::paintGL() {
glUseProgram(0);
}

void SliceViewGL::enterEvent(QEvent* ev) {
void SliceViewGL::enterEvent(QEnterEvent* ev) {
emit(enterEventSignaled());
}

Expand Down
2 changes: 1 addition & 1 deletion src/widgets/slice_view_GL.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public slots:
void initializeGL() override;
void resizeGL(int w, int h) override;
void paintGL() override;
void enterEvent(QEvent* ev) override;
void enterEvent(QEnterEvent* ev) override;
void leaveEvent(QEvent* ev) override;

signals:
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/volume_view_GL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ void VolumeViewGL::paintGL() {
// check OpenGL error
GLenum err;
while ((err = glGetError()) != GL_NO_ERROR) {
qDebug() << "OpenGL error: " << err << endl;
qDebug() << "OpenGL error: " << err << "\n";
}
#endif // _DEBUG

Expand Down

0 comments on commit 928c060

Please sign in to comment.