Commit f36f7ceb authored by camilo higuita's avatar camilo higuita
Browse files

initial work on doodle to text feature

parent 97683268
cmake_minimum_required(VERSION 3.0)
set(BUHO_VERSION 1.2.0)
set(BUHO_VERSION 1.2.1)
set(TESSDATA_PREFIX /usr/share/tessdata)
project(buho VERSION ${BUHO_VERSION})
......@@ -11,6 +13,9 @@ find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Qml Quick Sql Svg QuickControls2
find_package(KF5 REQUIRED COMPONENTS Config KIO Notifications I18n Attica SyntaxHighlighting)
find_package(MauiKit REQUIRED)
find_package(Tesseract REQUIRED)
find_package(Leptonica REQUIRED)
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
......
#
# Find Leptonica
#
# Exported variables:
# Leptonica_FOUND
# Leptonica_INCLUDE_DIRS
# Leptonica_LIBRARIES
#
# Leptonica_VERSION
# Leptonica_MAJOR_VERSION
# Leptonica_MINOR_VERSION
#
find_path(Leptonica_INCLUDE_DIR leptonica/allheaders.h
HINTS
/usr/include
/usr/local/include
/opt/include
/opt/local/include
${Leptonica_DIR}/include
)
if(NOT "${Leptonica_INCLUDE_DIR}" EQUAL "Leptonica_INCLUDE_DIR-NOTFOUND")
set(Leptonica_INCLUDE_DIRS ${Leptonica_INCLUDE_DIR}/leptonica)
file(STRINGS ${Leptonica_INCLUDE_DIRS}/allheaders.h Leptonica_MAJOR_VERSION REGEX "LIBLEPT_MAJOR_VERSION")
file(STRINGS ${Leptonica_INCLUDE_DIRS}/allheaders.h Leptonica_MINOR_VERSION REGEX "LIBLEPT_MINOR_VERSION")
string(REGEX MATCH "[0-9]+" Leptonica_MAJOR_VERSION ${Leptonica_MAJOR_VERSION})
string(REGEX MATCH "[0-9]+" Leptonica_MINOR_VERSION ${Leptonica_MINOR_VERSION})
set(Leptonica_VERSION ${Leptonica_MAJOR_VERSION}.${Leptonica_MINOR_VERSION})
endif()
find_library(Leptonica_LIBRARY NAMES lept liblept
HINTS
/usr/lib
/usr/local/lib
/opt/lib
/opt/local/lib
${Leptonica_DIR}/lib
)
set(Leptonica_LIBRARIES ${Leptonica_LIBRARY})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Leptonica
REQUIRED_VARS
Leptonica_INCLUDE_DIRS
Leptonica_LIBRARIES
VERSION_VAR Leptonica_VERSION
FAIL_MESSAGE "Try to set Leptonica_DIR or Leptonica_ROOT"
)
mark_as_advanced(Leptonica_INCLUDE_DIRS Leptonica_LIBRARIES)
##############################################################################
# @file FindOpenCV.cmake
# @brief Find OpenCV Library (http://sourceforge.net/projects/opencvlibrary/)
#
# @par 1. Setup
#
# The following variables are optionally searched for defaults
# OpenCV_DIR: Base directory of OpenCv tree to use.
#
# @par 2. Variable
#
# The following are set after configuration is done:
# - OpenCV_FOUND
# - OpenCV_LIBS
# - OpenCV_INCLUDE_DIR
# - OpenCV_VERSION (OpenCV_VERSION_MAJOR, OpenCV_VERSION_MINOR, OpenCV_VERSION_PATCH)
#
#
# The following variables are used to maintain compatibility with other
# Find<Pkg>.cmake modules, including the FindOpenCV.cmake module of
# Jan Woetzel (2006/09, www.mip.informatik.uni-kiel.de/~jw):
# - OpenCV_INCLUDE_DIRS
# - OpenCV_LIBRARIES
# - OpenCV_LINK_DIRECTORIES
#
# @par 3. Version
#
# 2012/10/22 Andreas Schuh, Find OpenCV 2 also if OpenCVConfig.cmake missing.
# 2012/02/28 Andreas Schuh, Reimplemented module to work also for OpenCV 1.x.
# 2010/04/07 Benoit Rat, Correct a bug when OpenCVConfig.cmake is not found.
# 2010/03/24 Benoit Rat, Add compatibility for when OpenCVConfig.cmake is not found.
# 2010/03/22 Benoit Rat, Creation of the script.
#
#
# tested with:
# - OpenCV 2.1: MinGW, MSVC2008
# - OpenCV 2.0: MinGW, MSVC2008, GCC4
#
# @par 4. Licence
#
# LGPL 2.1 : GNU Lesser General Public License Usage
# Alternatively, this file may be used under the terms of the GNU Lesser
#
# General Public License version 2.1 as published by the Free Software
# Foundation and appearing in the file LICENSE.LGPL included in the
# packaging of this file. Please review the following information to
# ensure the GNU Lesser General Public License version 2.1 requirements
# will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
#
# @ingroup CMakeFindModules
##############################################################################
# ----------------------------------------------------------------------------
# initialize search
set (OpenCV_FOUND FALSE)
set(OpenCV_INCLUDE_DIR /usr/include/opencv4/opencv2)
set(OpenCV_DIR /usr/lib/cmake/opencv4)
# 1. set OpenCV_DIR from environment variables
if (NOT OpenCV_DIR)
if (DEFINED ENV{OpenCV_DIR})
set (OpenCV_DIR "$ENV{OpenCV_DIR}" CACHE PATH "Installation prefix of OpenCV Library." FORCE)
elseif (DEFINED ENV{OPENCV_DIR})
set (OpenCV_DIR "$ENV{OPENCV_DIR}" CACHE PATH "Installation prefix of OpenCV Library." FORCE)
endif ()
endif ()
# 2. otherwise, try to derive it from include path
if (NOT OpenCV_DIR)
# a) look for include path which might be easily found using system default
# paths such as C_INCLUDE_PATH or CXX_INCLUDE_PATH
find_path (
OpenCV_INCLUDE_DIR "cv.h"
PATH_SUFFIXES "include" "include/opencv"
DOC "Directory of cv.h header file."
)
mark_as_advanced (OpenCV_INCLUDE_DIR)
# b) derive OpenCV_DIR from include path
if (OpenCV_INCLUDE_DIR)
# Mac OS Framework
string (REGEX REPLACE "/Headers(/.*)?$" "" OpenCV_DIR "${OpenCV_INCLUDE_DIR}")
# OpenCV 1
string (REGEX REPLACE "/include(/.*)$" "" OpenCV_DIR "${OpenCV_DIR}")
# OpenCV >= 2
if (EXISTS "${OpenCV_DIR}/share/opencv/OpenCVConfig.cmake")
set (OpenCV_DIR "${OpenCV_DIR}/share/opencv")
endif ()
# cache it such that users can view/correct it
set (OpenCV_DIR "${OpenCV_DIR}" CACHE PATH "Installation prefix of OpenCV Library." FORCE)
endif ()
endif ()
set (OpenCV_LIBS) # found libraries
set (OpenCV_COMPONENTS_REQUIRED) # requested components
set (OpenCV_LIB_COMPONENTS) # found components
set (OpenCV_VERSION) # found version
# ----------------------------------------------------------------------------
# find headers and libraries
if (EXISTS "${OpenCV_DIR}")
# --------------------------------------------------------------------------
# OpenCV 2
if (EXISTS "${OpenCV_DIR}/OpenCVConfig.cmake")
include ("${OpenCV_DIR}/OpenCVConfig.cmake")
foreach (__CVLIB IN LISTS OpenCV_COMPONENTS)
if (NOT __CVLIB MATCHES "^opencv_")
set (__CVLIB "opencv_${__CVLIB}")
endif ()
list (APPEND OpenCV_COMPONENTS_REQUIRED "${__CVLIB}")
endforeach ()
# Note that OpenCV 2.0.0 does only call the command include_directories()
# but does not set OpenCV_INCLUDE_DIRS. This variable was added to
# OpenCVConfig.cmake since version 2.1.0 of OpenCV.
get_directory_property (__INCLUDE_DIRS INCLUDE_DIRECTORIES)
find_path (
OpenCV_INCLUDE_DIR "cv.h"
HINTS ${__INCLUDE_DIRS}
DOC "Directory of cv.h header file."
NO_DEFAULT_PATH
)
mark_as_advanced (OpenCV_INCLUDE_DIR)
unset (__INCLUDE_DIRS)
# --------------------------------------------------------------------------
# OpenCV 1 (or OpenCV 2 with missing OpenCVConfig.cmake file)
else ()
# will be adjusted on Unix to find the correct library version
set (OpenCV_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_FIND_LIBRARY_SUFFIXES}")
# find include directory
find_path (
OpenCV_INCLUDE_DIR "cv.h"
PATHS "${OpenCV_DIR}"
PATH_SUFFIXES "include" "include/opencv"
DOC "Directory of cv.h header file."
NO_DEFAULT_PATH
)
mark_as_advanced (OpenCV_INCLUDE_DIR)
if (EXISTS ${OpenCV_INCLUDE_DIR})
# should not be done by Find module, but OpenCVConfig.cmake does it
# as well, unfortunately...
include_directories (${OpenCV_INCLUDE_DIR})
# extract version information from header file
if (EXISTS "${OpenCV_INCLUDE_DIR}/cvver.h")
file (STRINGS "${OpenCV_INCLUDE_DIR}/cvver.h" OpenCV_VERSIONS_TMP REGEX "^#define CV_[A-Z]+_VERSION[ \t]+[0-9]+$")
elseif (EXISTS "${OpenCV_INCLUDE_DIR}/../opencv2/core/version.hpp")
file (STRINGS "${OpenCV_INCLUDE_DIR}/../opencv2/core/version.hpp" OpenCV_VERSIONS_TMP REGEX "^#define CV_[A-Z]+_VERSION[ \t]+[0-9]+$")
else ()
message (FATAL_ERROR "Missing ${OpenCV_INCLUDE_DIR}/cvver.h or ${OpenCV_INCLUDE_DIR}/../opencv2/core/version.hpp file!")
endif ()
string (REGEX REPLACE ".*#define CV_MAJOR_VERSION[ \t]+([0-9]+).*" "\\1" OpenCV_VERSION_MAJOR ${OpenCV_VERSIONS_TMP})
string (REGEX REPLACE ".*#define CV_MINOR_VERSION[ \t]+([0-9]+).*" "\\1" OpenCV_VERSION_MINOR ${OpenCV_VERSIONS_TMP})
string (REGEX REPLACE ".*#define CV_SUBMINOR_VERSION[ \t]+([0-9]+).*" "\\1" OpenCV_VERSION_PATCH ${OpenCV_VERSIONS_TMP})
set (OpenCV_VERSION "${OpenCV_VERSION_MAJOR}.${OpenCV_VERSION_MINOR}.${OpenCV_VERSION_PATCH}")
# file name suffixes
if (UNIX)
set (OpenCV_CVLIB_NAME_SUFFIX)
set (CMAKE_FIND_LIBRARY_SUFFIXES)
foreach (SUFFIX IN LISTS OpenCV_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
if (NOT SUFFIX MATCHES "\\.${OpenCV_VERSION_MAJOR}\\.${OpenCV_VERSION_MINOR}\\.${OpenCV_VERSION_PATCH}$")
set (SUFFIX "${SUFFIX}.${OpenCV_VERSION}")
endif ()
list (APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${SUFFIX}")
endforeach ()
# for the 1.1pre1 version, the suffix of the libraries is by default .2.0.0 instead of .1.1.0
# thus consider these library files as well, assuming that the suffix has not been corrected
if (OpenCV_VERSION VERSION_EQUAL 1.1.0)
foreach (SUFFIX IN LISTS OpenCV_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
if (NOT SUFFIX MATCHES "\\.2\\.0\\.0$")
list (APPEND CMAKE_FIND_LIBRARY_SUFFIXES "${SUFFIX}.2.0.0")
endif ()
endforeach ()
endif ()
else ()
set (OpenCV_CVLIB_NAME_SUFFIX "${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}")
endif ()
endif ()
# library components
if (OpenCV_VERSION_MAJOR GREATER 1)
set (OpenCV_LIB_COMPONENTS core ml video calib3d contrib features2d flann gpu highgui imgproc objdetect legacy)
else ()
set (OpenCV_LIB_COMPONENTS cxcore cv ml highgui cvaux)
endif ()
if (OpenCV_COMPONENTS)
foreach (__CVLIB IN LISTS OpenCV_COMPONENTS)
string (REGEX REPLACE "^opencv_" "" __CVLIB__ "${__CVLIB}")
list (FIND OpenCV_LIB_COMPONENTS ${__CVLIB__} IDX)
if (IDX EQUAL -1)
message (FATAL_ERROR "Unknown OpenCV library component: ${__CVLIB}"
" Are you looking for OpenCV 2.0.0 or greater?"
" In this case, please set OpenCV_DIR to the"
" directory containing the OpenCVConfig.cmake file.")
endif ()
list (APPEND OpenCV_COMPONENTS_REQUIRED "${__CVLIB__}")
endforeach ()
else ()
set (OpenCV_COMPONENTS_REQUIRED ${OpenCV_LIB_COMPONENTS})
endif ()
# find libraries of components
set (OpenCV_LIB_COMPONENTS)
foreach (__CVLIB IN LISTS OpenCV_COMPONENTS_REQUIRED)
# debug build
find_library (
OpenCV_${__CVLIB}_LIBRARY_DEBUG
NAMES "opencv_${__CVLIB}${OpenCV_CVLIB_NAME_SUFFIX}d" "${__CVLIB}${OpenCV_CVLIB_NAME_SUFFIX}d"
PATHS "${OpenCV_DIR}/lib"
NO_DEFAULT_PATH
)
# release build
if (APPLE AND OpenCV_DIR MATCHES "/OpenCV\\.framework/*$" AND EXISTS "${OpenCV_DIR}/OpenCV" AND NOT IS_DIRECTORY "${OpenCV_DIR}/OpenCV")
find_file (
OpenCV_${__CVLIB}_LIBRARY_RELEASE
NAMES OpenCV
PATHS "${OpenCV_DIR}"
NO_DEFAULT_PATH
)
else ()
find_library (
OpenCV_${__CVLIB}_LIBRARY_RELEASE
NAMES "opencv_${__CVLIB}${OpenCV_CVLIB_NAME_SUFFIX}" "${__CVLIB}${OpenCV_CVLIB_NAME_SUFFIX}"
PATHS "${OpenCV_DIR}/lib"
NO_DEFAULT_PATH
)
endif ()
mark_as_advanced (OpenCV_${__CVLIB}_LIBRARY_DEBUG)
mark_as_advanced (OpenCV_${__CVLIB}_LIBRARY_RELEASE)
# both debug/release
if (OpenCV_${__CVLIB}_LIBRARY_DEBUG AND OpenCV_${__CVLIB}_LIBRARY_RELEASE)
set (OpenCV_${__CVLIB}_LIBRARY debug ${OpenCV_${__CVLIB}_LIBRARY_DEBUG} optimized ${OpenCV_${__CVLIB}_LIBRARY_RELEASE})
# only debug
elseif (OpenCV_${__CVLIB}_LIBRARY_DEBUG)
set (OpenCV_${__CVLIB}_LIBRARY ${OpenCV_${__CVLIB}_LIBRARY_DEBUG})
# only release
elseif (OpenCV_${__CVLIB}_LIBRARY_RELEASE)
set (OpenCV_${__CVLIB}_LIBRARY ${OpenCV_${__CVLIB}_LIBRARY_RELEASE})
# not found
else ()
set (OpenCV_${__CVLIB}_LIBRARY)
endif()
# add to list of found libraries
if (OpenCV_${__CVLIB}_LIBRARY)
list (APPEND OpenCV_LIB_COMPONENTS ${__CVLIB})
list (APPEND OpenCV_LIBS "${OpenCV_${__CVLIB}_LIBRARY}")
endif ()
endforeach ()
# restore library suffixes
set (CMAKE_FIND_LIBRARY_SUFFIXES "${OpenCV_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}")
# compatibility with OpenCV 2
set (OpenCV_INCLUDE_DIRS "${OpenCV_INCLUDE_DIR}")
endif ()
# --------------------------------------------------------------------------
# set OpenCV_INCLUDE_DIRS - required for OpenCV before version 2.1.0
if (OpenCV_INCLUDE_DIR MATCHES "/opencv$" AND NOT OpenCV_INCLUDE_DIRS)
get_filename_component (OpenCV_INCLUDE_DIRS "${OpenCV_INCLUDE_DIR}" PATH)
list (APPEND OpenCV_INCLUDE_DIRS "${OpenCV_INCLUDE_DIR}")
endif ()
# --------------------------------------------------------------------------
# handle the QUIETLY and REQUIRED arguments and set *_FOUND to TRUE
# if all listed variables are found or TRUE
include (FindPackageHandleStandardArgs)
set (OpenCV_REQUIRED_COMPONENTS_FOUND TRUE)
set (OpenCV_COMPONENTS_NOT_FOUND)
foreach (__CVLIB IN LISTS OpenCV_COMPONENTS_REQUIRED)
list (FIND OpenCV_LIB_COMPONENTS ${__CVLIB} IDX)
if (IDX EQUAL -1)
set (OpenCV_REQUIRED_COMPONENTS_FOUND FALSE)
list (APPEND OpenCV_COMPONENTS_NOT_FOUND ${__CVLIB})
endif ()
endforeach ()
if (NOT OpenCV_REQUIRED_COMPONENTS_FOUND)
if (NOT OpenCV_FIND_QUIET AND OpenCV_FIND_REQUIRED)
message (FATAL_ERROR "The following required OpenCV components"
" were not found: ${OpenCV_COMPONENTS_NOT_FOUND}")
endif ()
endif ()
find_package_handle_standard_args (
OpenCV
REQUIRED_VARS
OpenCV_INCLUDE_DIR
OpenCV_LIBS
OpenCV_REQUIRED_COMPONENTS_FOUND
VERSION_VAR
OpenCV_VERSION
)
set (OpenCV_FOUND "${OPENCV_FOUND}")
# --------------------------------------------------------------------------
# (backward) compatibility
if (OpenCV_FOUND)
set (OpenCV_LIBRARIES "${OpenCV_LIBS}")
endif ()
elseif (NOT OpenCV_FIND_QUIET AND OpenCV_FIND_REQUIRED)
message (FATAL_ERROR "Please specify the OpenCV directory using OpenCV_DIR (environment) variable.")
endif ()
# cmake macro to test if we use sane
#
# TESSERACT_FOUND - system has Sane
# TESSERACT_INCLUDE_DIR - the Sane include directory
# TESSERACT_LIBRARIES - The libraries needed to use Sane
FIND_PATH(TESSERACT_INCLUDE_DIR tesseract/baseapi.h
/usr/include
/usr/local/include
/opt/local/incude
)
FIND_LIBRARY(TESSERACT_LIBRARY NAMES tesseract libtesseract
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
)
if(TESSERACT_INCLUDE_DIR AND TESSERACT_LIBRARY)
set(TESSERACT_FOUND TRUE)
set(TESSERACT_LIBRARIES ${TESSERACT_LIBRARY})
else()
set(TESSERACT_FOUND FALSE)
endif()
if (TESSERACT_FOUND)
if (NOT Tesseract_FIND_QUIETLY)
message(STATUS "Found Tesseract: ${TESSERACT_LIBRARIES}")
endif (NOT Tesseract_FIND_QUIETLY)
else (TESSERACT_FOUND)
if (NOT Tesseract_FIND_QUIETLY)
message(STATUS "don't find Tesseract")
endif (NOT Tesseract_FIND_QUIETLY)
endif (TESSERACT_FOUND)
MARK_AS_ADVANCED(TESSERACT_INCLUDE_DIR TESSERACT_LIBRARIES TESSERACT_LIBRARY)
......@@ -28,6 +28,7 @@ set(buho_SRCS
syncing/notessyncer.cpp
controllers/notes/notescontroller.cpp
controllers/books/bookscontroller.cpp
doodle/doodlehanlder.cpp
)
set(buho_HDRS
......@@ -44,6 +45,7 @@ set(buho_HDRS
syncing/notessyncer.h
controllers/notes/notescontroller.h
controllers/books/bookscontroller.h
doodle/doodlehanlder.h
)
set(buho_ASSETS
......@@ -62,7 +64,7 @@ if(ANDROID)
kde_source_files_enable_exceptions(buho buho.cpp)
endif()
target_link_libraries(buho MauiKit Qt5::Sql Qt5::Qml Qt5::Svg Qt5::WebView)
target_link_libraries(buho MauiKit tesseract Qt5::Sql Qt5::Qml Qt5::Svg Qt5::WebView)
target_link_libraries(buho KF5::ConfigCore KF5::Notifications KF5::KIOCore KF5::I18n KF5::Attica KF5::SyntaxHighlighting)
install(TARGETS buho ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
#include "doodlehanlder.h"
#include <fstream>
#include <iostream>
#include <filesystem>
#include <chrono>
#include <leptonica/allheaders.h>
#include "tesseract/baseapi.h"
#include "tesseract/ocrclass.h"
#include <QImage>
#include <string>
#include <QDebug>
DoodleHanlder::DoodleHanlder(QObject *parent) : QObject(parent)
{
}
QString DoodleHanlder::getText(const QString &imagePath)
{
tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI();
api->Init(NULL, "eng", tesseract::OEM_LSTM_ONLY);
api->SetPageSegMode(tesseract::PSM_AUTO);
api->SetVariable("debug_file", "tesseract.log");
// char *text;
QImage image(imagePath);
if (image.isNull())
return "";
qDebug() << image;
QImage g=image.convertToFormat(QImage::Format_Grayscale8);
qDebug() << g;
if (g.isNull())
return "";
api->SetImage(g.bits(),
g.width(),
g.height(),
1,
g.bytesPerLine());
QString outText = QString::fromStdString(api->GetUTF8Text());
qDebug() << outText;
api->End();
// pixDestroy(&image);
return outText;
}
#ifndef DOODLEHANLDER_H
#define DOODLEHANLDER_H
#include <QObject>
#include <QString>
//#include <opencv4/opencv2/opencv.hpp>
class DoodleHanlder : public QObject
{
Q_OBJECT
public:
explicit DoodleHanlder(QObject *parent = nullptr);
public slots:
QString getText(const QString &imagePath);
signals:
};
#endif // DOODLEHANLDER_H
......@@ -37,6 +37,8 @@
#include "models/books/books.h"
#include "models/notes/notes.h"
#include "doodle/doodlehanlder.h"
#define BUHO_URI "org.maui.buho"
int Q_DECL_EXPORT main(int argc, char *argv[])
......@@ -85,6 +87,7 @@ int Q_DECL_EXPORT main(int argc, char *argv[])
qmlRegisterAnonymousType<Booklet>(BUHO_URI, 1);
qmlRegisterType<Notes>(BUHO_URI, 1, 0, "Notes");
qmlRegisterType<Books>(BUHO_URI, 1, 0, "Books");
qmlRegisterType<DoodleHanlder>(BUHO_URI, 1, 0, "Doodle");
#ifdef STATIC_KIRIGAMI
KirigamiPlugin::getInstance().registerTypes();
......
......@@ -6,6 +6,8 @@ import Qt.labs.settings 1.0
import org.kde.kirigami 2.7 as Kirigami
import org.kde.mauikit 1.2 as Maui
import org.maui.buho 1.0 as Buho
import "widgets"
import "views/notes"
import "views/books"
......@@ -30,11 +32,16 @@ Maui.ApplicationWindow
// autoHideHeader: swipeView.currentItem.editing
headBar.visible: !swipeView.currentItem.editing
Buho.Doodle
{
id: _doodleHandler
}
mainMenu: Action
{
text: i18n("Settings")
icon.name: "settings-configure"
onTriggered: _settingsDialog.open()
onTriggered: _doodleDialog.open()
}
// /***** COMPONENTS *****/
Settings
......@@ -52,6 +59,12 @@ Maui.ApplicationWindow
property font font : defaultFont
}
Maui.NewDialog
{
id: _doodleDialog
onFinished: _doodleHandler.getText(text)
}
SettingsDialog
{
id: _settingsDialog
......
......@@ -14,7 +14,7 @@ Booklet::Booklet(BooksSyncer *_syncer, QObject *parent) : MauiList(parent),
});
}
FMH::MODEL_LIST Booklet::items() const
const FMH::MODEL_LIST &Booklet::items() const
{
return this->m_list;
}
......
......@@ -41,7 +41,7 @@ public:
};
Q_ENUM(SORTBY)
FMH::MODEL_LIST items() const override final;
const FMH::MODEL_LIST &items() const override final;
void setSortBy(const SORTBY &sort);
SORTBY getSortBy() const;
......
......@@ -32,7 +32,7 @@ Books::Books(QObject *parent) : MauiList(parent),
this->syncer->getBooks();
}
FMH::MODEL_LIST Books::items() const
const FMH::MODEL_LIST &Books::items() const
{
return this->m_list;
}
......
......@@ -23,7 +23,7 @@ class Books : public MauiList
public:
Books(QObject *parent = nullptr);
FMH::MODEL_LIST items() const override final;
const FMH::MODEL_LIST &items() const override final;
Booklet * getBooklet() const;
......