Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
ebbf2b7
Fixed build issues
makarenkov2 Mar 12, 2025
5041cca
Added translation updating
makarenkov2 Mar 16, 2025
9f547a0
Merge branch 'patch' of https://github.com/makarenkov/LimeReport into…
makarenkov2 Mar 17, 2025
b38a5e6
Changed translation option name
makarenkov2 Mar 18, 2025
47aee66
Merge branch 'patch' of https://github.com/makarenkov/LimeReport into…
makarenkov2 Mar 20, 2025
c7e4028
Fixed code style
makarenkov2 Mar 20, 2025
90cdcb8
Fixed warnings
makarenkov2 Apr 18, 2025
cb6a6f1
minor fixes
Whiteman14 Jun 4, 2025
0c41bc7
Merge branch 'patch' of https://github.com/makarenkov/LimeReport into…
Whiteman14 Jun 4, 2025
b4a7d42
DesignElementsFactory class Export/Import directive added
Whiteman14 Oct 3, 2025
18ba631
Minor changes
makarenkov2 Apr 30, 2026
c2a32ca
Merge branch 'patch' of github.com:makarenkov/LimeReport into patch
makarenkov2 Apr 30, 2026
29e8d11
Define RC5 rotations and identify shallow source revisions
Whiteman14 Oct 7, 2026
f7e3685
Preserve translations of disabled optional features
Whiteman14 Oct 21, 2026
59c9d3d
Refresh translation locations for complete optional source scan
Whiteman14 Oct 21, 2026
248d73b
Merge branch 'patch' of github.com:makarenkov/LimeReport into patch
makarenkov2 Nov 5, 2026
30b26cf
Checking result of QFile::open()
makarenkov2 Nov 5, 2026
4e658ce
Compare Qt versions semantically when selecting translation APIs
Whiteman14 Nov 6, 2026
b0b9082
Merge branch 'patch' of https://github.com/makarenkov/LimeReport into…
Whiteman14 Nov 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 94 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ option(LIMEREPORT_DEMO "Build LimeReport demos" OFF)
option(ENABLE_DIALOG_DESIGNER "Enable dialog designer" OFF)
option(HAVE_UI_LOADER "Enable ui loader" OFF)
option(USE_QT6 "Use Qt6" OFF)
option(UPDATE_TRANSLATIONS "Update TS files" OFF)

if (ENABLE_DIALOG_DESIGNER AND NOT HAVE_UI_LOADER)
message(FATAL_ERROR "You need to enable HAVE_UI_LOADER")
Expand All @@ -35,13 +36,9 @@ if(HAVE_UI_LOADER)

if(ENABLE_DIALOG_DESIGNER)
if(USE_QT6)
if(ENABLE_DIALOG_DESIGNER)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Designer DesignerComponentsPrivate REQUIRED)
endif()
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Designer DesignerComponentsPrivate REQUIRED)
else()
if(ENABLE_DIALOG_DESIGNER)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Designer DesignerComponents REQUIRED)
endif()
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Designer DesignerComponents REQUIRED)
endif(USE_QT6)
endif()

Expand Down Expand Up @@ -347,8 +344,7 @@ ${PROJECT_NAME}/scriptbrowser/lrscriptbrowser.qrc
${PROJECT_NAME}/translationeditor/translationeditor.qrc
)

