fix library (chead card fixes )

This commit is contained in:
Andrei Yankovich 2022-01-19 22:22:54 +03:00
parent b345297c6c
commit c2efb07a12
7 changed files with 21 additions and 16 deletions

View File

@ -56,9 +56,7 @@ endif()
initAll()
if (DOCTOR_PILL_GUI)
add_definitions(-DDOCTOR_PILL_GUI)
else()
if (NOT DOCTOR_PILL_GUI)
set(DOCTOR_PILL_EXAMPLE OFF)
endif()

View File

@ -93,6 +93,7 @@ For working with gui wrapper you need to initialize this library before include
#### initialize the library (main.cpp)
```cpp
int main(int argc, char *argv[]) {
@ -129,6 +130,7 @@ int main(int argc, char *argv[]) {
```qml
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Controls.Material 2.15

View File

@ -35,13 +35,13 @@ set(ALL_SOURCES ${SOURCE_CPP} ${SOURCE_QRC} ${SOURCE_CPP_GUI})
set(PUBLIC_INCUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(PRIVATE_INCUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/private")
set(global_file "${CMAKE_CURRENT_SOURCE_DIR}/doctorpill_global.h")
configure_file("${global_file}.in" ${global_file} @ONLY)
add_library(${PROJECT_NAME} ${ALL_SOURCES})
target_link_libraries(${PROJECT_NAME} PUBLIC Qt${QT_VERSION_MAJOR}::Core )
set(DOCTOR_PILL_DEFINE "DOCTOR_PILL_WITHOUT_GUI")
if (DOCTOR_PILL_GUI)
set(DOCTOR_PILL_DEFINE "DOCTOR_PILL_WITH_GUI")
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Quick Concurrent REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC Qt${QT_VERSION_MAJOR}::Concurrent Qt${QT_VERSION_MAJOR}::Quick )
endif()
@ -65,3 +65,5 @@ prepareQM(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/../ "${LANGS}")
set(QML_IMPORT_PATH ${QML_IMPORT_PATH} "${CMAKE_CURRENT_SOURCE_DIR}" CACHE STRING "" FORCE)
set(global_file "${CMAKE_CURRENT_SOURCE_DIR}/doctorpill_global.h")
configure_file("${global_file}.in" ${global_file} @ONLY)

View File

@ -20,7 +20,7 @@ Page {
horizontalAlignment: Label.AlignHCenter
text: title
font.pointSize: 20
color: "#424242"
color: (Material.theme === Material.Light)? "#424242" : "#aaaaaa"
wrapMode: Label.WordWrap
visible: showTitle
}
@ -127,6 +127,8 @@ Page {
onClicked: {
if (root.model) {
root.model.diagnostic();
} else {
console.warn("The DoctorView require model object.")
}
}
}

View File

@ -6,12 +6,12 @@
//#
#include "doctorpill.h"
#ifdef DOCTOR_PILL_GUI
#ifdef DOCTOR_PILL_WITH_GUI
#include <QQmlApplicationEngine>
#endif
namespace DP {
#ifdef DOCTOR_PILL_GUI
#ifdef DOCTOR_PILL_WITH_GUI
bool init(QQmlApplicationEngine *engine) {
if (!engine)
@ -28,14 +28,14 @@ bool init(QQmlApplicationEngine *engine) {
return true;
}
QString version() {
return DOCTOR_PILL_VERSION;
}
#else
bool init() {
return true;
}
#endif
QString version() {
return DOCTOR_PILL_VERSION;
}
}

View File

@ -11,7 +11,7 @@
#include "DoctorPillCore/doctor.h"
#include "DoctorPillCore/doctortest.h"
#ifdef DOCTOR_PILL_GUI
#ifdef DOCTOR_PILL_WITH_GUI
#include "DoctorPillGui/doctormodel.h"
@ -27,7 +27,7 @@ class QQmlApplicationEngine;
*/
namespace DP {
#ifdef DOCTOR_PILL_GUI
#ifdef DOCTOR_PILL_WITH_GUI
/**
* @brief init This function initialize the qml gui classes of the DoctorPill library.
* @note if you do not use GUI then this function do nothing.

View File

@ -17,6 +17,7 @@
#endif
#define DOCTOR_PILL_VERSION "@DOCTOR_PILL_VERSION@"
#define @DOCTOR_PILL_DEFINE@
#endif //DoctorPill_GLOBAL_H