commit 156f25ea7fcd85df7314692b55192a5f05bfffd7 Author: Eshan Roy (Eshanized) Date: Tue Apr 30 21:31:46 2024 +0530 feat: add base files diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4a0b530 --- /dev/null +++ b/.gitignore @@ -0,0 +1,74 @@ +# 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* +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 + diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..79ff82d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,70 @@ +cmake_minimum_required(VERSION 3.5) + +project(snigdhaos-assistant VERSION 0.1 LANGUAGES CXX) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets) +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets) + +set(PROJECT_SOURCES + main.cpp + snigdhaosassistant.cpp + snigdhaosassistant.h + snigdhaosassistant.ui +) + +if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) + qt_add_executable(snigdhaos-assistant + MANUAL_FINALIZATION + ${PROJECT_SOURCES} + ) +# Define target properties for Android with Qt 6 as: +# set_property(TARGET snigdhaos-assistant 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 +else() + if(ANDROID) + add_library(snigdhaos-assistant 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(snigdhaos-assistant + ${PROJECT_SOURCES} + ) + endif() +endif() + +target_link_libraries(snigdhaos-assistant PRIVATE Qt${QT_VERSION_MAJOR}::Widgets) + +# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1. +# 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.snigdhaos-assistant) +endif() +set_target_properties(snigdhaos-assistant PROPERTIES + ${BUNDLE_ID_OPTION} + MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} + MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} + MACOSX_BUNDLE TRUE + WIN32_EXECUTABLE TRUE +) + +include(GNUInstallDirs) +install(TARGETS snigdhaos-assistant + BUNDLE DESTINATION . + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +if(QT_VERSION_MAJOR EQUAL 6) + qt_finalize_executable(snigdhaos-assistant) +endif() diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..4327965 --- /dev/null +++ b/main.cpp @@ -0,0 +1,11 @@ +#include "snigdhaosassistant.h" + +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + SnigdhaOSAssistant w; + w.show(); + return a.exec(); +} diff --git a/snigdhaosassistant.cpp b/snigdhaosassistant.cpp new file mode 100644 index 0000000..414550e --- /dev/null +++ b/snigdhaosassistant.cpp @@ -0,0 +1,14 @@ +#include "snigdhaosassistant.h" +#include "./ui_snigdhaosassistant.h" + +SnigdhaOSAssistant::SnigdhaOSAssistant(QWidget *parent) + : QMainWindow(parent) + , ui(new Ui::SnigdhaOSAssistant) +{ + ui->setupUi(this); +} + +SnigdhaOSAssistant::~SnigdhaOSAssistant() +{ + delete ui; +} diff --git a/snigdhaosassistant.h b/snigdhaosassistant.h new file mode 100644 index 0000000..e1dd6da --- /dev/null +++ b/snigdhaosassistant.h @@ -0,0 +1,23 @@ +#ifndef SNIGDHAOSASSISTANT_H +#define SNIGDHAOSASSISTANT_H + +#include + +QT_BEGIN_NAMESPACE +namespace Ui { +class SnigdhaOSAssistant; +} +QT_END_NAMESPACE + +class SnigdhaOSAssistant : public QMainWindow +{ + Q_OBJECT + +public: + SnigdhaOSAssistant(QWidget *parent = nullptr); + ~SnigdhaOSAssistant(); + +private: + Ui::SnigdhaOSAssistant *ui; +}; +#endif // SNIGDHAOSASSISTANT_H diff --git a/snigdhaosassistant.ui b/snigdhaosassistant.ui new file mode 100644 index 0000000..b27c08f --- /dev/null +++ b/snigdhaosassistant.ui @@ -0,0 +1,31 @@ + + + SnigdhaOSAssistant + + + + 0 + 0 + 800 + 600 + + + + SnigdhaOSAssistant + + + + + + 0 + 0 + 800 + 21 + + + + + + + +