if(ENABLE_DIALOG_DESIGNER)
set(DIALOG_DESIGNER_SOURCES
set(DIALOG_DESIGNER_SOURCES
${PROJECT_NAME}/dialogdesigner/lrdialogdesigner.h
${PROJECT_NAME}/dialogdesigner/3rdparty/qtcreator/namespace_global.h
${PROJECT_NAME}/dialogdesigner/3rdparty/qtcreator/designerintegrationv2/formresizer.h
Expand All @@ -364,21 +360,34 @@ if(ENABLE_DIALOG_DESIGNER)
${PROJECT_NAME}/dialogdesigner/templates/Dialog.ui
${PROJECT_NAME}/dialogdesigner/dialogdesigner.qrc)

if(ENABLE_DIALOG_DESIGNER)
message(STATUS "DesignerComponents found")
list( APPEND LIMEREPORT_SOURCES ${DIALOG_DESIGNER_SOURCES} )

endif()

set(BARCODE_SOURCES
${PROJECT_NAME}/items/lrbarcodeitem.cpp
${PROJECT_NAME}/items/lrbarcodeitem.h)
if (ENABLE_ZINT)
list(APPEND LIMEREPORT_SOURCES ${PROJECT_NAME}/items/lrbarcodeitem.cpp)
list(APPEND LIMEREPORT_SOURCES ${PROJECT_NAME}/items/lrbarcodeitem.h)
list(APPEND LIMEREPORT_SOURCES ${BARCODE_SOURCES})
endif(ENABLE_ZINT)

set(STATIC_FACTORY_SOURCES
${PROJECT_NAME}/lrfactoryinitializer.cpp
${PROJECT_NAME}/lrfactoryinitializer.h)
if (LIMEREPORT_STATIC)
list(APPEND LIMEREPORT_SOURCES ${PROJECT_NAME}/lrfactoryinitializer.cpp)
list(APPEND LIMEREPORT_SOURCES ${PROJECT_NAME}/lrfactoryinitializer.h)
list(APPEND LIMEREPORT_SOURCES ${STATIC_FACTORY_SOURCES})
endif(LIMEREPORT_STATIC)

# Scan optional features even when disabled; -noobsolete must not remove their translations.
set(LIMEREPORT_TRANSLATION_SOURCES
${LIMEREPORT_SOURCES}
${DIALOG_DESIGNER_SOURCES}
${BARCODE_SOURCES}
${STATIC_FACTORY_SOURCES})
list(REMOVE_DUPLICATES LIMEREPORT_TRANSLATION_SOURCES)


set(EXTRA_FILES
${PROJECT_NAME}/lrglobal.h
Expand All @@ -397,7 +406,7 @@ set(GLOBAL_HEADERS
${PROJECT_NAME}/LRCallbackDS
${PROJECT_NAME}/LRDataManager
${PROJECT_NAME}/LRScriptManager
${CMAKE_BINARY_DIR}/limereport/version.h
${CMAKE_CURRENT_BINARY_DIR}/limereport/version.h
)

set(PROJECT_NAME ${PROJECT_NAME}-qt${QT_VERSION_MAJOR})
Expand Down Expand Up @@ -455,10 +464,15 @@ if(ENABLE_ZINT)
target_link_libraries( ${PROJECT_NAME} PRIVATE QZint)
endif(ENABLE_ZINT)

target_compile_definitions( ${PROJECT_NAME} PRIVATE -DDEFAULT_ITEM_PADDING=${DEFAULT_ITEM_PADDING} -DHAVE_QT${QT_VERSION_MAJOR} -DHAVE_REPORT_DESIGNER -DUSE_QJSENGINE -D_CRT_SECURE_NO_WARNINGS)
target_compile_definitions( ${PROJECT_NAME} PRIVATE
-DDEFAULT_ITEM_PADDING=${DEFAULT_ITEM_PADDING}
-DHAVE_QT${QT_VERSION_MAJOR}
-DHAVE_REPORT_DESIGNER
-DUSE_QJSENGINE
-D_CRT_SECURE_NO_WARNINGS)

target_include_directories( ${PROJECT_NAME} PRIVATE
limereport/
limereport/
limereport/base
limereport/bands
limereport/databrowser
Expand All @@ -470,18 +484,81 @@ target_include_directories( ${PROJECT_NAME} PRIVATE
limereport/scripteditor )

target_include_directories( ${PROJECT_NAME} PUBLIC
${CMAKE_BINARY_DIR}/limereport )
${CMAKE_CURRENT_BINARY_DIR}/limereport )

target_include_directories( ${PROJECT_NAME} INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/include)

list (APPEND GLOBAL_HEADERS ${EXTRA_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${GLOBAL_HEADERS}")


message(STATUS "${PROJECT_NAME} UPDATE_TRANSLATIONS: ${UPDATE_TRANSLATIONS}")
list(APPEND LANGUAGES ru es fr pl zh ar)
foreach(lang ${LANGUAGES})
list(APPEND TS_FILES translations/limereport_${lang}.ts)
endforeach()

if (QT_VERSION VERSION_GREATER_EQUAL 6.7.0)

qt_add_lrelease(
TS_FILES ${TS_FILES}
EXCLUDE_FROM_ALL
LRELEASE_TARGET ${PROJECT_NAME}_lrelease
OPTIONS -removeidentical
)

if (UPDATE_TRANSLATIONS)
qt_add_lupdate(
TS_FILES ${TS_FILES}
SOURCES ${LIMEREPORT_TRANSLATION_SOURCES}
LUPDATE_TARGET ${PROJECT_NAME}_lupdate
OPTIONS -noobsolete
)
add_dependencies(${PROJECT_NAME}_lrelease ${PROJECT_NAME}_lupdate)
endif()

elseif (QT_VERSION VERSION_GREATER_EQUAL 6.2.0)

qt_add_lrelease(
${PROJECT_NAME}
TS_FILES ${TS_FILES}
OPTIONS -removeidentical
)

if (UPDATE_TRANSLATIONS)
qt_add_lupdate(
${PROJECT_NAME}
TS_FILES ${TS_FILES}
SOURCES ${LIMEREPORT_TRANSLATION_SOURCES}
OPTIONS -noobsolete
)
add_dependencies(${PROJECT_NAME}_lrelease ${PROJECT_NAME}_lupdate)
endif()

else()

if (UPDATE_TRANSLATIONS)
qt5_create_translation(
QM_FILES
${LIMEREPORT_TRANSLATION_SOURCES}
${TS_FILES}
OPTIONS -noobsolete -locations relative
)
else()
qt5_add_translation(QM_FILES ${TS_FILES} OPTIONS -removeidentical)
endif()

add_custom_target(${PROJECT_NAME}_lrelease DEPENDS ${QM_FILES})

endif()

add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_lrelease)


install(TARGETS
${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/limereport)

8 changes: 4 additions & 4 deletions cmake/modules/GenerateVersionHeader.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ find_package(Git)
if(GIT_EXECUTABLE)
# Generate a git-describe version string from Git repository tags
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --tags --dirty
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_DESCRIBE_VERSION
RESULT_VARIABLE GIT_DESCRIBE_ERROR_CODE
OUTPUT_STRIP_TRAILING_WHITESPACE
Expand All @@ -22,7 +22,7 @@ if(NOT DEFINED GIT_VERSION)
endif()

configure_file(
${CMAKE_SOURCE_DIR}/limereport/version.h.in
${CMAKE_BINARY_DIR}/limereport/version.h
${CMAKE_CURRENT_SOURCE_DIR}/limereport/version.h.in
${CMAKE_CURRENT_BINARY_DIR}/limereport/version.h
@ONLY)

7 changes: 5 additions & 2 deletions limereport/base/lrattribsabstractfactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace LimeReport {

template <typename AbstractProduct, typename IdentifierType, typename ProductCreator,
typename Attribs>
class AttribsAbstractFactory:
class LIMEREPORT_EXPORT AttribsAbstractFactory:
public Singleton<
AttribsAbstractFactory<AbstractProduct, IdentifierType, ProductCreator, Attribs>> {
private:
Expand All @@ -56,8 +56,11 @@ class AttribsAbstractFactory:
{
if (m_factoryMap.contains(id))
return true;
return (m_factoryMap.insert(id, creator).value() == creator)
bool res = (m_factoryMap.insert(id, creator).value() == creator)
&& (m_attribsMap.insert(id, attribs).value() == attribs);
// if (res)
// qDebug() << id << "Registered";
return res;
}
bool unregisterCreator(const IdentifierType& id)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void SizeHandleRect::mousePressEvent(QMouseEvent *e)
return;

m_startSize = m_curSize = m_resizable->size();
#if QT_VERSION < QT_VERSION_CHECK(5,15,3)
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
m_startPos = m_curPos = m_resizable->mapFromGlobal(e->globalPos());
#else
m_startPos = m_curPos = m_resizable->mapFromGlobal(e->globalPosition());
Expand All @@ -121,7 +121,11 @@ void SizeHandleRect::mouseMoveEvent(QMouseEvent *e)
// causes the handle and the mouse cursor to become out of sync
// once a min/maxSize limit is hit. When the cursor reenters the valid
// areas, it will now snap to it.
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_curPos = m_resizable->mapFromGlobal(e->globalPos());
#else
m_curPos = m_resizable->mapFromGlobal(e->globalPosition());
#endif
QSize delta = QSize(m_curPos.x() - m_startPos.x(), m_curPos.y() - m_startPos.y());
switch (m_dir) {
case Right:
Expand Down
2 changes: 1 addition & 1 deletion limereport/items/lralignpropitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ typedef QMap<QString, Qt::Alignment> AlignMap;

class AlignmentItemEditor;

class AlignmentPropItem: public ObjectPropItem {
class LIMEREPORT_EXPORT AlignmentPropItem: public ObjectPropItem {
Q_OBJECT
public:
AlignmentPropItem(): ObjectPropItem(), m_horizEditor(NULL), m_vertEditor(NULL) { }
Expand Down
17 changes: 13 additions & 4 deletions limereport/items/lrborderframeeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,24 @@ void BorderFrameEditor::unSetAllLines()

void BorderFrameEditor::mousePressEvent(QMouseEvent* event)
{
if (event->x() >= 10 && event->y() < 30)
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
int x = event->x();
int y = event->y();
#else
int x = event->position().x();
int y = event->position().y();
#endif

if (x >= 10 && y < 30)
emit borderSideClicked(BaseDesignIntf::BorderSide::TopLine, !topLine);

if ((event->x() >= 10 && event->x() < 30) && (event->y() > 10))
if ((x >= 10 && x < 30) && (y > 10))
emit borderSideClicked(BaseDesignIntf::BorderSide::LeftLine, !leftLine);

if (event->x() >= 10 && (event->y() > 80 && event->y() < rect().bottom()))
if (x >= 10 && (y > 80 && y < rect().bottom()))
emit borderSideClicked(BaseDesignIntf::BorderSide::BottomLine, !bottomLine);

if ((event->x() >= 130 && event->x() < rect().width()) && event->y() > 10)
if ((x >= 130 && x < rect().width()) && y > 10)
emit borderSideClicked(BaseDesignIntf::BorderSide::RightLine, !rightLine);
}

Expand Down Expand Up @@ -172,6 +180,7 @@ QGraphicsLineItem* BorderFrameEditor::createSideLine(LimeReport::BaseDesignIntf:
return scene->addLine(
QLineF(10, rect().bottom() - 10, rect().width() - 10, rect().bottom() - 10), m_pen);
}
return nullptr;
}

void BorderFrameEditor::updateBorders()
Expand Down
13 changes: 6 additions & 7 deletions limereport/items/lrchartitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,26 +770,25 @@ QSizeF AbstractSeriesChart::calcChartLegendSize(const QFont& font, const qreal m
}
default: {
qreal cw = 0;
qreal maxWidth = 0;
qreal mw = 0;

if (m_chartItem->series().isEmpty()) {
foreach (QString label, m_designLabels) {
cw += fm.height();
if (maxWidth < fm.boundingRect(label).width())
maxWidth = fm.boundingRect(label).width() + 10;
if (mw < fm.boundingRect(label).width())
mw = fm.boundingRect(label).width() + 10;
}
} else {
foreach (SeriesItem* series, m_chartItem->series()) {
cw += fm.height();
if (maxWidth < fm.boundingRect(series->name()).width())
maxWidth = fm.boundingRect(series->name()).width() + 10;
if (mw < fm.boundingRect(series->name()).width())
mw = fm.boundingRect(series->name()).width() + 10;
}
}
cw += fm.height();
return QSizeF(maxWidth + fm.height() * 2, cw);
return QSizeF(mw + fm.height() * 2, cw);
}
}
return QSizeF();
}

bool AbstractSeriesChart::verticalLabels(QPainter* painter, QRectF labelsRect)
Expand Down
2 changes: 1 addition & 1 deletion limereport/items/lrtextitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,13 @@ bool TextItem::isNeedExpandContent() const
{
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 1))
QRegExp rx("$*\\{[^{]*\\}");
return content().contains(rx) || isContentBackedUp();
#else
bool result = false;
QRegularExpression rx("\\$*\\{[^{]*\\}");
result = content().contains(rx) || isContentBackedUp();
return result;
#endif
return content().contains(rx) || isContentBackedUp();
}

QString TextItem::replaceBR(QString text) const { return text.replace("<br/>", "\n"); }
Expand Down
8 changes: 4 additions & 4 deletions limereport/lrbasedesignintf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1354,10 +1354,10 @@ void BaseDesignIntf::contextMenuEvent(QGraphicsSceneContextMenuEvent* event)
pasteAction->setEnabled(false);

#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
lockGeometryAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_L));
copyAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_C));
cutAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_X));
pasteAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_V));
lockGeometryAction->setShortcut(QKeySequence(Qt::Key(Qt::CTRL) | Qt::Key_L));
copyAction->setShortcut(QKeySequence(Qt::Key(Qt::CTRL) | Qt::Key_C));
cutAction->setShortcut(QKeySequence(Qt::Key(Qt::CTRL) | Qt::Key_X));
pasteAction->setShortcut(QKeySequence(Qt::Key(Qt::CTRL) | Qt::Key_V));
#else
lockGeometryAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L));
copyAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_C));
Expand Down
1 change: 0 additions & 1 deletion limereport/lrdatasourcemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,6 @@ QString DataSourceManager::replaceVariables(QString value)
}
return value;
#endif
return QString();
}

QString DataSourceManager::replaceVariables(QString query, QMap<QString, QString>& aliasesToParam)
Expand Down
2 changes: 1 addition & 1 deletion limereport/lrdatasourcemanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private slots:
DataNode* m_rootNode;
};

class DataSourceManager:
class LIMEREPORT_EXPORT DataSourceManager:
public QObject,
public ICollectionContainer,
public IVariablesContainer,
Expand Down
2 changes: 1 addition & 1 deletion limereport/lrdesignelementsfactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct ItemAttribs {
}
};

class DesignElementsFactory:
class LIMEREPORT_EXPORT DesignElementsFactory:
public AttribsAbstractFactory<LimeReport::BaseDesignIntf, QString, CreateBand, ItemAttribs> {
private:
friend class Singleton<DesignElementsFactory>;
Expand Down
Loading
Loading