Skip to content

Commit

Permalink
Set correct identification of windows.
Browse files Browse the repository at this point in the history
Prevents console window opening.
  • Loading branch information
Sibras committed Nov 17, 2021
1 parent c398eb7 commit 474a5e1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
14 changes: 12 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,20 @@ endif()
# Use folder structure for arranging files within IDEs
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

find_package(Qt6 COMPONENTS GUI QML Network XML Concurrent REQUIRED)
find_package(Qt6 COMPONENTS Quick QML Network XML Concurrent REQUIRED)

qt_add_executable(ShiftIntrinsicGuide MANUAL_FINALIZATION)

if(WIN32)
set_target_properties(ShiftIntrinsicGuide PROPERTIES
WIN32_EXECUTABLE TRUE
)
elseif(APPLE)
set_target_properties(ShiftIntrinsicGuide PROPERTIES
MACOSX_BUNDLE TRUE
)
endif()

configure_file(include/Version.h.in Version.h)

# Add in the executable code
Expand Down Expand Up @@ -81,7 +91,7 @@ target_include_directories(ShiftIntrinsicGuide
)

target_link_libraries(ShiftIntrinsicGuide PRIVATE
Qt6::Gui
Qt6::Quick
Qt6::Qml
Qt6::Network
Qt6::Xml
Expand Down
2 changes: 1 addition & 1 deletion include/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Application final : public QObject
Application& operator=(Application&&) = delete;

/** Default constructor. */
explicit Application(QObject* parent = nullptr) noexcept;
explicit Application(int argc, char* argv[], QObject* parent = nullptr) noexcept;

/** Destructor. */
~Application() noexcept override;
Expand Down
6 changes: 2 additions & 4 deletions source/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@

#include <QQmlContext>

int argc = 0;

Application::Application(QObject* parent) noexcept
Application::Application(int argc, char* argv[], QObject* parent) noexcept
: QObject(parent)
, app(argc, nullptr)
, app(argc, argv)
, technologiesModel(this)
, typesModel(this)
, categoriesModel(this)
Expand Down
4 changes: 2 additions & 2 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

#include "Application.h"

int main()
int main(int argc, char* argv[])
{
Application app;
Application app(argc, argv);

return app.run();
}
1 change: 0 additions & 1 deletion source/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import QtQuick.Controls.Universal
import QtQuick 6.0
import QtQuick.Layouts 6.0

ApplicationWindow {
visible: true
Expand Down

0 comments on commit 474a5e1

Please sign in to comment.