diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..26333e1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,83 @@ +# This file is used to ignore files which are generated +# ---------------------------------------------------------------------------- + +*~ +*.autosave +*.a +*.core +*.moc +*.o +*.obj +*.orig +*.rej +*.so +*.so.* +*_pch.h.cpp +*_resource.rc +*.qm +.#* +*.*# +core +!core/ +tags +.DS_Store +.directory +*.debug +Makefile* +*.prl +*.app +moc_*.cpp +ui_*.h +qrc_*.cpp +Thumbs.db +*.res +*.rc +/.qmake.cache +/.qmake.stash + +# qtcreator generated files +*.pro.user* +*.qbs.user* +CMakeLists.txt.user* + +# xemacs temporary files +*.flc + +# Vim temporary files +.*.swp + +# Visual Studio generated files +*.ib_pdb_index +*.idb +*.ilk +*.pdb +*.sln +*.suo +*.vcproj +*vcproj.*.*.user +*.ncb +*.sdf +*.opensdf +*.vcxproj +*vcxproj.* + +# MinGW generated files +*.Debug +*.Release + +# Python byte code +*.pyc + +# Binaries +# -------- +*.dll +*.exe + +# Directories with generated files +.moc/ +.obj/ +.pch/ +.rcc/ +.uic/ +/build*/ +_build*/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e14778..22da3e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,11 +16,11 @@ find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets LinguistTools) set(TS_FILES ${TARGET_APP}_en_US.ts) set(PROJECT_SOURCES - main.cpp - mainwindow.cpp - mainwindow.h - mainwindow.ui - ${TS_FILES} + main.cpp + mainwindow.cpp + mainwindow.h + mainwindow.ui + ${TS_FILES} ) if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) @@ -28,27 +28,28 @@ if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) MANUAL_FINALIZATION ${PROJECT_SOURCES} utils/messagehandler.h + assets/icons.qrc ) # Define target properties for Android with Qt 6 as: # set_property(TARGET ${TARGET_APP} APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR # ${CMAKE_CURRENT_SOURCE_DIR}/android) # For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation - qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}) +qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}) else() if(ANDROID) add_library(${TARGET_APP} SHARED ${PROJECT_SOURCES} ) -# Define properties for Android with Qt 5 after find_package() calls as: -# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android") - else() - add_executable(${TARGET_APP} - ${PROJECT_SOURCES} - ) - endif() + # Define properties for Android with Qt 5 after find_package() calls as: + # set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android") +else() + add_executable(${TARGET_APP} + ${PROJECT_SOURCES} + ) +endif() - qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}) +qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}) endif() target_link_libraries(${TARGET_APP} PRIVATE Qt${QT_VERSION_MAJOR}::Widgets) @@ -61,7 +62,7 @@ target_link_libraries(${TARGET_APP} PRIVATE GenericCore) # If you are developing for iOS or macOS you should consider setting an # explicit, fixed bundle identifier manually though. if(${QT_VERSION} VERSION_LESS 6.1.0) - set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER com.example.${TARGET_APP}) + set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER com.example.${TARGET_APP}) endif() set_target_properties(${TARGET_APP} PROPERTIES ${BUNDLE_ID_OPTION} diff --git a/assets/feature.png b/assets/feature.png new file mode 100644 index 0000000..a9b73d9 Binary files /dev/null and b/assets/feature.png differ diff --git a/assets/icons.qrc b/assets/icons.qrc new file mode 100644 index 0000000..d51a60e --- /dev/null +++ b/assets/icons.qrc @@ -0,0 +1,7 @@ + + + software-application.png + feature.png + no-picture-taking.png + + diff --git a/assets/no-picture-taking.png b/assets/no-picture-taking.png new file mode 100644 index 0000000..2ae8799 Binary files /dev/null and b/assets/no-picture-taking.png differ diff --git a/assets/software-application.png b/assets/software-application.png new file mode 100644 index 0000000..2edb87d Binary files /dev/null and b/assets/software-application.png differ diff --git a/assets/urls.txt b/assets/urls.txt new file mode 100644 index 0000000..7442630 --- /dev/null +++ b/assets/urls.txt @@ -0,0 +1,5 @@ +software-application.png: +https://www.flaticon.com/free-icon/software-application_5063917 + +feature.png: +https://www.flaticon.com/free-icon/feature_1085784 diff --git a/mainwindow.cpp b/mainwindow.cpp index f6117f2..4c50172 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -9,6 +9,18 @@ MainWindow::MainWindow(QWidget* parent) ui->setupUi(this); m_core = std::make_shared(); + + /// application icon + const QString iconString = "://feature.png"; +#ifdef QT_DEBUG + QPixmap pixmap = QPixmap(iconString); + QTransform transform = QTransform(); + transform.rotate(180); + QPixmap rotated = pixmap.transformed(transform); + setWindowIcon(QIcon(rotated)); +#else + setWindowIcon(QIcon(iconString)); +#endif } MainWindow::~MainWindow() { delete ui; } diff --git a/mainwindow.ui b/mainwindow.ui index 32bc75f..4b2a83e 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -11,7 +11,7 @@ - MainWindow + GenericQtClient