├── .gitignore
├── AUTHORS
├── CHANGELOG
├── CMakeLists.txt
├── CURRENT_VERSION
├── INSTALL
├── LICENSE
├── README.md
├── dialogs
├── DrawRectangle.cpp
├── DrawRectangle.h
├── DrawRectangle.ui
├── FindDialog.cpp
├── FindDialog.h
├── FindDialog.ui
├── GetRowIDDialog.cpp
├── GetRowIDDialog.h
├── GetRowIDDialog.ui
├── SettingsDialog.cpp
├── SettingsDialog.h
├── SettingsDialog.ui
├── ShortCutDialog.ui
├── ShortCutsDialog.cpp
└── ShortCutsDialog.h
├── qt-box-editor.pro
├── resources
├── QBE-Faenza.qrc
├── QBE-GNOME.qrc
├── QBE-Oxygen.qrc
├── QBE-Tango.qrc
├── application.qrc
├── icons
│ ├── QBE-Faenza
│ │ ├── README
│ │ ├── applications-fonts.svg
│ │ ├── document-import.png
│ │ ├── document-open.png
│ │ ├── document-save-as.png
│ │ ├── document-save.png
│ │ ├── edit-find.svg
│ │ ├── edit-redo.png
│ │ ├── edit-undo.png
│ │ ├── exit.png
│ │ ├── format-text-bold.png
│ │ ├── format-text-italic.png
│ │ ├── format-text-underline.png
│ │ ├── go-jump.png
│ │ ├── go-next.png
│ │ ├── go-previous.png
│ │ ├── help-about.svg
│ │ ├── index.theme
│ │ ├── key_bindings.svg
│ │ ├── software-properties.svg
│ │ ├── zoom-fit.png
│ │ ├── zoom-height.png
│ │ ├── zoom-in.png
│ │ ├── zoom-original.png
│ │ ├── zoom-out.png
│ │ ├── zoom-selection.png
│ │ └── zoom-width.png
│ ├── QBE-GNOME
│ │ ├── README
│ │ ├── application-exit.png
│ │ ├── document-open.png
│ │ ├── document-save-as.png
│ │ ├── document-save.png
│ │ ├── edit-find.png
│ │ ├── edit-redo.png
│ │ ├── edit-undo.png
│ │ ├── format-text-bold.png
│ │ ├── format-text-italic.png
│ │ ├── format-text-underline.png
│ │ ├── go-down.png
│ │ ├── go-jump.png
│ │ ├── go-next.png
│ │ ├── go-previous.png
│ │ ├── go-up.png
│ │ ├── help-about.png
│ │ ├── index.theme
│ │ ├── list-add.png
│ │ ├── list-remove.png
│ │ ├── preferences-desktop-font.png
│ │ ├── preferences-desktop-keyboard-shortcuts.png
│ │ ├── preferences-system.png
│ │ ├── zoom-fit-best.png
│ │ ├── zoom-in.png
│ │ ├── zoom-original.png
│ │ └── zoom-out.png
│ ├── QBE-Misc
│ │ ├── Document-import.svg
│ │ ├── README
│ │ ├── gnome-edit-find.svg
│ │ ├── joinRow.svg
│ │ ├── moveTo.svg
│ │ └── splitRow.svg
│ ├── QBE-Oxygen
│ │ ├── application-exit.png
│ │ ├── application-x-font-ttf.png
│ │ ├── document-import.png
│ │ ├── document-open.png
│ │ ├── document-save-as.png
│ │ ├── document-save.png
│ │ ├── draw-rectangle.png
│ │ ├── edit-find.png
│ │ ├── edit-redo.png
│ │ ├── edit-table-delete-row.png
│ │ ├── edit-table-insert-row-under.png
│ │ ├── edit-undo.png
│ │ ├── format-text-bold.png
│ │ ├── format-text-italic.png
│ │ ├── format-text-underline.png
│ │ ├── go-down.png
│ │ ├── go-jump.png
│ │ ├── go-next.png
│ │ ├── go-previous.png
│ │ ├── go-up.png
│ │ ├── help-about.png
│ │ ├── index.theme
│ │ ├── list-add.png
│ │ ├── list-remove.png
│ │ ├── preferences-desktop-keyboard.png
│ │ ├── preferences-system.png
│ │ ├── zoom-fit-best.png
│ │ ├── zoom-fit-height.png
│ │ ├── zoom-fit-width.png
│ │ ├── zoom-in.png
│ │ ├── zoom-original.png
│ │ ├── zoom-out.png
│ │ └── zoom-select.png
│ ├── QBE-Tango
│ │ ├── README
│ │ ├── View-zoom-0.svg
│ │ ├── View-zoom-fit.svg
│ │ ├── View-zoom-in.svg
│ │ ├── View-zoom-out.svg
│ │ ├── View-zoom-target.svg
│ │ ├── document-open.svg
│ │ ├── document-save-as.svg
│ │ ├── document-save.svg
│ │ ├── edit-find.svg
│ │ ├── edit-redo.svg
│ │ ├── edit-undo.svg
│ │ ├── font-x-generic.svg
│ │ ├── format-text-bold.svg
│ │ ├── format-text-italic.svg
│ │ ├── format-text-underline.svg
│ │ ├── go-down.svg
│ │ ├── go-jump.svg
│ │ ├── go-next.svg
│ │ ├── go-previous.svg
│ │ ├── go-top.svg
│ │ ├── go-up.svg
│ │ ├── help-browser.svg
│ │ ├── index.theme
│ │ ├── list-add.svg
│ │ ├── list-remove.svg
│ │ └── system-log-out.svg
│ ├── qbe.ico
│ ├── qbe.png
│ ├── qbe.svg
│ └── qbe
│ │ ├── README
│ │ ├── deleteRow.png
│ │ ├── deleteRow.svg
│ │ ├── down.svg
│ │ ├── drawRect.png
│ │ ├── insertRow.svg
│ │ ├── rectangle.svg
│ │ ├── showSymbol.png
│ │ └── up.svg
└── win.rc
├── src
├── ChildWidget.cpp
├── ChildWidget.h
├── DelegateEditors.cpp
├── DelegateEditors.h
├── MainWindow.cpp
├── MainWindow.h
├── Settings.h
├── TessTools.cpp
├── TessTools.h
└── main.cpp
└── tests
├── 8.box
├── 8.tif
├── DESCRIPTIONS
├── eng.ligatures.exp01.box
├── eng.ligatures.exp01.tif
├── eng.ligatures.exp01.txt
├── hiero.sethe.1.box
├── hiero.sethe.1.png
├── kan01.box
├── kan01.png
├── multipages.box
├── multipages.tif
├── pangrams-stam.box
├── pangrams-stam.png
├── slk.example.001.bmp
└── slk.example.001.box
/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | *.swp
3 | .hg*
4 | temp*
5 | x_code*
6 | qt-box-editor-*
7 | qt-box-editor.pro*
8 | tests*
9 | old*
10 | Makefile
11 | Makefile.Debug
12 | Makefile.Release
13 | object_script.*
14 | win32*
15 | win64*
16 | *.dll
17 | build/*
--------------------------------------------------------------------------------
/AUTHORS:
--------------------------------------------------------------------------------
1 | zofer = Zohar Gofer (C) 2012
2 | daemons2000 = Dmitri Silaev (C) 2012
3 | zdenop = Zdenko Podobný (C) 2011-2012
4 | mk219533 = Marcel Kołodziejczyk (C) 2009-2010 (Original author)
5 |
--------------------------------------------------------------------------------
/CHANGELOG:
--------------------------------------------------------------------------------
1 | 1.13
2 | - fixed compatibility with QT5
3 | - build build against the tesseract 5.4.x and leptonica 1.84
4 | - add cmake support
5 |
6 | 1.12
7 | - fixed compatibility with Tesseract API 3.02 and 3.03
8 | - fix generating box file with tesserac 3.04 and 3.05
9 | - fix grayscale palette in PIXqImage
10 | - fix opening box files created by text2image
11 | - use c++11 for bulding
12 | - several other bug fixes
13 |
14 | 1.11
15 | - fixed compatibility with QT5
16 | - added multipage support
17 | - use leptonica for opening tif files to problems with tif
18 | - several bug fixes
19 |
20 | 1.10
21 | - implemented bbox drag resizing (thanks to D. Silaev)
22 | - reload image, reload box file from disk
23 | - implemented 'regenerate box file'
24 | - implemented 'convert image to binary image'
25 | - implemented 'zoom in/out' with CTRL + mouse wheel
26 | - watch for modified boxfile outside of program
27 | - set CrossCursor for rubberBand selection
28 | - improve shortcuts info/help
29 | - fix for moveTo function
30 | - fix crash for joinSymbol/add check for selection in modelItemBox
31 |
32 | 1.09
33 | - implemented icontheme change option + 3 additional themes (gnome, tango,
34 | oxygen)
35 | - implemented option to change QT Style
36 | - implemented redo (thanks to Z. Gofer)
37 | - improved undo (thanks to Z. Gofer)
38 | - Rubber band selection with Ctrl + mouse click and drag from image
39 | (thanks to D. Silaev)
40 | - multiline join and delete (thanks to D. Silaev)
41 | - baloon effect - possibility to define how many symbols will be displayed
42 | (thanks to D. Silaev)
43 | - extended settings for more customisation
44 | - several fixed of segfault
45 |
46 | 1.08
47 | - show/hide columns with font formatting (thanks to D. Silaev)
48 | - char table col width management, Font column fixes (thanks to D. Silaev)
49 | - fixed MSVC build (thanks to D. Silaev)
50 | - multiple Balloon Symbols to increase proofreading (thanks to D. Silaev)
51 | - initial implementation of undo for table operation: Add, Delete, Change,
52 | Join, Split, Replace (thanks to Z. Gofer)
53 | - Halo text effect for better readability (thanks to D. Silaev)
54 | - fixes related to direct typing mode thanks to D. Silaev)
55 | - fix segfault when zooming
56 |
57 | 1.07
58 | - implement Drag&Drop for opening images
59 | - create box file if not exists (requires tesseract traineddata)
60 | - multirow change of font style (bold/italic/underlined)
61 | - export to multiple box files based on font style (bold/italic/underlined)
62 | - draw rectangle based on bounding box
63 | - fixes for table size, font style change, line recognition in text export,
64 | row moving
65 |
66 | 1.06
67 | - changes of box size is visible on image immediately
68 | - implemented find dialog
69 |
70 | 1.05
71 | - status bar improvement:
72 | * UTF code of symbol
73 | * size of box
74 | * zoom factor
75 | - export of symbols to txt file ( symbol per line, line by line, paragraph per
76 | line)
77 | - import of symbols from txt file
78 | - improved settings dialog for export/import
79 |
80 | 1.04
81 | - direct typing mode (automatic moving to next symbol cell after key release
82 | event)
83 | - improved copy&paste in symbol table
84 | - new functions: "Go to", "Move to" for symbol table
85 | - toolbar for symbol table operations
86 | - fixed loading multipage box file (at the moment there is support only for
87 | first page, so other pages must be ignored)
88 | - fixed check of new version on Windows build (proxy is still not supported)
89 | - used plastic theme
90 |
91 | 1.03
92 | - setting dialog
93 | - option to select font for table, colors for boxes
94 | - shortcuts help/dialog
95 | - added function to insert box
96 | - added function to move box within table/model
97 |
98 | 1.02
99 | - replace icons from Faenza Icons set
100 | - added zoom to box, zoom to fit, fit to width, fit to height
101 | - added hide/show boxes
102 | - improved saving/restoring state of application
103 |
104 | 1.01
105 | - fixed problem that application did not find box file if there where multiple
106 | dots in filename
107 | - add support for tesseract v3.00 box files
108 | - Open file remembers last open directory
109 | - added Check for update (it did not work on windows)
110 | - added Recent files to File menu
111 | - added Save As function
112 | - added Zoom 1:1
113 |
114 | 1.00
115 | - initial release
116 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.5)
2 |
3 | project(qt-box-editor CXX)
4 | set(CMAKE_CXX_STANDARD 17)
5 |
6 | set(QTB_VERSION "1.13.0")
7 | add_definitions(-DAPP_VERSION="${QTB_VERSION}")
8 | set(CMAKE_INCLUDE_CURRENT_DIR ON)
9 | set(CMAKE_AUTOMOC ON)
10 | set(CMAKE_AUTORCC ON)
11 | set(CMAKE_AUTOUIC ON)
12 |
13 | find_package(Qt5 REQUIRED Widgets Svg Network)
14 | find_package(Leptonica REQUIRED)
15 | find_package(Tesseract REQUIRED)
16 |
17 | include_directories(${Tesseract_INCLUDE_DIRS} ${Leptonica_INCLUDE_DIRS})
18 | include_directories(
19 | ${CMAKE_CURRENT_SOURCE_DIR}/dialogs ${CMAKE_CURRENT_SOURCE_DIR}/src
20 | )
21 | link_directories(${Tesseract_LIBRARY_DIRS} ${leptonica_LIBRARY_DIRS})
22 | add_definitions(${Tesseract_DEFINITIONS} ${leptonica_DEFINITIONS})
23 |
24 | set(project_SOURCES
25 | src/main.cpp
26 | src/MainWindow.cpp
27 | src/ChildWidget.cpp
28 | src/DelegateEditors.cpp
29 | src/TessTools.cpp
30 | dialogs/SettingsDialog.cpp
31 | dialogs/GetRowIDDialog.cpp
32 | dialogs/ShortCutsDialog.cpp
33 | dialogs/FindDialog.cpp
34 | dialogs/DrawRectangle.cpp)
35 | set(project_HEADERS
36 | src/MainWindow.h
37 | src/ChildWidget.h
38 | src/Settings.h
39 | src/TessTools.h
40 | src/DelegateEditors.h
41 | dialogs/SettingsDialog.h
42 | dialogs/GetRowIDDialog.h
43 | dialogs/ShortCutsDialog.h
44 | dialogs/FindDialog.h
45 | dialogs/DrawRectangle.h)
46 | set(project_FORMS
47 | dialogs/ShortCutDialog.ui dialogs/GetRowIDDialog.ui
48 | dialogs/SettingsDialog.ui dialogs/FindDialog.ui dialogs/DrawRectangle.ui)
49 | set(project_RESOURCES
50 | resources/application.qrc resources/QBE-GNOME.qrc resources/QBE-Faenza.qrc
51 | resources/QBE-Oxygen.qrc resources/QBE-Tango.qrc)
52 |
53 | # qt5_add_resources(project_SOURCES ${project_RESOURCES})
54 |
55 | if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
56 | enable_language("RC")
57 | set (WIN32_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/resources/win.rc)
58 | endif()
59 |
60 | add_executable(
61 | ${CMAKE_PROJECT_NAME}-${QTB_VERSION} ${project_SOURCES} ${project_FORMS}
62 | ${project_HEADERS} ${project_RESOURCES} ${WIN32_RESOURCES})
63 | target_link_libraries(
64 | ${CMAKE_PROJECT_NAME}-${QTB_VERSION} Qt5::Widgets Qt5::Svg Qt5::Network
65 | ${Leptonica_LIBRARIES} ${Tesseract_LIBRARIES} )
66 |
--------------------------------------------------------------------------------
/CURRENT_VERSION:
--------------------------------------------------------------------------------
1 | 1.11
2 |
--------------------------------------------------------------------------------
/INSTALL:
--------------------------------------------------------------------------------
1 | REQUIREMENTS
2 | ============
3 | * QT4 (tested with QT-4.7.3, QT-4.8.2)
4 | * leptonica library
5 | * tesseract 3.01 or 3.02 build as library
6 | Obs.: In case you're compiling it with QT5 >= then you must to install libqt5svg5-dev/libqt5svg5-devel
7 |
8 | BUILDING
9 | ========
10 |
11 | adjust location of leptonica and tesseract in qt-box-editor.pro
12 | qmake
13 | make
14 |
15 | In case of Windows, output is in win32 directory.
16 |
17 | BUILDING ON UBUNTU
18 | ==================
19 |
20 | sudo apt-get install qt5-qmake
21 | sudo apt-get install qt5-default
22 | sudo apt-get install libqt5gui5
23 | sudo apt-get install qt5-doc
24 | sudo apt-get install libqt5svg5-dev
25 | sudo apt-get install libleptonica-dev
26 |
27 | qmake -qt=5
28 | make
29 |
30 | BUILDING ON OSX
31 | ==================
32 |
33 | Before you can run the qmake/ make commands below, you'll need to install the Apple published Xcode suite, and run it at least once so the terms can be agreed to.
34 |
35 | brew cask install xquartz
36 | brew install --with-training-tools tesseract
37 | brew install qt
38 | qmake
39 | make
40 | open qt-box-editor-1.13dev.app/
41 |
42 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 |
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | QT Box Editor
2 | =============
3 |
4 | Project homepage: [https://github.com/zdenop/qt-box-editor](https://github.com/zdenop/qt-box-editor)
5 |
6 | Project description: [https://zdenop.github.io/qt-box-editor/](https://zdenop.github.io/qt-box-editor/)
7 |
8 | Screenshots: [wiki](https://github.com/zdenop/qt-box-editor/wiki)
9 |
10 | Download current (devel) source: [tar.gz](https://github.com/zdenop/qt-box-editor/tarball/master) or [zip](https://github.com/zdenop/qt-box-editor/zipball/master).
11 |
12 | The latest released source is [qt-box-editor-v1.13](https://github.com/zdenop/qt-box-editor/tarball/master/tree/v1.13).
13 |
14 | Download [win32 binary build](http://sourceforge.net/projects/qtboxeditor/?source=dlp) from [sourceforge.net](http://sourceforge.net/projects/qtboxeditor/)
15 |
16 | Licence: [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
17 |
18 |
19 | DESCRIPTION
20 | -----------
21 |
22 | QT Box Editor is tool for adjusting [tesseract-ocr](https://github.com/tesseract-ocr/tesseract) v3 (a.k.a Legacy engine) box files. Aim of this project is to provide easy and efficient way for editing regardless file size.
23 | **It is useless for training tesseract v4 and above (LSTM engine).**
24 |
25 | Release information can be found in CHANGELOG file. Code and artwork contribution is welcomed.
26 |
27 | QT box editor is a successor of [tesseract-gui project](https://github.com/mk219533/tesseract-gui) that is not developed anymore. Name of application was changed due to name collision with project http://tesseract-gui.sourceforge.net.
28 |
29 |
30 | LICENSE
31 | -------
32 |
33 | License was changed from "THE BEER-WARE LICENSE" to ["Apache License, Version 2.0"](http://www.apache.org/licenses/LICENSE-2.0) based on agreement with Marcel Kołodziejczyk ([original author](https://github.com/mk219533/tesseract-gui)). Anyway you are welcome to buy him a free beer if you meet him. He deserves it.
34 |
35 | [Faenza Icons](http://tiheum.deviantart.com/art/Faenza-Icons-173323228) are under GNU/GPL license.
36 | [Tango Icons](http://tango.freedesktop.org/) are Public Domain.
37 |
38 | ARTWORK
39 | -------
40 |
41 | These icons are Faenza Icons:
42 | exit.png
43 | filesave.png
44 | fileopen.png
45 | gtk-jump-to-ltr.png
46 | help-about.png
47 | next.png
48 | previous.png
49 | text_bold.png
50 | text_italic.png
51 | text_under.png
52 | window-close.png
53 | zoom-in.png
54 | zoom-fit.png
55 | zoom-original.png
56 | zoom-out.png
57 | zoom-selection.png (is modified zoom-fit.png)
58 |
59 | import.svg is modified icon of Faenza fileopen icon.
60 |
61 | joinRow.svg and splitRow.svg are adapted icons of lmproulx icons [Convergent](http://www.openclipart.org/detail/convergent-by-lmproulx) and [Divergent](http://www.openclipart.org/detail/divergent-by-lmproulx)
62 |
63 | gnome-edit-find.svg is from [Wikipedia](http://en.wikipedia.org/wiki/File:Gnome-edit-find.svg).
64 |
65 | Other icons/artwork were created for Qt Box Editor and they are released under Apache License, Version 2.0.
66 |
67 |
68 | Distribution
69 | ------------
70 |
71 | See [release page](https://github.com/zdenop/qt-box-editor/releases)
72 |
73 |
74 |
75 | Instalation
76 | -----------
77 |
78 | Requirements: QT5, tesseract & leptonica and (optionally) cmake.
79 |
80 | For building you can use `qmake-qt5` or `cmake`
81 |
82 | For cmake build you will need to compile&install tesseract by cmake otherwise cmake relevant files (e.g. ` tesseractConfig.cmake`) will not be created and installed.
83 |
84 | ## cmake windows build
85 |
86 | `` could be e.g. `f:/Qt/5.15.2/msvc2019_64`
87 | `` could be e.g. `f:/win64`
88 |
89 | ```sh
90 | set QTDIR=
91 | set PATH=%QTDIR%/bin;%PATH%
92 | cmake -G "Visual Studio 16 2019" -A x64 -S . -B build -DCMAKE_PREFIX_PATH=";"
93 | cmake --build build --config Release --verbose
94 | ```
95 |
96 | The Output will be at build\Release\qt-box-editor-1.13.0.exe
97 |
98 | ## cmake linux build
99 |
100 | ```sh
101 | cmake -B build
102 | make
103 | ```
104 |
105 | ## qmake linux build
106 |
107 | ```sh
108 | qmake-qt5
109 | make
110 | ```
--------------------------------------------------------------------------------
/dialogs/DrawRectangle.cpp:
--------------------------------------------------------------------------------
1 | /**********************************************************************
2 | * File: FindDialog.cpp
3 | * Description: Find Dialog
4 | * Author: Zdenko Podobny
5 | * Created: 2011-09-23
6 | *
7 | * (C) Copyright 2011-2024, Zdenko Podobny
8 | **
9 | ** Licensed under the Apache License, Version 2.0 (the "License");
10 | ** you may not use this file except in compliance with the License.
11 | ** You may obtain a copy of the License at
12 | **
13 | ** http://www.apache.org/licenses/LICENSE-2.0
14 | **
15 | ** Unless required by applicable law or agreed to in writing, software
16 | ** distributed under the License is distributed on an "AS IS" BASIS,
17 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | ** See the License for the specific language governing permissions and
19 | ** limitations under the License.
20 | *
21 | **********************************************************************/
22 |
23 | #include "dialogs/DrawRectangle.h"
24 | #include "ui_DrawRectangle.h"
25 |
26 | //http://qt.gitorious.org/qt-labs/qtspotify/blobs/b7b0ecae6f5ab815e941bd62c00b0f87d2810016/logindialog.cpp
27 | DrawRectangle::DrawRectangle(QWidget* parent, QString title, int maxWidth,
28 | int maxHeight) :
29 | QDialog(parent),
30 | ui(new Ui::DrawRect)
31 | {
32 | ui->setupUi(this);
33 |
34 | if (!title.isEmpty())
35 | setWindowTitle(tr("Draw rectangle in %1:").arg(title));
36 |
37 | ui->spinBox_x1->setMaximum(maxWidth);
38 | ui->spinBox_x2->setMaximum(maxWidth);
39 | ui->spinBox_y1->setMaximum(maxHeight);
40 | ui->spinBox_y2->setMaximum(maxHeight);
41 |
42 | ui->spinBox_x1->setFocus();
43 | // workaround selectAll() do not work...
44 | ui->spinBox_x1->stepUp();
45 | ui->spinBox_x1->stepDown();
46 |
47 | QLabel *lbl = new QLabel("OR you can insert line from Tesseract output e.g. ((1645,6315),(1756,6432))", this);
48 | lbl->setToolTip("Use this, if you got Tesseract's output like
FAIL! APPLY_BOXES: boxfile line 58/D"
49 | "((3166,6595),(3267,6686)): FAILURE! Couldn't find a matching blob
");
50 |
51 | // NOTE: We do next here:
52 | // 1) delete buttonBox from layout
53 | // 2) insert our widgets with respective span parameters
54 | // 3) insert original buttonBox
55 | QLayoutItem *buttonBox = ui->gridLayout->itemAt(ui->gridLayout->rowCount());
56 | ui->gridLayout->addWidget(lbl, ui->gridLayout->rowCount(), 0, 4, 0);
57 | edtTesseractOutput = new QLineEdit(this);
58 | edtTesseractOutput->setPlaceholderText("Enter here numbers like '((3183,6605),(3291,6716))'");
59 | ui->gridLayout->addWidget(edtTesseractOutput, ui->gridLayout->rowCount(), 0, 4, 0);
60 | ui->gridLayout->addWidget(buttonBox->widget(), ui->gridLayout->rowCount(), 0, 4, 0);
61 | }
62 |
63 | DrawRectangle::~DrawRectangle()
64 | {
65 | delete ui;
66 | }
67 | /**
68 | * Input: tesseract coord; e.g.:Bounding box=(197,27)->(206,41)
69 | * return: image coord ; e.g.: (197, , 206, )
70 | */
71 | QRect DrawRectangle::getRectangle() const
72 | {
73 | QRect coords;
74 | if (edtTesseractOutput && !edtTesseractOutput->text().isEmpty()) {
75 | const QString output(edtTesseractOutput->text());
76 | QRegExp rx("(\\d+)");
77 | QStringList list;
78 | int pos = 0;
79 | while ((pos = rx.indexIn(output, pos)) != -1) {
80 | list << rx.cap(1);
81 | pos += rx.matchedLength();
82 | }
83 | if (list.isEmpty() || list.count() != 4) {
84 | coords.setCoords(0, 0, 0, 0);
85 | } else {
86 | coords.setTopLeft(QPoint(list.at(0).toInt(), ui->spinBox_y1->maximum() - list.at(1).toInt()));
87 | coords.setBottomRight(QPoint(list.at(2).toInt(), ui->spinBox_y2->maximum() - list.at(3).toInt()));
88 | }
89 | edtTesseractOutput->clear();
90 | } else {
91 | ui->spinBox_x1->setFocus();
92 | ui->spinBox_x1->selectAll();
93 |
94 | if (ui->spinBox_x1->value() == 0
95 | && ui->spinBox_y1->value() == 0
96 | && ui->spinBox_x2->value() == 0
97 | && ui->spinBox_y2->value() == 0) {
98 | // NOTE: User hasn't changed anything
99 | coords.setCoords(0, 0, 0, 0);
100 | } else {
101 | // NOTE: User input some values
102 | coords.setCoords(ui->spinBox_x1->value(),
103 | ui->spinBox_y1->maximum() - ui->spinBox_y1->value(),
104 | ui->spinBox_x2->value(),
105 | ui->spinBox_y2->maximum() - ui->spinBox_y2->value());
106 | }
107 | }
108 | return coords;
109 | }
110 |
--------------------------------------------------------------------------------
/dialogs/DrawRectangle.h:
--------------------------------------------------------------------------------
1 | /**********************************************************************
2 | * File: FindDialog.h
3 | * Description: Find Dialog
4 | * Author: Zdenko Podobny
5 | * Created: 2011-09-23
6 | *
7 | * (C) Copyright 2011-2024, Zdenko Podobny
8 | **
9 | ** Licensed under the Apache License, Version 2.0 (the "License");
10 | ** you may not use this file except in compliance with the License.
11 | ** You may obtain a copy of the License at
12 | **
13 | ** http://www.apache.org/licenses/LICENSE-2.0
14 | **
15 | ** Unless required by applicable law or agreed to in writing, software
16 | ** distributed under the License is distributed on an "AS IS" BASIS,
17 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | ** See the License for the specific language governing permissions and
19 | ** limitations under the License.
20 | *
21 | **********************************************************************/
22 |
23 | #ifndef DIALOGS_DrawRectangle_H_
24 | #define DIALOGS_DrawRectangle_H_
25 |
26 | #include
27 | #include
28 | #include
29 |
30 | namespace Ui {
31 | class DrawRect;
32 | }
33 |
34 | class DrawRectangle : public QDialog {
35 | Q_OBJECT
36 |
37 | public:
38 | DrawRectangle(QWidget* parent = 0, QString title = "", int maxWidth = 0,
39 | int maxHeight = 0);
40 | ~DrawRectangle();
41 |
42 | QRect getRectangle() const;
43 |
44 | private:
45 | Ui::DrawRect *ui;
46 | QLineEdit *edtTesseractOutput;
47 | };
48 |
49 |
50 | #endif // DIALOGS_DrawRectangle_H_
51 |
--------------------------------------------------------------------------------
/dialogs/DrawRectangle.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | DrawRect
4 |
5 |
6 |
7 | 0
8 | 0
9 | 293
10 | 100
11 |
12 |
13 |
14 | Dialog
15 |
16 |
17 | false
18 |
19 |
20 | false
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | <html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:600;">Bounding box</span></p></body></html>
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | Qt::Horizontal
42 |
43 |
44 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | spinBox_x1
60 | spinBox_y1
61 | spinBox_x2
62 | spinBox_y2
63 | buttonBox
64 |
65 |
66 |
67 |
68 | buttonBox
69 | accepted()
70 | DrawRect
71 | accept()
72 |
73 |
74 | 248
75 | 254
76 |
77 |
78 | 157
79 | 274
80 |
81 |
82 |
83 |
84 | buttonBox
85 | rejected()
86 | DrawRect
87 | reject()
88 |
89 |
90 | 316
91 | 260
92 |
93 |
94 | 286
95 | 274
96 |
97 |
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/dialogs/FindDialog.cpp:
--------------------------------------------------------------------------------
1 | /**********************************************************************
2 | * File: FindDialog.cpp
3 | * Description: Find Dialog
4 | * Author: Zdenko Podobny
5 | * Created: 2011-09-23
6 | *
7 | * (C) Copyright 2011-2024, Zdenko Podobny
8 | **
9 | ** Licensed under the Apache License, Version 2.0 (the "License");
10 | ** you may not use this file except in compliance with the License.
11 | ** You may obtain a copy of the License at
12 | **
13 | ** http://www.apache.org/licenses/LICENSE-2.0
14 | **
15 | ** Unless required by applicable law or agreed to in writing, software
16 | ** distributed under the License is distributed on an "AS IS" BASIS,
17 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | ** See the License for the specific language governing permissions and
19 | ** limitations under the License.
20 | *
21 | **********************************************************************/
22 |
23 | #include "dialogs/FindDialog.h"
24 | #include "Settings.h"
25 |
26 | #if (!defined(_WIN32))
27 | #include
28 | #endif
29 |
30 | #include
31 |
32 | FindDialog::FindDialog(QWidget* parent, QString title)
33 | : QDialog(parent) {
34 | setupUi(this);
35 |
36 | if (!title.isEmpty())
37 | setWindowTitle(tr("Find in %1:").arg(title));
38 | findNextButton = new QPushButton(tr("&Next"));
39 | findNextButton->setDefault(true);
40 | findNextButton->setEnabled(false);
41 | findPrevButton = new QPushButton(tr("&Previous"));
42 | findPrevButton->setEnabled(false);
43 | closeButton = new QPushButton(tr("&Close"));
44 |
45 | buttonBox->addButton(findNextButton,
46 | QDialogButtonBox::ActionRole);
47 | buttonBox->addButton(findPrevButton,
48 | QDialogButtonBox::ActionRole);
49 | buttonBox->addButton(closeButton,
50 | QDialogButtonBox::RejectRole);
51 |
52 | QRegExp regExp(".+"); // no empty string test
53 | lineEdit->setValidator(new QRegExpValidator(regExp, this));
54 |
55 | connect(findNextButton, SIGNAL(clicked()), this, SLOT(findNext()));
56 | connect(findPrevButton, SIGNAL(clicked()), this, SLOT(findPrev()));
57 | connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
58 | connect(checkBox_Mc, SIGNAL(toggled(bool)), this, SLOT(changed_Mc(bool)));
59 | connect(parent, SIGNAL(blinkFindDialog()), this, SLOT(blinkFindDialog()));
60 | timerBlink = new QTimeLine(10);
61 | originalBackColor = this->palette().color(QPalette::Window);;
62 | getSettings();
63 | }
64 |
65 | void FindDialog::on_lineEdit_textChanged() {
66 | findNextButton->setEnabled(lineEdit->hasAcceptableInput());
67 | findPrevButton->setEnabled(lineEdit->hasAcceptableInput());
68 | }
69 |
70 | void FindDialog::findNext() {
71 | QString symbol = lineEdit->text();
72 | Qt::CaseSensitivity mc =
73 | checkBox_Mc->isChecked() ? Qt::CaseSensitive
74 | : Qt::CaseInsensitive;
75 | emit findNext(symbol, mc);
76 | }
77 |
78 | void FindDialog::findPrev() {
79 | QString symbol = lineEdit->text();
80 | Qt::CaseSensitivity mc =
81 | checkBox_Mc->isChecked() ? Qt::CaseSensitive
82 | : Qt::CaseInsensitive;
83 | emit findPrev(symbol, mc);
84 | }
85 |
86 | void FindDialog::changed_Mc(bool status) {
87 | QSettings settings(QSettings::IniFormat, QSettings::UserScope,
88 | SETTING_ORGANIZATION, SETTING_APPLICATION);
89 | settings.setValue("Find/MatchCase", status);
90 | }
91 |
92 | void FindDialog::blinkFindDialog() {
93 | QApplication::beep();
94 | if(timerBlink->state() == QTimeLine::NotRunning)
95 | {
96 | timerBlink->resume();
97 | connect(timerBlink, SIGNAL(finished()), this, SLOT(blinkFinished()));
98 | }
99 | QPalette pal = this->palette();
100 | pal.setColor(QPalette::Window, Qt::red);
101 | this->setPalette(pal);
102 | }
103 |
104 | void FindDialog::blinkFinished() {
105 | disconnect(timerBlink, SIGNAL(finished()), this, SLOT(blinkFinished()));
106 | QPalette pal = this->palette();
107 | pal.setColor(QPalette::Window, originalBackColor);
108 | this->setPalette(pal);
109 | }
110 |
111 | void FindDialog::closeEvent(QCloseEvent* event) {
112 | writeGeometry();
113 | event->accept();
114 | }
115 |
116 | void FindDialog::getSettings() {
117 | QSettings settings(QSettings::IniFormat, QSettings::UserScope,
118 | SETTING_ORGANIZATION, SETTING_APPLICATION);
119 | if (settings.contains("Find/MatchCase"))
120 | checkBox_Mc->setChecked(settings.value("Find/MatchCase").toBool());
121 |
122 | QPoint pos = settings.value("Find/Pos", QPoint(200, 200)).toPoint();
123 | QSize size = settings.value("Find/Size", QSize(300, 100)).toSize();
124 | resize(size);
125 | move(pos);
126 | }
127 |
128 | void FindDialog::writeGeometry() {
129 | QSettings settings(QSettings::IniFormat, QSettings::UserScope,
130 | SETTING_ORGANIZATION, SETTING_APPLICATION);
131 | settings.setValue("Find/Pos", pos());
132 | settings.setValue("Find/Size", size());
133 | }
134 |
--------------------------------------------------------------------------------
/dialogs/FindDialog.h:
--------------------------------------------------------------------------------
1 | /**********************************************************************
2 | * File: FindDialog.h
3 | * Description: Find Dialog
4 | * Author: Zdenko Podobny
5 | * Created: 2011-09-23
6 | *
7 | * (C) Copyright 2011-2024, Zdenko Podobny
8 | **
9 | ** Licensed under the Apache License, Version 2.0 (the "License");
10 | ** you may not use this file except in compliance with the License.
11 | ** You may obtain a copy of the License at
12 | **
13 | ** http://www.apache.org/licenses/LICENSE-2.0
14 | **
15 | ** Unless required by applicable law or agreed to in writing, software
16 | ** distributed under the License is distributed on an "AS IS" BASIS,
17 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | ** See the License for the specific language governing permissions and
19 | ** limitations under the License.
20 | *
21 | **********************************************************************/
22 |
23 | #ifndef DIALOGS_FINDDIALOG_H_
24 | #define DIALOGS_FINDDIALOG_H_
25 |
26 | #include
27 | #include
28 | #include
29 | #include
30 | #include
31 | #include
32 |
33 | #include "ui_FindDialog.h"
34 |
35 | class FindDialog : public QDialog, public Ui::Find {
36 | Q_OBJECT
37 |
38 | public:
39 | explicit FindDialog(QWidget* parent = 0, QString title = "");
40 |
41 | public slots:
42 | void blinkFindDialog();
43 |
44 | signals:
45 | void findNext(const QString &smbl, Qt::CaseSensitivity mc);
46 | void findPrev(const QString &smbl, Qt::CaseSensitivity mc);
47 |
48 | protected:
49 | void closeEvent(QCloseEvent* event);
50 |
51 | private:
52 | QPushButton *findNextButton;
53 | QPushButton *findPrevButton;
54 | QPushButton *closeButton;
55 | QTimeLine *timerBlink;
56 | QColor originalBackColor;
57 |
58 | void writeGeometry();
59 |
60 | private slots:
61 | void on_lineEdit_textChanged();
62 | void findNext();
63 | void findPrev();
64 | void blinkFinished();
65 | void changed_Mc(bool status);
66 | void getSettings();
67 | };
68 |
69 |
70 | #endif // DIALOGS_FINDDIALOG_H_
71 |
--------------------------------------------------------------------------------
/dialogs/FindDialog.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | Find
4 |
5 |
6 |
7 | 0
8 | 0
9 | 306
10 | 98
11 |
12 |
13 |
14 | Find...
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | Find symbol:
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | Qt::Vertical
38 |
39 |
40 | QDialogButtonBox::NoButton
41 |
42 |
43 |
44 |
45 |
46 |
47 | Match case
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | buttonBox
57 | rejected()
58 | Find
59 | reject()
60 |
61 |
62 | 316
63 | 260
64 |
65 |
66 | 286
67 | 274
68 |
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/dialogs/GetRowIDDialog.cpp:
--------------------------------------------------------------------------------
1 | /**********************************************************************
2 | * File: GetRowIDDialog.cpp
3 | * Description: Get Row ID Dialog
4 | * Author: Zdenko Podobny
5 | * Created: 2011-04-14
6 | *
7 | * (C) Copyright 2011-2024, Zdenko Podobny
8 | **
9 | ** Licensed under the Apache License, Version 2.0 (the "License");
10 | ** you may not use this file except in compliance with the License.
11 | ** You may obtain a copy of the License at
12 | **
13 | ** http://www.apache.org/licenses/LICENSE-2.0
14 | **
15 | ** Unless required by applicable law or agreed to in writing, software
16 | ** distributed under the License is distributed on an "AS IS" BASIS,
17 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | ** See the License for the specific language governing permissions and
19 | ** limitations under the License.
20 | *
21 | **********************************************************************/
22 |
23 | #include "dialogs/GetRowIDDialog.h"
24 |
25 | GetRowIDDialog::GetRowIDDialog(QWidget* parent)
26 | : QDialog(parent) {
27 | setupUi(this);
28 | buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
29 |
30 | QRegExp regExp("^\\d\\d*$");
31 | lineEdit->setValidator(new QRegExpValidator(regExp, this));
32 |
33 | connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
34 | connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
35 | }
36 |
37 | void GetRowIDDialog::on_lineEdit_textChanged() {
38 | buttonBox->button(QDialogButtonBox::Ok)->setEnabled(
39 | lineEdit->hasAcceptableInput());
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/dialogs/GetRowIDDialog.h:
--------------------------------------------------------------------------------
1 | /**********************************************************************
2 | * File: GetRowIDDialog.h
3 | * Description: Get Row ID Dialog
4 | * Author: Zdenko Podobny
5 | * Created: 2011-04-14
6 | *
7 | * (C) Copyright 2011-2024, Zdenko Podobny
8 | **
9 | ** Licensed under the Apache License, Version 2.0 (the "License");
10 | ** you may not use this file except in compliance with the License.
11 | ** You may obtain a copy of the License at
12 | **
13 | ** http://www.apache.org/licenses/LICENSE-2.0
14 | **
15 | ** Unless required by applicable law or agreed to in writing, software
16 | ** distributed under the License is distributed on an "AS IS" BASIS,
17 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | ** See the License for the specific language governing permissions and
19 | ** limitations under the License.
20 | *
21 | **********************************************************************/
22 |
23 | #ifndef DIALOGS_GETROWIDDIALOG_H_
24 | #define DIALOGS_GETROWIDDIALOG_H_
25 |
26 | #include
27 | #include
28 | #include
29 |
30 | #include "ui_GetRowIDDialog.h"
31 |
32 | class GetRowIDDialog : public QDialog, public Ui::GetRowIDDialog {
33 | Q_OBJECT
34 |
35 | public:
36 | explicit GetRowIDDialog(QWidget* parent = 0);
37 |
38 | private slots:
39 | void on_lineEdit_textChanged();
40 | };
41 |
42 |
43 | #endif // DIALOGS_GETROWIDDIALOG_H_
44 |
--------------------------------------------------------------------------------
/dialogs/GetRowIDDialog.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | GetRowIDDialog
4 |
5 |
6 |
7 | 0
8 | 0
9 | 174
10 | 69
11 |
12 |
13 |
14 | Enter row id…
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | Row ID:
23 |
24 |
25 | lineEdit
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | Qt::Horizontal
38 |
39 |
40 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok
41 |
42 |
43 |
44 |
45 |
46 |
47 | lineEdit
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/dialogs/SettingsDialog.h:
--------------------------------------------------------------------------------
1 | /**********************************************************************
2 | * File: SettingsDialog.h
3 | * Description: Settings Dialog
4 | * Author: Zdenko Podobny
5 | * Created: 2011-02-11
6 | *
7 | * (C) Copyright 2010, Marcel Kolodziejczyk
8 | * (C) Copyright 2011-2024, Zdenko Podobny
9 | **
10 | ** Licensed under the Apache License, Version 2.0 (the "License");
11 | ** you may not use this file except in compliance with the License.
12 | ** You may obtain a copy of the License at
13 | **
14 | ** http://www.apache.org/licenses/LICENSE-2.0
15 | **
16 | ** Unless required by applicable law or agreed to in writing, software
17 | ** distributed under the License is distributed on an "AS IS" BASIS,
18 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 | ** See the License for the specific language governing permissions and
20 | ** limitations under the License.
21 | *
22 | **********************************************************************/
23 |
24 | #ifndef SRC_INCLUDE_SETTINGSDIALOG_H_
25 | #define SRC_INCLUDE_SETTINGSDIALOG_H_
26 |
27 | #include
28 | #include
29 | #include
30 | #include
31 | #include
32 | #include
33 |
34 | #include "ui_SettingsDialog.h"
35 | #include "Settings.h"
36 |
37 | class SettingsDialog : public QDialog, public Ui::SettingsDialog {
38 | Q_OBJECT
39 |
40 | public:
41 | explicit SettingsDialog(QWidget* pard = 0, int tabIndex = 0);
42 | ~SettingsDialog();
43 | QString getLangName(QString lang);
44 |
45 | signals:
46 | void settingsChanged();
47 |
48 | private slots:
49 | void on_fontButton_clicked();
50 | void on_fontImageButton_clicked();
51 | void on_imageFontColorButton_clicked();
52 | void on_colorRectButton_clicked();
53 | void on_rectFillColorButton_clicked();
54 | void on_colorBoxButton_clicked();
55 | void on_backgroundColorButton_clicked();
56 | void on_pbSelectDP_clicked();
57 | void on_pbCheck_clicked();
58 | void saveSettings();
59 |
60 | private:
61 | void initSettings();
62 | void initLangs();
63 | void initStyles();
64 | void chooseColor(QPushButton* button, QColor* color);
65 | void updateColorButton(QPushButton* button, const QColor& color);
66 |
67 | QFont tableFont;
68 | QFont imageFont;
69 | QColor imageFontColor;
70 | QColor rectColor;
71 | QColor rectFillColor;
72 | QColor boxColor;
73 | QColor backgroundColor;
74 | };
75 | #endif // SRC_INCLUDE_SETTINGSDIALOG_H_
76 |
--------------------------------------------------------------------------------
/dialogs/ShortCutDialog.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | ShortCutDialog
4 |
5 |
6 |
7 | 0
8 | 0
9 | 340
10 | 350
11 |
12 |
13 |
14 | Shortcuts list
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | QFrame::Plain
23 |
24 |
25 | true
26 |
27 |
28 |
29 |
30 |
31 |
32 | Ok
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 | okButton
44 | clicked()
45 | ShortCutDialog
46 | close()
47 |
48 |
49 | 120
50 | 297
51 |
52 |
53 | 119
54 | 159
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/dialogs/ShortCutsDialog.cpp:
--------------------------------------------------------------------------------
1 | /**********************************************************************
2 | * File: ShortCutsDialog.cpp
3 | * Description: Dialog for shorcuts
4 | * Author: Zdenko Podobny
5 | * Created: 2011-03-21
6 | *
7 | * (C) Copyright 2011-2024, Zdenko Podobny
8 | **
9 | ** Licensed under the Apache License, Version 2.0 (the "License");
10 | ** you may not use this file except in compliance with the License.
11 | ** You may obtain a copy of the License at
12 | **
13 | ** http://www.apache.org/licenses/LICENSE-2.0
14 | **
15 | ** Unless required by applicable law or agreed to in writing, software
16 | ** distributed under the License is distributed on an "AS IS" BASIS,
17 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | ** See the License for the specific language governing permissions and
19 | ** limitations under the License.
20 | *
21 | **********************************************************************/
22 |
23 | #include "dialogs/ShortCutsDialog.h"
24 |
25 | ShortCutsDialog::ShortCutsDialog(QWidget* parent)
26 | : QDialog(parent) {
27 | setupUi(this);
28 | textEdit -> setHtml(tr(
29 | "
Editor shortcuts
"
30 | "
F1 — this help "
31 | "Ins — insert symbol below current symbol "
32 | "Del — delete current symbol "
33 | "CTRL + 1 — join current symbol with next symbol"
34 | " "
35 | "CTRL + 2 — split current symbol to 2 symbols"
36 | " "
37 | " "
38 | "CTRL + B — set symbol as bold "
39 | "CTRL + I — set symbol as italic "
40 | "CTRL + U — set symbol as underlined "
41 | " "
42 | "CTRL + Z — undo last change "
43 | "CTRL + Y — redo last undo "
44 | " "
45 | "CTRL + +/- — zoom image "
46 | "CTRL + * — zoom image to original scale "
47 | "CTRL + . — zoom image to fit whole image in "
48 | "current view "
49 | "CTRL + > — zoom image to fit height of "
50 | "image in current view"
51 | " "
52 | "CTRL + < — zoom image to fit width of image"
53 | " in current view "
54 | "CTRL + / — zoom current box to fit in current"
55 | " view "
56 | " "
57 | "CTRL + D — direct type mode "
58 | " "
59 | "CTRL + Arrows up/down — move symbol up/down in"
60 | " table "
61 | "CTRL + G — go to row id… "
62 | "CTRL + M — Move row to row id… "
63 | "CTRL + T — setting dialog "
64 | " "
65 | "CTRL + F — find symbol "
66 | " "
67 | "CTRL + L — show/hide balloon symbols on "
68 | "image "
69 | "CTRL + H — show/hide all boxes on image "
70 | "CTRL + R — draw/hide rectangle on image "
71 | "Arrowsin table area — move "
72 | "focus/selection "
73 | "Arrowsin image area — scroll image "
74 | "
"
75 | ""
76 | "
Mouse tips for image area
"
77 | "Wheel — scroll image "
78 | "CTRL + Wheel — zoom in/out "
79 | "CTRL + Click(left button) on symbol — "
80 | "select/highlight symbol "
81 | "CTRL + Click(left button) and CTRL +"
82 | " drag — add symbols to selection "
83 | "Click (Left button) and Drag symbol border — "
84 | "change symbol box. It works with single symbol "
85 | "selection only. "
86 | "