diff --git a/README.txt b/README.txt index 7063a24fd..e4ea2ef14 100644 --- a/README.txt +++ b/README.txt @@ -5,7 +5,7 @@ Valentina Web page: https://smart-pattern.com.ua/ Wiki: https://wiki.valentinaproject.org Valentina main repository: https://gitlab.com/smart-pattern/valentina PPA for Ubuntu (develop): https://launchpad.net/~dismine/+archive/valentina-dev -Help translate https://www.transifex.com/organization/valentina +Help translate https://explore.transifex.com/valentina/valentina-project/ Valentina ========== diff --git a/dist/AppImage/appimage.yml b/dist/AppImage/appimage.yml index 59ae86247..24406dec2 100644 --- a/dist/AppImage/appimage.yml +++ b/dist/AppImage/appimage.yml @@ -66,6 +66,6 @@ script: # bundle icu's data - mkdir -p $BUILD_APPDIR/usr/share/icu - cp /usr/share/icu/*/icudt*.dat $BUILD_APPDIR/usr/share/icu/ - - linuxdeployqt $BUILD_APPDIR/usr/share/applications/valentina.desktop -bundle-non-qt-libs -verbose=2 -no-strip + - linuxdeployqt $BUILD_APPDIR/usr/share/applications/ua.com.smart-pattern.valentina.desktop -bundle-non-qt-libs -verbose=2 -no-strip # Show what we have done - find $BUILD_APPDIR/ diff --git a/dist/debian/valentina.install b/dist/debian/valentina.install index a933781e9..4734c7908 100644 --- a/dist/debian/valentina.install +++ b/dist/debian/valentina.install @@ -16,3 +16,4 @@ usr/share/icons/hicolor/256x256/mimetypes/* usr/share/icons/hicolor/512x512/apps/* usr/share/icons/hicolor/512x512/mimetypes/* usr/share/applications/* +usr/share/metainfo/* diff --git a/dist/macx/puzzle/Info.plist b/dist/macx/puzzle/Info.plist index 4e56561fc..45d697081 100755 --- a/dist/macx/puzzle/Info.plist +++ b/dist/macx/puzzle/Info.plist @@ -9,19 +9,19 @@ CFBundlePackageType APPL LSMinimumSystemVersion - 10.7 + ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright - © 2013-2022, Valentina project + © 2013-2023, Valentina project CFBundleSignature @TYPEINFO@ CFBundleExecutable @EXECUTABLE@ CFBundleIdentifier - io.bitbucket.valentinaproject.@EXECUTABLE@ + ua.com.smart-pattern.@EXECUTABLE@ CFBundleShortVersionString - 0.7.52 + @SHORT_VERSION@ CFBundleVersion - 0.7.52.0 + @FULL_VERSION@ CFBundleInfoDictionaryVersion 6.0 CFBundleDocumentTypes @@ -33,7 +33,7 @@ layout.incs LSItemContentTypes - io.bitbucket.valentinaproject.vlt + ua.com.smart-pattern.vlt CFBundleTypeName Valentina layout @@ -54,7 +54,7 @@ UTTypeIconFile layout.icns UTTypeIdentifier - io.bitbucket.valentinaproject.vlt + ua.com.smart-pattern.vlt UTTypeTagSpecification public.filename-extension diff --git a/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/Contents.json b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/Contents.json new file mode 100644 index 000000000..7cd4f8e12 --- /dev/null +++ b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "icon_16x16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "icon_16x16@2x.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "icon_32x32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "icon_32x32@2x.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "icon_128x128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "icon_128x128@2x.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "icon_256x256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "icon_256x256@2x.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "icon_512x512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "icon_512x512@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_128x128.png b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_128x128.png new file mode 100644 index 000000000..75671b472 Binary files /dev/null and b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_128x128.png differ diff --git a/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_128x128@2x.png b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_128x128@2x.png new file mode 100644 index 000000000..71a68ea73 Binary files /dev/null and b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_128x128@2x.png differ diff --git a/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_16x16.png b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_16x16.png new file mode 100644 index 000000000..c5e6ab2e9 Binary files /dev/null and b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_16x16.png differ diff --git a/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_16x16@2x.png b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_16x16@2x.png new file mode 100644 index 000000000..23554e5b6 Binary files /dev/null and b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_16x16@2x.png differ diff --git a/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_256x256.png b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_256x256.png new file mode 100644 index 000000000..71a68ea73 Binary files /dev/null and b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_256x256.png differ diff --git a/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_256x256@2x.png b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_256x256@2x.png new file mode 100644 index 000000000..fba7803c1 Binary files /dev/null and b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_256x256@2x.png differ diff --git a/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_32x32.png b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_32x32.png new file mode 100644 index 000000000..23554e5b6 Binary files /dev/null and b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_32x32.png differ diff --git a/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_32x32@2x.png b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_32x32@2x.png new file mode 100644 index 000000000..4fdf929b0 Binary files /dev/null and b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_32x32@2x.png differ diff --git a/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_512x512.png b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_512x512.png new file mode 100644 index 000000000..fba7803c1 Binary files /dev/null and b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_512x512.png differ diff --git a/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_512x512@2x.png b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_512x512@2x.png new file mode 100644 index 000000000..6f7c1106c Binary files /dev/null and b/dist/macx/puzzle/puzzle.xcassets/Puzzle.appiconset/icon_512x512@2x.png differ diff --git a/dist/macx/tape/Info.plist b/dist/macx/tape/Info.plist index 2555f3396..0c9ff74e5 100755 --- a/dist/macx/tape/Info.plist +++ b/dist/macx/tape/Info.plist @@ -9,19 +9,19 @@ CFBundlePackageType APPL LSMinimumSystemVersion - 10.7 + ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright - © 2013-2022, Valentina project + © 2013-2023, Valentina project CFBundleSignature @TYPEINFO@ CFBundleExecutable @EXECUTABLE@ CFBundleIdentifier - io.bitbucket.valentinaproject.@EXECUTABLE@ + ua.com.smart-pattern.@EXECUTABLE@ CFBundleShortVersionString - 0.7.52 + @SHORT_VERSION@ CFBundleVersion - 0.7.52.0 + @FULL_VERSION@ CFBundleInfoDictionaryVersion 6.0 CFBundleDocumentTypes @@ -33,7 +33,7 @@ i-measurements.incs LSItemContentTypes - io.bitbucket.valentinaproject.vit + ua.com.smart-pattern.vit CFBundleTypeName Valentina individual measurements @@ -47,10 +47,10 @@ s-measurements.icns LSItemContentTypes - io.bitbucket.valentinaproject.vst + ua.com.smart-pattern.vst CFBundleTypeName - Valentina multisize measurements + Valentina multisize measurements LSHandlerRank Owner @@ -68,7 +68,7 @@ UTTypeIconFile i-measurements.icns UTTypeIdentifier - io.bitbucket.valentinaproject.vit + ua.com.smart-pattern.vit UTTypeTagSpecification public.filename-extension @@ -76,7 +76,7 @@ vit public.mime-type - text/xml + text/xml @@ -86,11 +86,11 @@ public.xml UTTypeDescription - Valentina multisize measurements + Valentina multisize measurements UTTypeIconFile s-measurements.icns UTTypeIdentifier - io.bitbucket.valentinaproject.vst + ua.com.smart-pattern.vst UTTypeTagSpecification public.filename-extension @@ -98,7 +98,7 @@ vst public.mime-type - text/xml + text/xml diff --git a/dist/macx/tape/tape.xcassets/Tape.appiconset/Contents.json b/dist/macx/tape/tape.xcassets/Tape.appiconset/Contents.json new file mode 100644 index 000000000..7cd4f8e12 --- /dev/null +++ b/dist/macx/tape/tape.xcassets/Tape.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "icon_16x16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "icon_16x16@2x.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "icon_32x32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "icon_32x32@2x.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "icon_128x128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "icon_128x128@2x.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "icon_256x256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "icon_256x256@2x.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "icon_512x512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "icon_512x512@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_128x128.png b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_128x128.png new file mode 100644 index 000000000..65c3ebcc1 Binary files /dev/null and b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_128x128.png differ diff --git a/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_128x128@2x.png b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_128x128@2x.png new file mode 100644 index 000000000..8727da332 Binary files /dev/null and b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_128x128@2x.png differ diff --git a/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_16x16.png b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_16x16.png new file mode 100644 index 000000000..677e4fd23 Binary files /dev/null and b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_16x16.png differ diff --git a/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_16x16@2x.png b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_16x16@2x.png new file mode 100644 index 000000000..db7ced593 Binary files /dev/null and b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_16x16@2x.png differ diff --git a/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_256x256.png b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_256x256.png new file mode 100644 index 000000000..8727da332 Binary files /dev/null and b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_256x256.png differ diff --git a/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_256x256@2x.png b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_256x256@2x.png new file mode 100644 index 000000000..ba36972e9 Binary files /dev/null and b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_256x256@2x.png differ diff --git a/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_32x32.png b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_32x32.png new file mode 100644 index 000000000..db7ced593 Binary files /dev/null and b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_32x32.png differ diff --git a/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_32x32@2x.png b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_32x32@2x.png new file mode 100644 index 000000000..b6b81f099 Binary files /dev/null and b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_32x32@2x.png differ diff --git a/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_512x512.png b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_512x512.png new file mode 100644 index 000000000..ba36972e9 Binary files /dev/null and b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_512x512.png differ diff --git a/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_512x512@2x.png b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_512x512@2x.png new file mode 100644 index 000000000..5df7c3417 Binary files /dev/null and b/dist/macx/tape/tape.xcassets/Tape.appiconset/icon_512x512@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_128x128.png b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_128x128.png new file mode 100644 index 000000000..7684622d7 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_128x128.png differ diff --git a/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_128x128@2x.png b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_128x128@2x.png new file mode 100644 index 000000000..f83646fda Binary files /dev/null and b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_128x128@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_16x16.png b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_16x16.png new file mode 100644 index 000000000..7c1cfa03f Binary files /dev/null and b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_16x16.png differ diff --git a/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_16x16@2x.png b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_16x16@2x.png new file mode 100644 index 000000000..8b94ca9b6 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_16x16@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_256x256.png b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_256x256.png new file mode 100644 index 000000000..f83646fda Binary files /dev/null and b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_256x256.png differ diff --git a/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_256x256@2x.png b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_256x256@2x.png new file mode 100644 index 000000000..b22ebe5f1 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_256x256@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_32x32.png b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_32x32.png new file mode 100644 index 000000000..8b94ca9b6 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_32x32.png differ diff --git a/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_32x32@2x.png b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_32x32@2x.png new file mode 100644 index 000000000..b1270648f Binary files /dev/null and b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_32x32@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_512x512.png b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_512x512.png new file mode 100644 index 000000000..b22ebe5f1 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_512x512.png differ diff --git a/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_512x512@2x.png b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_512x512@2x.png new file mode 100644 index 000000000..e927b9f88 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/i-measurements.iconset/icon_512x512@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/layout.iconset/icon_128x128.png b/dist/macx/valentina-project.xcassets/layout.iconset/icon_128x128.png new file mode 100644 index 000000000..e424b5bb4 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/layout.iconset/icon_128x128.png differ diff --git a/dist/macx/valentina-project.xcassets/layout.iconset/icon_128x128@2x.png b/dist/macx/valentina-project.xcassets/layout.iconset/icon_128x128@2x.png new file mode 100644 index 000000000..c71a5c413 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/layout.iconset/icon_128x128@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/layout.iconset/icon_16x16.png b/dist/macx/valentina-project.xcassets/layout.iconset/icon_16x16.png new file mode 100644 index 000000000..a8fa98d1f Binary files /dev/null and b/dist/macx/valentina-project.xcassets/layout.iconset/icon_16x16.png differ diff --git a/dist/macx/valentina-project.xcassets/layout.iconset/icon_16x16@2x.png b/dist/macx/valentina-project.xcassets/layout.iconset/icon_16x16@2x.png new file mode 100644 index 000000000..dddd7a48d Binary files /dev/null and b/dist/macx/valentina-project.xcassets/layout.iconset/icon_16x16@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/layout.iconset/icon_256x256.png b/dist/macx/valentina-project.xcassets/layout.iconset/icon_256x256.png new file mode 100644 index 000000000..c71a5c413 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/layout.iconset/icon_256x256.png differ diff --git a/dist/macx/valentina-project.xcassets/layout.iconset/icon_256x256@2x.png b/dist/macx/valentina-project.xcassets/layout.iconset/icon_256x256@2x.png new file mode 100644 index 000000000..9f370f115 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/layout.iconset/icon_256x256@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/layout.iconset/icon_32x32.png b/dist/macx/valentina-project.xcassets/layout.iconset/icon_32x32.png new file mode 100644 index 000000000..dddd7a48d Binary files /dev/null and b/dist/macx/valentina-project.xcassets/layout.iconset/icon_32x32.png differ diff --git a/dist/macx/valentina-project.xcassets/layout.iconset/icon_32x32@2x.png b/dist/macx/valentina-project.xcassets/layout.iconset/icon_32x32@2x.png new file mode 100644 index 000000000..2b37af605 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/layout.iconset/icon_32x32@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/layout.iconset/icon_512x512.png b/dist/macx/valentina-project.xcassets/layout.iconset/icon_512x512.png new file mode 100644 index 000000000..9f370f115 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/layout.iconset/icon_512x512.png differ diff --git a/dist/macx/valentina-project.xcassets/layout.iconset/icon_512x512@2x.png b/dist/macx/valentina-project.xcassets/layout.iconset/icon_512x512@2x.png new file mode 100644 index 000000000..0317516bf Binary files /dev/null and b/dist/macx/valentina-project.xcassets/layout.iconset/icon_512x512@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/pattern.iconset/icon_128x128.png b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_128x128.png new file mode 100644 index 000000000..bcb61b684 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_128x128.png differ diff --git a/dist/macx/valentina-project.xcassets/pattern.iconset/icon_128x128@2x.png b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_128x128@2x.png new file mode 100644 index 000000000..2f943933c Binary files /dev/null and b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_128x128@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/pattern.iconset/icon_16x16.png b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_16x16.png new file mode 100644 index 000000000..25dd9268f Binary files /dev/null and b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_16x16.png differ diff --git a/dist/macx/valentina-project.xcassets/pattern.iconset/icon_16x16@2x.png b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_16x16@2x.png new file mode 100644 index 000000000..9fdd08777 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_16x16@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/pattern.iconset/icon_256x256.png b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_256x256.png new file mode 100644 index 000000000..2f943933c Binary files /dev/null and b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_256x256.png differ diff --git a/dist/macx/valentina-project.xcassets/pattern.iconset/icon_256x256@2x.png b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_256x256@2x.png new file mode 100644 index 000000000..7f6b66365 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_256x256@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/pattern.iconset/icon_32x32.png b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_32x32.png new file mode 100644 index 000000000..9fdd08777 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_32x32.png differ diff --git a/dist/macx/valentina-project.xcassets/pattern.iconset/icon_32x32@2x.png b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_32x32@2x.png new file mode 100644 index 000000000..288488d11 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_32x32@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/pattern.iconset/icon_512x512.png b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_512x512.png new file mode 100644 index 000000000..7f6b66365 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_512x512.png differ diff --git a/dist/macx/valentina-project.xcassets/pattern.iconset/icon_512x512@2x.png b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_512x512@2x.png new file mode 100644 index 000000000..00e326956 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/pattern.iconset/icon_512x512@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_128x128.png b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_128x128.png new file mode 100644 index 000000000..142aa7526 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_128x128.png differ diff --git a/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_128x128@2x.png b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_128x128@2x.png new file mode 100644 index 000000000..a6df4e718 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_128x128@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_16x16.png b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_16x16.png new file mode 100644 index 000000000..5dc37f402 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_16x16.png differ diff --git a/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_16x16@2x.png b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_16x16@2x.png new file mode 100644 index 000000000..f0517d16d Binary files /dev/null and b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_16x16@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_256x256.png b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_256x256.png new file mode 100644 index 000000000..a6df4e718 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_256x256.png differ diff --git a/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_256x256@2x.png b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_256x256@2x.png new file mode 100644 index 000000000..08d0b4594 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_256x256@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_32x32.png b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_32x32.png new file mode 100644 index 000000000..f0517d16d Binary files /dev/null and b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_32x32.png differ diff --git a/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_32x32@2x.png b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_32x32@2x.png new file mode 100644 index 000000000..ec4f0e434 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_32x32@2x.png differ diff --git a/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_512x512.png b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_512x512.png new file mode 100644 index 000000000..08d0b4594 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_512x512.png differ diff --git a/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_512x512@2x.png b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_512x512@2x.png new file mode 100644 index 000000000..c9e785f74 Binary files /dev/null and b/dist/macx/valentina-project.xcassets/s-measurements.iconset/icon_512x512@2x.png differ diff --git a/dist/macx/valentina/Info.plist b/dist/macx/valentina/Info.plist index 9efa82427..593fe35c4 100755 --- a/dist/macx/valentina/Info.plist +++ b/dist/macx/valentina/Info.plist @@ -9,19 +9,19 @@ CFBundlePackageType APPL LSMinimumSystemVersion - 10.7 + ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright - © 2013-2022, Valentina project + © 2013-2023, Valentina project CFBundleSignature @TYPEINFO@ CFBundleExecutable @EXECUTABLE@ CFBundleIdentifier - io.bitbucket.valentinaproject.@EXECUTABLE@ + ua.com.smart-pattern.@EXECUTABLE@ CFBundleShortVersionString - 0.7.52 + @SHORT_VERSION@ CFBundleVersion - 0.7.52.0 + @FULL_VERSION@ CFBundleInfoDictionaryVersion 6.0 CFBundleDocumentTypes @@ -33,7 +33,7 @@ pattern.icns LSItemContentTypes - io.bitbucket.valentinaproject.val + ua.com.smart-pattern.val CFBundleTypeName Valentina pattern file @@ -47,7 +47,7 @@ i-measurements.icns LSItemContentTypes - io.bitbucket.valentinaproject.vit + ua.com.smart-pattern.vit CFBundleTypeName Valentina individual measurements @@ -61,7 +61,7 @@ s-measurements.icns LSItemContentTypes - io.bitbucket.valentinaproject.vst + ua.com.smart-pattern.vst CFBundleTypeName Valentina multisize measurements @@ -80,9 +80,9 @@ UTTypeDescription Valentina pattern file UTTypeIconFile - pattern + pattern.icns UTTypeIdentifier - io.bitbucket.valentinaproject.val + ua.com.smart-pattern.val UTTypeTagSpecification public.filename-extension @@ -104,7 +104,7 @@ UTTypeIconFile i-measurements.icns UTTypeIdentifier - io.bitbucket.valentinaproject.vit + ua.com.smart-pattern.vit UTTypeTagSpecification public.filename-extension @@ -126,7 +126,7 @@ UTTypeIconFile s-measurements.icns UTTypeIdentifier - io.bitbucket.valentinaproject.vst + ua.com.smart-pattern.vst UTTypeTagSpecification public.filename-extension @@ -148,7 +148,7 @@ UTTypeIconFile layout.icns UTTypeIdentifier - io.bitbucket.valentinaproject.vlt + ua.com.smart-pattern.vlt UTTypeTagSpecification public.filename-extension diff --git a/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/Contents.json b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/Contents.json new file mode 100644 index 000000000..8828718d6 --- /dev/null +++ b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "icon_16x16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "icon_16x16@2x.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "icon_32x32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "icon_32x32@2x.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "icon_128x128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "icon_128x128@2x.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "icon_256x256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "icon_256x256@2x.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "icon_512x512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "icon_512x512@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_128x128.png b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_128x128.png new file mode 100644 index 000000000..48baa5f0a Binary files /dev/null and b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_128x128.png differ diff --git a/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_128x128@2x.png b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_128x128@2x.png new file mode 100644 index 000000000..127c4b250 Binary files /dev/null and b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_128x128@2x.png differ diff --git a/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_16x16.png b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_16x16.png new file mode 100644 index 000000000..fd7dd5c1f Binary files /dev/null and b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_16x16.png differ diff --git a/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_16x16@2x.png b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_16x16@2x.png new file mode 100644 index 000000000..a5ff895cb Binary files /dev/null and b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_16x16@2x.png differ diff --git a/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_256x256.png b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_256x256.png new file mode 100644 index 000000000..127c4b250 Binary files /dev/null and b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_256x256.png differ diff --git a/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_256x256@2x.png b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_256x256@2x.png new file mode 100644 index 000000000..48a488020 Binary files /dev/null and b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_256x256@2x.png differ diff --git a/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_32x32.png b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_32x32.png new file mode 100644 index 000000000..a5ff895cb Binary files /dev/null and b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_32x32.png differ diff --git a/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_32x32@2x.png b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_32x32@2x.png new file mode 100644 index 000000000..91a67a3b8 Binary files /dev/null and b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_32x32@2x.png differ diff --git a/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_512x512.png b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_512x512.png new file mode 100644 index 000000000..48a488020 Binary files /dev/null and b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_512x512.png differ diff --git a/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_512x512@2x.png b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_512x512@2x.png new file mode 100644 index 000000000..6ad98a73f Binary files /dev/null and b/dist/macx/valentina/valentina.xcassets/Valentina.appiconset/icon_512x512@2x.png differ diff --git a/dist/rpm/valentina.spec b/dist/rpm/valentina.spec index 6acb1224c..ff2609d98 100644 --- a/dist/rpm/valentina.spec +++ b/dist/rpm/valentina.spec @@ -23,6 +23,9 @@ BuildRequires: qt5-qtxmlpatterns-devel >= 5.4.0 BuildRequires: qt5-qtsvg-devel >= 5.4.0 BuildRequires: qt5-qttools-devel >= 5.4.0 +BuildRequires: desktop-file-utils +BuildRequires: libappstream-glib + Requires: qt5-qtsvg >= 5.4.0 Requires: qt5-qtbase-gui >= 5.4.0 Requires: qt5-qtxmlpatterns >= 5.4.0 @@ -172,6 +175,12 @@ cp dist/debian/valentina.mime dist/debian/%{name} && %suse_update_desktop_file -r puzzle Utility Applet %endif +%check +appstream-util validate-relax --nonet "%{buildroot}%{_datadir}/metainfo/ua.com.smart-pattern.valentina.metainfo.xml" +desktop-file-validate %{buildroot}%{_datadir}/applications/ua.com.smart-pattern.valentina.desktop +desktop-file-validate %{buildroot}%{_datadir}/applications/ua.com.smart-pattern.tape.desktop +desktop-file-validate %{buildroot}%{_datadir}/applications/ua.com.smart-pattern.puzzle.desktop + %post /sbin/ldconfig update-desktop-database &> /dev/null ||: @@ -216,9 +225,10 @@ fi %dir %{_datadir}/mime/ %dir %{_datadir}/mime/packages/ %{_datadir}/mime/packages/%{name}.xml -%{_datadir}/applications/%{name}.desktop -%{_datadir}/applications/tape.desktop -%{_datadir}/applications/puzzle.desktop +%{_datadir}/applications/ua.com.smart-pattern.valentina.desktop +%{_datadir}/applications/ua.com.smart-pattern.tape.desktop +%{_datadir}/applications/ua.com.smart-pattern.puzzle.desktop +%{_datadir}/metainfo/ua.com.smart-pattern.valentina.metainfo.xml %{_datadir}/icons/hicolor diff --git a/dist/puzzle.desktop b/dist/ua.com.smart-pattern.puzzle.desktop similarity index 71% rename from dist/puzzle.desktop rename to dist/ua.com.smart-pattern.puzzle.desktop index b166d63fe..7164788f4 100644 --- a/dist/puzzle.desktop +++ b/dist/ua.com.smart-pattern.puzzle.desktop @@ -2,13 +2,15 @@ Type=Application Name=Puzzle Exec=puzzle %F -Version=1.0 +Version=1.1 GenericName=Valentina's layout editor +GenericName[uk]=Редактор розкладки Валентини Comment=Create and edit layouts Comment[uk]=Створюйте і редагуйте розкладки -Comment[ru]=Создавайте и редактируйте раскладку Icon=puzzle Terminal=false MimeType=application/x-valentina-layout; Categories=Qt;Utility;FileTools; TryExec=puzzle +Keywords=layout;nesting +StartupWMClass=puzzle diff --git a/dist/tape.desktop b/dist/ua.com.smart-pattern.tape.desktop similarity index 75% rename from dist/tape.desktop rename to dist/ua.com.smart-pattern.tape.desktop index 589da7ac1..b1c6ca9d3 100644 --- a/dist/tape.desktop +++ b/dist/ua.com.smart-pattern.tape.desktop @@ -2,13 +2,15 @@ Type=Application Name=Tape Exec=tape %F -Version=1.0 +Version=1.1 GenericName=Valentina's measurements editor +GenericName[uk]=Редактор мірок Валентини Comment=Create and edit measurements Comment[uk]=Створюйте і редагуйте мірки -Comment[ru]=Создавайте и редактируйте мерки Icon=tape Terminal=false MimeType=application/x-valentina-s-measurements;application/x-valentina-i-measurements; Categories=Qt;Utility;FileTools; TryExec=tape +Keywords=measurements +StartupWMClass=tape diff --git a/dist/valentina.desktop b/dist/ua.com.smart-pattern.valentina.desktop similarity index 73% rename from dist/valentina.desktop rename to dist/ua.com.smart-pattern.valentina.desktop index a563e9656..1e3e22a98 100644 --- a/dist/valentina.desktop +++ b/dist/ua.com.smart-pattern.valentina.desktop @@ -2,8 +2,9 @@ Type=Application Name=Valentina Exec=valentina %F -Version=1.0 +Version=1.1 GenericName=Pattern making program +GenericName[uk]=Програма створення викрійок Comment=Creating pattern of clothes Comment[uk]=Створеня викрійок одягу Icon=valentina @@ -11,3 +12,5 @@ Terminal=false MimeType=application/x-valentina-pattern; Categories=Graphics;VectorGraphics;2DGraphics;Qt;Engineering; TryExec=valentina +Keywords=pattern +StartupWMClass=valentina diff --git a/dist/ua.com.smart-pattern.valentina.metainfo.xml b/dist/ua.com.smart-pattern.valentina.metainfo.xml new file mode 100644 index 000000000..4010d1569 --- /dev/null +++ b/dist/ua.com.smart-pattern.valentina.metainfo.xml @@ -0,0 +1,95 @@ + + + + ua.com.smart-pattern.valentina.desktop + ua.com.smart-pattern.valentina.desktop + Valentina + Provides a cross-platform patternmaking program which allows designers to create and model patterns of clothing + CC0-1.0 + GPL-3.0-or-later + +

+ Valentina is a cross-platform patternmaking program which allows designers + to create and model patterns of clothing. This software allows pattern + creation, using either standard sizing tables or an individual’s set of + measurements. It blends new technologies with traditional methods to create + a unique pattern making tool. +

+
+ + Graphics + + https://smart-pattern.com.ua/valentina/download/ + https://gitlab.com/smart-pattern/valentina/-/issues + https://explore.transifex.com/valentina/valentina-project/ + https://smart-pattern.com.ua/contact/ + https://gitlab.com/smart-pattern/valentina + https://smart-pattern.com.ua/valentina/contribute/ + Roman Telezhynskyi + contact@smart-pattern.com.ua + + + + +

+ This is a development release in the 0.7 series. +

+
    +
  • Fix layout sheet export with empty name.
  • +
  • Fix visualization for tool Point from circle and tangent.
  • +
  • Fix loading background image.
  • +
  • Puzzle: message "Invalid version: Max supported version 0.1.2" when opening 0.1.1 file in Val 0.7.52.
  • +
  • Fix export measurement separator to CSV.
  • +
  • Fix option Hide labels.
  • +
  • Improve segmenting a curve for calculating a piece path.
  • +
  • [smart-pattern/valentina#184] Fix incorrect seam allowance.
  • +
  • Export area of piece in Final measurements.
  • +
  • New option Show accuracy radius.
  • +
  • New option Interactive tools.
  • +
  • Improve error messages while import CSV data.
  • +
  • Fix regression in dialog Known measurements.
  • +
+
+ + valentina#187 + valentina#189 + +
+
+ + +

+ This is a development release in the 0.7 series. +

+
    +
  • Fix crash when default locale is ru.
  • +
  • Puzzle app. Fix incorrect update of a layout piece.
  • +
  • Fix visualization for tool Point of intersection line and axis.
  • +
  • Improved curve segment warnings.
  • +
  • Tape app. Add action Add separator to menu.
  • +
  • Tape app. Fix crash after switching language.
  • +
  • Fix Valentina app crash after canceling a tool.
  • +
  • Puzzle app. Fix reading a piece name.
  • +
  • Fix warning while segmenting flipped arc.
  • +
  • Tape app. "Export from existing ..." now supports multisize measurements.
  • +
  • Fix main path validation. False positive double curve.
  • +
  • Fix Setup multisize measurements dialog. Improved handling Height dimension.
  • +
  • Fix updating dimension labels in Valentina app.
  • +
  • Fix menu on Mac OS X.
  • +
  • Add function's argument template with name in the Formula Wizard.
  • +
  • Unit type for increments.
  • +
  • Support for options Force Flipping and Forbid Flipping in Puzzle.
  • +
  • Remember selected dimension values.
  • +
  • Fix segmenting a simple curve.
  • +
  • Fix export tiled pdf on Mac OS.
  • +
  • Improve visualization for tools.
  • +
  • Fix calculating an elliptical arc.
  • +
  • Enable Approximation scale option for Elliptical arc.
  • +
  • Fix bug in seam allowance.
  • +
  • Allow resizing Spline path dialog.
  • +
  • Improve highlighting file in file browser for Linux.
  • +
+
+
+ +
diff --git a/dist/win/openssl/win64/libcrypto-1_1-x64.dll b/dist/win/openssl/win64/libcrypto-1_1-x64.dll index 2e0f7ff54..57ba6e5a2 100644 Binary files a/dist/win/openssl/win64/libcrypto-1_1-x64.dll and b/dist/win/openssl/win64/libcrypto-1_1-x64.dll differ diff --git a/dist/win/openssl/win64/libssl-1_1-x64.dll b/dist/win/openssl/win64/libssl-1_1-x64.dll index be0e20698..7958452c6 100644 Binary files a/dist/win/openssl/win64/libssl-1_1-x64.dll and b/dist/win/openssl/win64/libssl-1_1-x64.dll differ diff --git a/qbs/imports/VApp.qbs b/qbs/imports/VApp.qbs new file mode 100644 index 000000000..3c33294d6 --- /dev/null +++ b/qbs/imports/VApp.qbs @@ -0,0 +1,89 @@ +import qbs.FileInfo +import qbs.Utilities + +CppApplication { + Depends { name: "buildconfig" } + Depends { name: "bundle"; condition: qbs.targetOS.contains("macos") } + + Properties { + condition: qbs.targetOS.contains("macos") + cpp.minimumMacosVersion: buildconfig.minimumMacosVersion + } + + Properties { + condition: buildconfig.enableRPath + cpp.rpaths: FileInfo.joinPaths(cpp.rpathOrigin, + "..", + qbs.targetOS.contains("macos") + ? "Frameworks" + : buildconfig.installLibraryPath) + } + + Properties { + condition: qbs.targetOS.contains("unix") && buildconfig.buildWithCcache + cpp.compilerWrapper: "ccache" + } + + Properties { + condition: Qt.core.versionMajor >= 5 && Qt.core.versionMinor < 12 + cpp.cxxLanguageVersion: "c++11" + } + + // Since Qt 5.12 available support for C++17 + Properties { + condition: Qt.core.versionMajor >= 5 && Qt.core.versionMinor >= 12 + cpp.cxxLanguageVersion: "c++17" + } + + Group { + // See question on StackOwerflow "QSslSocket error when SSL is NOT used" (http://stackoverflow.com/a/31277055/3045403) + // Copy of answer: + // We occasionally had customers getting very similar warning messages but the software was also crashing. + // We determined it was because, although we weren't using SSL either, the program found a copy of OpenSSL on the + // customer's computer and tried interfacing with it. The version it found was too old though (from Qt 5.2 onwards v1.0.0 + // or later is required). + // + // Our solution was to distribute the OpenSSL DLLs along with our application (~1.65 MB). The alternative is to compile + // Qt from scratch without OpenSSL support. + condition: qbs.targetOS.contains("windows") && (qbs.architecture.contains("x86_64") || qbs.architecture.contains("x86")) + name: "openssl" + prefix: project.sourceDirectory + "/dist/win/" + files: { + var files = []; + + if (qbs.toolchainType.contains("mingw")) + files.push("msvcr120.dll"); + + // Minimal supported OpenSSL version since Qt 5.12.4 is 1.1.1. + if (Utilities.versionCompare(Qt.core.version, "5.12.4") >= 0) { + if (qbs.architecture.contains("x86_64")) { + files.push( + "openssl/win64/libcrypto-1_1-x64.dll", + "openssl/win64/libssl-1_1-x64.dll" + ); + } else { + files.push( + "openssl/win32/libcrypto-1_1.dll", + "openssl/win32/libssl-1_1.dll" + ); + } + } else { + if (qbs.architecture.contains("x86_64")) { + files.push( + "openssl/win64/libeay32.dll", + "openssl/win64/ssleay32.dll" + ); + } else { + files.push( + "openssl/win32/libeay32.dll", + "openssl/win32/ssleay32.dll" + ); + } + } + return files; + } + fileTags: ["openssl_dist"] + qbs.install: true + qbs.installDir: buildconfig.installBinaryPath + } +} diff --git a/qbs/imports/VDynamicLib.qbs b/qbs/imports/VDynamicLib.qbs new file mode 100644 index 000000000..eea557564 --- /dev/null +++ b/qbs/imports/VDynamicLib.qbs @@ -0,0 +1,26 @@ +VLib { + Depends { name: "windeployqt"; } + Depends { name: "i18nconfig"; } + + buildconfig.staticBuild: false + + windeployqt.noVirtualkeyboard: true + + Properties { + condition: qbs.targetOS.contains("macos") + bundle.identifierPrefix: 'ua.com.smart-pattern' + } + + Properties { + condition: i18nconfig.limitDeploymentOfQtTranslations + windeployqt.languages: i18nconfig.qtTranslationLocales.join(',') + } + + installDebugInformation: qbs.buildVariant !== "release" + + Properties { + condition: !qbs.targetOS.contains("macos") || (qbs.targetOS.contains("macos") && !buildconfig.enableMultiBundle) + install: true + installDir: buildconfig.installLibraryPath + } +} diff --git a/qbs/imports/VLib.qbs b/qbs/imports/VLib.qbs new file mode 100644 index 000000000..3f5636737 --- /dev/null +++ b/qbs/imports/VLib.qbs @@ -0,0 +1,34 @@ +import qbs.FileInfo + +Library { + Depends { name: "buildconfig" } + Depends { name: "bundle"; condition: qbs.targetOS.contains("macos") } + Depends { name: "cpp" } + + type: buildconfig.staticBuild ? "staticlibrary" : "dynamiclibrary" + + buildconfig.appTarget: qbs.targetOS.contains("macos") ? "Valentina" : "valentina" + cpp.includePaths: [".."] + + // Allow MAC OS X to find library inside a bundle + cpp.sonamePrefix: (!buildconfig.staticBuild && qbs.targetOS.contains("macos")) ? "@rpath" : undefined + + Properties { + condition: (!buildconfig.staticBuild && buildconfig.enableRPath) + cpp.rpaths: cpp.rpathOrigin + } + + Properties { + condition: qbs.targetOS.contains("unix") && buildconfig.buildWithCcache + cpp.compilerWrapper: "ccache" + } + + install: false + installDebugInformation: false + + Properties { + condition: qbs.targetOS.contains("macos") + cpp.minimumMacosVersion: buildconfig.minimumMacosVersion + bundle.isBundle: buildconfig.frameworksBuild + } +} diff --git a/qbs/imports/VTestApp.qbs b/qbs/imports/VTestApp.qbs new file mode 100644 index 000000000..481eba4e0 --- /dev/null +++ b/qbs/imports/VTestApp.qbs @@ -0,0 +1,10 @@ +VApp { + type: base.concat("autotest") + install: false + condition: buildconfig.enableUnitTests + + Properties { + condition: qbs.targetOS.contains("macos") + bundle.isBundle: false + } +} diff --git a/qbs/imports/VToolApp.qbs b/qbs/imports/VToolApp.qbs new file mode 100644 index 000000000..225976691 --- /dev/null +++ b/qbs/imports/VToolApp.qbs @@ -0,0 +1,221 @@ +import qbs.FileInfo +import qbs.File + +VApp { + Depends { name: "freedesktop2" } + Depends { name: "tenv" } + Depends { name: "windeployqt"; condition: qbs.targetOS.contains("windows") } + Depends { name: "i18nconfig"; } + Depends { name: "i18n"; } + Depends { name: "ib"; condition: qbs.targetOS.contains("macos") } + Depends { name: "macdeployqt"; condition: qbs.targetOS.contains("macos") } + + version: "0.7.52" + install: true + installDir: buildconfig.installBinaryPath + installDebugInformation: qbs.buildVariant !== "release" + consoleApplication: false + + property bool primaryApp: false + + Properties { + condition: qbs.targetOS.contains("macos") + // Breakpoints do not work if debug the app inside of bundle. In debug mode we turn off creating a bundle. + // Probably it will breake some dependencies. Version for Mac designed to work inside an app bundle. + bundle.isBundle: qbs.buildVariant === "release" + bundle.identifierPrefix: 'ua.com.smart-pattern' + bundle.infoPlist:({ + "NSHumanReadableCopyright": buildconfig.valentina_copyright_string + }) + } + + Properties { + condition: buildconfig.enableAppImage && qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos") + cpp.dynamicLibraries: ["icudata", "icui18n", "icuuc"] + } + + Group { + name: "freedesktop" + prefix: project.sourceDirectory + "/dist/" + files: [ + "ua.com.smart-pattern." + product.targetName + ".desktop" + ] + } + + freedesktop2.desktopKeys: ({ + 'Exec': FileInfo.joinPaths(qbs.installPrefix, + product.installDir, + product.targetName) + ' %F', + 'X-Application-Version': product.version, + }) + + Group { + name: "Translations" + prefix: project.sourceDirectory + "/share/translations/" + files: { + var files = []; + + var locales = i18nconfig.translationLocales; + + for (var i = 0; i < locales.length; i++) { + files.push("valentina_" + locales[i] + ".ts"); + } + + var pmSystems = i18nconfig.pmSystems; + + for (var i = 0; i < pmSystems.length; i++) { + for (var j = 0; j < locales.length; j++) { + files.push("measurements_" + pmSystems[i] + "_" + locales[j] + ".ts"); + } + } + + return files; + } + } + + Group { + condition: product.primaryApp || (qbs.targetOS.contains("macos") && (!bundle.isBundle || (bundle.isBundle && buildconfig.enableMultiBundle))) + fileTagsFilter: "qm" + qbs.install: true + qbs.installDir: buildconfig.installDataPath + "/translations" + } + + Rule { + multiplex: true + condition: qbs.targetOS.contains("macos") && bundle.isBundle && (buildconfig.enableMultiBundle || primaryApp) + inputs: ["qm"] + outputFileTags: ["bundle.qm", "bundle.content"] + outputArtifacts: { + var locales = product.i18nconfig.translationLocales; + var artifactNames = []; + + for (var i = 0; i < locales.length; i++) { + const lprojDir = FileInfo.joinPaths(product.buildDirectory, product.bundle.bundleName, + "Contents", "Resources", "translations", locales[i] + product.bundle.localizedResourcesFolderSuffix); + + var qmRex = new RegExp('.*_' + locales[i] + '\.qm$', 'g'); + artifactNames = artifactNames.concat((inputs["qm"] || []).filter(function(file){ + return qmRex.exec(file.fileName); + }).map(function(file){ + return FileInfo.joinPaths(lprojDir, file.fileName); + })); + + artifactNames.push(FileInfo.joinPaths(lprojDir, "Localizable.strings")); + + const qtTranslationsMask = [ + "qt_", + "qtbase_", + "qtxmlpatterns_" + ]; + + qtTranslationsMask.forEach(function(mask) { + var qmFile = FileInfo.joinPaths(product.i18n.qtTranslationsPath, mask + locales[i] + ".qm"); + if (File.exists(qmFile)) { + artifactNames.push(FileInfo.joinPaths(lprojDir, mask + locales[i] + ".qm")); + } else { + const lang = locales[i].split('_')[0]; + qmFile = FileInfo.joinPaths(product.i18n.qtTranslationsPath, mask + lang + ".qm"); + if (File.exists(qmFile)) + artifactNames.push(FileInfo.joinPaths(lprojDir, mask + lang + ".qm")); + } + }); + } + + var artifacts = artifactNames.map(function(art){ + var a = { + filePath: art, + fileTags: ["bundle.qm", "bundle.content"] + } + return a; + }); + return artifacts; + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "Preparing Valentina translations"; + cmd.highlight = "filegen"; + + var data = []; + const locales = product.i18nconfig.translationLocales; + + for (var i = 0; i < locales.length; i++) { + const qmRex = new RegExp('.*_' + locales[i] + '.qm$', 'g'); + const src = (inputs["qm"] || []).filter(function(file){ + return qmRex.exec(file.fileName); + }); + + const lprojDir = FileInfo.joinPaths(product.buildDirectory, product.bundle.bundleName, + "Contents", "Resources", "translations", locales[i] + product.bundle.localizedResourcesFolderSuffix); + + for (var j = 0; j < src.length; j++) { + data.push({ + "source" : src[j].filePath, + "destination": FileInfo.joinPaths(lprojDir, src[j].fileName) + }); + } + + data.push({ + "source" : FileInfo.joinPaths(project.sourceDirectory, "share", "translations", "Localizable.strings"), + "destination": FileInfo.joinPaths(lprojDir, "Localizable.strings") + }); + + const qtTranslationsMask = [ + "qt_", + "qtbase_", + "qtxmlpatterns_" + ]; + + qtTranslationsMask.forEach(function(mask) { + var qmFile = FileInfo.joinPaths(product.i18n.qtTranslationsPath, mask + locales[i] + ".qm"); + if (File.exists(qmFile)) { + data.push({ + "source" : qmFile, + "destination": FileInfo.joinPaths(lprojDir, mask + locales[i] + ".qm") + }); + } else { + const lang = locales[i].split('_')[0]; + qmFile = FileInfo.joinPaths(product.i18n.qtTranslationsPath, mask + lang + ".qm"); + if (File.exists(qmFile)) { + data.push({ + "source" : qmFile, + "destination": FileInfo.joinPaths(lprojDir, mask + lang + ".qm") + }); + } + } + }); + } + cmd.data = data; + + cmd.sourceCode = function() { + data.forEach(function(copyData) { + File.copy(copyData.source, copyData.destination); + }); + }; + return [cmd]; + } + } + + Properties { + condition: qbs.targetOS.contains("windows") + windeployqt.noVirtualkeyboard: true + } + + Properties { + condition: qbs.targetOS.contains("macos") + ib.appIconName: targetName + macdeployqt.targetApps: ["Tape", "Puzzle"] + } + + Properties { + condition: qbs.targetOS.contains("windows") && i18nconfig.limitDeploymentOfQtTranslations + windeployqt.languages: i18nconfig.qtTranslationLocales.join(',') + } + + Group { + condition: qbs.targetOS.contains("macos") && bundle.isBundle + fileTagsFilter: "bundle.content" + qbs.install: true + qbs.installDir: buildconfig.installAppPath + qbs.installSourceBase: destinationDirectory + } +} diff --git a/qbs/modules/buildconfig/buildconfig.qbs b/qbs/modules/buildconfig/buildconfig.qbs new file mode 100644 index 000000000..e2657143b --- /dev/null +++ b/qbs/modules/buildconfig/buildconfig.qbs @@ -0,0 +1,861 @@ +import qbs.FileInfo +import qbs.Utilities + +Module { + property bool staticBuild: true + property bool frameworksBuild: qbs.targetOS.contains("macos") && !staticBuild + + property bool enableAddressSanitizer: false + property bool enableUbSanitizer: false + property bool enableThreadSanitizer: false + + // Use this property to disable building unit tests. + property bool enableUnitTests: true + + // Use this property to disable the use of rpath. This can be used when packaging Valentina for distributions which + // do not permit the use of rpath, such as Fedora. + property bool enableRPath: true + + // Use this property to disable the use of precompiled headers. This can be used when packaging Valentina for + // distributions which provides not enough space on build servers. + property bool enablePCH: true + + property bool enableAppImage: false + + property bool enableMultiBundle: false + + property string valentina_copyright_year: { return new Date().getFullYear().toString(); } + property string valentina_copyright_string: "(C) 2013-" + valentina_copyright_year + ", Valentina project" + + Depends { name: "ccache"; } + + // Use this property to disable the use of ccache. + property bool enableCcache: true + readonly property bool ccachePresent: ccache.ccachePresent + readonly property bool ccachePCHSupport: ccache.pchSupport + readonly property bool buildWithCcache: enableCcache && (enablePCH && ccachePresent && ccachePCHSupport || (!enablePCH && ccachePresent)) + + property bool treatWarningsAsErrors: true + + property string libDirName: "lib" + + property string appTarget + + readonly property string installAppPath: { + if (qbs.targetOS.contains("macos")) + return "Applications"; + else if (qbs.targetOS.contains("windows")) + return "."; + else + return "bin"; + } + + readonly property string installBinaryPath: { + if (qbs.targetOS.contains("macos")) + return installAppPath + "/" + appTarget + ".app/Contents/MacOS" + else + return installAppPath + } + + readonly property string installLibraryPath: { + if (qbs.targetOS.contains("macos")) + return installAppPath + "/" + appTarget + ".app/Contents/Frameworks" + else if (qbs.targetOS.contains("windows")) + return installAppPath + else + return libDirName + "/" + appTarget + } + + readonly property string installPluginPath: { + if (qbs.targetOS.contains("macos")) + return installAppPath + "/" + appTarget + ".app/Contents/Plugins" + else + return installLibraryPath + "/plugins" + } + + readonly property string installDataPath: { + if (qbs.targetOS.contains("macos")) + return installAppPath + "/" + appTarget + ".app/Contents/Resources" + else if (qbs.targetOS.contains("windows")) + return installAppPath + else + return "share/" + appTarget + } + + Depends { name: "cpp" } + Depends { name: "Qt.core"; versionAtLeast: project.minimumQtVersion } + Depends { name: "vcs2"; } + + cpp.defines: { + var defines = [ + // The following define makes your compiler emit warnings if you use + // any feature of Qt which has been marked as deprecated (the exact warnings + // depend on your compiler). Please consult the documentation of the + // deprecated API in order to know how to port your code away from it. + "QT_DEPRECATED_WARNINGS", + + // You can make your code fail to compile if it uses deprecated APIs. + // In order to do so, uncomment the following line. + "QT_DISABLE_DEPRECATED_BEFORE=0x060000", // disables all the APIs deprecated before Qt 6.0.0 + + // Since Qt 5.4.0 the source code location is recorded only in debug builds. + // We need this information also in release builds. For this need define QT_MESSAGELOGCONTEXT. + "QT_MESSAGELOGCONTEXT", + + "QBS_BUILD", + "QT_NO_FOREACH" + ]; + + if (qbs.targetOS.contains("unix")) { + defines.push('BINDIR="' + FileInfo.joinPaths(qbs.installPrefix, "bin") + '"'); + const dataDir = FileInfo.joinPaths(qbs.installPrefix, "share"); + defines.push('DATADIR="' + dataDir + '"'); + defines.push('PKGDATADIR="' + FileInfo.joinPaths(dataDir, "valentina") + '"'); + } + + if (qbs.buildVariant !== "debug") + defines.push('V_NO_ASSERT'); + + if (enableAppImage && qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos")) + defines.push('APPIMAGE'); + + if (enableMultiBundle) + defines.push('MULTI_BUNDLE'); + + return defines; + } + + cpp.visibility: "minimal" + + Properties { + condition: Qt.core.versionMajor >= 5 && Qt.core.versionMinor < 12 + cpp.cxxLanguageVersion: "c++11" + } + // Since Qt 5.12 available support for C++17 + Properties { + condition: Qt.core.versionMajor >= 5 && Qt.core.versionMinor >= 12 + cpp.cxxLanguageVersion: "c++17" + } + + readonly property string minimumMacosVersion: { + // Check which minimal OSX version supports current Qt version + if (Qt.core.versionMajor >= 6) { + // For Qt 6.5 https://doc-snapshots.qt.io/qt6-6.5/supported-platforms.html + if (Qt.core.versionMinor >= 5) // Qt 6.5 + return "11.0"; + + // See page https://doc.qt.io/qt-6.4/supported-platforms.html + return "10.14"; // Qt 6.4 and above + } + + if (Qt.core.versionMajor >= 5) { + // See page https://doc.qt.io/qt-5.15/supported-platforms.html + // For qt 5.14 https://doc.qt.io/archives/qt-5.14/supported-platforms.html + if (Qt.core.versionMinor >= 14) // Qt 5.14 + return "10.13"; + + // For Qt 5.13 https://doc.qt.io/archives/qt-5.13/supported-platforms.html + // For Qt 5.12 https://doc.qt.io/archives/qt-5.12/supported-platforms.html + if (Qt.core.versionMinor >= 12) // Qt 5.12 + return "10.12"; + + // For older versions https://doc.qt.io/archives/qt-5.11/supported-platforms-and-configurations.html + if (Qt.core.versionMinor >= 10) // Qt 5.11 and Qt 5.10 + return "10.11"; + + if (Qt.core.versionMinor >= 9) // Qt 5.9 + return "10.10"; + + if (Qt.core.versionMinor >= 8) // Qt 5.8 + return "10.9"; + + if (Qt.core.versionMinor >= 7) // Qt 5.7 + return "10.8"; + + if (Qt.core.versionMinor >= 4) // Qt 5.4 + return "10.7"; + + return "10.6"; + } + + return undefined; + } + + cpp.separateDebugInformation: true + + Properties { + condition: qbs.buildVariant === "debug" + cpp.warningLevel: "all" + cpp.treatWarningsAsErrors: treatWarningsAsErrors + } + + property stringList debugFlags: { + var debugFlags = []; + if (qbs.toolchain.contains("gcc")) { + if (qbs.toolchain.contains("clang")) { + debugFlags.push( + "-fparse-all-comments", + "-Wabi", + "-Wabstract-final-class", + "-Wabstract-vbase-init", + "-Waddress", + "-Waddress-of-temporary", + "-Waggregate-return", + "-Wall", + "-Wambiguous-macro", + "-Wambiguous-member-template", + "-Wanalyzer-incompatible-plugin", + "-Wanonymous-pack-parens", + "-Warc", + "-Warc-bridge-casts-disallowed-in-nonarc", + "-Warc-maybe-repeated-use-of-weak", + "-Warc-non-pod-memaccess", + "-Warc-performSelector-leaks", + "-Warc-repeated-use-of-weak", + "-Warc-retain-cycles", + "-Warc-unsafe-retained-assign", + "-Warray-bounds", + "-Warray-bounds-pointer-arithmetic", + "-Wasm", + "-Wasm-operand-widths", + "-Wassign-enum", + "-Watomic-properties", + "-Watomic-property-with-user-defined-accessor", + "-Wattributes", + "-Wauto-import", + "-Wauto-storage-class", + "-Wauto-var-id", + "-Wavailability", + "-Wbackslash-newline-escape", +// "-Wbad-array-new-length", + "-Wbad-function-cast", + "-Wbind-to-temporary-copy", + "-Wno-c++98-compat-bind-to-temporary-copy", + "-Wbitfield-constant-conversion", + "-Wbitwise-op-parentheses", + "-Wbool-conversion", + "-Wbool-conversions", + "-Wbuiltin-macro-redefined", + "-Wbuiltin-requires-header", + "-Wc++-compat", + "-Wc++0x-compat", + "-Wc++0x-extensions", + "-Wc++0x-narrowing", + "-Wc++11-compat", + "-Wc++11-compat-pedantic", + "-Wc++11-compat-reserved-user-defined-literal", + "-Wc++11-extensions", + "-Wc++11-extra-semi", + "-Wc++11-long-long", + "-Wc++11-narrowing", + "-Wc11-extensions", + "-Wcast-align", + "-Wcast-of-sel-type", + "-Wcast-qual", + "-WCFString-literal", + "-Wchar-align", + "-Wchar-subscripts", + "-Wcomment", + "-Wcomments", + "-Wcompare-distinct-pointer-types", + "-Wcomplex-component-init", + "-Wconditional-type-mismatch", + "-Wconditional-uninitialized", + "-Wconfig-macros", + "-Wconstant-conversion", + "-Wconstant-logical-operand", + "-Wconstexpr-not-const", + "-Wconversion", + "-Wconversion-null", + "-Wno-covered-switch-default", + "-Wctor-dtor-privacy", + "-Wcustom-atomic-properties", + "-Wdangling-else", + "-Wdangling-field", + "-Wdangling-initializer-list", + "-Wdeclaration-after-statement", + "-Wdelegating-ctor-cycles", + "-Wdelete-incomplete", + "-Wdelete-non-virtual-dtor", + "-Wdeprecated", + "-Wdeprecated-declarations", + "-Wdeprecated-implementations", + "-Wdeprecated-objc-isa-usage", + "-Wdeprecated-objc-pointer-introspection", + "-Wdeprecated-objc-pointer-introspection-performSelector", + "-Wdeprecated-register", + "-Wdeprecated-writable-strings", + "-Wdirect-ivar-access", +// "-Wdisabled-macro-expansion", Disabled + "-Wdisabled-optimization", + "-Wdiscard-qual", + "-Wdistributed-object-modifiers", + "-Wdiv-by-zero", + "-Wdivision-by-zero", + "-Wdocumentation", + "-Wdocumentation-deprecated-sync", + "-Wdocumentation-html", + "-Wdollar-in-identifier-extension", + "-Wduplicate-decl-specifier", + "-Wduplicate-enum", + "-Wduplicate-method-arg", + "-Wduplicate-method-match", + "-Wdynamic-class-memaccess", + "-Weffc++", + "-Wembedded-directive", + "-Wempty-body", + "-Wempty-translation-unit", + "-Wendif-labels", + "-Wenum-compare", + "-Wenum-conversion", + "-Wexplicit-ownership-type", + "-Wextern-initializer", + "-Wextra", + "-Wextra-semi", + "-Wextra-tokens", + "-Wflexible-array-extensions", + "-Wfloat-equal", + "-Wformat", + "-Wformat-extra-args", + "-Wformat-invalid-specifier", + "-Wformat-non-iso", + "-Wformat-nonliteral", + "-Wformat-security", + "-Wformat-y2k", + "-Wformat-zero-length", + "-Wformat=2", + "-Wfour-char-constants", + "-Wgcc-compat", + "-Wgnu", + "-Wgnu-array-member-paren-init", + "-Wgnu-designator", + "-Wgnu-static-float-init", + "-Wheader-guard", + "-Wheader-hygiene", + "-Widiomatic-parentheses", + "-Wignored-attributes", + "-Wignored-qualifiers", + "-Wimplicit", + "-Wimplicit-atomic-properties", + "-Wimplicit-conversion-floating-point-to-bool", + "-Wimplicit-exception-spec-mismatch", + "-Wimplicit-fallthrough", + "-Wimplicit-fallthrough-per-function", + "-Wimplicit-function-declaration", + "-Wimplicit-int", + "-Wimplicit-retain-self", + "-Wimport", + "-Wimport-preprocessor-directive-pedantic", + "-Wincompatible-library-redeclaration", + "-Wincompatible-pointer-types", + "-Wincompatible-pointer-types-discards-qualifiers", + "-Wincomplete-implementation", + "-Wincomplete-module", + "-Wincomplete-umbrella", + "-Winit-self", + "-Winitializer-overrides", +// "-Winline", + "-Wint-conversion", + "-Wint-conversions", + "-Wint-to-pointer-cast", + "-Wint-to-void-pointer-cast", + "-Winteger-overflow", + "-Winvalid-constexpr", + "-Winvalid-iboutlet", + "-Winvalid-noreturn", + "-Winvalid-offsetof", + "-Winvalid-pch", + "-Winvalid-pp-token", + "-Winvalid-source-encoding", + "-Winvalid-token-paste", + "-Wknr-promoted-parameter", + "-Wlanguage-extension-token", + "-Wlarge-by-value-copy", + "-Wliteral-conversion", + "-Wliteral-range", + "-Wlocal-type-template-args", + "-Wno-c++98-compat-local-type-template-args", + "-Wlogical-not-parentheses", + "-Wlogical-op-parentheses", +// "-Wlong-long", // We have been using C++11 + "-Wloop-analysis", + "-Wmain", + "-Wmain-return-type", + "-Wmalformed-warning-check", + "-Wmethod-signatures", + "-Wmicrosoft", + "-Wmicrosoft-exists", + "-Wmismatched-parameter-types", + "-Wmismatched-return-types", + "-Wmismatched-tags", + "-Wmissing-braces", + "-Wmissing-declarations", + "-Wmissing-field-initializers", + "-Wmissing-format-attribute", + "-Wmissing-include-dirs", + "-Wmissing-method-return-type", + "-Wmissing-noreturn", + "-Wmissing-prototypes", + "-Wmissing-selector-name", + "-Wmissing-sysroot", + "-Wmissing-variable-declarations", + "-Wmodule-conflict", + "-Wmost", + "-Wmultichar", + "-Wnarrowing", + "-Wnested-externs", + "-Wnewline-eof", + "-Wnon-gcc", + "-Wnon-literal-null-conversion", + "-Wnon-pod-varargs", + "-Wnon-virtual-dtor", + "-Wnonnull", + "-Wnonportable-cfstrings", + "-Wno-c++98-compat", + "-WNSObject-attribute", + "-Wnull-arithmetic", + "-Wnull-character", + "-Wnull-conversion", + "-Wnull-dereference", + "-Wodr", + "-Wold-style-cast", + "-Wold-style-definition", + "-Wout-of-line-declaration", + "-Wover-aligned", + "-Woverflow", + "-Woverlength-strings", + "-Woverloaded-shift-op-parentheses", + "-Woverloaded-virtual", + "-Woverriding-method-mismatch", + "-Wpacked", + "-Wparentheses", + "-Wparentheses-equality", + "-Wpedantic", + "-Wpointer-arith", + "-Wpointer-sign", + "-Wpointer-to-int-cast", + "-Wpointer-type-mismatch", + "-Wpredefined-identifier-outside-function", + "-Wprivate-extern", + "-Wprotocol", + "-Wprotocol-property-synthesis-ambiguity", + "-Wreadonly-iboutlet-property", + "-Wreceiver-expr", + "-Wreceiver-forward-class", + "-Wredundant-decls", + "-Wreinterpret-base-class", + "-Wreorder", + "-Wrequires-super-attribute", + "-Wreserved-user-defined-literal", + "-Wreturn-stack-address", + "-Wreturn-type", + "-Wreturn-type-c-linkage", + "-Wsection", + "-Wselector", + "-Wselector-type-mismatch", + "-Wself-assign", + "-Wself-assign-field", + "-Wsemicolon-before-method-body", + "-Wsentinel", + "-Wsequence-point", + "-Wserialized-diagnostics", + "-Wshadow-ivar", + "-Wshift-count-negative", + "-Wshift-count-overflow", + "-Wshift-op-parentheses", + "-Wshift-overflow", + "-Wshift-sign-overflow", + "-Wshorten-64-to-32", + "-Wsign-compare", + "-Wsign-conversion", + "-Wsign-promo", + "-Wsizeof-array-argument", + "-Wsizeof-array-decay", + "-Wsizeof-pointer-memaccess", + "-Wsometimes-uninitialized", + "-Wsource-uses-openmp", +// "-Wstack-protector", + "-Wstatic-float-init", + "-Wstatic-in-inline", + "-Wstatic-local-in-inline", + "-Wstatic-self-init", + "-Wstrict-aliasing", + "-Wstrict-aliasing=0", + "-Wstrict-aliasing=1", + "-Wstrict-aliasing=2", + "-Wstrict-overflow", + "-Wstrict-overflow=0", + "-Wstrict-overflow=1", + "-Wstrict-overflow=2", + "-Wstrict-overflow=3", + "-Wstrict-overflow=4", + "-Wstrict-overflow=5", + "-Wstrict-prototypes", + "-Wstrict-selector-match", + "-Wstring-compare", + "-Wstring-conversion", + "-Wstring-plus-int", + "-Wstrlcpy-strlcat-size", + "-Wstrncat-size", + "-Wsuper-class-method-mismatch", + "-Wswitch", + "-Wswitch-default", + "-Wsynth", + "-Wtautological-compare", + "-Wtautological-constant-out-of-range-compare", + "-Wtentative-definition-incomplete-type", + "-Wthread-safety", + "-Wthread-safety-analysis", + "-Wthread-safety-attributes", + "-Wthread-safety-beta", + "-Wthread-safety-precise", + "-Wtrigraphs", + "-Wtype-limits", + "-Wtype-safety", + "-Wtypedef-redefinition", + "-Wtypename-missing", + "-Wundeclared-selector", + "-Wundef", + "-Wundefined-inline", + "-Wundefined-internal", + "-Wundefined-reinterpret-cast", + "-Wunicode", + "-Wunicode-whitespace", + "-Wuninitialized", + "-Wunnamed-type-template-args", + "-Wunneeded-internal-declaration", + "-Wunneeded-member-function", + "-Wunsequenced", + "-Wunsupported-visibility", + "-Wunused", + "-Wunused-argument", + "-Wunused-command-line-argument", + "-Wunused-comparison", + "-Wunused-exception-parameter", + "-Wunused-function", + "-Wunused-label", + "-Wunused-member-function", + "-Wunused-parameter", + "-Wunused-private-field", + "-Wunused-result", + "-Wunused-value", + "-Wunused-variable", + "-Wunused-volatile-lvalue", + "-Wuser-defined-literals", + "-Wvarargs", + "-Wvariadic-macros", + "-Wvector-conversion", + "-Wvector-conversions", + "-Wvexing-parse", + "-Wvisibility", + "-Wvla", + "-Wvla-extension", + "-Wvolatile-register-var", +// "-Wweak-vtables", + "-Wwrite-strings", + "-Wzero-length-array", + "-Qunused-arguments", + "-fcolor-diagnostics", + "-Wno-gnu-zero-variadic-macro-arguments", + "-fms-extensions" // Need for pragma message + ) + + if (Utilities.versionCompare(cpp.compilerVersion, "14") < 0) { + debugFlags.push("-Wweak-template-vtables") + } + + if (Utilities.versionCompare(cpp.compilerVersion, "13") >= 0) { + debugFlags.push( + "-Wreserved-identifier", + "-Wunused-but-set-parameter", + "-Wunused-but-set-variable" + ) + } + + if (Utilities.versionCompare(cpp.compilerVersion, "15") >= 0) { + debugFlags.push( + "-Warray-parameter" + ) + } + + if (qbs.targetOS.contains("macos")) { + // Cannot suppress warnings from Qt headers + debugFlags.push( + "-Wno-sign-conversion", + "-Wno-duplicate-enum", + "-Wno-shorten-64-to-32", + "-Wno-deprecated" + ) + } + + if (qbs.buildVariant === "release") { + debugFlags.push("-Wno-unknown-warning-option") + } + + if (qbs.targetOS.contains("windows")) { + // Don't use additional keys on Windows system. + // Can't find a way to ignore Qt header on there. + debugFlags.push( + "-Wall", + "-Wextra", + "-pedantic", + "-Wno-gnu-zero-variadic-macro-arguments", + "-fms-extensions # Need for pragma message" + ) + } + } else if (!qbs.toolchain.contains("clang")) { + debugFlags.push( + "-Wall", + "-Wextra", + "-pedantic", + "-Weffc++", + "-Woverloaded-virtual", + "-Wctor-dtor-privacy", + "-Wnon-virtual-dtor", + "-Wold-style-cast", + "-Wconversion", + "-Winit-self", +// "-Wstack-protector", + "-Wunreachable-code", + "-Wcast-align", + "-Wcast-qual", + "-Wdisabled-optimization", + "-Wfloat-equal", + "-Wformat=2", + "-Wimport", +// "-Wmissing-include-dirs", + "-Wpacked", + "-Wredundant-decls", +// "-Winline", + "-Winvalid-pch", +// "-Wunsafe-loop-optimizations", +// "-Wlong-long", // We have been using C++11 + "-Wmissing-format-attribute", + "-Wswitch-default", + "-Wuninitialized", + "-Wvariadic-macros", + "-Wlogical-op", + "-Wnoexcept", + "-Wmissing-noreturn", + "-Wpointer-arith", + "-Wstrict-null-sentinel", + "-Wstrict-overflow=5", + "-Wno-error=strict-overflow", + "-Wundef", + "-Wno-unused", + "-Wno-pragmas" + ) + + if (Utilities.versionCompare(cpp.compilerVersion, "5") >= 0) { + debugFlags.push( + "-Wswitch-bool", + "-Wlogical-not-parentheses", + "-Wsizeof-array-argument", +// "-Wsuggest-final-types", +// "-Wsuggest-final-methods", + "-Wbool-compare" + ) + } + + if (Utilities.versionCompare(cpp.compilerVersion, "6") >= 0) { + debugFlags.push( + "-Wshift-negative-value", + "-Wshift-overflow", + "-Wshift-overflow=2", + "-Wtautological-compare", +// "-Wnull-dereference", + "-Wduplicated-cond", + "-Wmisleading-indentation" + ) + } + + if (Utilities.versionCompare(cpp.compilerVersion, "7") >= 0) { + debugFlags.push( + "-Wduplicated-branches", + "-Wrestrict", + "-Walloc-zero", + "-Wnonnull", + "-Wno-stringop-overflow" // cannot suppress warning in Qt headers + ) + } + + if (Utilities.versionCompare(cpp.compilerVersion, "8") >= 0) { + debugFlags.push( + "-Wmultistatement-macros", + "-Warray-bounds" + ) + } + + if (Utilities.versionCompare(cpp.compilerVersion, "10") >= 0) { + debugFlags.push( + "-Wredundant-tags" + ) + } + + if (Utilities.versionCompare(cpp.compilerVersion, "11") >= 0) { + debugFlags.push( + "-Wctad-maybe-unsupported", + "-Wmismatched-tags" // bugged in gcc 10 + ) + } + + if (qbs.targetOS.contains("windows")) { + // Don't use additional keys on Windows system. + // Can't find a way to ignore Qt header on there. + debugFlags.push( + "-Wall", + "-Wno-pragmas", + "-Wno-error=strict-overflow", + "-Wextra" + ) + + if (Qt.core.versionMajor === 5 && Qt.core.versionMinor === 6) { + debugFlags.push( + "-Wno-array-bounds" // annoying warning + ) + } + } + } + } + else if (qbs.toolchain.contains("msvc")) { + debugFlags.push( + "-Wall", + "-wd4061", // enum value is not *explicitly* handled in switch + "-wd4099", // first seen using 'struct' now seen using 'class' + "-wd4127", // conditional expression is constant + "-wd4217", // member template isn't copy constructor + "-wd4250", // inherits (implements) some member via dominance + "-wd4251", // needs to have dll-interface to be used by clients + "-wd4275", // exported class derived from non-exported class + "-wd4347", // "behavior change", function called instead of template + "-wd4355", // "'this': used in member initializer list + "-wd4505", // unreferenced function has been removed + "-wd4510", // default constructor could not be generated + "-wd4511", // copy constructor could not be generated + "-wd4512", // assignment operator could not be generated + "-wd4513", // destructor could not be generated + "-wd4514", // 'function' : unreferenced inline function has been removed + "-wd4610", // can never be instantiated user defined constructor required + "-wd4623", // default constructor could not be generated + "-wd4624", // destructor could not be generated + "-wd4625", // copy constructor could not be generated + "-wd4626", // assignment operator could not be generated + "-wd4640", // a local static object is not thread-safe + "-wd4661", // a member of the template class is not defined. + "-wd4670", // a base class of an exception class is inaccessible for catch + "-wd4672", // a base class of an exception class is ambiguous for catch + "-wd4673", // a base class of an exception class is inaccessible for catch + "-wd4675", // resolved overload was found by argument-dependent lookup + "-wd4702", // unreachable code, e.g. in header. + "-wd4710", // call was not inlined + "-wd4711", // call was inlined + "-wd4820", // some padding was added + "-wd4917", // a GUID can only be associated with a class, interface or namespace + "-wd4351", // elements of array 'array' will be default initialized + // The following are real warnings but are generated by almost all MS headers, including + // standard library headers, so it's impractical to leave them on. + "-wd4619", // there is no warning number 'XXXX' + "-wd4668", // XXX is not defined as a preprocessor macro + "-wd5045", // Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified + // Because Microsoft doesn't provide a way to suppress warnings in headers we will suppress + // all warnings we meet in headers globally + "-wd4548", + "-wd4350", + "-wd4242", + "-wd4265", + "-wd4599", + "-wd4371", + "-wd4718", + "-wd4946", + "-wd4868", // compiler may not enforce left-to-right evaluation order in braced initializer list + "-wd4866", // compiler may not enforce left-to-right evaluation order for call to 'C++17 operator' + "-wd4571", // catch(...) semantics changed since Visual C++ 7.1; structured exceptions (SEH) are no longer caught + "-wd5026", // move constructor was implicitly defined as deleted + "-wd5027", // move assignment operator was implicitly defined as deleted + "-wd5039", // pointer or reference to potentially throwing function passed to extern C function under -EHc. + "-wd4774", // format string expected in argument 3 is not a string literal + "-wd5204", // class has virtual functions, but its trivial destructor is not virtual; instances of objects derived + // from this class may not be destructed correctly + "-wd5219", // implicit conversion from '' to '', possible loss of data + "-wd5243" // 'type-name': using incomplete class 'class-name' can cause potential one definition rule violation due + // to ABI limitation + ) + } + return debugFlags; + } + + cpp.cxxFlags: { + var flags = debugFlags; + if (qbs.toolchain.contains("gcc") && enableAddressSanitizer) { + flags.push("-fno-omit-frame-pointer"); + } + return flags; + } + + Properties { + condition: Utilities.versionCompare(qbs.version, "1.22") < 0 + cpp.systemIncludePaths: { + var qtLibs = [ + "QtCore", + "QtSvg", + "QtXml", + "QtPrintSupport", + "QtXmlPatterns", + "QtWidgets", + "QtGui", + "QtNetwork", + "QtTest", + "QtConcurrent" + ]; + + var paths = []; + + if (!qbs.targetOS.contains("macos")) + { + paths.push(Qt.core.incPath); + + for (var i = 0; i < qtLibs.length; i++) { + paths.push(FileInfo.joinPaths(Qt.core.incPath, qtLibs[i])); + } + + } else { + for (var i = 0; i < qtLibs.length; i++) { + paths.push(FileInfo.joinPaths(Qt.core.incPath, qtLibs[i] + ".framework/Versions/" + Qt.core.versionMajor + + "/Headers")); + paths.push(FileInfo.joinPaths(Qt.core.incPath, qtLibs[i] + ".framework/Headers")); + } + } + + return paths; + } + } + + Properties { + condition: qbs.toolchain.contains("gcc") + cpp.driverFlags: { + var flags = []; + if (enableAddressSanitizer) + flags.push("-fsanitize=address"); + if (enableUbSanitizer) + flags.push("-fsanitize=undefined"); + if (enableThreadSanitizer) + flags.push("-fsanitize=thread"); + return flags; + } + } + + vcs2.headerFileName: "vcsRepoState.h" + + Group { + name: "Precompiled headers" + condition: buildconfig.enablePCH + prefix: product.sourceDirectory + "/" + files: { + var files = ["stable.h"]; + if (qbs.toolchain.contains("msvc")) + files.push("stable.cpp") + return files; + } + fileTags: ["cpp_pch_src"] + } +} diff --git a/qbs/modules/ccache/ccache.qbs b/qbs/modules/ccache/ccache.qbs new file mode 100644 index 000000000..305419d3c --- /dev/null +++ b/qbs/modules/ccache/ccache.qbs @@ -0,0 +1,65 @@ +import qbs.Process +import qbs.Utilities + +// Don't forget to edit ccache config: +// ccache --set-config=sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime +Module { + readonly property bool ccachePresent: ccacheProbe.present + readonly property bool pchSupport: ccachePCHProbe.pchSupport + + // change to shell tool which supports key "-c" to excecute command line + property string shellTool: "bash" + + // ccache doesn't provide key to get only version number + readonly property string command: "ccache --version | head -n 1 | grep -oE '[0-9]((\.)[0-9]){0,2}'" + + Probe { + id: ccacheProbe + + property bool present + property string tool: shellTool + property string toolCommand: command + + configure: { + var detector = new Process(); + try { + if (detector.exec(tool, ["-c", toolCommand]) === 0) { + var version = detector.readStdOut().trim(); // we can read only one time + present = Utilities.versionCompare(version, "0.0.0") >= 0; + console.info("Found ccache version " + version + "."); + } + } finally { + detector.close(); + } + } + } + + Probe { + id: ccachePCHProbe + condition: ccachePresent === true + property string tool: shellTool + property string toolCommand: command + + property bool pchSupport + + configure: { + var detector = new Process(); + try { + if (detector.exec(tool, ["-c", toolCommand]) === 0) { + var version = detector.readStdOut().trim(); // we can read only one time + + pchSupport = Utilities.versionCompare(version, "3.1.0") >= 0; + if (!pchSupport && Utilities.versionCompare(version, "3.1.0") < 0){ + console.info("ccache is tool old, version >= 3.1.0 required to work with precompiled headers."); + pchSupport = false; + } + + if (pchSupport) + console.info("ccache supports compilation with precompiled headers.") + } + } finally { + detector.close(); + } + } + } +} diff --git a/qbs/modules/ebr/ebr.qbs b/qbs/modules/ebr/ebr.qbs new file mode 100644 index 000000000..567009342 --- /dev/null +++ b/qbs/modules/ebr/ebr.qbs @@ -0,0 +1,61 @@ +import "rcc.js" as Rcc + +Module { + + additionalProductTypes: "ebr.rcc" + + property bool enableCompression: true + property int thresholdLevel: 70 + property string compressAlgorithm: "zstd" + property int compressLevel: -1 + + Rule { + inputs: ["ebr.external_qrc"] + outputFileTags: ["ebr.rcc"] + outputArtifacts: { + var artifact = { + filePath: input.completeBaseName + ".rcc", + fileTags: ["ebr.rcc"] + }; + return [artifact]; + } + prepare: { + var args = ["-binary", input.filePath, "-o", output.filePath]; + var enableCompression = input.moduleProperty("ebr", "enableCompression"); + if (enableCompression) { + var compressAlgorithm = input.moduleProperty("ebr", "compressAlgorithm"); + if (product.Qt.core.versionMajor >= 5 && product.Qt.core.versionMinor >= 13) { + // Since Qt 5.13 we have option to select compress algorithm + if (compressAlgorithm !== "zstd") + args.push("-compress-algo", compressAlgorithm); + } else { + if (compressAlgorithm !== "zlib") + compressAlgorithm = "zlib"; + } + + var thresholdLevel = input.moduleProperty("ebr", "thresholdLevel"); + if (thresholdLevel !== 70) + args.push("-threshold", thresholdLevel); + + var compressLevel = input.moduleProperty("ebr", "compressLevel"); + if (compressLevel !== -1) { + // rcc will silently ignore incorrect values + if (compressAlgorithm === "zstd") + compressLevel = Rcc.bound(0, compressLevel, 19); + else if (compressAlgorithm === "zlib") + compressLevel = Rcc.bound(1, compressLevel, 9); + } + + if (compressLevel !== -1) + args.push("-compress", compressLevel); + } else { + args.push("-no-compress"); + } + + var cmd = new Command(Rcc.fullPath(product), args); + cmd.description = "rcc (external) "+ input.fileName; + cmd.highlight = 'filegen'; + return cmd; + } + } +} diff --git a/qbs/modules/ebr/rcc.js b/qbs/modules/ebr/rcc.js new file mode 100644 index 000000000..906d1f263 --- /dev/null +++ b/qbs/modules/ebr/rcc.js @@ -0,0 +1,13 @@ +var Utilities = require("qbs.Utilities"); + +function fullPath(product) +{ + if (Utilities.versionCompare(product.Qt.core.version, "6.1") < 0) + return product.Qt.core.binPath + '/' + product.Qt.core.rccName; + return product.Qt.core.libExecPath + '/' + product.Qt.core.rccName; +} + +function bound(min, val, max) +{ + return Math.max(min, Math.min(max, val)); +} diff --git a/qbs/modules/freedesktop2/FreeDesktop2.qbs b/qbs/modules/freedesktop2/FreeDesktop2.qbs new file mode 100644 index 000000000..0c8a51ba2 --- /dev/null +++ b/qbs/modules/freedesktop2/FreeDesktop2.qbs @@ -0,0 +1,192 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Alberto Mardegan +** Contact: http://www.qt.io/licensing +** +** This file is part of Qbs. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms and +** conditions see http://www.qt.io/terms-conditions. For further information +** use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +import qbs.ModUtils +import qbs.TextFile +import "freedesktop2.js" as Fdo + +Module { + property string name: product.name + + property var desktopKeys + + readonly property var defaultDesktopKeys: { + return { + 'Type': 'Application', + 'Name': product.freedesktop2.name, + 'Exec': product.targetName, + 'Terminal': 'false', + 'Version': '1.1', + } + } + property bool _fdoSupported: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("darwin") + + additionalProductTypes: "freedesktop.desktopfile" + + FileTagger { + patterns: [ "*.desktop" ] + fileTags: [ "freedesktop.desktopfile_source" ] + } + + Rule { + alwaysRun: true + condition: _fdoSupported + + inputs: [ "freedesktop.desktopfile_source" ] + outputFileTags: [ "freedesktop.desktopfile" ] + + Artifact { + fileTags: [ "freedesktop.desktopfile" ] + filePath: input.fileName + } + + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "Generating " + output.fileName + " from " + input.fileName; + cmd.highlight = "codegen"; + cmd.sourceCode = function() { + var aggregateDesktopKeys = Fdo.parseDesktopFile(input.filePath); + var desktopKeys = ModUtils.moduleProperty(product, "desktopKeys") || {} + var mainSection = aggregateDesktopKeys['Desktop Entry']; + for (key in desktopKeys) { + if (desktopKeys.hasOwnProperty(key)) { + mainSection[key] = desktopKeys[key]; + } + } + + var defaultValues = product.freedesktop2.defaultDesktopKeys + for (key in defaultValues) { + if (!(key in mainSection)) { + mainSection[key] = defaultValues[key]; + } + } + + Fdo.dumpDesktopFile(output.filePath, aggregateDesktopKeys); + } + return [cmd]; + } + } + + Group { + condition: product.freedesktop2._fdoSupported + fileTagsFilter: [ "freedesktop.desktopfile" ] + qbs.install: true + qbs.installDir: "share/applications" + } + + Group { + condition: product.freedesktop2._fdoSupported + fileTagsFilter: [ "freedesktop.appIcon" ] + qbs.install: true + qbs.installDir: "share/icons/hicolor/scalable/apps" + } + + Group { + condition: product.freedesktop2._fdoSupported + fileTagsFilter: [ "freedesktop.48x48AppsIcons" ] + qbs.install: true + qbs.installDir: "share/icons/hicolor/48x48/apps" + } + + Group { + condition: product.freedesktop2._fdoSupported + fileTagsFilter: [ "freedesktop.64x64AppsIcons" ] + qbs.install: true + qbs.installDir: "share/icons/hicolor/64x64/apps" + } + + Group { + condition: product.freedesktop2._fdoSupported + fileTagsFilter: [ "freedesktop.128x128AppsIcons" ] + qbs.install: true + qbs.installDir: "share/icons/hicolor/128x128/apps" + } + + Group { + condition: product.freedesktop2._fdoSupported + fileTagsFilter: [ "freedesktop.256x256AppsIcons" ] + qbs.install: true + qbs.installDir: "share/icons/hicolor/256x256/apps" + } + + Group { + condition: product.freedesktop2._fdoSupported + fileTagsFilter: [ "freedesktop.512x512AppsIcons" ] + qbs.install: true + qbs.installDir: "share/icons/hicolor/512x512/apps" + } + + Group { + condition: product.freedesktop2._fdoSupported + fileTagsFilter: [ "freedesktop.48x48MimetypesIcons" ] + qbs.install: true + qbs.installDir: "share/icons/hicolor/48x48/mimetypes" + } + + Group { + condition: product.freedesktop2._fdoSupported + fileTagsFilter: [ "freedesktop.64x64MimetypesIcons" ] + qbs.install: true + qbs.installDir: "share/icons/hicolor/64x64/mimetypes" + } + + Group { + condition: product.freedesktop2._fdoSupported + fileTagsFilter: [ "freedesktop.128x128MimetypesIcons" ] + qbs.install: true + qbs.installDir: "share/icons/hicolor/128x128/mimetypes" + } + + Group { + condition: product.freedesktop2._fdoSupported + fileTagsFilter: [ "freedesktop.256x256MimetypesIcons" ] + qbs.install: true + qbs.installDir: "share/icons/hicolor/256x256/mimetypes" + } + + Group { + condition: product.freedesktop2._fdoSupported + fileTagsFilter: [ "freedesktop.512x512MimetypesIcons" ] + qbs.install: true + qbs.installDir: "share/icons/hicolor/512x512/mimetypes" + } + + FileTagger { + patterns: [ "*.metainfo.xml", "*.appdata.xml" ] + fileTags: [ "freedesktop.appstream" ] + } + + Group { + condition: product.freedesktop2._fdoSupported + fileTagsFilter: [ "freedesktop.appstream" ] + qbs.install: true + qbs.installDir: "share/metainfo" + } +} diff --git a/qbs/modules/freedesktop2/freedesktop2.js b/qbs/modules/freedesktop2/freedesktop2.js new file mode 100644 index 000000000..90151dc4f --- /dev/null +++ b/qbs/modules/freedesktop2/freedesktop2.js @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Alberto Mardegan +** Contact: http://www.qt.io/licensing +** +** This file is part of Qbs. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms and +** conditions see http://www.qt.io/terms-conditions. For further information +** use the contact form at http://www.qt.io/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +var TextFile = require("qbs.TextFile"); + +function parseDesktopFile(filePath) { + var file = new TextFile(filePath); + var fileValues = {}; + var currentSection = {}; + var sectionRex = /^\[(.+)\]$/g + while (!file.atEof()) { + var line = file.readLine().trim(); + if (line.length == 0) continue; + if (line[0] == '#') continue; + var match = sectionRex.exec(line); + if (match) { + var currentSectionName = match[1]; + fileValues[currentSectionName] = {}; + currentSection = fileValues[currentSectionName]; + continue; + } + var parts = line.split('=', 2); + currentSection[parts[0]] = parts[1] + } + file.close(); + return fileValues +} + +function dumpDesktopFile(filePath, keys) { + var file = new TextFile(filePath, TextFile.WriteOnly); + for (var sectionName in keys) { + file.writeLine('[' + sectionName + ']'); + var section = keys[sectionName]; + for (var key in section) { + var line = key + '=' + section[key]; + file.writeLine(line); + } + // Write an empty line between sections (and before EOF) + file.writeLine(''); + } + file.close(); +} diff --git a/qbs/modules/i18n/i18n.qbs b/qbs/modules/i18n/i18n.qbs new file mode 100644 index 000000000..777c5ae3e --- /dev/null +++ b/qbs/modules/i18n/i18n.qbs @@ -0,0 +1,243 @@ +import qbs.File +import qbs.FileInfo +import qbs.TextFile +import qbs.Process + +/** + This module generates 'i18n.pro' artifact, which then acts as an input for 'lupdate' program, which in turn produces + translation files, which are compiled by 'lrelease' program into 'qm' files, which can be loaded by an application. + */ +Module { + Depends { name: "Qt.core" } + + additionalProductTypes: ["i18n"] + + /* + Unfortunately you can not simply add empty files to the product, cause 'Qt.core' module has a rule, which calls 'lrelease' on + every 'ts' file in the product and 'lrelease' triggers error if these files are empty. Additionaly 'lupdate' also triggers + errors, when parsing 'pro' file. Instead this property can be used to create new translation file. + */ + property stringList additionalTranslations: [] + + // Explicitly trigger build even if build a product + property bool update: false + + // Build with legacy way though .pro file + property bool buildWithPro: true + + property string lupdateName: "lupdate" + + readonly property string qtTranslationsPath: qtTranslationsProbe.qtTranslationsPath + + Rule { + condition: update && buildWithPro + multiplex: true + inputs: ["i18n.hpp", "i18n.src", "i18n.ui", "i18n.res", "i18n.ts"] + + prepare: { + var proCmd = new JavaScriptCommand(); + proCmd.description = 'generating ' + output.filePath; + proCmd.highlight = 'codegen'; + proCmd.sourceCode = function() { + var f = new TextFile(output.filePath, TextFile.WriteOnly); + try { + f.writeLine("lupdate_only {"); + if (inputs["i18n.hpp"] !== undefined) + for (var i = 0; i < inputs["i18n.hpp"].length; i++) + f.writeLine("HEADERS += " + FileInfo.relativePath(product.sourceDirectory, inputs["i18n.hpp"][i].filePath)); + f.writeLine(""); + if (inputs["i18n.src"] !== undefined) + for (var i = 0; i < inputs["i18n.src"].length; i++) + f.writeLine("SOURCES += " + FileInfo.relativePath(product.sourceDirectory, inputs["i18n.src"][i].filePath)); + f.writeLine(""); + if (inputs["i18n.ui"] !== undefined) + for (var i = 0; i < inputs["i18n.ui"].length; i++) + f.writeLine("FORMS += " + FileInfo.relativePath(product.sourceDirectory, inputs["i18n.ui"][i].filePath)); + f.writeLine(""); + // lupdate processes QML files that are listed in the .qrc file + if (inputs["i18n.res"] !== undefined) + for (var i = 0; i < inputs["i18n.res"].length; i++) + f.writeLine("RESOURCES += " + FileInfo.relativePath(product.sourceDirectory, inputs["i18n.res"][i].filePath)); + f.writeLine("}"); + + f.writeLine(""); + if (inputs["i18n.ts"] !== undefined) + for (var i = 0; i < inputs["i18n.ts"].length; i++) + f.writeLine("TRANSLATIONS += " + FileInfo.relativePath(product.sourceDirectory, inputs["i18n.ts"][i].filePath)); + for (var i = 0; i < product.i18n.additionalTranslations.length; i++) { + var targetDirectory = product.sourceDirectory + "/" + FileInfo.path(product.i18n.additionalTranslations[i]); + if (!File.exists(targetDirectory)) + console.error("Directory '" + targetDirectory + "' does not exists. Please create it."); + f.writeLine("TRANSLATIONS += " + product.i18n.additionalTranslations[i]); + } + } finally { + f.close(); + } + } + return [proCmd]; + } + + Artifact { + filePath: product.sourceDirectory + "/" + product.name + ".i18n.pro" + fileTags: ["i18n.pro"] + } + } + + Rule { + condition: buildWithPro + inputs: ["i18n.pro"] + + prepare: { + var lupdateName = product.i18n.lupdateName; + var cmdLupdate = new Command(product.Qt.core.binPath + '/' + lupdateName, ["-verbose", input.filePath]); + cmdLupdate.description = "Invoking '" + lupdateName + "' program"; + cmdLupdate.highlight = 'filegen'; + + var cmdClean = new JavaScriptCommand(); + cmdClean.description = "Removing " + input.fileName; + cmdClean.highlight = "filegen"; + cmdClean.sourceCode = function() { + File.remove(input.filePath); + } + return [cmdLupdate, cmdClean] + } + + outputFileTags: ["i18n"] + } + + Rule { + condition: update && !buildWithPro + multiplex: true + inputs: ["i18n.hpp", "i18n.src", "i18n.ui", "i18n.ts"] + + prepare: { + var proCmd = new JavaScriptCommand(); + proCmd.description = 'generating ' + output.filePath; + proCmd.highlight = 'codegen'; + proCmd.sourceCode = function() { + var f = new TextFile(output.filePath, TextFile.WriteOnly); + try { + // Since Qt 5.13 lupdate supports passing a project description in JSON file. For producing such a + // description from .pro file we can use new tool lprodump. But tehnically we don't need it. We can + // totally fake format. + // JSON file structure: + // Project ::= { + // string projectFile // Name of the project file. (required) + // string codec // Source code codec. Valid values are + // // currently "utf-16" or "utf-8" (default). + // string[] translations // List of .ts files of the project. (required) + // string[] includePaths // List of include paths. + // string[] sources // List of source files. (required) + // string[] excluded // List of source files, which are + // // excluded for translation. + // Project[] subProjects // List of sub-projects. + // } + // It seems all we need are projectFile, sources and translations options. + + var sources = []; + if (inputs["i18n.hpp"] !== undefined) + for (var i = 0; i < inputs["i18n.hpp"].length; i++) + sources.push(inputs["i18n.hpp"][i].filePath); + + if (inputs["i18n.src"] !== undefined) + for (var i = 0; i < inputs["i18n.src"].length; i++) + sources.push(inputs["i18n.src"][i].filePath); + + if (inputs["i18n.ui"] !== undefined) + for (var i = 0; i < inputs["i18n.ui"].length; i++) + sources.push(inputs["i18n.ui"][i].filePath); + + // lupdate processes QML files that are listed in the .qrc file + if (inputs["i18n.res"] !== undefined) + for (var i = 0; i < inputs["i18n.res"].length; i++) + sources.push(inputs["i18n.res"][i].filePath); + + var translations = []; + if (inputs["i18n.ts"] !== undefined) + for (var i = 0; i < inputs["i18n.ts"].length; i++) + translations.push(inputs["i18n.ts"][i].filePath); + + for (var i = 0; i < product.i18n.additionalTranslations.length; i++) { + var targetDirectory = product.sourceDirectory + "/" + FileInfo.path(product.i18n.additionalTranslations[i]); + if (!File.exists(targetDirectory)) + console.error("Directory '" + targetDirectory + "' does not exists. Please create it."); + translations.push(product.i18n.additionalTranslations[i]); + } + + var project = { + projectFile: "", // Looks like can be empty + sources: sources.sort(), + translations: translations.sort() + }; + + f.write(JSON.stringify([project], null, 2)); + } finally { + f.close(); + } + } + return [proCmd]; + } + + Artifact { + filePath: product.sourceDirectory + "/" + product.name + ".i18n.json" + fileTags: ["i18n.json"] + } + } + + Rule { + condition: !buildWithPro + inputs: ["i18n.json"] + + prepare: { + var lupdateName = product.i18n.lupdateName; + var cmdLupdate = new Command(product.Qt.core.binPath + '/' + lupdateName, ["-verbose", "-project", input.filePath]); + cmdLupdate.description = "Invoking '" + lupdateName + "' program"; + cmdLupdate.highlight = 'filegen'; + + var cmdClean = new JavaScriptCommand(); + cmdClean.description = "Removing " + input.fileName; + cmdClean.highlight = "filegen"; + cmdClean.sourceCode = function() { + File.remove(input.filePath); + } + return [cmdLupdate, cmdClean] + } + + outputFileTags: ["i18n"] + } + + Probe { + id: qtTranslationsProbe + + readonly property string binPath: product.Qt.core.binPath + + property string qtTranslationsPath + + configure: { + var qmakeProcess = new Process(); + try { + var suffix = FileInfo.executableSuffix(); + var qmakePath = FileInfo.joinPaths(binPath, "qmake" + suffix); + qmakeProcess.exec(qmakePath, ["-query"]); + if (qmakeProcess.exitCode() !== 0) { + throw "The qmake executable '" + FileInfo.toNativeSeparators(qmakePath) + "' failed with exit code " + + qmakeProcess.exitCode() + "."; + } + while (!qmakeProcess.atEnd()) { + var line = qmakeProcess.readLine(); + var index = (line || "").indexOf(":"); + if (index !== -1) { + if (line.slice(0, index) === "QT_INSTALL_TRANSLATIONS") { + var path = line.slice(index + 1).trim(); + if (path) + qtTranslationsPath = FileInfo.fromNativeSeparators(path); + break; + } + } + } + } finally { + qmakeProcess.close(); + } + } + } +} diff --git a/qbs/modules/i18nconfig/i18nconfig.qbs b/qbs/modules/i18nconfig/i18nconfig.qbs new file mode 100644 index 000000000..6fd15b2f4 --- /dev/null +++ b/qbs/modules/i18nconfig/i18nconfig.qbs @@ -0,0 +1,68 @@ +Module { + readonly property stringList translationLocales: [ + "uk_UA", + "de_DE", + "cs_CZ", + "he_IL", + "fr_FR", + "it_IT", + "nl_NL", + "id_ID", + "es_ES", + "fi_FI", + "en_US", + "en_CA", + "en_IN", + "ro_RO", + "zh_CN", + "pt_BR", + "el_GR", + "pl_PL" + ] + + property bool limitDeploymentOfQtTranslations: true + + readonly property stringList qtTranslationLocales: [ + "uk", + "de", + "cs", + "he", + "fr", + "it", +// "nl", Not supported by Qt +// "id", Not supported by Qt + "es", + "fi", + "en", +// "ro", Not supported by Qt + "zh_CN", + "pt", +// "el", Not supported by Qt + "pl", +// "zh_TW", Not supported by Valentina +// "ar", Not supported by Valentina +// "bg", Not supported by Valentina +// "ca", Not supported by Valentina +// "da", Not supported by Valentina +// "fa", Not supported by Valentina +// "gd", Not supported by Valentina +// "gl", Not supported by Valentina +// "hu", Not supported by Valentina +// "ja", Not supported by Valentina +// "ko", Not supported by Valentina +// "lt", Not supported by Valentina +// "lv", Not supported by Valentina +// "ru", Not supported by Valentina +// "sk", Not supported by Valentina +// "sl", Not supported by Valentina +// "sv", Not supported by Valentina +// "tr", Not supported by Valentina + ] + + readonly property stringList pmSystems: [ + "p0", "p1", "p2", "p3", "p4", "p5", "p6", "p7", "p8", "p9", "p10", "p11", "p12", "p13", "p14", "p15", + "p16", "p17", "p18", "p19", "p20", "p21", "p22", "p23", "p24", "p25", "p26", "p27", "p28", "p29", + "p30", "p31", "p32", "p33", "p34", "p35", "p36", "p37", "p38", "p39", "p40", "p41", "p42", "p43", + "p44", "p45", "p46", "p47", "p48", "p49", "p50", "p51", "p52", "p53", "p54", "p998" + ] +} diff --git a/qbs/modules/macdeployqt/macdeployqt.qbs b/qbs/modules/macdeployqt/macdeployqt.qbs new file mode 100644 index 000000000..a1c372b24 --- /dev/null +++ b/qbs/modules/macdeployqt/macdeployqt.qbs @@ -0,0 +1,106 @@ +import qbs.File +import qbs.FileInfo +import qbs.Environment +import qbs.Utilities +import qbs.ModUtils + +/** + This module uses _macdeployqt_ program to collect Qt runtime for MacOS deployment. + */ +Module { + additionalProductTypes: ["macdeployqt"] + + property bool artifacts: true + + property string macdeployqtArtifact: artifacts ? "maceployqt.txt" : undefined + + property string macdeployqtProgram: "macdeployqt" + + property bool noPlugins: false + + property int verbose: undefined + + property bool noStrip: true + + property bool useDebugLibs: false + + property bool alwaysOverwrite: false + + property bool appstoreCompliant: false + + property string libpath: undefined + + property stringList targetApps: undefined + + Rule { +// alwaysRun: true + multiplex: true + condition: product.qbs.targetOS.contains("macos") && product.bundle.isBundle && (product.buildconfig.enableMultiBundle || (!product.buildconfig.enableMultiBundle && product.primaryApp)) + inputs: ["bundle.content"] + + prepare: { + var macdeployqtProgram = product.macdeployqt.macdeployqtProgram; + + // Checking if directory exists as a dirty workaround to check if `--no-install` options has been set from command line. + + if (!File.exists(product.qbs.installRoot)) { + var cmd = new JavaScriptCommand(); + cmd.macdeployqtProgram = macdeployqtProgram; + cmd.description = "can not invoke '" + macdeployqtProgram + "' when '--no-install` options has been set from command line"; + cmd.sourceCode = function () { + console.warn("Can not invoke '" + macdeployqtProgram + "' when '--no-install` options has been set from command line (tip: remove your build directory entirely after unchecking '--no-install' option)"); + } + } else { + const installRoot = product.qbs.installRoot + product.qbs.installPrefix + "/" + product.buildconfig.installAppPath; + + var cmdArgs = [installRoot + "/" + product.targetName + ".app"]; + + if (product.macdeployqt.noPlugins) + cmdArgs.push("--no-plugins"); + + if (product.macdeployqt.verbose !== undefined) + cmdArgs.push("--verbose", product.macdeployqt.verbose); + + if (product.macdeployqt.noStrip) + cmdArgs.push("-no-strip"); + + if (product.macdeployqt.useDebugLibs) + cmdArgs.push("-use-debug-libs"); + + if (product.macdeployqt.alwaysOverwrite) + cmdArgs.push("-always-overwrite"); + + if (product.macdeployqt.appstoreCompliant) + cmdArgs.push("-appstore-compliant"); + + if (product.macdeployqt.libpath !== undefined) + cmdArgs.push("--libpath", product.macdeployqt.libpath); + + if (product.macdeployqt.targetApps !== undefined && !product.buildconfig.enableMultiBundle && product.primaryApp) + { + product.macdeployqt.targetApps.forEach(function(targetApp) { + cmdArgs.push("-executable=\"" + installRoot + "/" + product.targetName + ".app/Contents/MacOS/" + targetApp + "\""); + }); + } + + var cmd = new Command(product.Qt.core.binPath + "/" + macdeployqtProgram, cmdArgs); + cmd.jobPool = "macdeployqt"; + cmd.description = "invoking '" + macdeployqtProgram; + cmd.stdoutFilePath = product.buildDirectory + "/" + product.macdeployqt.macdeployqtArtifact; + } + cmd.workingDirectory = product.qbs.installRoot; + cmd.highlight = "filegen"; + return [cmd] + } + + Artifact { + filePath: product.buildDirectory + "/" + product.macdeployqt.macdeployqtArtifact + fileTags: ["macdeployqt"] + } + } + + JobLimit { + jobPool: "macdeployqt" + jobCount: 1 + } +} diff --git a/qbs/modules/multibundle/multibundle.qbs b/qbs/modules/multibundle/multibundle.qbs new file mode 100644 index 000000000..87b722b2d --- /dev/null +++ b/qbs/modules/multibundle/multibundle.qbs @@ -0,0 +1,130 @@ +import qbs.File + +Module { + additionalProductTypes: ["multibundle"] + + property stringList targetApps: undefined + + Rule { +// alwaysRun: true + multiplex: true + condition: product.qbs.targetOS.contains("macos") && product.buildconfig.enableMultiBundle && product.type.contains("dynamiclibrary") + inputs: product.bundle.isBundle ? ["bundle.content"] : ["dynamiclibrary"] + outputFileTags: ["multibundle"] + outputArtifacts: { + var artifactNames = []; + + const fileName = product.bundle.isBundle ? product.bundle.bundleName : inputs["dynamiclibrary"][0].fileName; + + const installRoot = product.qbs.installRoot + product.qbs.installPrefix + "/" + product.buildconfig.installAppPath; + product.multibundle.targetApps.forEach(function(targetApp) { + artifactNames.push(installRoot + "/" + targetApp + ".app/Contents/Frameworks/" + fileName); + + if (product.installDebugInformation) + artifactNames.push(installRoot + "/" + targetApp + ".app/Contents/Frameworks/" + fileName + + product.cpp.debugInfoBundleSuffix); + }); + + var artifacts = artifactNames.map(function(art){ + var a = { + filePath: art, + fileTags: ["multibundle"] + } + return a; + }); + return artifacts; + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "Copying dynamic library into bundles"; + cmd.highlight = "filegen"; + + const fileName = product.bundle.isBundle ? product.bundle.bundleName : inputs["dynamiclibrary"][0].fileName; + const installRoot = product.qbs.installRoot + product.qbs.installPrefix + "/" + product.buildconfig.installAppPath; + var data = []; + product.multibundle.targetApps.forEach(function(targetApp) { + data.push({ + "source" : product.buildDirectory + "/" + fileName, + "destination": installRoot + "/" + targetApp + ".app/Contents/Frameworks/" + fileName + }); + + if (product.installDebugInformation) + data.push({ + "source" : product.buildDirectory + "/" + fileName + product.cpp.debugInfoBundleSuffix, + "destination": installRoot + "/" + targetApp + ".app/Contents/Frameworks/" + fileName + + product.cpp.debugInfoBundleSuffix + }); + }); + + cmd.data = data; + + cmd.sourceCode = function() { + data.forEach(function(copyData) { + File.copy(copyData.source, copyData.destination); + }); + }; + return [cmd]; + } + } + + Rule { +// alwaysRun: true + condition: product.qbs.targetOS.contains("macos") && !product.buildconfig.enableMultiBundle && product.type.contains("application") + inputs: ["application"] + outputFileTags: ["multibundle"] + outputArtifacts: { + var artifactNames = []; + + const installRoot = product.qbs.installRoot + product.qbs.installPrefix + "/" + product.buildconfig.installAppPath; + product.multibundle.targetApps.forEach(function(targetApp) { + artifactNames.push(installRoot + "/" + targetApp + ".app/Contents/MacOS/" + input.fileName); + + if (product.installDebugInformation) + artifactNames.push(installRoot + "/" + targetApp + ".app/Contents/MacOS/" + input.fileName + + product.cpp.debugInfoBundleSuffix); + }); + + var artifacts = artifactNames.map(function(art){ + var a = { + filePath: art, + fileTags: ["multibundle"] + } + return a; + }); + return artifacts; + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "Copying auxiliary binary into bundle"; + cmd.highlight = "filegen"; + + const fileName = product.bundle.isBundle ? product.bundle.bundleName : inputs["dynamiclibrary"][0].fileName; + const installRoot = product.qbs.installRoot + product.qbs.installPrefix + "/" + product.buildconfig.installAppPath; + var data = []; + product.multibundle.targetApps.forEach(function(targetApp) { + data.push({ + "source" : input.filePath, + "destination": installRoot + "/" + targetApp + ".app/Contents/MacOS/" + input.fileName + }); + + if (product.installDebugInformation) + data.push({ + "source" : product.buildDirectory + "/" + input.fileName + product.cpp.debugInfoBundleSuffix, + "destination": installRoot + "/" + targetApp + ".app/Contents/MacOS/" + fileName + + product.cpp.debugInfoBundleSuffix + }); + }); + + cmd.data = data; + + cmd.sourceCode = function() { + data.forEach(function(copyData) { + console.info("Dynamic source: " + copyData.source); + console.info("Dynamic destination: " + copyData.destination); + File.copy(copyData.source, copyData.destination); + }); + }; + return [cmd]; + } + } +} diff --git a/qbs/modules/tenv/tenv.qbs b/qbs/modules/tenv/tenv.qbs new file mode 100644 index 000000000..163228c9b --- /dev/null +++ b/qbs/modules/tenv/tenv.qbs @@ -0,0 +1,115 @@ +import qbs.FileInfo +import qbs.File + +Module { + additionalProductTypes: "tenv.deps" + + // Use this property to preparing test environment. By default for debug purposes we copy some nessesary files and + // libraries into build directory. + property bool enableTestEnvironment: true + + Rule { + multiplex: true +// alwaysRun: true + condition: enableTestEnvironment + inputs: ["pdftops_dist_macx", "pdftops_dist_win", "openssl_dist", "multisize_tables", "label_templates", "qm"] + outputFileTags: ["tenv.deps"] + outputArtifacts: { + var artifactNames = (inputs["pdftops_dist_macx"] || []).map(function(file){ + return FileInfo.joinPaths(product.buildDirectory, file.fileName); + }); + + artifactNames = artifactNames.concat((inputs["pdftops_dist_win"] || []).map(function(file){ + return FileInfo.joinPaths(product.buildDirectory, file.fileName); + })); + + artifactNames = artifactNames.concat((inputs["openssl_dist"] || []).map(function(file){ + return FileInfo.joinPaths(product.buildDirectory, file.fileName); + })); + + artifactNames = artifactNames.concat((inputs["multisize_tables"] || []).map(function(file){ + return FileInfo.joinPaths(product.buildDirectory, "tables/multisize",file.fileName); + })); + + artifactNames = artifactNames.concat((inputs["label_templates"] || []).map(function(file){ + return FileInfo.joinPaths(product.buildDirectory, "labels",file.fileName); + })); + + artifactNames = artifactNames.concat((inputs["qm"] || []).map(function(file){ + return FileInfo.joinPaths(product.buildDirectory, "translations", file.fileName); + })); + + var artifacts = artifactNames.map(function(art){ + var a = { + filePath: art, + fileTags: ["tenv.deps"] + } + return a; + }); + return artifacts; + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "Preparing test environment"; + cmd.highlight = "filegen"; + + var sources = (inputs["pdftops_dist_macx"] || []).map(function(artifact) { + return artifact.filePath; + }); + + sources = sources.concat((inputs["pdftops_dist_win"] || []).map(function(artifact) { + return artifact.filePath; + })); + + sources = sources.concat((inputs["openssl_dist"] || []).map(function(artifact) { + return artifact.filePath; + })); + + sources = sources.concat((inputs["multisize_tables"] || []).map(function(artifact) { + return artifact.filePath; + })); + + sources = sources.concat((inputs["label_templates"] || []).map(function(artifact) { + return artifact.filePath; + })); + + sources = sources.concat((inputs["qm"] || []).map(function(artifact) { + return artifact.filePath; + })); + + cmd.sources = sources; + + var destination = (inputs["pdftops_dist_macx"] || []).map(function(artifact) { + return FileInfo.joinPaths(product.buildDirectory, artifact.fileName); + }); + + destination = destination.concat((inputs["pdftops_dist_win"] || []).map(function(artifact) { + return FileInfo.joinPaths(product.buildDirectory, artifact.fileName); + })); + + destination = destination.concat((inputs["openssl_dist"] || []).map(function(artifact) { + return FileInfo.joinPaths(product.buildDirectory, artifact.fileName); + })); + + destination = destination.concat((inputs["multisize_tables"] || []).map(function(artifact) { + return FileInfo.joinPaths(product.buildDirectory, "tables/multisize", artifact.fileName); + })); + + destination = destination.concat((inputs["label_templates"] || []).map(function(artifact) { + return FileInfo.joinPaths(product.buildDirectory, "labels", artifact.fileName); + })); + + destination = destination.concat((inputs["qm"] || []).map(function(artifact) { + return FileInfo.joinPaths(product.buildDirectory, "translations", artifact.fileName); + })); + + cmd.destination = destination; + cmd.sourceCode = function() { + for (var i in sources) { + File.copy(sources[i], destination[i]); + } + }; + return [cmd]; + } + } +} diff --git a/qbs/modules/vcs2/vcs2.qbs b/qbs/modules/vcs2/vcs2.qbs new file mode 100644 index 000000000..ebe8f4704 --- /dev/null +++ b/qbs/modules/vcs2/vcs2.qbs @@ -0,0 +1,178 @@ +import qbs.File +import qbs.FileInfo +import qbs.Process +import qbs.TextFile +import qbs.Utilities + +Module { + property string type: typeProbe.type + property string repoDir: project.sourceDirectory + property string toolFilePath: { + if (type === "git") + return "git"; + if (type === "svn") + return "svn"; + } + + property string headerFileName: "vcs-repo-state.h" + readonly property string repoState: gitProbe.repoState || subversionProbe.repoState + readonly property string repoStateTag: gitProbe.repoStateTag || subversionProbe.repoStateTag + readonly property string repoStateDistance: gitProbe.repoStateDistance || subversionProbe.repoStateDistance + readonly property string repoStateRevision: gitProbe.repoStateRevision || subversionProbe.repoStateRevision + + // Internal + readonly property string includeDir: FileInfo.joinPaths(product.buildDirectory, "vcs-include") + readonly property string metaDataBaseDir: typeProbe.metaDataBaseDir + + PropertyOptions { + name: "type" + allowedValues: ["git", "svn"] + description: "the version control system your project is using" + } + + Depends { name: "cpp"; condition: headerFileName } + Properties { + condition: headerFileName + cpp.includePaths: [includeDir] + } + + Probe { + id: typeProbe + + property string tool: toolFilePath + property string theRepoDir: repoDir + + property string type + property string metaDataBaseDir + + configure: { + var detector = new Process(); + try { + detector.setWorkingDirectory(theRepoDir); + if (detector.exec(tool || "git", ["rev-parse", "--git-dir"]) === 0) { + found = true; + type = "git"; + metaDataBaseDir = detector.readStdOut().trim(); + if (!FileInfo.isAbsolutePath(metaDataBaseDir)) + metaDataBaseDir = FileInfo.joinPaths(theRepoDir, metaDataBaseDir); + return; + } + if (detector.exec(tool || "svn", + ["info", "--show-item", "wc-root", "--no-newline"]) === 0) { + found = true + type = "svn"; + metaDataBaseDir = FileInfo.joinPaths(detector.readStdOut(), ".svn"); + return; + } else if (detector.exec(tool || "svn", ["info"]) === 0) { + if (detector.exec(tool || "svn", ["--version", "--quiet"]) === 0 + && Utilities.versionCompare(detector.readStdOut().trim(), "1.9") < 0) { + throw "svn too old, version >= 1.9 required"; + } + } + } finally { + detector.close(); + } + } + } + + Probe { + id: gitProbe + condition: type === "git" + + property string tool: toolFilePath + property string theRepoDir: repoDir + property string filePath: FileInfo.joinPaths(metaDataBaseDir, "logs/HEAD") + property var timestamp: File.lastModified(filePath) + + property string repoState + property string repoStateTag + property string repoStateDistance + property string repoStateRevision + + configure: { + if (!File.exists(filePath)) + return; // No commits yet. + var proc = new Process(); + try { + proc.setWorkingDirectory(theRepoDir); + // tag is formatted as TAG-N-gSHA: + // 1. latest stable version is TAG, or vX.Y.Z + // 2. number of commits since latest stable version is N + // 3. latest commit is gSHA + proc.exec(tool, ["describe", "--always", "HEAD"], true); + repoState = proc.readStdOut().trim(); + if (repoState) + found = true; + + const tagSections = repoState.split("-"); + repoStateTag = tagSections[0]; + repoStateDistance = tagSections[1]; + repoStateRevision = tagSections[2]; + } finally { + proc.close(); + } + } + } + + Probe { + id: subversionProbe + condition: type === "svn" + + property string tool: toolFilePath + property string theRepoDir: repoDir + property string filePath: FileInfo.joinPaths(metaDataBaseDir, "wc.db") + property var timestamp: File.lastModified(filePath) + + property string repoState + property string repoStateTag + property string repoStateDistance + property string repoStateRevision + + configure: { + var proc = new Process(); + try { + proc.setWorkingDirectory(theRepoDir); + proc.exec(tool, ["info", "-r", "HEAD", "--show-item", "revision", "--no-newline"], + true); + repoState = proc.readStdOut().trim(); + if (repoState) + found = true; + } finally { + proc.close(); + } + } + } + + Rule { + condition: headerFileName + multiplex: true + Artifact { + filePath: FileInfo.joinPaths(product.vcs2.includeDir, product.vcs2.headerFileName) + fileTags: ["hpp"] + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generating " + output.fileName; + cmd.highlight = "codegen"; + cmd.repoState = product.vcs2.repoState; + cmd.repoStateTag = product.vcs2.repoStateTag; + cmd.repoStateDistance = product.vcs2.repoStateDistance; + cmd.repoStateRevision = product.vcs2.repoStateRevision; + cmd.sourceCode = function() { + var f = new TextFile(output.filePath, TextFile.WriteOnly); + try { + f.writeLine("#ifndef VCS_REPO_STATE_H"); + f.writeLine("#define VCS_REPO_STATE_H"); + f.writeLine('#define VCS_REPO_STATE "' + (repoState ? repoState : "none") + '"') + f.writeLine('#define VCS_REPO_STATE_TAG "' + (repoStateTag ? repoStateTag : "none") + '"') + f.writeLine('#define VCS_REPO_STATE_DISTANCE "' + (repoStateDistance ? repoStateDistance : "none") + '"') + f.writeLine('#define VCS_REPO_STATE_REVISION "' + (repoStateRevision ? repoStateRevision : "none") + '"') + f.writeLine("#endif"); + } finally { + f.close(); + } + }; + return [cmd]; + } + } +} diff --git a/qbs/modules/windeployqt/windeployqt.qbs b/qbs/modules/windeployqt/windeployqt.qbs new file mode 100644 index 000000000..d87584ad6 --- /dev/null +++ b/qbs/modules/windeployqt/windeployqt.qbs @@ -0,0 +1,183 @@ +import qbs.File +import qbs.FileInfo +import qbs.Environment +import qbs.Utilities +import qbs.ModUtils + +/** + This module uses _windeployqt_ program to collect Qt runtime for Windows deployment. + */ +Module { + additionalProductTypes: ["windeployqt"] + + property bool artifacts: true + + property bool json: false + + property string windeployqtArtifact: artifacts ? (json ? "windeployqt.json" : "windeployqt.txt") + : undefined + + property string windeployqtProgram: "windeployqt.exe" + + property string qmake: undefined + + /** + Defines where collected files are being copied. This can be useful to distinguish Qt runtime from project artifacts. Uses + location of the binary if undefined. + */ + property string dir: undefined + + property string libdir: undefined + + property string plugindir: product.windeployqt.dir !== undefined ? product.windeployqt.dir + "/plugins" + : undefined + + property bool debug: false + + property bool release: false + + property bool pdb: false + + property bool force: false + + property bool dryRun: false + + property bool noPatchqt: false + + property bool ignoreLibraryErrors: false + + property bool noPlugins: false + + property bool noLibraries: false + + property string languages: undefined + + property bool noTranslations: false + + property bool noSystemD3dCompiler: false + + property bool compilerRuntime: false + + property bool noVirtualkeyboard: false + + property bool noCompilerRuntime: false + + property bool noOpenglSw: false + + property string list: undefined + + property int verbose: undefined + + Depends { name: "Qt.core" } + + Rule { +// alwaysRun: true + condition: product.qbs.targetOS.contains("windows") + inputs: product.type.contains("dynamiclibrary") ? ["dynamiclibrary"] : ["application"] + + prepare: { + var windeployqtProgram = product.windeployqt.windeployqtProgram; + + // Checking if directory exists as a dirty workaround to check if `--no-install` options has been set from command line. + + if (!File.exists(product.qbs.installRoot)) { + var cmd = new JavaScriptCommand(); + cmd.windeployqtProgram = windeployqtProgram; + cmd.description = "can not invoke '" + windeployqtProgram + "' when '--no-install` options has been set from command line"; + cmd.sourceCode = function () { + console.warn("Can not invoke '" + windeployqtProgram + "' when '--no-install` options has been set from command line (tip: remove your build directory entirely after unchecking '--no-install' option)"); + } + } else { + var cmdArgs = [] + + if (Utilities.versionCompare(product.Qt.core.version, "6") >= 0) { + if (product.windeployqt.qmake !== undefined) + cmdArgs.push("--qmake", product.windeployqt.qmake) + + if (product.windeployqt.ignoreLibraryErrors) + cmdArgs.push("--ignore-library-errors") + + if (!product.windeployqt.noTranslations && product.windeployqt.languages !== undefined) + cmdArgs.push("--translations", product.windeployqt.languages) + } + + if (product.windeployqt.dir !== undefined) + cmdArgs.push("--dir", product.windeployqt.dir) + + if (product.windeployqt.noLibraries) + cmdArgs.push("--no-libraries") + else if (product.windeployqt.libdir !== undefined) + cmdArgs.push("--libdir", product.windeployqt.libdir) + + if (product.windeployqt.noPlugins) + cmdArgs.push("--no-plugins") + else if (product.windeployqt.plugindir !== undefined) + cmdArgs.push("--plugindir", product.windeployqt.plugindir) + + if (product.windeployqt.debug) + cmdArgs.push("--debug") + + if (product.windeployqt.release) + cmdArgs.push("--release") + + if (product.windeployqt.pdb && product.qbs.toolchain.contains("msvc")) + cmdArgs.push("--pdb") + + if (product.windeployqt.force) + cmdArgs.push("--force") + + if (product.windeployqt.dryRun) + cmdArgs.push("--dry-run") + + if (product.windeployqt.noPatchqt) + cmdArgs.push("--no-patchqt") + + if (product.windeployqt.noTranslations) + cmdArgs.push("--no-translations") + + if (product.windeployqt.noSystemD3dCompiler) + cmdArgs.push("--no-system-d3d-compiler") + + if (product.windeployqt.compilerRuntime) + cmdArgs.push("--compiler-runtime") + else if (product.windeployqt.noCompilerRuntime) + cmdArgs.push("--no-compiler-runtime") + + if (product.windeployqt.noVirtualkeyboard) + cmdArgs.push("--no-virtualkeyboard") + + if (product.windeployqt.json) + cmdArgs.push("--json") + + if (product.windeployqt.noOpenglSw) + cmdArgs.push("--no-opengl-sw") + + if (product.windeployqt.list !== undefined) + cmdArgs.push("--list", product.windeployqt.list) + + if (product.windeployqt.verbose !== undefined) + cmdArgs.push("--verbose", product.windeployqt.verbose) + + cmdArgs.push(product.installDir + "/" + input.fileName); + + var cmd = new Command(product.Qt.core.binPath + "/" + windeployqtProgram, cmdArgs); + cmd.jobPool = "windeployqt"; + cmd.description = "invoking '" + windeployqtProgram; + cmd.stdoutFilePath = product.buildDirectory + "/" + product.windeployqt.windeployqtArtifact; + } + cmd.workingDirectory = product.qbs.installRoot; + cmd.highlight = "filegen"; + return [cmd] + } + + Artifact { + filePath: product.buildDirectory + "/" + product.windeployqt.windeployqtArtifact + fileTags: ["windeployqt", "windeployqt.json", "json"] + } + } + + JobLimit { + jobPool: "windeployqt" + jobCount: 1 + } +} diff --git a/scripts/qbs_lupdate.sh b/scripts/qbs_lupdate.sh new file mode 100755 index 000000000..f2b79d75c --- /dev/null +++ b/scripts/qbs_lupdate.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Run this script if you want to find and update all strings in the code. +# Please, run this script from folder /scripts. + +start=$(date +%s) + +# Download all translations from transifex.com. +cd ../share/translations +RESOURCES=`find . -regextype sed -regex ".*/measurements_p[0-9]\{1,2\}\.ts"` +cd ../../scripts + +# Empty means unstable branch +MEASUREMENTS_BRANCH='' # For example _05x +VALENTINA_BRANCH='' # for example 05x + +NUMBER=( $RESOURCES ) +NUMBER=${#NUMBER[@]} + +# Certant languages like he_IL and zh_CN are not supported by math parser +for ((i=0;iAfter each crash Valentina collects information that may help us fix the problem. We do not collect any personal information. Find more about what %1kind of information%2 we collect. + + DRW_TextCodec + + No available codec for code page '%1'. + + + DelGroup @@ -14663,6 +14670,13 @@ Do you want to save your changes? Wrong tag name '%1'. + + VAbstractPiece + + Piece '%1'. Not enough points to build seam allowance. + + + VAbstractPieceData diff --git a/share/translations/valentina_cs_CZ.ts b/share/translations/valentina_cs_CZ.ts index c1ca1f161..67844066c 100644 --- a/share/translations/valentina_cs_CZ.ts +++ b/share/translations/valentina_cs_CZ.ts @@ -342,6 +342,13 @@ Po každém pádu Valentina sbírá informace, které nám mohou pomoci problém opravit. Nesbíráme žádné osobní údaje. Podívejte se, jaký %1typ informací%2 sbíráme. + + DRW_TextCodec + + No available codec for code page '%1'. + + + DelGroup @@ -14211,6 +14218,13 @@ Chcete uložit změny? Špatný název značky '%1'. + + VAbstractPiece + + Piece '%1'. Not enough points to build seam allowance. + + + VAbstractPieceData diff --git a/share/translations/valentina_de_DE.ts b/share/translations/valentina_de_DE.ts index f4075b130..ca7df370d 100644 --- a/share/translations/valentina_de_DE.ts +++ b/share/translations/valentina_de_DE.ts @@ -342,6 +342,13 @@ Nach jedem Absturz stellt Valentina Informationen zusammen, die helfen können, das Problem zu beheben. Es werden keine persönlichen Daten übertragen. Finde mehr darüber heraus, welche %1 Information %2 übertragen werden. + + DRW_TextCodec + + No available codec for code page '%1'. + + + DelGroup @@ -14205,6 +14212,13 @@ Do you want to save your changes? Falscher Symbolname '%1'. + + VAbstractPiece + + Piece '%1'. Not enough points to build seam allowance. + + + VAbstractPieceData diff --git a/share/translations/valentina_el_GR.ts b/share/translations/valentina_el_GR.ts index 0919317ab..a08699bfd 100644 --- a/share/translations/valentina_el_GR.ts +++ b/share/translations/valentina_el_GR.ts @@ -338,6 +338,13 @@ Το κείμενο εμφανίζεται κάτω απο το εικονίδιο (συνιστάται για τους αρχάριους). + + DRW_TextCodec + + No available codec for code page '%1'. + + + DelGroup @@ -13875,6 +13882,13 @@ Do you want to save your changes? + + VAbstractPiece + + Piece '%1'. Not enough points to build seam allowance. + + + VAbstractPieceData diff --git a/share/translations/valentina_en_CA.ts b/share/translations/valentina_en_CA.ts index 4f48fc93b..1b422d797 100644 --- a/share/translations/valentina_en_CA.ts +++ b/share/translations/valentina_en_CA.ts @@ -342,6 +342,13 @@ After each crash Valentina collects information that may help us fix the problem. We do not collect any personal information. Find more about what %1kind of information%2 we collect. + + DRW_TextCodec + + No available codec for code page '%1'. + + + DelGroup @@ -14204,6 +14211,13 @@ Do you want to save your changes? Wrong tag name '%1'. + + VAbstractPiece + + Piece '%1'. Not enough points to build seam allowance. + + + VAbstractPieceData diff --git a/share/translations/valentina_en_IN.ts b/share/translations/valentina_en_IN.ts index 701c07b4c..0a8895d8d 100644 --- a/share/translations/valentina_en_IN.ts +++ b/share/translations/valentina_en_IN.ts @@ -342,6 +342,13 @@ After each crash Valentina collects information that may help us fix the problem. We do not collect any personal information. Find more about what %1kind of information%2 we collect. + + DRW_TextCodec + + No available codec for code page '%1'. + + + DelGroup @@ -14204,6 +14211,13 @@ Do you want to save your changes? Wrong tag name '%1'. + + VAbstractPiece + + Piece '%1'. Not enough points to build seam allowance. + + + VAbstractPieceData diff --git a/share/translations/valentina_en_US.ts b/share/translations/valentina_en_US.ts index 98d9cf707..02a563baf 100644 --- a/share/translations/valentina_en_US.ts +++ b/share/translations/valentina_en_US.ts @@ -342,6 +342,13 @@ After each crash Valentina collects information that may help us fix the problem. We do not collect any personal information. Find more about what %1kind of information%2 we collect. + + DRW_TextCodec + + No available codec for code page '%1'. + + + DelGroup @@ -14204,6 +14211,13 @@ Do you want to save your changes? Wrong tag name '%1'. + + VAbstractPiece + + Piece '%1'. Not enough points to build seam allowance. + + + VAbstractPieceData diff --git a/share/translations/valentina_es_ES.ts b/share/translations/valentina_es_ES.ts index 77a35d7e0..111c475ed 100644 --- a/share/translations/valentina_es_ES.ts +++ b/share/translations/valentina_es_ES.ts @@ -342,6 +342,13 @@ Tras cada cuelgue Valentina recolecta información que puede ayudarnos a resolver el problema. No recolectamos ninguna información personal. Encuentre más sobre qué %1tipo de información%2 recolectamos. + + DRW_TextCodec + + No available codec for code page '%1'. + + + DelGroup @@ -14208,6 +14215,13 @@ Quieres guardar los cambios? Nombre de etiqueta equivocado '%1'. + + VAbstractPiece + + Piece '%1'. Not enough points to build seam allowance. + + + VAbstractPieceData diff --git a/share/translations/valentina_fi_FI.ts b/share/translations/valentina_fi_FI.ts index 3cece73e7..74de699bd 100644 --- a/share/translations/valentina_fi_FI.ts +++ b/share/translations/valentina_fi_FI.ts @@ -244,6 +244,13 @@ Varmista kohdan poistaminen + + DRW_TextCodec + + No available codec for code page '%1'. + + + DelGroup @@ -12721,6 +12728,13 @@ Do you want to save your changes? + + VAbstractPiece + + Piece '%1'. Not enough points to build seam allowance. + + + VAbstractPieceData diff --git a/share/translations/valentina_fr_FR.ts b/share/translations/valentina_fr_FR.ts index c77628fe2..3bdf87afa 100644 --- a/share/translations/valentina_fr_FR.ts +++ b/share/translations/valentina_fr_FR.ts @@ -342,6 +342,13 @@ Après chaque plantage, Valentina collecte des informations qui peuvent nous servir à régler le problème. Nous ne collectons aucune information personnelle. Pour en savoir plus : %1 le genre d'information%2 que nous collectons. + + DRW_TextCodec + + No available codec for code page '%1'. + + + DelGroup @@ -14205,6 +14212,13 @@ Voulez-vous enregistrer vos changements ? Mauvais nom de tag '%1'. + + VAbstractPiece + + Piece '%1'. Not enough points to build seam allowance. + + + VAbstractPieceData diff --git a/share/translations/valentina_he_IL.ts b/share/translations/valentina_he_IL.ts index 0531a56fe..0419956a5 100644 --- a/share/translations/valentina_he_IL.ts +++ b/share/translations/valentina_he_IL.ts @@ -243,6 +243,13 @@ ספר + + DRW_TextCodec + + No available codec for code page '%1'. + + + DelGroup @@ -12163,6 +12170,13 @@ Do you want to save your changes? + + VAbstractPiece + + Piece '%1'. Not enough points to build seam allowance. + + + VAbstractPieceData diff --git a/share/translations/valentina_id_ID.ts b/share/translations/valentina_id_ID.ts index 490089fe2..415a6f521 100644 --- a/share/translations/valentina_id_ID.ts +++ b/share/translations/valentina_id_ID.ts @@ -228,6 +228,13 @@ Setelah setiap kerusakan Valentina mengumpulkan informasi yang dapat membantu kami memperbaiki suatu masalah. Kami tidak mengumpulkan informasi pribadi apapun. Temukan lebih lanjut tentang apa <a href="https://bitbucket.org/dismine/valentina/wiki/manual/Crash_reports"> jenis informasi </a> kami kumpulkan. + + DRW_TextCodec + + No available codec for code page '%1'. + + + DelGroup @@ -11876,6 +11883,13 @@ Do you want to save your changes? + + VAbstractPiece + + Piece '%1'. Not enough points to build seam allowance. + + + VAbstractPieceData diff --git a/share/translations/valentina_it_IT.ts b/share/translations/valentina_it_IT.ts index 80915e341..8c18c1e55 100644 --- a/share/translations/valentina_it_IT.ts +++ b/share/translations/valentina_it_IT.ts @@ -342,6 +342,13 @@ Dopo ogni crash Valentina recupera informazioni utili per risolvere un problema. Non raccogliamo informazioni personali. Scopri di più in merito al %1tipo di informazioni%2 che collezioniamo. + + DRW_TextCodec + + No available codec for code page '%1'. + + + DelGroup @@ -14191,6 +14198,13 @@ Vuoi salvare le tue modifiche? Nome di etichetta errato '%1'. + + VAbstractPiece + + Piece '%1'. Not enough points to build seam allowance. + + + VAbstractPieceData diff --git a/share/translations/valentina_nl_NL.ts b/share/translations/valentina_nl_NL.ts index 67d1ab7c3..23397aa54 100644 --- a/share/translations/valentina_nl_NL.ts +++ b/share/translations/valentina_nl_NL.ts @@ -342,6 +342,13 @@ Na iedere crash verzamelt Valentina informatie die mogelijks kan bijdragen om het probleem te verhelpen. Wij verzamelen geen persoonlijke informatie. Voor meer informatie zie %1soort informatie%2. + + DRW_TextCodec + + No available codec for code page '%1'. + + + DelGroup @@ -14207,6 +14214,13 @@ Wil je deze veranderingen opslaan? Verkeerde etiket naam '%1'. + + VAbstractPiece + + Piece '%1'. Not enough points to build seam allowance. + + + VAbstractPieceData diff --git a/share/translations/valentina_pl_PL.ts b/share/translations/valentina_pl_PL.ts index 704c88de2..f26ee49ce 100644 --- a/share/translations/valentina_pl_PL.ts +++ b/share/translations/valentina_pl_PL.ts @@ -342,6 +342,13 @@ Po każdej awarii, Valentina zbiera informacje, które moga pomóc nam w naprawieniu zaistniałego problemu. Nie gromadzimy żadnych informacji osobistych. Dowiedź się więcej o %1rodzaju zbieranych przez nas informacji%2. + + DRW_TextCodec + + No available codec for code page '%1'. + + + DelGroup @@ -13015,6 +13022,13 @@ Czy chcesz zapisać zmiany? + + VAbstractPiece + + Piece '%1'. Not enough points to build seam allowance. + + + VAbstractPieceData diff --git a/share/translations/valentina_pt_BR.ts b/share/translations/valentina_pt_BR.ts index 4acfee52f..6caebd6ac 100644 --- a/share/translations/valentina_pt_BR.ts +++ b/share/translations/valentina_pt_BR.ts @@ -342,6 +342,13 @@ Após cada erro, Valentina coleta informações que poderão nos ajudar a solucionar o problema. Nós não coletamos qualquer informação pessoal. Para maiores detalhes sobre qual %1tipo de informação%2 nós coletamos. + + DRW_TextCodec + + No available codec for code page '%1'. + + + DelGroup @@ -14200,6 +14207,13 @@ Deseja salvar suas mudanças? Nome da etiqueta errada '%1'. + + VAbstractPiece + + Piece '%1'. Not enough points to build seam allowance. + + + VAbstractPieceData diff --git a/share/translations/valentina_ro_RO.ts b/share/translations/valentina_ro_RO.ts index a009669f9..89e73a1f3 100644 --- a/share/translations/valentina_ro_RO.ts +++ b/share/translations/valentina_ro_RO.ts @@ -334,6 +334,13 @@ După fiecare prăbușire, Valentina colectează informații care pot ajuta să rezolvăm problema. Noi nu colectăm informații personale. Află mai multe despre ce <a href="https://bitbucket.org/dismine/valentina/wiki/manual/Crash_reports"> fel de informații </a> colectăm noi. + + DRW_TextCodec + + No available codec for code page '%1'. + + + DelGroup @@ -12643,6 +12650,13 @@ Do you want to save your changes? + + VAbstractPiece + + Piece '%1'. Not enough points to build seam allowance. + + + VAbstractPieceData diff --git a/share/translations/valentina_uk_UA.ts b/share/translations/valentina_uk_UA.ts index 98e8bf782..6b4d0aaea 100644 --- a/share/translations/valentina_uk_UA.ts +++ b/share/translations/valentina_uk_UA.ts @@ -342,6 +342,13 @@ Після кожного падіння Valentina збирає інформацію яка може допомогти нам у виправленні помилки. Ми не збираємо персональну інформацію користувачів. Дізнатися більше про %1інформацію%2 яку ми збираємо. + + DRW_TextCodec + + No available codec for code page '%1'. + + + DelGroup @@ -14209,6 +14216,13 @@ Do you want to save your changes? Не правильне ім'я тегу '%1'. + + VAbstractPiece + + Piece '%1'. Not enough points to build seam allowance. + + + VAbstractPieceData diff --git a/share/translations/valentina_zh_CN.ts b/share/translations/valentina_zh_CN.ts index fbd3e0bc5..34d9ce544 100644 --- a/share/translations/valentina_zh_CN.ts +++ b/share/translations/valentina_zh_CN.ts @@ -278,6 +278,13 @@ 作者: + + DRW_TextCodec + + No available codec for code page '%1'. + + + DelGroup @@ -11719,6 +11726,13 @@ Do you want to save your changes? + + VAbstractPiece + + Piece '%1'. Not enough points to build seam allowance. + + + VAbstractPieceData diff --git a/src/app/app.qbs b/src/app/app.qbs new file mode 100644 index 000000000..e4aa919c3 --- /dev/null +++ b/src/app/app.qbs @@ -0,0 +1,7 @@ +Project { + references: [ + "valentina/valentina.qbs", + "puzzle/puzzle.qbs", + "tape/tape.qbs", + ] +} diff --git a/src/app/puzzle/dialogs/configpages/puzzlepreferenceslayoutpage.cpp b/src/app/puzzle/dialogs/configpages/puzzlepreferenceslayoutpage.cpp index 28076e555..45d4ec549 100644 --- a/src/app/puzzle/dialogs/configpages/puzzlepreferenceslayoutpage.cpp +++ b/src/app/puzzle/dialogs/configpages/puzzlepreferenceslayoutpage.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "puzzlepreferenceslayoutpage.h" #include "ui_puzzlepreferenceslayoutpage.h" -#include "vpapplication.h" +#include "../../vpapplication.h" #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #include "../vmisc/backport/qoverload.h" #endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0) diff --git a/src/app/puzzle/dialogs/vpdialogabout.cpp b/src/app/puzzle/dialogs/vpdialogabout.cpp index a1a000da0..ee3c57d89 100644 --- a/src/app/puzzle/dialogs/vpdialogabout.cpp +++ b/src/app/puzzle/dialogs/vpdialogabout.cpp @@ -39,6 +39,11 @@ #include #include +#if !defined(BUILD_REVISION) && defined(QBS_BUILD) +#include +#define BUILD_REVISION VCS_REPO_STATE_REVISION +#endif + //--------------------------------------------------------------------------------------------------------------------- VPDialogAbout::VPDialogAbout(QWidget *parent) :QDialog(parent), diff --git a/src/app/puzzle/layout/vplayoutsettings.h b/src/app/puzzle/layout/vplayoutsettings.h index 207718d42..60f0d9d45 100644 --- a/src/app/puzzle/layout/vplayoutsettings.h +++ b/src/app/puzzle/layout/vplayoutsettings.h @@ -33,7 +33,7 @@ #include #include -#include "def.h" +#include "../vmisc/def.h" class VPLayoutSettings { diff --git a/src/app/puzzle/layout/vppiece.h b/src/app/puzzle/layout/vppiece.h index 19ae71c66..75ef5600a 100644 --- a/src/app/puzzle/layout/vppiece.h +++ b/src/app/puzzle/layout/vppiece.h @@ -45,6 +45,7 @@ class VPSheet; class VPPiece : public VLayoutPiece { + Q_DECLARE_TR_FUNCTIONS(VPPiece) // NOLINT public: VPPiece() = default; explicit VPPiece(const VLayoutPiece &layoutPiece); diff --git a/src/app/puzzle/main.cpp b/src/app/puzzle/main.cpp index 161bab225..1b5bb9174 100644 --- a/src/app/puzzle/main.cpp +++ b/src/app/puzzle/main.cpp @@ -71,6 +71,10 @@ auto main(int argc, char *argv[]) -> int VPApplication app(argc, argv); app.InitOptions(); +#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) + VPApplication::setDesktopFileName(QStringLiteral("ua.com.smart-pattern.puzzle.desktop")); +#endif + QTimer::singleShot(0, &app, &VPApplication::ProcessCMD); #if defined(APPIMAGE) && defined(Q_OS_LINUX) diff --git a/src/app/puzzle/puzzle.pro b/src/app/puzzle/puzzle.pro index 10ed4c8be..e8ae65c9a 100644 --- a/src/app/puzzle/puzzle.pro +++ b/src/app/puzzle/puzzle.pro @@ -12,6 +12,8 @@ QT += core gui widgets network xml svg xmlpatterns printsupport concurrent # Name of binary file TARGET = puzzle +VERSION = 0.7.52 + # We want create executable file TEMPLATE = app diff --git a/src/app/puzzle/puzzle.qbs b/src/app/puzzle/puzzle.qbs new file mode 100644 index 000000000..661c1397b --- /dev/null +++ b/src/app/puzzle/puzzle.qbs @@ -0,0 +1,294 @@ +import qbs.FileInfo + +VToolApp { + Depends { name: "buildconfig" } + Depends { name: "ib"; condition: qbs.targetOS.contains("macos") } + Depends { name: "Qt"; submodules: ["widgets", "svg"] } + Depends { name: "VMiscLib" } + Depends { name: "VLayoutLib" } + Depends { name: "IFCLib" } + Depends { name: "VFormatLib" } + Depends { name: "VWidgetsLib" } + Depends { name: "FervorLib" } + Depends { name: "multibundle"; } + + name: "Puzzle" + buildconfig.appTarget: qbs.targetOS.contains("macos") ? "Puzzle" : "puzzle" + targetName: buildconfig.appTarget + multibundle.targetApps: ["Valentina"] + + files: [ + "main.cpp", + "vpapplication.cpp", + "vpcommandline.cpp", + "vpcommands.cpp", + "vpmainwindow.cpp", + "vpsettings.cpp", + "vptilefactory.cpp", + "vpapplication.h", + "vpcommandline.h", + "vpcommands.h", + "vpmainwindow.h", + "vpsettings.h", + "vptilefactory.h", + "vpmainwindow.ui", + ] + + Group { + name: "dialogs" + prefix: "dialogs/" + files: [ + "configpages/puzzlepreferencesconfigurationpage.cpp", + "configpages/puzzlepreferencespathpage.cpp", + "configpages/puzzlepreferenceslayoutpage.cpp", + "dialogpuzzlepreferences.cpp", + "vpdialogabout.cpp", + "dialogsavemanuallayout.cpp", + "configpages/puzzlepreferencesconfigurationpage.h", + "configpages/puzzlepreferencespathpage.h", + "configpages/puzzlepreferenceslayoutpage.h", + "dialogpuzzlepreferences.h", + "vpdialogabout.h", + "dialogsavemanuallayout.h", + "configpages/puzzlepreferencesconfigurationpage.ui", + "configpages/puzzlepreferencespathpage.ui", + "configpages/puzzlepreferenceslayoutpage.ui", + "dialogpuzzlepreferences.ui", + "vpdialogabout.ui", + "dialogsavemanuallayout.ui", + ] + } + + Group { + name: "undocommands" + prefix: "undocommands/" + files: [ + "vpundoaddsheet.cpp", + "vpundocommand.cpp", + "vpundomovepieceonsheet.cpp", + "vpundooriginmove.cpp", + "vpundopiecemove.cpp", + "vpundopiecerotate.cpp", + "vpundopiecezvaluemove.cpp", + "vpundoremovesheet.cpp", + "vpundoaddsheet.h", + "vpundocommand.h", + "vpundomovepieceonsheet.h", + "vpundooriginmove.h", + "vpundopiecemove.h", + "vpundopiecerotate.h", + "vpundopiecezvaluemove.h", + "vpundoremovesheet.h", + ] + } + + Group { + name: "xml" + prefix: "xml/" + files: [ + "vplayoutfilereader.cpp", + "vplayoutfilewriter.cpp", + "vplayoutliterals.cpp", + "vplayoutfilereader.h", + "vplayoutfilewriter.h", + "vplayoutliterals.h", + ] + } + + Group { + name: "layout" + prefix: "layout/" + files: [ + "layoutdef.cpp", + "vplayout.cpp", + "vplayoutsettings.cpp", + "vppiece.cpp", + "vpsheet.cpp", + "layoutdef.h", + "vplayout.h", + "vplayoutsettings.h", + "vppiece.h", + "vpsheet.h", + ] + } + + Group { + name: "carousel" + prefix: "carousel/" + files: [ + "vpcarrousel.cpp", + "vpcarrouselpiece.cpp", + "vpcarrouselpiecelist.cpp", + "vpmimedatapiece.cpp", + "vpcarrousel.h", + "vpcarrouselpiece.h", + "vpcarrouselpiecelist.h", + "vpmimedatapiece.h", + "vpcarrousel.ui", + ] + } + + Group { + name: "scene" + prefix: "scene/" + files: [ + "vpgraphicspiece.cpp", + "vpgraphicspiececontrols.cpp", + "vpgraphicssheet.cpp", + "vpgraphicstilegrid.cpp", + "vpmaingraphicsview.cpp", + "scenedef.h", + "vpgraphicspiece.h", + "vpgraphicspiececontrols.h", + "vpgraphicssheet.h", + "vpgraphicstilegrid.h", + "vpmaingraphicsview.h", + ] + } + + Group { + name: "Resources" + prefix: "share/resources/" + files: [ + "cursor.qrc", // Tools cursor icons + "puzzleicon.qrc", + ] + } + + cpp.includePaths: [product.sourceDirectory] + + Export { + Depends { name: "cpp" } + cpp.defines: { + var defines = []; + var extension = qbs.targetOS.contains("windows") ? ".exe" : ""; + defines.push('PUZZLE_BUILDDIR="' + FileInfo.joinPaths(exportingProduct.buildDirectory, exportingProduct.targetName + extension) +'"'); + return defines; + } + } + + Group { + condition: qbs.targetOS.contains("windows") && (qbs.architecture.contains("x86_64") || qbs.architecture.contains("x86")) + name: "pdftops Windows" + prefix: project.sourceDirectory + "/dist/win/" + files: ["pdftops.exe"] + fileTags: ["pdftops_dist_win"] + qbs.install: true + qbs.installDir: buildconfig.installBinaryPath + } + + Group { + condition: qbs.targetOS.contains("macos") && qbs.architecture.contains("x86_64") && buildconfig.enableMultiBundle + name: "pdftops MacOS" + prefix: project.sourceDirectory + "/dist/macx/bin64/" + files: ["pdftops"] + fileTags: ["pdftops_dist_macx"] + qbs.install: true + qbs.installDir: buildconfig.installBinaryPath + } + + Group { + name: "48x48/apps" + prefix: project.sourceDirectory + "/share/icons/48x48/apps/" + files: "puzzle.png" + fileTags: "freedesktop.48x48AppsIcons" + } + + Group { + name: "64x64/apps" + prefix: project.sourceDirectory + "/share/icons/64x64/apps/" + files: "puzzle.png" + fileTags: "freedesktop.64x64AppsIcons" + } + + Group { + name: "128x128/apps" + prefix: project.sourceDirectory + "/share/icons/128x128/apps/" + files: "puzzle.png" + fileTags: "freedesktop.128x128AppsIcons" + } + + Group { + name: "256x256/apps" + prefix: project.sourceDirectory + "/share/icons/256x256/apps/" + files: "puzzle.png" + fileTags: "freedesktop.256x256AppsIcons" + } + + Group { + name: "512x512/apps" + prefix: project.sourceDirectory + "/share/icons/512x512/apps/" + files: "puzzle.png" + fileTags: "freedesktop.512x512AppsIcons" + } + + Group { + name: "apps48x48/mimetypes" + prefix: project.sourceDirectory + "/share/icons/48x48/mimetypes/" + files: "application-x-valentina-layout.png" + fileTags: "freedesktop.48x48MimetypesIcons" + } + + Group { + name: "apps64x64/mimetypes" + prefix: project.sourceDirectory + "/share/icons/64x64/mimetypes/" + files: "application-x-valentina-layout.png" + fileTags: "freedesktop.64x64MimetypesIcons" + } + + Group { + name: "apps128x128/mimetypes" + prefix: project.sourceDirectory + "/share/icons/128x128/mimetypes/" + files: "application-x-valentina-layout.png" + fileTags: "freedesktop.128x128MimetypesIcons" + } + + Group { + name: "apps256x256/mimetypes" + prefix: project.sourceDirectory + "/share/icons/256x256/mimetypes/" + files: "application-x-valentina-layout.png" + fileTags: "freedesktop.256x256MimetypesIcons" + } + + Group { + name: "apps512x512/mimetypes" + prefix: project.sourceDirectory + "/share/icons/512x512/mimetypes/" + files: "application-x-valentina-layout.png" + fileTags: "freedesktop.512x512MimetypesIcons" + } + + Group { + name: "Puzzle RC" + condition: qbs.targetOS.contains("windows") + prefix: product.sourceDirectory + "/share/resources/" + files: "puzzle.rc" + } + + Group { + name: "win deploy" + condition: qbs.targetOS.contains("windows") + prefix: project.sourceDirectory + "/dist/win/" + files: [ + "layout.ico", + ] + qbs.install: true + qbs.installDir: buildconfig.installAppPath + } + + Group { + name: "MacOS assets" + condition: qbs.targetOS.contains("macos") && buildconfig.enableMultiBundle + prefix: project.sourceDirectory + "/dist/macx/puzzle/" + files: [ + "Info.plist", + "puzzle.xcassets" + ] + } + + Group { + name: "ICNS" + condition: qbs.targetOS.contains("macos") && buildconfig.enableMultiBundle + prefix: project.sourceDirectory + "/dist/macx/valentina-project.xcassets/" + files: "layout.iconset" + } +} diff --git a/src/app/puzzle/scene/vpgraphicspiece.cpp b/src/app/puzzle/scene/vpgraphicspiece.cpp index a78ded1c4..bace17670 100644 --- a/src/app/puzzle/scene/vpgraphicspiece.cpp +++ b/src/app/puzzle/scene/vpgraphicspiece.cpp @@ -47,7 +47,7 @@ #include "../vpapplication.h" #include "compatibility.h" -#include "vlayoutpiecepath.h" +#include "../vlayout/vlayoutpiecepath.h" #include "../vgeometry/vlayoutplacelabel.h" diff --git a/src/app/puzzle/scene/vpmaingraphicsview.cpp b/src/app/puzzle/scene/vpmaingraphicsview.cpp index 18d8076f7..a91f42ac8 100644 --- a/src/app/puzzle/scene/vpmaingraphicsview.cpp +++ b/src/app/puzzle/scene/vpmaingraphicsview.cpp @@ -62,7 +62,9 @@ QT_WARNING_POP namespace { QT_WARNING_PUSH +#if !defined(Q_OS_MACOS) && defined(Q_CC_CLANG) QT_WARNING_DISABLE_CLANG("-Wenum-enum-conversion") +#endif Q_GLOBAL_STATIC_WITH_ARGS(const QKeySequence, restoreOriginShortcut, // NOLINT (QKeySequence(Qt::ControlModifier + Qt::Key_Asterisk))) diff --git a/src/app/puzzle/stable.h b/src/app/puzzle/stable.h index 22e9d4702..556e99d36 100644 --- a/src/app/puzzle/stable.h +++ b/src/app/puzzle/stable.h @@ -51,21 +51,29 @@ # include #endif -//In Windows you can't use same header in all modes. -#if !defined(Q_OS_WIN) -# ifdef QT_WIDGETS_LIB -# include -# endif +#ifdef QT_WIDGETS_LIB +# include +#endif - //Build doesn't work, if include this headers on Windows. -# ifdef QT_XMLPATTERNS_LIB -# include -# endif +#ifdef QT_SVG_LIB +# include +#endif -# ifdef QT_NETWORK_LIB -# include -# endif -#endif/*Q_OS_WIN*/ +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif + +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include +#endif #endif /*__cplusplus*/ diff --git a/src/app/puzzle/vpapplication.cpp b/src/app/puzzle/vpapplication.cpp index bf196d5ba..e6fdb75ae 100644 --- a/src/app/puzzle/vpapplication.cpp +++ b/src/app/puzzle/vpapplication.cpp @@ -60,6 +60,11 @@ QT_WARNING_POP #include #include +#if !defined(BUILD_REVISION) && defined(QBS_BUILD) +#include +#define BUILD_REVISION VCS_REPO_STATE_REVISION +#endif + //--------------------------------------------------------------------------------------------------------------------- inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) // NOLINT(readability-function-cognitive-complexity) { diff --git a/src/app/puzzle/vpmainwindow.cpp b/src/app/puzzle/vpmainwindow.cpp index fdf0d3764..44e6d5dbd 100644 --- a/src/app/puzzle/vpmainwindow.cpp +++ b/src/app/puzzle/vpmainwindow.cpp @@ -1527,7 +1527,9 @@ void VPMainWindow::InitZoomToolBar() delete m_mouseCoordinate; QT_WARNING_PUSH +#if !defined(Q_OS_MACOS) && defined(Q_CC_CLANG) QT_WARNING_DISABLE_CLANG("-Wenum-enum-conversion") +#endif // connect the zoom buttons and shortcuts to the slots QList zoomInShortcuts; diff --git a/src/app/puzzle/vpsettings.cpp b/src/app/puzzle/vpsettings.cpp index 24c6c4030..991f2d515 100644 --- a/src/app/puzzle/vpsettings.cpp +++ b/src/app/puzzle/vpsettings.cpp @@ -57,7 +57,9 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutLineWidth, (QLatin1String( int cachedLineWidth = -1; } // namespace -Q_DECLARE_METATYPE(QMarginsF) +#ifndef QBS_BUILD +Q_DECLARE_METATYPE(QMarginsF) // NOLINT +#endif //--------------------------------------------------------------------------------------------------------------------- VPSettings::VPSettings(Format format, Scope scope, const QString &organization, const QString &application, diff --git a/src/app/puzzle/vpsettings.h b/src/app/puzzle/vpsettings.h index 6492b2679..873f786e0 100644 --- a/src/app/puzzle/vpsettings.h +++ b/src/app/puzzle/vpsettings.h @@ -30,7 +30,7 @@ #include -#include "vcommonsettings.h" +#include "../vmisc/vcommonsettings.h" class VPSettings : public VCommonSettings { diff --git a/src/app/tape/dialogs/dialogabouttape.cpp b/src/app/tape/dialogs/dialogabouttape.cpp index f2c64bd9b..d54fc9a07 100644 --- a/src/app/tape/dialogs/dialogabouttape.cpp +++ b/src/app/tape/dialogs/dialogabouttape.cpp @@ -39,6 +39,11 @@ #include #include +#if !defined(BUILD_REVISION) && defined(QBS_BUILD) +#include +#define BUILD_REVISION VCS_REPO_STATE_REVISION +#endif + //--------------------------------------------------------------------------------------------------------------------- DialogAboutTape::DialogAboutTape(QWidget *parent) :QDialog(parent), diff --git a/src/app/tape/main.cpp b/src/app/tape/main.cpp index 0db4e342b..f5d58306e 100644 --- a/src/app/tape/main.cpp +++ b/src/app/tape/main.cpp @@ -66,7 +66,11 @@ auto main(int argc, char *argv[]) -> int #endif //Q_OS_MAC MApplication app(argc, argv); - app.InitOptions(); + app.InitOptions(); + +#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) + MApplication::setDesktopFileName(QStringLiteral("ua.com.smart-pattern.tape.desktop")); +#endif QTimer::singleShot(0, &app, &MApplication::ProcessCMD); diff --git a/src/app/tape/mapplication.cpp b/src/app/tape/mapplication.cpp index d0bcfb0ca..c4769c312 100644 --- a/src/app/tape/mapplication.cpp +++ b/src/app/tape/mapplication.cpp @@ -59,6 +59,11 @@ #include #include +#if !defined(BUILD_REVISION) && defined(QBS_BUILD) +#include +#define BUILD_REVISION VCS_REPO_STATE_REVISION +#endif + #if defined(APPIMAGE) && defined(Q_OS_LINUX) # include "../vmisc/appimage.h" #endif // defined(APPIMAGE) && defined(Q_OS_LINUX) diff --git a/src/app/tape/stable.h b/src/app/tape/stable.h index 4611a10a7..389dadd4b 100644 --- a/src/app/tape/stable.h +++ b/src/app/tape/stable.h @@ -51,21 +51,33 @@ # include #endif -//In Windows you can't use same header in all modes. -#if !defined(Q_OS_WIN) -# ifdef QT_WIDGETS_LIB -# include -# endif +#ifdef QT_WINEXTRAS_LIB +# include +#endif - //Build doesn't work, if include this headers on Windows. -# ifdef QT_XMLPATTERNS_LIB -# include -# endif +#ifdef QT_WIDGETS_LIB +# include +#endif -# ifdef QT_NETWORK_LIB -# include -# endif -#endif/*Q_OS_WIN*/ +#ifdef QT_SVG_LIB +# include +#endif + +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif + +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include +#endif #endif /*__cplusplus*/ diff --git a/src/app/tape/tape.pro b/src/app/tape/tape.pro index 6e6017317..3cae65453 100644 --- a/src/app/tape/tape.pro +++ b/src/app/tape/tape.pro @@ -12,6 +12,8 @@ QT += core gui widgets network xml xmlpatterns printsupport svg concurrent # Name of binary file TARGET = tape +VERSION = 0.7.52 + # We want create executable file TEMPLATE = app diff --git a/src/app/tape/tape.qbs b/src/app/tape/tape.qbs new file mode 100644 index 000000000..8a2b3e9b2 --- /dev/null +++ b/src/app/tape/tape.qbs @@ -0,0 +1,255 @@ +import qbs.FileInfo + +VToolApp { + Depends { name: "buildconfig" } + Depends { name: "ib"; condition: qbs.targetOS.contains("macos") } + Depends { name: "Qt"; submodules: ["widgets", "svg"] } + Depends { name: "VMiscLib"; } + Depends { name: "VPatternDBLib"; } + Depends { name: "FervorLib"; } + Depends { name: "QMUParserLib"; } + Depends { name: "VFormatLib"; } + Depends { name: "VWidgetsLib"; } + Depends { name: "VToolsLib"; } + Depends { name: "ebr" } + Depends { name: "multibundle"; } + + name: "Tape" + buildconfig.appTarget: qbs.targetOS.contains("macos") ? "Tape" : "tape" + targetName: buildconfig.appTarget + multibundle.targetApps: ["Valentina"] + + files: [ + "main.cpp", + "tmainwindow.cpp", + "mapplication.cpp", + "vlitepattern.cpp", + "vtapesettings.cpp", + "tmainwindow.h", + "mapplication.h", + "version.h", + "vlitepattern.h", + "vtapesettings.h", + "tmainwindow.ui", + ] + + Group { + name: "dialogs" + prefix: "dialogs/" + files: [ + "dialogdimensioncustomnames.cpp", + "dialogdimensionlabels.cpp", + "dialogmeasurementscsvcolumns.cpp", + "dialogrestrictdimension.cpp", + "dialogabouttape.cpp", + "dialognewmeasurements.cpp", + "dialogmdatabase.cpp", + "dialogtapepreferences.cpp", + "configpages/tapepreferencesconfigurationpage.cpp", + "configpages/tapepreferencespathpage.cpp", + "dialogsetupmultisize.cpp", + "dialogdimensioncustomnames.h", + "dialogdimensionlabels.h", + "dialogmeasurementscsvcolumns.h", + "dialogrestrictdimension.h", + "dialogabouttape.h", + "dialognewmeasurements.h", + "dialogmdatabase.h", + "dialogtapepreferences.h", + "configpages/tapepreferencesconfigurationpage.h", + "configpages/tapepreferencespathpage.h", + "dialogsetupmultisize.h", + "dialogdimensioncustomnames.ui", + "dialogdimensionlabels.ui", + "dialogmeasurementscsvcolumns.ui", + "dialogrestrictdimension.ui", + "dialogabouttape.ui", + "dialognewmeasurements.ui", + "dialogmdatabase.ui", + "dialogtapepreferences.ui", + "configpages/tapepreferencesconfigurationpage.ui", + "configpages/tapepreferencespathpage.ui", + "dialogsetupmultisize.ui", + ] + } + + Group { + name: "Resources" + files: [ + "share/resources/tapeicon.qrc", + ] + } + + Export { + Depends { name: "cpp" } + cpp.defines: { + var defines = []; + var extension = qbs.targetOS.contains("windows") ? ".exe" : ""; + defines.push('TAPE_BUILDDIR="' + FileInfo.joinPaths(exportingProduct.buildDirectory, exportingProduct.targetName + extension) +'"'); + return defines; + } + } + + Group { + name: "Multisize tables" + prefix: project.sourceDirectory + "/src/app/share/tables/multisize/" + files: [ + "GOST_man_ru.vst" + ] + fileTags: ["multisize_tables"] + qbs.install: true + qbs.installDir: { + if (qbs.targetOS.contains("macos") && !buildconfig.enableMultiBundle) + return buildconfig.installAppPath + "/Valentina.app/Contents/Resources/tables/multisize" + + return buildconfig.installDataPath + "/tables/multisize" + } + } + + Group { + name: "Measurements templates" + prefix: project.sourceDirectory + "/src/app/share/tables/templates/" + files: [ + "template_all_measurements.vit", + "t_Aldrich_Women.vit" + ] + fileTags: ["measurements_templates"] + qbs.install: true + qbs.installDir: { + if (qbs.targetOS.contains("macos") && !buildconfig.enableMultiBundle) + return buildconfig.installAppPath + "/Valentina.app/Contents/Resources/tables/templates" + + return buildconfig.installDataPath + "/tables/templates" + } + } + + Group { + name: "48x48/apps" + prefix: project.sourceDirectory + "/share/icons/48x48/apps/" + files: "tape.png" + fileTags: "freedesktop.48x48AppsIcons" + } + + Group { + name: "64x64/apps" + prefix: project.sourceDirectory + "/share/icons/64x64/apps/" + files: "tape.png" + fileTags: "freedesktop.64x64AppsIcons" + } + + Group { + name: "128x128/apps" + prefix: project.sourceDirectory + "/share/icons/128x128/apps/" + files: "tape.png" + fileTags: "freedesktop.128x128AppsIcons" + } + + Group { + name: "256x256/apps" + prefix: project.sourceDirectory + "/share/icons/256x256/apps/" + files: "tape.png" + fileTags: "freedesktop.256x256AppsIcons" + } + + Group { + name: "512x512/apps" + prefix: project.sourceDirectory + "/share/icons/512x512/apps/" + files: "tape.png" + fileTags: "freedesktop.512x512AppsIcons" + } + + Group { + name: "apps48x48/mimetypes" + prefix: project.sourceDirectory + "/share/icons/48x48/mimetypes/" + files: ["application-x-valentina-i-measurements.png", "application-x-valentina-s-measurements.png"] + fileTags: "freedesktop.48x48MimetypesIcons" + } + + Group { + name: "apps64x64/mimetypes" + prefix: project.sourceDirectory + "/share/icons/64x64/mimetypes/" + files: ["application-x-valentina-i-measurements.png", "application-x-valentina-s-measurements.png"] + fileTags: "freedesktop.64x64MimetypesIcons" + } + + Group { + name: "apps128x128/mimetypes" + prefix: project.sourceDirectory + "/share/icons/128x128/mimetypes/" + files: ["application-x-valentina-i-measurements.png", "application-x-valentina-s-measurements.png"] + fileTags: "freedesktop.128x128MimetypesIcons" + } + + Group { + name: "apps256x256/mimetypes" + prefix: project.sourceDirectory + "/share/icons/256x256/mimetypes/" + files: ["application-x-valentina-i-measurements.png", "application-x-valentina-s-measurements.png"] + fileTags: "freedesktop.256x256MimetypesIcons" + } + + Group { + name: "apps512x512/mimetypes" + prefix: project.sourceDirectory + "/share/icons/512x512/mimetypes/" + files: ["application-x-valentina-i-measurements.png", "application-x-valentina-s-measurements.png"] + fileTags: "freedesktop.512x512MimetypesIcons" + } + + Group { + name: "Diagrams" + prefix: product.sourceDirectory + "/share/resources/" + files: "diagrams.qrc" + fileTags: "ebr.external_qrc" + } + + Group { + fileTagsFilter: "ebr.rcc" + qbs.install: true + qbs.installDir: { + if (qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos")) + return "share/valentina/"; + + if (qbs.targetOS.contains("macos") && !buildconfig.enableMultiBundle) + return buildconfig.installAppPath + "/Valentina.app/Contents/Resources" + + return buildconfig.installDataPath + "/"; + } + } + + Group { + name: "Tape RC" + condition: qbs.targetOS.contains("windows") + prefix: product.sourceDirectory + "/share/resources/" + files: "tape.rc" + } + + Group { + name: "win deploy" + condition: qbs.targetOS.contains("windows") + prefix: project.sourceDirectory + "/dist/win/" + files: [ + "i-measurements.ico", + "s-measurements.ico", + ] + qbs.install: true + qbs.installDir: buildconfig.installAppPath + } + + Group { + name: "MacOS assets" + condition: qbs.targetOS.contains("macos") && buildconfig.enableMultiBundle + prefix: project.sourceDirectory + "/dist/macx/tape/" + files: [ + "Info.plist", + "tape.xcassets" + ] + } + + Group { + name: "ICNS" + condition: qbs.targetOS.contains("macos") && buildconfig.enableMultiBundle + prefix: project.sourceDirectory + "/dist/macx/valentina-project.xcassets/" + files: [ + "i-measurements.iconset", + "s-measurements.iconset" + ] + } +} diff --git a/src/app/tape/tmainwindow.ui b/src/app/tape/tmainwindow.ui index 51f60f573..02f24edf7 100644 --- a/src/app/tape/tmainwindow.ui +++ b/src/app/tape/tmainwindow.ui @@ -14,7 +14,7 @@ - + :/tapeicon/64x64/logo.png:/tapeicon/64x64/logo.png @@ -51,7 +51,7 @@ - + :/tapeicon/16x16/measurement.png:/tapeicon/16x16/measurement.png @@ -626,7 +626,7 @@ ... - + :/tapeicon/24x24/fx.png:/tapeicon/24x24/fx.png @@ -818,7 +818,7 @@ - + :/tapeicon/16x16/info.png:/tapeicon/16x16/info.png @@ -1382,7 +1382,7 @@ false - + :/tapeicon/24x24/red_plus.png:/tapeicon/24x24/red_plus.png @@ -1397,7 +1397,7 @@ false - + :/tapeicon/24x24/orange_plus.png:/tapeicon/24x24/orange_plus.png @@ -1415,7 +1415,7 @@ false - + :/tapeicon/24x24/padlock_opened.png:/tapeicon/24x24/padlock_opened.png @@ -1526,7 +1526,7 @@ true - + :/tapeicon/24x24/mannequin.png:/tapeicon/24x24/mannequin.png @@ -1625,7 +1625,7 @@ false - + :/tapeicon/24x24/separator.png:/tapeicon/24x24/separator.png @@ -1649,10 +1649,12 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
- + + + actionMeasurementDiagram diff --git a/src/app/valentina/core/vapplication.cpp b/src/app/valentina/core/vapplication.cpp index 4082bf6b9..ed5f50178 100644 --- a/src/app/valentina/core/vapplication.cpp +++ b/src/app/valentina/core/vapplication.cpp @@ -38,7 +38,7 @@ #include "../mainwindow.h" #include "../vmisc/qt_dispatch/qt_dispatch.h" #include "../vmisc/vsysexits.h" -#include "vvalentinasettings.h" +#include "../vmisc/vvalentinasettings.h" #include #include @@ -53,6 +53,11 @@ #include #include +#if !defined(BUILD_REVISION) && defined(QBS_BUILD) +#include +#define BUILD_REVISION VCS_REPO_STATE_REVISION +#endif + #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) #include "../vmisc/backport/qscopeguard.h" #else @@ -73,19 +78,42 @@ namespace { auto AppFilePath(const QString &appName) -> QString { - QString appNameExe = appName; // NOLINT(performance-unnecessary-copy-initialization) #ifdef Q_OS_WIN - appNameExe += ".exe"; + const QString executableSuffix = QStringLiteral(".exe"); +#else + const QString executableSuffix; #endif - QFileInfo canonicalFile(QStringLiteral("%1/%2").arg(QCoreApplication::applicationDirPath(), appNameExe)); + + QFileInfo canonicalFile(QStringLiteral("%1/%2").arg(QCoreApplication::applicationDirPath(), + appName + executableSuffix)); if (canonicalFile.exists()) { return canonicalFile.absoluteFilePath(); } +#if defined(Q_OS_MACOS) && defined(QBS_BUILD) && defined(MULTI_BUNDLE) + QFileInfo multiBundleFile(QStringLiteral("%1/../../../%2.app/Contents/MacOS/%2") + .arg(QCoreApplication::applicationDirPath(), appName)); + if (multiBundleFile.exists()) + { + return multiBundleFile.absoluteFilePath(); + } +#endif + +#if !defined(QBS_BUILD) QFileInfo debugFile(QStringLiteral("%1/../../%2/bin/%3") - .arg(QCoreApplication::applicationDirPath(), appName, appNameExe)); - return debugFile.exists() ? debugFile.absoluteFilePath() : appNameExe; + .arg(QCoreApplication::applicationDirPath(), appName, appName + executableSuffix)); + if (debugFile.exists()) + { + return debugFile.absoluteFilePath(); + } +#endif + +#if !defined(Q_OS_MACOS) + return appName + executableSuffix; +#else + return appName + QStringLiteral(".app"); +#endif } } // namespace @@ -484,13 +512,23 @@ void VApplication::ActivateDarkMode() //--------------------------------------------------------------------------------------------------------------------- auto VApplication::TapeFilePath() -> QString { - return AppFilePath(QStringLiteral("tape")); +#ifdef Q_OS_MACOS + const QString appName = QStringLiteral("Tape"); +#else + const QString appName = QStringLiteral("tape"); +#endif + return AppFilePath(appName); } //--------------------------------------------------------------------------------------------------------------------- auto VApplication::PuzzleFilePath() -> QString { - return AppFilePath(QStringLiteral("puzzle")); +#ifdef Q_OS_MACOS + const QString appName = QStringLiteral("Puzzle"); +#else + const QString appName = QStringLiteral("puzzle"); +#endif + return AppFilePath(appName); } //--------------------------------------------------------------------------------------------------------------------- @@ -637,6 +675,32 @@ void VApplication::InitOptions() ActivateDarkMode(); } +//--------------------------------------------------------------------------------------------------------------------- +void VApplication::StartDetachedProcess(const QString &program, const QStringList &arguments) +{ +#if !defined(Q_OS_MACOS) + const QString workingDirectory = QFileInfo(program).absoluteDir().absolutePath(); + QProcess::startDetached(program, arguments, workingDirectory); +#else + if (not program.endsWith(".app")) + { + const QString workingDirectory = QFileInfo(program).absoluteDir().absolutePath(); + QProcess::startDetached(program, arguments, workingDirectory); + } + else + { + QStringList openArguments {"-n", QStringLiteral("/Applications/%1").arg(program)}; + if (not arguments.isEmpty()) + { + openArguments.append("--args"); + openArguments += arguments; + } + + QProcess::startDetached("open", openArguments); + } +#endif +} + //--------------------------------------------------------------------------------------------------------------------- auto VApplication::LabelLanguages() -> QStringList { diff --git a/src/app/valentina/core/vapplication.h b/src/app/valentina/core/vapplication.h index 1cd673aa2..5143583a5 100644 --- a/src/app/valentina/core/vapplication.h +++ b/src/app/valentina/core/vapplication.h @@ -32,7 +32,7 @@ #include "../vmisc/vabstractvalapplication.h" #include "../vpatterndb/vtranslatevars.h" #include "vcmdexport.h" -#include "vlockguard.h" +#include "../vmisc/vlockguard.h" class VApplication;// use in define @@ -51,6 +51,8 @@ public: void InitOptions(); + static void StartDetachedProcess(const QString &program, const QStringList &arguments); + static auto TapeFilePath() -> QString; static auto PuzzleFilePath() -> QString; diff --git a/src/app/valentina/core/vcmdexport.cpp b/src/app/valentina/core/vcmdexport.cpp index 696175f22..00285e150 100644 --- a/src/app/valentina/core/vcmdexport.cpp +++ b/src/app/valentina/core/vcmdexport.cpp @@ -32,7 +32,7 @@ #include "../ifc/xml/vdomdocument.h" #include "../vmisc/commandoptions.h" #include "../vmisc/vsysexits.h" -#include "vvalentinasettings.h" +#include "../vmisc/vvalentinasettings.h" #include "../vmisc/dialogs/dialogexporttocsv.h" #include "../vlayout/vlayoutgenerator.h" #include diff --git a/src/app/valentina/core/vformulapropertyeditor.cpp b/src/app/valentina/core/vformulapropertyeditor.cpp index 15a3e3881..e77134eba 100644 --- a/src/app/valentina/core/vformulapropertyeditor.cpp +++ b/src/app/valentina/core/vformulapropertyeditor.cpp @@ -68,7 +68,7 @@ VFormulaPropertyEditor::VFormulaPropertyEditor(QWidget *parent) // The layout (a horizontal layout) auto* layout = new QHBoxLayout(this); layout->setSpacing(3); - layout->setMargin(0); + layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(m_TextLabel); // Spacer (this is needed for proper display of the label and button) layout->addSpacerItem(new QSpacerItem(1000000000, 0, QSizePolicy::Expanding, QSizePolicy::Preferred)); diff --git a/src/app/valentina/core/vtooloptionspropertybrowser.cpp b/src/app/valentina/core/vtooloptionspropertybrowser.cpp index fc01c75b7..1c85657b1 100644 --- a/src/app/valentina/core/vtooloptionspropertybrowser.cpp +++ b/src/app/valentina/core/vtooloptionspropertybrowser.cpp @@ -33,7 +33,7 @@ #include "../vwidgets/vcontrolpointspline.h" #include "../vwidgets/vsimplepoint.h" #include "../vwidgets/vsimplecurve.h" -#include "def.h" +#include "../vmisc/def.h" #include "vformulaproperty.h" #include "../vpatterndb/vformula.h" #include "../vgeometry/vcubicbezier.h" diff --git a/src/app/valentina/dialogs/dialogaboutapp.cpp b/src/app/valentina/dialogs/dialogaboutapp.cpp index abfdfe254..8554aeb72 100644 --- a/src/app/valentina/dialogs/dialogaboutapp.cpp +++ b/src/app/valentina/dialogs/dialogaboutapp.cpp @@ -37,6 +37,11 @@ #include "../vmisc/vabstractvalapplication.h" #include "../vmisc/vvalentinasettings.h" +#if !defined(BUILD_REVISION) && defined(QBS_BUILD) +#include +#define BUILD_REVISION VCS_REPO_STATE_REVISION +#endif + //--------------------------------------------------------------------------------------------------------------------- DialogAboutApp::DialogAboutApp(QWidget *parent) : QDialog(parent), diff --git a/src/app/valentina/dialogs/dialogfinalmeasurements.ui b/src/app/valentina/dialogs/dialogfinalmeasurements.ui index 90a889ea0..5cba8aa0c 100644 --- a/src/app/valentina/dialogs/dialogfinalmeasurements.ui +++ b/src/app/valentina/dialogs/dialogfinalmeasurements.ui @@ -88,7 +88,6 @@ 14 - 75 false true @@ -121,7 +120,6 @@ 14 - 75 true @@ -156,7 +154,6 @@ 14 - 75 true @@ -188,7 +185,6 @@ 14 - 75 true @@ -639,7 +635,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/app/valentina/dialogs/dialogincrements.ui b/src/app/valentina/dialogs/dialogincrements.ui index c7ab349c8..9808bd4ba 100644 --- a/src/app/valentina/dialogs/dialogincrements.ui +++ b/src/app/valentina/dialogs/dialogincrements.ui @@ -1608,7 +1608,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/app/valentina/dialogs/dialogknownmaterials.ui b/src/app/valentina/dialogs/dialogknownmaterials.ui index ec6bf6225..2c48784a3 100644 --- a/src/app/valentina/dialogs/dialogknownmaterials.ui +++ b/src/app/valentina/dialogs/dialogknownmaterials.ui @@ -106,7 +106,7 @@ VLineEdit QLineEdit -
vlineedit.h
+
../vwidgets/vlineedit.h
diff --git a/src/app/valentina/dialogs/dialogpatternproperties.ui b/src/app/valentina/dialogs/dialogpatternproperties.ui index a4b4d313e..c360ecf3a 100644 --- a/src/app/valentina/dialogs/dialogpatternproperties.ui +++ b/src/app/valentina/dialogs/dialogpatternproperties.ui @@ -317,7 +317,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/app/valentina/dialogs/vwidgetgroups.ui b/src/app/valentina/dialogs/vwidgetgroups.ui index 3a3ee72f3..c0ae44dca 100644 --- a/src/app/valentina/dialogs/vwidgetgroups.ui +++ b/src/app/valentina/dialogs/vwidgetgroups.ui @@ -85,7 +85,7 @@ VCompleterLineEdit QLineEdit -
vlineedit.h
+
../vwidgets/vlineedit.h
diff --git a/src/app/valentina/main.cpp b/src/app/valentina/main.cpp index be34e752f..761bf9ba5 100644 --- a/src/app/valentina/main.cpp +++ b/src/app/valentina/main.cpp @@ -80,6 +80,10 @@ auto main(int argc, char *argv[]) -> int VApplication app(argc, argv); app.InitOptions(); +#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) + VApplication::setDesktopFileName(QStringLiteral("ua.com.smart-pattern.valentina.desktop")); +#endif + if (VApplication::IsGUIMode() && VAbstractApplication::VApp()->Settings()->IsAutomaticallyCheckUpdates()) { // Set feed URL before doing anything else diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index a4efdb09b..8d6203cf5 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -41,7 +41,7 @@ #include "../vmisc/qxtcsvmodel.h" #include "../vmisc/vmodifierkey.h" #include "../vmisc/vsysexits.h" -#include "undocommands/renamepp.h" +#include "../vtools/undocommands/renamepp.h" #include "core/vtooloptionspropertybrowser.h" #include "../ifc/xml/vpatternconverter.h" #include "../vformat/vmeasurements.h" @@ -2127,9 +2127,7 @@ void MainWindow::ShowMeasurements() arguments.append(QStringLiteral("--") + LONG_OPTION_NO_HDPI_SCALING); } - const QString tape = VApplication::TapeFilePath(); - const QString workingDirectory = QFileInfo(tape).absoluteDir().absolutePath(); - QProcess::startDetached(tape, arguments, workingDirectory); + VApplication::StartDetachedProcess(VApplication::TapeFilePath(), arguments); } else { @@ -2894,7 +2892,9 @@ void MainWindow::ToolBarTools() Also for me don't work Qt:CTRL and work Qt::ControlModifier.*/ QT_WARNING_PUSH +#if !defined(Q_OS_MACOS) && defined(Q_CC_CLANG) QT_WARNING_DISABLE_CLANG("-Wenum-enum-conversion") +#endif QList zoomInShortcuts; zoomInShortcuts.append(QKeySequence(QKeySequence::ZoomIn)); @@ -3801,16 +3801,13 @@ void MainWindow::on_actionOpen_triggered() //--------------------------------------------------------------------------------------------------------------------- void MainWindow::on_actionOpenPuzzle_triggered() { - const QString puzzle = VApplication::PuzzleFilePath(); - const QString workingDirectory = QFileInfo(puzzle).absoluteDir().absolutePath(); - QStringList arguments; if (isNoScaling) { arguments.append(QStringLiteral("--") + LONG_OPTION_NO_HDPI_SCALING); } - QProcess::startDetached(puzzle, arguments, workingDirectory); + VApplication::StartDetachedProcess(VApplication::PuzzleFilePath(), arguments); } //--------------------------------------------------------------------------------------------------------------------- @@ -3861,9 +3858,7 @@ void MainWindow::on_actionCreateManualLayout_triggered() rldFile.setAutoRemove(false); - const QString puzzle = VApplication::PuzzleFilePath(); - const QString workingDirectory = QFileInfo(puzzle).absoluteDir().absolutePath(); - QProcess::startDetached(puzzle, arguments, workingDirectory); + VApplication::StartDetachedProcess(VApplication::PuzzleFilePath(), arguments); } else { @@ -3948,9 +3943,7 @@ void MainWindow::on_actionUpdateManualLayout_triggered() rldFile.setAutoRemove(false); - const QString puzzle = VApplication::PuzzleFilePath(); - const QString workingDirectory = QFileInfo(puzzle).absoluteDir().absolutePath(); - QProcess::startDetached(puzzle, arguments, workingDirectory); + VApplication::StartDetachedProcess(VApplication::PuzzleFilePath(), arguments); } else { @@ -4740,16 +4733,13 @@ void MainWindow::ActionShowMainPath_triggered(bool checked) //--------------------------------------------------------------------------------------------------------------------- void MainWindow::ActionOpenTape_triggered() { - const QString tape = VApplication::TapeFilePath(); - const QString workingDirectory = QFileInfo(tape).absoluteDir().absolutePath(); - QStringList arguments; if (isNoScaling) { arguments.append(QStringLiteral("--") + LONG_OPTION_NO_HDPI_SCALING); } - QProcess::startDetached(tape, arguments, workingDirectory); + VApplication::StartDetachedProcess(VApplication::TapeFilePath(), arguments); } //--------------------------------------------------------------------------------------------------------------------- @@ -5831,16 +5821,13 @@ auto MainWindow::LoadPattern(QString fileName, const QString& customMeasureFile) if (m.Type() == MeasurementsType::Multisize || m.Type() == MeasurementsType::Individual) { - const QString tape = VApplication::TapeFilePath(); - const QString workingDirectory = QFileInfo(tape).absoluteDir().absolutePath(); - - QStringList arguments = QStringList() << fileName; + QStringList arguments {fileName}; if (isNoScaling) { arguments.append(QStringLiteral("--") + LONG_OPTION_NO_HDPI_SCALING); } - QProcess::startDetached(tape, arguments, workingDirectory); + VApplication::StartDetachedProcess(VApplication::TapeFilePath(), arguments); QCoreApplication::exit(V_EX_OK); return false; // stop continue processing } @@ -5862,16 +5849,13 @@ auto MainWindow::LoadPattern(QString fileName, const QString& customMeasureFile) { // Here comes undocumented Valentina's feature. // Because app bundle in Mac OS X doesn't allow setup assosiation for Puzzle we must do this through Valentina - const QString puzzle = VApplication::PuzzleFilePath(); - const QString workingDirectory = QFileInfo(puzzle).absoluteDir().absolutePath(); - - QStringList arguments = QStringList() << fileName; + QStringList arguments {fileName}; if (isNoScaling) { arguments.append(QStringLiteral("--") + LONG_OPTION_NO_HDPI_SCALING); } - QProcess::startDetached(puzzle, arguments, workingDirectory); + VApplication::StartDetachedProcess(VApplication::PuzzleFilePath(), arguments); QCoreApplication::exit(V_EX_OK); return false; // stop continue processing } diff --git a/src/app/valentina/mainwindow.ui b/src/app/valentina/mainwindow.ui index 5d3d507bb..f77105ccd 100644 --- a/src/app/valentina/mainwindow.ui +++ b/src/app/valentina/mainwindow.ui @@ -3213,19 +3213,19 @@ - VPlainTextEdit - QPlainTextEdit -
vplaintextedit.h
+ VMainGraphicsView + QGraphicsView +
../vwidgets/vmaingraphicsview.h
VLineEdit QLineEdit -
vlineedit.h
+
../vwidgets/vlineedit.h
- VMainGraphicsView - QGraphicsView -
vmaingraphicsview.h
+ VPlainTextEdit + QPlainTextEdit +
../vwidgets/vplaintextedit.h
diff --git a/src/app/valentina/stable.h b/src/app/valentina/stable.h index 910158621..0c7176aa2 100644 --- a/src/app/valentina/stable.h +++ b/src/app/valentina/stable.h @@ -39,9 +39,9 @@ #include /*In all cases we need include core header for getting defined values*/ -//#ifdef QT_CORE_LIB -//# include -//#endif +#ifdef QT_CORE_LIB +# include +#endif #ifdef QT_GUI_LIB # include @@ -51,29 +51,33 @@ # include #endif -//In Windows you can't use same header in all modes. -#if !defined(Q_OS_WIN) -# ifdef QT_WIDGETS_LIB -# include -# endif +#ifdef QT_WINEXTRAS_LIB +# include +#endif -# ifdef QT_SVG_LIB -# include -# endif +#ifdef QT_WIDGETS_LIB +# include +#endif -# ifdef QT_PRINTSUPPORT_LIB -# include -# endif +#ifdef QT_SVG_LIB +# include +#endif - //Build doesn't work, if include this headers on Windows. -# ifdef QT_XMLPATTERNS_LIB -# include -# endif +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif -# ifdef QT_NETWORK_LIB -# include -# endif -#endif/*Q_OS_WIN*/ +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include +#endif #endif /*__cplusplus*/ diff --git a/src/app/valentina/valentina.pro b/src/app/valentina/valentina.pro index 884b08639..8492b5a65 100644 --- a/src/app/valentina/valentina.pro +++ b/src/app/valentina/valentina.pro @@ -28,6 +28,8 @@ macx{ TARGET = valentina } +VERSION = 0.7.52 + # Use out-of-source builds (shadow builds) CONFIG -= debug_and_release debug_and_release_target @@ -154,9 +156,13 @@ unix{ # .desktop file desktop.path = $$DATADIR/applications/ - desktop.files += ../../../dist/$${TARGET}.desktop \ - desktop.files += ../../../dist/tape.desktop \ - desktop.files += ../../../dist/puzzle.desktop + desktop.files += ../../../dist/ua.com.smart-pattern.$${TARGET}.desktop \ + desktop.files += ../../../dist/ua.com.smart-pattern.tape.desktop \ + desktop.files += ../../../dist/ua.com.smart-pattern.puzzle.desktop + + # .metainfo.xml file + metainfo.path = $$DATADIR/metainfo/ + metainfo.files += ../../../dist/ua.com.smart-pattern.$${TARGET}.metainfo.xml # logo hicolor_48_apps.path = $$DATADIR/icons/hicolor/48x48/apps/ @@ -245,6 +251,7 @@ unix{ tape \ puzzle \ desktop \ + metainfo \ hicolor_48_apps \ hicolor_48_mimetypes \ hicolor_64_apps \ diff --git a/src/app/valentina/valentina.qbs b/src/app/valentina/valentina.qbs new file mode 100644 index 000000000..949ea417e --- /dev/null +++ b/src/app/valentina/valentina.qbs @@ -0,0 +1,337 @@ +import qbs.FileInfo + +VToolApp { + Depends { name: "buildconfig" } + Depends { name: "ib"; condition: qbs.targetOS.contains("macos") } + Depends { name: "Qt"; submodules: ["widgets", "svg", "xmlpatterns", "concurrent"] } + Depends { name: "VPatternDBLib"; } + Depends { name: "VWidgetsLib"; } + Depends { name: "FervorLib"; } + Depends { name: "IFCLib"; } + Depends { name: "VLayoutLib"; } + Depends { name: "VToolsLib"; } + Depends { name: "VFormatLib"; } + Depends { name: "VMiscLib"; } + + primaryApp: true + + Depends { + name: "Qt.winextras" + condition: qbs.targetOS.contains("windows") + versionAtLeast: "5.6" + required: false + } + + name: "Valentina" + buildconfig.appTarget: qbs.targetOS.contains("macos") ? "Valentina" : "valentina" + targetName: buildconfig.appTarget + + files: [ + "main.cpp", + "mainwindow.cpp", + "mainwindow.h", + "mainwindowsnogui.cpp", + "mainwindowsnogui.h", + "version.h", + "mainwindow.ui" + ] + + Group { + name: "dialogs" + prefix: "dialogs/" + files: [ + "dialogaddbackgroundimage.h", + "dialogs.h", + "dialogincrements.h", + "dialoghistory.h", + "dialogpatternproperties.h", + "dialognewpattern.h", + "dialogaboutapp.h", + "dialoglayoutsettings.h", + "dialoglayoutprogress.h", + "dialogsavelayout.h", + "vwidgetbackgroundimages.h", + "vwidgetgroups.h", + "vwidgetdetails.h", + "dialogpreferences.h", + "configpages/preferencesconfigurationpage.h", + "configpages/preferencespatternpage.h", + "configpages/preferencespathpage.h", + "dialogdatetimeformats.h", + "dialogknownmaterials.h", + "dialogfinalmeasurements.h", + + "dialogaddbackgroundimage.cpp", + "dialogincrements.cpp", + "dialoghistory.cpp", + "dialogpatternproperties.cpp", + "dialognewpattern.cpp", + "dialogaboutapp.cpp", + "dialoglayoutsettings.cpp", + "dialoglayoutprogress.cpp", + "dialogsavelayout.cpp", + "vwidgetbackgroundimages.cpp", + "vwidgetgroups.cpp", + "vwidgetdetails.cpp", + "dialogpreferences.cpp", + "configpages/preferencesconfigurationpage.cpp", + "configpages/preferencespatternpage.cpp", + "configpages/preferencespathpage.cpp", + "dialogdatetimeformats.cpp", + "dialogknownmaterials.cpp", + "dialogfinalmeasurements.cpp", + + "dialogaddbackgroundimage.ui", + "dialogincrements.ui", + "dialoghistory.ui", + "dialogpatternproperties.ui", + "dialognewpattern.ui", + "dialogaboutapp.ui", + "dialoglayoutsettings.ui", + "dialoglayoutprogress.ui", + "dialogsavelayout.ui", + "vwidgetbackgroundimages.ui", + "vwidgetgroups.ui", + "vwidgetdetails.ui", + "dialogpreferences.ui", + "configpages/preferencesconfigurationpage.ui", + "configpages/preferencespatternpage.ui", + "configpages/preferencespathpage.ui", + "dialogdatetimeformats.ui", + "dialogknownmaterials.ui", + "dialogfinalmeasurements.ui" + ] + } + + Group { + name: "xml" + prefix: "xml/" + files: [ + "vpattern.h", + "vpattern.cpp" + ] + } + + Group { + name: "core" + prefix: "core/" + files: [ + "vapplication.h", + "vformulaproperty.h", + "vformulapropertyeditor.h", + "vtooloptionspropertybrowser.h", + "vcmdexport.h", + + "vapplication.cpp", + "vformulaproperty.cpp", + "vformulapropertyeditor.cpp", + "vtooloptionspropertybrowser.cpp", + "vcmdexport.cpp" + ] + } + + Group { + name: "Resources" + prefix: "share/resources/" + files: [ + "cursor.qrc", // Tools cursor icons + "toolicon.qrc", + ] + } + + Properties { + condition: qbs.targetOS.contains("macos") + ib.appIconName: "Valentina" + } + + Export { + Depends { name: "cpp" } + cpp.defines: { + var defines = []; + var extension = qbs.targetOS.contains("windows") ? ".exe" : ""; + defines.push('VALENTINA_BUILDDIR="' + FileInfo.joinPaths(exportingProduct.buildDirectory, exportingProduct.targetName + extension) +'"'); + defines.push('TRANSLATIONS_DIR="' + FileInfo.joinPaths(exportingProduct.buildDirectory, 'translations') +'"'); + return defines; + } + } + + Group { + name: "Label templates" + prefix: project.sourceDirectory + "/src/app/share/labels/" + files: [ + "def_pattern_label.xml", + "def_piece_label.xml" + ] + fileTags: ["label_templates"] + qbs.install: true + qbs.installDir: buildconfig.installDataPath + "/labels" + } + + Group { + name: "Multisize tables" + prefix: project.sourceDirectory + "/src/app/share/tables/multisize/" + files: [ + "GOST_man_ru.vst" + ] + fileTags: ["multisize_tables"] + qbs.install: true + qbs.installDir: buildconfig.installDataPath + "/tables/multisize" + } + + Group { + name: "Measurements templates" + prefix: project.sourceDirectory + "/src/app/share/tables/templates/" + files: [ + "template_all_measurements.vit", + "t_Aldrich_Women.vit" + ] + fileTags: ["measurements_templates"] + qbs.install: true + qbs.installDir: buildconfig.installDataPath + "/tables/templates" + } + + Group { + condition: qbs.targetOS.contains("windows") && (qbs.architecture.contains("x86_64") || qbs.architecture.contains("x86")) + name: "pdftops Windows" + prefix: project.sourceDirectory + "/dist/win/" + files: ["pdftops.exe"] + fileTags: ["pdftops_dist_win"] + qbs.install: true + qbs.installDir: buildconfig.installBinaryPath + } + + Group { + condition: qbs.targetOS.contains("macos") && qbs.architecture.contains("x86_64") + name: "pdftops MacOS" + prefix: project.sourceDirectory + "/dist/macx/bin64/" + files: ["pdftops"] + fileTags: ["pdftops_dist_macx"] + qbs.install: true + qbs.installDir: buildconfig.installBinaryPath + } + + Group { + name: "freedesktop" + prefix: project.sourceDirectory + "/dist/" + files: [ + "ua.com.smart-pattern." + product.targetName + ".metainfo.xml" + ] + } + + Group { + name: "48x48/apps" + prefix: project.sourceDirectory + "/share/icons/48x48/apps/" + files: "valentina.png" + fileTags: "freedesktop.48x48AppsIcons" + } + + Group { + name: "64x64/apps" + prefix: project.sourceDirectory + "/share/icons/64x64/apps/" + files: "valentina.png" + fileTags: "freedesktop.64x64AppsIcons" + } + + Group { + name: "128x128/apps" + prefix: project.sourceDirectory + "/share/icons/128x128/apps/" + files: "valentina.png" + fileTags: "freedesktop.128x128AppsIcons" + } + + Group { + name: "256x256/apps" + prefix: project.sourceDirectory + "/share/icons/256x256/apps/" + files: "valentina.png" + fileTags: "freedesktop.256x256AppsIcons" + } + + Group { + name: "512x512/apps" + prefix: project.sourceDirectory + "/share/icons/512x512/apps/" + files: "valentina.png" + fileTags: "freedesktop.512x512AppsIcons" + } + + Group { + name: "apps48x48/mimetypes" + prefix: project.sourceDirectory + "/share/icons/48x48/mimetypes/" + files: "application-x-valentina-pattern.png" + fileTags: "freedesktop.48x48MimetypesIcons" + } + + Group { + name: "apps64x64/mimetypes" + prefix: project.sourceDirectory + "/share/icons/64x64/mimetypes/" + files: "application-x-valentina-pattern.png" + fileTags: "freedesktop.64x64MimetypesIcons" + } + + Group { + name: "apps128x128/mimetypes" + prefix: project.sourceDirectory + "/share/icons/128x128/mimetypes/" + files: "application-x-valentina-pattern.png" + fileTags: "freedesktop.128x128MimetypesIcons" + } + + Group { + name: "apps256x256/mimetypes" + prefix: project.sourceDirectory + "/share/icons/256x256/mimetypes/" + files: "application-x-valentina-pattern.png" + fileTags: "freedesktop.256x256MimetypesIcons" + } + + Group { + name: "apps512x512/mimetypes" + prefix: project.sourceDirectory + "/share/icons/512x512/mimetypes/" + files: "application-x-valentina-pattern.png" + fileTags: "freedesktop.512x512MimetypesIcons" + } + + Group { + name: "win deploy" + condition: qbs.targetOS.contains("windows") + prefix: project.sourceDirectory + "/" + files: [ + "dist/win/valentina.ico", + "dist/win/pattern.ico", + "dist/win/EUDC.TTE", + "AUTHORS.txt", + "LICENSE_GPL.txt", + "README.txt", + "ChangeLog.txt", + "share/qtlogging.ini" + ] + qbs.install: true + qbs.installDir: buildconfig.installAppPath + } + + Group { + name: "Valentina RC" + condition: qbs.targetOS.contains("windows") + prefix: product.sourceDirectory + "/share/resources/" + files: "valentina.rc" + } + + Group { + name: "MacOS assets" + condition: qbs.targetOS.contains("macos") + prefix: project.sourceDirectory + "/dist/macx/valentina/" + files: [ + "Info.plist", + "valentina.xcassets" + ] + } + + Group { + name: "ICNS" + condition: qbs.targetOS.contains("macos") + prefix: project.sourceDirectory + "/dist/macx/valentina-project.xcassets/" + files: [ + "pattern.iconset", + "layout.iconset", + "i-measurements.iconset", + "s-measurements.iconset" + ] + } +} diff --git a/src/libs/fervor/fervor.qbs b/src/libs/fervor/fervor.qbs new file mode 100644 index 000000000..ad94fc539 --- /dev/null +++ b/src/libs/fervor/fervor.qbs @@ -0,0 +1,21 @@ +VLib { + Depends { name: "Qt"; submodules: ["widgets", "network"] } + Depends { name: "IFCLib" } + + name: "FervorLib" + files: [ + "fvupdatewindow.cpp", + "fvupdater.cpp", + "fvavailableupdate.cpp", + "fvupdatewindow.h", + "fvupdater.h", + "fvavailableupdate.h", + "fvupdatewindow.ui", + ] + + Export { + Depends { name: "cpp" } + Depends { name: "Qt"; submodules: ["network"] } + cpp.includePaths: [exportingProduct.sourceDirectory] + } +} diff --git a/src/libs/fervor/stable.h b/src/libs/fervor/stable.h index 8022c5e99..ca3731074 100644 --- a/src/libs/fervor/stable.h +++ b/src/libs/fervor/stable.h @@ -38,27 +38,44 @@ /* Add C++ includes here */ #ifdef QT_CORE_LIB -#include +# include +#endif + +#ifdef QT_GUI_LIB +# include #endif #ifdef QT_XML_LIB # include #endif -//In Windows you can't use those headers in all modes. -#if !defined(Q_OS_WIN) -# ifdef QT_PRINTSUPPORT_LIB -# include -# endif +#ifdef QT_WINEXTRAS_LIB +# include +#endif -# ifdef QT_XMLPATTERNS_LIB -# include -# endif +#ifdef QT_WIDGETS_LIB +# include +#endif -# ifdef QT_NETWORK_LIB -# include -# endif -#endif/*Q_OS_WIN*/ +#ifdef QT_SVG_LIB +# include +#endif + +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif + +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include +#endif #endif/*__cplusplus*/ diff --git a/src/libs/ifc/ifc.qbs b/src/libs/ifc/ifc.qbs new file mode 100644 index 000000000..76b79c458 --- /dev/null +++ b/src/libs/ifc/ifc.qbs @@ -0,0 +1,86 @@ +VLib { + Depends { name: "Qt"; submodules: ["gui", "xml", "svg", "xmlpatterns", "concurrent"] } + Depends { name: "VMiscLib" } + + name: "IFCLib" + files: [ + "ifcdef.h", + "ifcdef.cpp", + ] + + Group { + name: "exception" + prefix: "exception/" + files: [ + "vexceptionobjecterror.h", + "vexceptionemptyparameter.h", + "vexceptionconversionerror.h", + "vexceptionbadid.h", + "vexception.h", + "vexceptionterminatedposition.h", + "vexceptionwrongid.h", + "vexceptionundo.h", + "vexceptioninvalidnotch.h", + "vexceptioninvalidhistory.h", + "vexceptionobjecterror.cpp", + "vexceptionemptyparameter.cpp", + "vexceptionconversionerror.cpp", + "vexceptionbadid.cpp", + "vexception.cpp", + "vexceptionterminatedposition.cpp", + "vexceptionwrongid.cpp", + "vexceptionundo.cpp", + "vexceptioninvalidnotch.cpp", + "vexceptioninvalidhistory.cpp", + ] + } + + Group { + name: "xml" + prefix: "xml/" + files: [ + "utils.h", + "vabstractconverter.h", + "vbackgroundpatternimage.h", + "vdomdocument.h", + "vlayoutconverter.h", + "vpatternconverter.h", + "vpatternimage.h", + "vtoolrecord.h", + "vabstractpattern.h", + "vvstconverter.h", + "/vvitconverter.h", + "/vabstractmconverter.h", + "vlabeltemplateconverter.h", + "vwatermarkconverter.h", + "utils.cpp", + "vabstractconverter.cpp", + "vbackgroundpatternimage.cpp", + "vdomdocument.cpp", + "vlayoutconverter.cpp", + "vpatternconverter.cpp", + "vpatternimage.cpp", + "vtoolrecord.cpp", + "vabstractpattern.cpp", + "vvstconverter.cpp", + "vvitconverter.cpp", + "vabstractmconverter.cpp", + "vlabeltemplateconverter.cpp", + "vwatermarkconverter.cpp", + ] + } + + Group { + name: "Resources" + files: [ + "schema.qrc", + ] + } + + Export { + Depends { name: "cpp" } + Depends { name: "Qt"; submodules: ["xml"] } + Depends { name: "VMiscLib" } + cpp.includePaths: [exportingProduct.sourceDirectory] + } +} diff --git a/src/libs/ifc/stable.h b/src/libs/ifc/stable.h index dba87a8b7..c38a29241 100644 --- a/src/libs/ifc/stable.h +++ b/src/libs/ifc/stable.h @@ -38,27 +38,44 @@ /* Add C++ includes here */ #ifdef QT_CORE_LIB -#include +# include +#endif + +#ifdef QT_GUI_LIB +# include #endif #ifdef QT_XML_LIB # include #endif -//In Windows you can't use those headers in all modes. -#if !defined(Q_OS_WIN) -# ifdef QT_PRINTSUPPORT_LIB -# include -# endif +#ifdef QT_WINEXTRAS_LIB +# include +#endif -# ifdef QT_XMLPATTERNS_LIB -# include -# endif +#ifdef QT_WIDGETS_LIB +# include +#endif -# ifdef QT_NETWORK_LIB -# include -# endif -#endif/*Q_OS_WIN*/ +#ifdef QT_SVG_LIB +# include +#endif + +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif + +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include +#endif #endif/*__cplusplus*/ diff --git a/src/libs/ifc/xml/vabstractconverter.h b/src/libs/ifc/xml/vabstractconverter.h index 0f42e5b4e..36ae8d69d 100644 --- a/src/libs/ifc/xml/vabstractconverter.h +++ b/src/libs/ifc/xml/vabstractconverter.h @@ -44,6 +44,7 @@ QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") class VAbstractConverter :public VDomDocument { + Q_OBJECT // NOLINT public: explicit VAbstractConverter(const QString &fileName); virtual ~VAbstractConverter() = default; diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index 67e0bec52..5ada9dfbb 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -2574,7 +2574,9 @@ auto VAbstractPattern::GetGroups(const QString &patternPieceName) -> QMap #include -#include "../ifc/ifcdef.h" +#include "../ifcdef.h" #include "../vmisc/def.h" #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "../vmisc/diagnostic.h" diff --git a/src/libs/ifc/xml/vlayoutconverter.cpp b/src/libs/ifc/xml/vlayoutconverter.cpp index f069e1fdb..c9882a440 100644 --- a/src/libs/ifc/xml/vlayoutconverter.cpp +++ b/src/libs/ifc/xml/vlayoutconverter.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "vlayoutconverter.h" #include "../exception/vexception.h" -#include "ifcdef.h" +#include "../ifcdef.h" #include "../vlayout/vlayoutpoint.h" /* diff --git a/src/libs/ifc/xml/vlayoutconverter.h b/src/libs/ifc/xml/vlayoutconverter.h index 71871cf8b..5ebda1305 100644 --- a/src/libs/ifc/xml/vlayoutconverter.h +++ b/src/libs/ifc/xml/vlayoutconverter.h @@ -35,6 +35,7 @@ class QString; class VLayoutConverter : public VAbstractConverter { + Q_OBJECT // NOLINT public: explicit VLayoutConverter(const QString &fileName); ~VLayoutConverter() override =default; diff --git a/src/libs/libs.qbs b/src/libs/libs.qbs new file mode 100644 index 000000000..c9d277dff --- /dev/null +++ b/src/libs/libs.qbs @@ -0,0 +1,18 @@ +Project { + references: [ + "fervor/fervor.qbs", + "ifc/ifc.qbs", + "qmuparser/qmuparser.qbs", + "vdxf/vdxf.qbs", + "vformat/vformat.qbs", + "vgeometry/vgeometry.qbs", + "vlayout/vlayout.qbs", + "vmisc/vmisc.qbs", + "vobj/vobj.qbs", + "vpatterndb/vpatterndb.qbs", + "vpropertyexplorer/vpropertyexplorer.qbs", + "vtest/vtest.qbs", + "vtools/vtools.qbs", + "vwidgets/vwidgets.qbs", + ] +} diff --git a/src/libs/qmuparser/qmuparser.qbs b/src/libs/qmuparser/qmuparser.qbs new file mode 100644 index 000000000..18ae99468 --- /dev/null +++ b/src/libs/qmuparser/qmuparser.qbs @@ -0,0 +1,56 @@ +VDynamicLib { + Depends { name: "multibundle"; } + + name: "QMUParserLib" + version: "2.7.0" + files: [ + "qmuparser.cpp", + "qmuparsertokenreader.cpp", + "qmuparsererror.cpp", + "qmuparsercallback.cpp", + "qmuparserbytecode.cpp", + "qmuparserbase.cpp", + "qmuparsertest.cpp", + "qmutranslation.cpp", + "qmuformulabase.cpp", + "qmutokenparser.cpp", + "qmudef.cpp", + "qmuparser.h", + "qmuparser_global.h", + "qmuparsertokenreader.h", + "qmuparsertoken.h", + "qmuparserfixes.h", + "qmuparsererror.h", + "qmuparserdef.h", + "qmuparsercallback.h", + "qmuparserbytecode.h", + "qmuparserbase.h", + "qmuparsertest.h", + "qmutranslation.h", + "qmudef.h", + "qmuformulabase.h", + "qmutokenparser.h", + "qmuparsercallback_p.h", + "make_unique.h", + ] + + cpp.defines: ["QMUPARSER_LIBRARY", 'QMUP_VERSION="' + product.version + '"'] + + Export { + Depends { name: "cpp" } + cpp.includePaths: [exportingProduct.sourceDirectory] + } + + Group { + name: "win deploy" + condition: qbs.targetOS.contains("windows") + prefix: product.sourceDirectory + "/" + files: [ + "LICENSE_BSD.txt" + ] + qbs.install: true + qbs.installDir: buildconfig.installAppPath + } + + multibundle.targetApps: ["Valentina", "Tape", "Puzzle"] +} diff --git a/src/libs/qmuparser/qmuparserdef.h b/src/libs/qmuparser/qmuparserdef.h index 963e99624..a5bda09a4 100644 --- a/src/libs/qmuparser/qmuparserdef.h +++ b/src/libs/qmuparser/qmuparserdef.h @@ -33,7 +33,9 @@ @brief This file contains standard definitions used by the parser. */ -#define QMUP_VERSION "2.7.0" +#ifndef QMUP_VERSION +#define QMUP_VERSION "2.7.0" // Leave while we still use qmake +#endif #define QMUP_VERSION_DATE "20191030; GC" // Detect whether the compiler supports C++11 noexcept exception specifications. diff --git a/src/libs/qmuparser/stable.h b/src/libs/qmuparser/stable.h index 006cfe22a..bf49e98e3 100644 --- a/src/libs/qmuparser/stable.h +++ b/src/libs/qmuparser/stable.h @@ -35,9 +35,45 @@ /* Add C++ includes here */ #ifdef QT_CORE_LIB -#include +# include #endif +#ifdef QT_GUI_LIB +# include #endif +#ifdef QT_XML_LIB +# include +#endif + +#ifdef QT_WINEXTRAS_LIB +# include +#endif + +#ifdef QT_WIDGETS_LIB +# include +#endif + +#ifdef QT_SVG_LIB +# include +#endif + +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif + +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include +#endif + +#endif/*__cplusplus*/ + #endif // STABLE_H diff --git a/src/libs/vdxf/libdxfrw/drw_base.h b/src/libs/vdxf/libdxfrw/drw_base.h index b995b0435..56be2dbd9 100644 --- a/src/libs/vdxf/libdxfrw/drw_base.h +++ b/src/libs/vdxf/libdxfrw/drw_base.h @@ -466,7 +466,7 @@ public: void addDouble(double d) {setType(DOUBLE); content.d = d;} void addCoord() {setType(COORD); vdata.x=0.0; vdata.y=0.0; vdata.z=0.0; content.v = &vdata;} void addCoord(const DRW_Coord &v) {setType(COORD); vdata = v; content.v = &vdata;} - void setType(enum TYPE t) { type = t;} + void setType(TYPE t) { type = t;} void setCoordX(double d) { if (type == COORD) vdata.x = d;} void setCoordY(double d) { if (type == COORD) vdata.y = d;} void setCoordZ(double d) { if (type == COORD) vdata.z = d;} @@ -481,7 +481,7 @@ private: public: DRW_VarContent content; - enum TYPE type; + TYPE type; int code; /*!< dxf code of this value*/ private: @@ -529,7 +529,7 @@ public: widthDefault = 31 /*!< by default (dxf -3) */ }; - static int lineWidth2dxfInt(enum lineWidth lw){ + static int lineWidth2dxfInt(lineWidth lw){ switch (lw){ case widthByLayer: return -1; @@ -591,7 +591,7 @@ public: return -3; } - static enum lineWidth dxfInt2lineWidth(int i){ + static lineWidth dxfInt2lineWidth(int i){ if (i<0) { if (i==-1) return widthByLayer; diff --git a/src/libs/vdxf/libdxfrw/drw_entities.h b/src/libs/vdxf/libdxfrw/drw_entities.h index 6e5afcd97..a7b522623 100644 --- a/src/libs/vdxf/libdxfrw/drw_entities.h +++ b/src/libs/vdxf/libdxfrw/drw_entities.h @@ -194,7 +194,7 @@ protected: bool parseDxfGroups(int code, dxfReader *reader); public: - enum DRW::ETYPE eType; /*!< enum: entity type, code 0 */ + DRW::ETYPE eType; /*!< enum: entity type, code 0 */ duint32 handle; /*!< entity identifier, code 5 */ std::list > appData; /*!< list of application data, code 102 */ duint32 parentHandle; /*!< Soft-pointer ID/handle to owner BLOCK_RECORD object, code 330 */ @@ -203,7 +203,7 @@ public: UTF8STRING lineType; /*!< line type, code 6 */ duint32 material; /*!< hard pointer id to material object, code 347 */ int color; /*!< entity color, code 62 */ - enum DRW_LW_Conv::lineWidth lWeight; /*!< entity lineweight, code 370 */ + DRW_LW_Conv::lineWidth lWeight; /*!< entity lineweight, code 370 */ double ltypeScale; /*!< linetype scale, code 48 */ bool visible; /*!< entity visibility, code 60 */ int numProxyGraph; /*!< Number of bytes in proxy graphics, code 92 */ @@ -709,8 +709,8 @@ public: double oblique; /*!< oblique angle, code 51 */ UTF8STRING style; /*!< style name, code 7 */ int textgen; /*!< text generation, code 71 */ - enum HAlign alignH; /*!< horizontal align, code 72 */ - enum VAlign alignV; /*!< vertical align, code 73 */ + HAlign alignH; /*!< horizontal align, code 72 */ + VAlign alignV; /*!< vertical align, code 73 */ }; //! Class to handle insert entries diff --git a/src/libs/vdxf/libdxfrw/drw_objects.h b/src/libs/vdxf/libdxfrw/drw_objects.h index c908df6bc..992d31033 100644 --- a/src/libs/vdxf/libdxfrw/drw_objects.h +++ b/src/libs/vdxf/libdxfrw/drw_objects.h @@ -104,7 +104,7 @@ protected: } public: - enum DRW::TTYPE tType {DRW::UNKNOWNT}; /*!< enum: entity type, code 0 */ + DRW::TTYPE tType {DRW::UNKNOWNT}; /*!< enum: entity type, code 0 */ duint32 handle {0}; /*!< entity identifier, code 5 */ int parentHandle {0}; /*!< Soft-pointer ID/handle to owner object, code 330 */ UTF8STRING name{}; /*!< entry name, code 2 */ @@ -381,7 +381,7 @@ public: int color; /*!< layer color, code 62 */ int color24; /*!< 24-bit color, code 420 */ bool plotF; /*!< Plot flag, code 290 */ - enum DRW_LW_Conv::lineWidth lWeight; /*!< layer lineweight, code 370 */ + DRW_LW_Conv::lineWidth lWeight; /*!< layer lineweight, code 370 */ std::string handlePlotS; /*!< Hard-pointer ID/handle of plotstyle, code 390 */ std::string handleMaterialS; /*!< Hard-pointer ID/handle of materialstyle, code 347 */ }; diff --git a/src/libs/vdxf/libdxfrw/intern/dxfreader.h b/src/libs/vdxf/libdxfrw/intern/dxfreader.h index fda528dd7..7b3f0d6f9 100644 --- a/src/libs/vdxf/libdxfrw/intern/dxfreader.h +++ b/src/libs/vdxf/libdxfrw/intern/dxfreader.h @@ -26,7 +26,7 @@ public: BOOL, INVALID }; - enum TYPE type; + TYPE type; public: explicit dxfReader(std::istream *stream) : type(INVALID), diff --git a/src/libs/vdxf/stable.h b/src/libs/vdxf/stable.h index a955d3bf5..a94c92dbb 100644 --- a/src/libs/vdxf/stable.h +++ b/src/libs/vdxf/stable.h @@ -40,13 +40,45 @@ /* Add C++ includes here */ #ifdef QT_CORE_LIB -#include +# include #endif #ifdef QT_GUI_LIB # include #endif +#ifdef QT_XML_LIB +# include +#endif + +#ifdef QT_WINEXTRAS_LIB +# include +#endif + +#ifdef QT_WIDGETS_LIB +# include +#endif + +#ifdef QT_SVG_LIB +# include +#endif + +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif + +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include +#endif + #endif/*__cplusplus*/ #endif // STABLE_H diff --git a/src/libs/vdxf/vdxf.qbs b/src/libs/vdxf/vdxf.qbs new file mode 100644 index 000000000..136507126 --- /dev/null +++ b/src/libs/vdxf/vdxf.qbs @@ -0,0 +1,52 @@ +VLib { + Depends { name: "VMiscLib" } + Depends { name: "Qt"; submodules: ["gui"] } + + name: "VDXFLib" + files: [ + "vdxfengine.cpp", + "vdxfpaintdevice.cpp", + "dxiface.cpp", + "dxfdef.cpp", + "vdxfengine.h", + "vdxfpaintdevice.h", + "dxfdef.h", + "dxiface.h", + ] + + Group { + name: "libdxfrw" + prefix: "libdxfrw/" + files: [ + "drw_base.cpp", + "intern/drw_dbg.cpp", + "intern/drw_textcodec.cpp", + "intern/dxfreader.cpp", + "intern/dxfwriter.cpp", + "drw_classes.cpp", + "drw_entities.cpp", + "drw_header.cpp", + "drw_objects.cpp", + "libdxfrw.cpp", + "drw_reserve.h", + "intern/make_unique.h", + "intern/drw_dbg.h", + "intern/drw_textcodec.h", + "intern/dxfreader.h", + "intern/dxfwriter.h", + "drw_base.h", + "drw_classes.h", + "drw_entities.h", + "drw_header.h", + "drw_interface.h", + "drw_objects.h", + "libdxfrw.h", + "main_doc.h", + ] + } + + Export { + Depends { name: "cpp" } + cpp.includePaths: [exportingProduct.sourceDirectory] + } +} diff --git a/src/libs/vformat/stable.h b/src/libs/vformat/stable.h index 49d07a207..d01573e25 100644 --- a/src/libs/vformat/stable.h +++ b/src/libs/vformat/stable.h @@ -38,27 +38,44 @@ /* Add C++ includes here */ #ifdef QT_CORE_LIB -#include +# include +#endif + +#ifdef QT_GUI_LIB +# include #endif #ifdef QT_XML_LIB # include #endif -//In Windows you can't use those headers in all modes. -#if !defined(Q_OS_WIN) -# ifdef QT_PRINTSUPPORT_LIB -# include -# endif +#ifdef QT_WINEXTRAS_LIB +# include +#endif -# ifdef QT_XMLPATTERNS_LIB -# include -# endif +#ifdef QT_WIDGETS_LIB +# include +#endif -# ifdef QT_NETWORK_LIB -# include -# endif -#endif/*Q_OS_WIN*/ +#ifdef QT_SVG_LIB +# include +#endif + +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif + +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include +#endif #endif/*__cplusplus*/ diff --git a/src/libs/vformat/vdimensions.cpp b/src/libs/vformat/vdimensions.cpp index f1641895e..2487abd2d 100644 --- a/src/libs/vformat/vdimensions.cpp +++ b/src/libs/vformat/vdimensions.cpp @@ -211,7 +211,7 @@ auto VAbstartMeasurementDimension::IsRangeValid() -> bool if (not valid) { - m_error = tr("Invalid min/max range"); + m_error = QCoreApplication::translate("VAbstartMeasurementDimension", "Invalid min/max range"); } return valid; @@ -223,7 +223,7 @@ auto VAbstartMeasurementDimension::IsStepValid() -> bool bool valid = ValidSteps().indexOf(m_step) != -1; if (not valid) { - m_error = tr("Invalid step"); + m_error = QCoreApplication::translate("VAbstartMeasurementDimension", "Invalid step"); } return valid; @@ -235,7 +235,7 @@ auto VAbstartMeasurementDimension::IsBaseValid() -> bool bool valid = ValidBases().indexOf(m_baseValue) != -1; if (not valid) { - m_error = tr("Base value invalid"); + m_error = QCoreApplication::translate("VAbstartMeasurementDimension", "Base value invalid"); } return valid; @@ -253,13 +253,13 @@ auto VAbstartMeasurementDimension::DimensionName(MeasurementDimension type) -> Q switch(type) { case MeasurementDimension::X: - return tr("Height", "dimension"); + return QCoreApplication::translate("VAbstartMeasurementDimension", "Height", "dimension"); case MeasurementDimension::Y: - return tr("Size", "dimension"); + return QCoreApplication::translate("VAbstartMeasurementDimension", "Size", "dimension"); case MeasurementDimension::W: - return tr("Waist", "dimension"); + return QCoreApplication::translate("VAbstartMeasurementDimension", "Waist", "dimension"); case MeasurementDimension::Z: - return tr("Hip", "dimension"); + return QCoreApplication::translate("VAbstartMeasurementDimension", "Hip", "dimension"); default: return {}; } @@ -278,19 +278,28 @@ auto VAbstartMeasurementDimension::DimensionToolTip(const MeasurementDimension_p case MeasurementDimension::Y: if (dimension->CustomName().isEmpty() && dimension->IsBodyMeasurement()) { - return fc ? tr("Chest full circumference", "dimension") : tr("Chest half circumference", "dimension"); + return fc ? QCoreApplication::translate("VAbstartMeasurementDimension", "Chest full circumference", + "dimension") + : QCoreApplication::translate("VAbstartMeasurementDimension", "Chest half circumference", + "dimension"); } return {}; case MeasurementDimension::W: if (dimension->CustomName().isEmpty() && dimension->IsBodyMeasurement()) { - return fc ? tr("Waist full circumference", "dimension") : tr("Waist half circumference", "dimension"); + return fc ? QCoreApplication::translate("VAbstartMeasurementDimension", "Waist full circumference", + "dimension") + : QCoreApplication::translate("VAbstartMeasurementDimension", "Waist half circumference", + "dimension"); } return {}; case MeasurementDimension::Z: if (dimension->CustomName().isEmpty() && dimension->IsBodyMeasurement()) { - return fc ? tr("Hip full circumference", "dimension") : tr("Hip half circumference", "dimension"); + return fc ? QCoreApplication::translate("VAbstartMeasurementDimension", "Hip full circumference", + "dimension") + : QCoreApplication::translate("VAbstartMeasurementDimension", "Hip half circumference", + "dimension"); } return {}; case MeasurementDimension::X: diff --git a/src/libs/vformat/vformat.qbs b/src/libs/vformat/vformat.qbs new file mode 100644 index 000000000..554dd2402 --- /dev/null +++ b/src/libs/vformat/vformat.qbs @@ -0,0 +1,24 @@ +VLib { + Depends { name: "Qt"; submodules: ["xml"] } + Depends { name: "IFCLib" } + + name: "VFormatLib" + files: [ + "vdimensions.cpp", + "vmeasurements.cpp", + "vlabeltemplate.cpp", + "vpatternrecipe.cpp", + "vwatermark.cpp", + "vdimensions.h", + "vmeasurements.h", + "vlabeltemplate.h", + "vpatternrecipe.h", + "vwatermark.h", + ] + + Export { + Depends { name: "cpp" } + Depends { name: "Qt"; submodules: ["xml"] } + cpp.includePaths: [exportingProduct.sourceDirectory] + } +} diff --git a/src/libs/vgeometry/stable.h b/src/libs/vgeometry/stable.h index 02bb0e4d9..63109b1e7 100644 --- a/src/libs/vgeometry/stable.h +++ b/src/libs/vgeometry/stable.h @@ -38,13 +38,45 @@ /* Add C++ includes here */ #ifdef QT_CORE_LIB -#include +# include #endif #ifdef QT_GUI_LIB # include #endif +#ifdef QT_XML_LIB +# include +#endif + +#ifdef QT_WINEXTRAS_LIB +# include +#endif + +#ifdef QT_WIDGETS_LIB +# include +#endif + +#ifdef QT_SVG_LIB +# include +#endif + +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif + +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include +#endif + #endif/*__cplusplus*/ #endif // STABLE_H diff --git a/src/libs/vgeometry/vgeometry.qbs b/src/libs/vgeometry/vgeometry.qbs new file mode 100644 index 000000000..923b5dbc0 --- /dev/null +++ b/src/libs/vgeometry/vgeometry.qbs @@ -0,0 +1,63 @@ +VLib { + Depends { name: "Qt"; submodules: ["gui", "concurrent"] } + Depends { name: "VMiscLib"} + Depends { name: "IFCLib"} + Depends { name: "QMUParserLib" } + + name: "VGeometryLib" + files: [ + "vgeometrydef.cpp", + "vgobject.cpp", + "vabstractcurve.cpp", + "varc.cpp", + "vlayoutplacelabel.cpp", + "vpointf.cpp", + "vspline.cpp", + "vsplinepath.cpp", + "vsplinepoint.cpp", + "vellipticalarc.cpp", + "vcubicbezier.cpp", + "vabstractcubicbezier.cpp", + "vabstractcubicbezierpath.cpp", + "vcubicbezierpath.cpp", + "vabstractarc.cpp", + "vabstractbezier.cpp", + "vplacelabelitem.cpp", + "vgobject.h", + "vgobject_p.h", + "vabstractcurve.h", + "varc.h", + "varc_p.h", + "vlayoutplacelabel.h", + "vpointf.h", + "vpointf_p.h", + "vspline.h", + "vspline_p.h", + "vsplinepath.h", + "vsplinepath_p.h", + "vsplinepoint.h", + "vsplinepoint_p.h", + "vgeometrydef.h", + "vellipticalarc.h", + "vellipticalarc_p.h", + "vabstractcurve_p.h", + "vcubicbezier.h", + "vcubicbezier_p.h", + "vabstractcubicbezier.h", + "vabstractcubicbezierpath.h", + "vcubicbezierpath.h", + "vcubicbezierpath_p.h", + "vabstractarc.h", + "vabstractarc_p.h", + "vabstractbezier.h", + "vplacelabelitem.h", + "vplacelabelitem_p.h" + ] + + Export { + Depends { name: "cpp" } + Depends { name: "Qt"; submodules: ["gui"] } + Depends { name: "VMiscLib"} + cpp.includePaths: [exportingProduct.sourceDirectory] + } +} diff --git a/src/libs/vlayout/dialogs/watermarkwindow.ui b/src/libs/vlayout/dialogs/watermarkwindow.ui index c3d979f99..191077f8b 100644 --- a/src/libs/vlayout/dialogs/watermarkwindow.ui +++ b/src/libs/vlayout/dialogs/watermarkwindow.ui @@ -389,7 +389,7 @@ QtColorPicker QPushButton -
qtcolorpicker.h
+
../vwidgets/qtcolorpicker.h
diff --git a/src/libs/vlayout/stable.h b/src/libs/vlayout/stable.h index 4c54f263f..e0d5ec120 100644 --- a/src/libs/vlayout/stable.h +++ b/src/libs/vlayout/stable.h @@ -38,7 +38,43 @@ /* Add C++ includes here */ #ifdef QT_CORE_LIB -#include +# include +#endif + +#ifdef QT_GUI_LIB +# include +#endif + +#ifdef QT_XML_LIB +# include +#endif + +#ifdef QT_WINEXTRAS_LIB +# include +#endif + +#ifdef QT_WIDGETS_LIB +# include +#endif + +#ifdef QT_SVG_LIB +# include +#endif + +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif + +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include #endif #endif/*__cplusplus*/ diff --git a/src/libs/vlayout/vabstractpiece.cpp b/src/libs/vlayout/vabstractpiece.cpp index 1e33f98c1..671051032 100644 --- a/src/libs/vlayout/vabstractpiece.cpp +++ b/src/libs/vlayout/vabstractpiece.cpp @@ -1069,7 +1069,9 @@ auto VAbstractPiece::Equidistant(QVector points, qreal width, const QS points = CorrectEquidistantPoints(points); if ( points.size() < 3 ) { - const QString errorMsg = tr("Piece '%1'. Not enough points to build seam allowance.").arg(name); + const QString errorMsg = + QCoreApplication::translate("VAbstractPiece", "Piece '%1'. Not enough points to build seam allowance.") + .arg(name); VAbstractApplication::VApp()->IsPedantic() ? throw VException(errorMsg) : qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; return {}; diff --git a/src/libs/vlayout/vabstractpiece.h b/src/libs/vlayout/vabstractpiece.h index 884547b3b..1254c9981 100644 --- a/src/libs/vlayout/vabstractpiece.h +++ b/src/libs/vlayout/vabstractpiece.h @@ -40,7 +40,7 @@ #include "../vgeometry/vgobject.h" #include "vsapoint.h" #include "vrawsapoint.h" -#include "testpath.h" +#include "../vmisc/testpath.h" class VAbstractPieceData; class QPainterPath; diff --git a/src/libs/vlayout/vlayout.qbs b/src/libs/vlayout/vlayout.qbs new file mode 100644 index 000000000..1bd442ece --- /dev/null +++ b/src/libs/vlayout/vlayout.qbs @@ -0,0 +1,94 @@ +VLib { + Depends { name: "Qt"; submodules: ["concurrent", "svg"] } + Depends { name: "VMiscLib" } + Depends { name: "VGeometryLib" } + Depends { name: "VPatternDBLib" } + Depends { name: "VObjLib" } + Depends { name: "QMUParserLib" } + Depends { name: "VDXFLib" } + Depends { name: "IFCLib" } + Depends { name: "VWidgetsLib" } + Depends { name: "VFormatLib" } + + name: "VLayoutLib" + files: { + var files = [ + "vlayoutexporter.h", + "vlayoutgenerator.h", + "vlayoutdef.h", + "vlayoutpaper.h", + "vlayoutpaper_p.h", + "vbank.h", + "vcontour.h", + "vcontour_p.h", + "vbestsquare.h", + "vlayoutpoint.h", + "vposition.h", + "vrawlayout.h", + "vprintlayout.h", + "vsapoint.h", + "vtextmanager.h", + "vposter.h", + "vgraphicsfillitem.h", + "vabstractpiece.h", + "vabstractpiece_p.h", + "vlayoutpiece.h", + "vlayoutpiece_p.h", + "vlayoutpiecepath.h", + "vlayoutpiecepath_p.h", + "vbestsquare_p.h", + "vrawsapoint.h", + "vlayoutexporter.cpp", + "vlayoutgenerator.cpp", + "vlayoutpaper.cpp", + "vbank.cpp", + "vcontour.cpp", + "vbestsquare.cpp", + "vlayoutpoint.cpp", + "vposition.cpp", + "vrawlayout.cpp", + "vprintlayout.cpp", + "vtextmanager.cpp", + "vposter.cpp", + "vgraphicsfillitem.cpp", + "vabstractpiece.cpp", + "vlayoutpiece.cpp", + "vlayoutpiecepath.cpp", + "vrawsapoint.cpp" + ]; + + if (Qt.core.versionMajor >= 5 && Qt.core.versionMinor < 12) { + files.push("vsapoint.cpp"); // need only before C++17 + } + + return files; + } + + Group { + name: "dialogs" + prefix: "dialogs/" + files: [ + "dialoglayoutscale.h", + "vabstractlayoutdialog.h", + "watermarkwindow.h", + "dialoglayoutscale.cpp", + "vabstractlayoutdialog.cpp", + "watermarkwindow.cpp", + "dialoglayoutscale.ui", + "watermarkwindow.ui", + ] + } + + Group { + name: "Resources" + prefix: "share/" + files: [ + "icons.qrc", + ] + } + + Export { + Depends { name: "cpp" } + cpp.includePaths: [exportingProduct.sourceDirectory] + } +} diff --git a/src/libs/vlayout/vlayoutpiece_p.h b/src/libs/vlayout/vlayoutpiece_p.h index c1ad97727..7efe933b5 100644 --- a/src/libs/vlayout/vlayoutpiece_p.h +++ b/src/libs/vlayout/vlayoutpiece_p.h @@ -46,7 +46,7 @@ #include "vtextmanager.h" #include "../ifc/exception/vexception.h" #include "vlayoutpoint.h" -#include "vlayoutplacelabel.h" +#include "../vgeometry/vlayoutplacelabel.h" QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") diff --git a/src/libs/vlayout/vsapoint.cpp b/src/libs/vlayout/vsapoint.cpp index d00ff1320..72c00f4f4 100644 --- a/src/libs/vlayout/vsapoint.cpp +++ b/src/libs/vlayout/vsapoint.cpp @@ -26,7 +26,6 @@ ** *************************************************************************/ - // See https://stackoverflow.com/a/46719572/3045403 #if __cplusplus < 201703L #include "vsapoint.h" diff --git a/src/libs/vmisc/customevents.h b/src/libs/vmisc/customevents.h index 1b74fe4f3..3afe0adf8 100644 --- a/src/libs/vmisc/customevents.h +++ b/src/libs/vmisc/customevents.h @@ -44,7 +44,9 @@ enum CustomEventType { //--------------------------------------------------------------------------------------------------------------------- QT_WARNING_PUSH +#if !defined(Q_OS_MACOS) && defined(Q_CC_CLANG) QT_WARNING_DISABLE_CLANG("-Wenum-enum-conversion") +#endif // Define undo event identifier const QEvent::Type UNDO_EVENT = static_cast(QEvent::User + CustomEventType::UndoEventType); @@ -63,7 +65,9 @@ public: //--------------------------------------------------------------------------------------------------------------------- QT_WARNING_PUSH +#if !defined(Q_OS_MACOS) && defined(Q_CC_CLANG) QT_WARNING_DISABLE_CLANG("-Wenum-enum-conversion") +#endif const QEvent::Type LITE_PARSE_EVENT = static_cast(QEvent::User + CustomEventType::LiteParseEventType); @@ -81,7 +85,9 @@ public: //--------------------------------------------------------------------------------------------------------------------- QT_WARNING_PUSH +#if !defined(Q_OS_MACOS) && defined(Q_CC_CLANG) QT_WARNING_DISABLE_CLANG("-Wenum-enum-conversion") +#endif const QEvent::Type FIT_BEST_CURRENT_EVENT = static_cast(QEvent::User + CustomEventType::FitBestCurrentEventType); @@ -100,7 +106,9 @@ public: //--------------------------------------------------------------------------------------------------------------------- QT_WARNING_PUSH +#if !defined(Q_OS_MACOS) && defined(Q_CC_CLANG) QT_WARNING_DISABLE_CLANG("-Wenum-enum-conversion") +#endif const QEvent::Type WARNING_MESSAGE_EVENT = static_cast(QEvent::User + CustomEventType::WarningMessageEventType); diff --git a/src/libs/vmisc/dialogs/dialogexporttocsv.h b/src/libs/vmisc/dialogs/dialogexporttocsv.h index 6954e685d..145da8929 100644 --- a/src/libs/vmisc/dialogs/dialogexporttocsv.h +++ b/src/libs/vmisc/dialogs/dialogexporttocsv.h @@ -31,7 +31,7 @@ #include -#include "../vmisc/defglobal.h" +#include "../defglobal.h" namespace Ui { diff --git a/src/libs/vmisc/dialogs/dialogselectlanguage.cpp b/src/libs/vmisc/dialogs/dialogselectlanguage.cpp index 80e8deb36..dea6bd4fd 100644 --- a/src/libs/vmisc/dialogs/dialogselectlanguage.cpp +++ b/src/libs/vmisc/dialogs/dialogselectlanguage.cpp @@ -27,7 +27,7 @@ *************************************************************************/ #include "dialogselectlanguage.h" #include "ui_dialogselectlanguage.h" -#include "../vmisc/def.h" +#include "../def.h" //--------------------------------------------------------------------------------------------------------------------- DialogSelectLanguage::DialogSelectLanguage(QWidget *parent) : diff --git a/src/libs/vmisc/dialogs/dialogselectlanguage.h b/src/libs/vmisc/dialogs/dialogselectlanguage.h index bca913212..e371dda8e 100644 --- a/src/libs/vmisc/dialogs/dialogselectlanguage.h +++ b/src/libs/vmisc/dialogs/dialogselectlanguage.h @@ -30,7 +30,7 @@ #include -#include "../vmisc/defglobal.h" +#include "../defglobal.h" namespace Ui { diff --git a/src/libs/vmisc/fpm/math.hpp b/src/libs/vmisc/fpm/math.hpp index d41110cc6..0f37503d3 100644 --- a/src/libs/vmisc/fpm/math.hpp +++ b/src/libs/vmisc/fpm/math.hpp @@ -25,6 +25,7 @@ namespace detail QT_WARNING_PUSH QT_WARNING_DISABLE_CLANG("-Wsign-conversion") +QT_WARNING_DISABLE_GCC("-Wconversion") // Returns the index of the most-signifcant set bit inline auto find_highest_bit(unsigned long long value) noexcept -> long diff --git a/src/libs/vmisc/projectversion.cpp b/src/libs/vmisc/projectversion.cpp index 2c051979b..f0906eaee 100644 --- a/src/libs/vmisc/projectversion.cpp +++ b/src/libs/vmisc/projectversion.cpp @@ -40,8 +40,13 @@ #include #include +#if !defined(LATEST_TAG_DISTANCE) && defined(QBS_BUILD) +#include +#define LATEST_TAG_DISTANCE VCS_REPO_STATE_DISTANCE +#endif + extern const QString APP_VERSION_STR(QStringLiteral("%1.%2.%3.%4").arg(MAJOR_VERSION).arg(MINOR_VERSION) - .arg(DEBUG_VERSION).arg(LATEST_TAG_DISTANCE)); + .arg(DEBUG_VERSION).arg(LATEST_TAG_DISTANCE)); //--------------------------------------------------------------------------------------------------------------------- QString compilerString() diff --git a/src/libs/vmisc/stable.h b/src/libs/vmisc/stable.h index 6053b936a..5f007595a 100644 --- a/src/libs/vmisc/stable.h +++ b/src/libs/vmisc/stable.h @@ -38,17 +38,41 @@ /* Add C++ includes here */ #ifdef QT_CORE_LIB -#include +# include #endif #ifdef QT_GUI_LIB # include #endif -#ifdef QT_GUI_LIB +#ifdef QT_XML_LIB +# include +#endif + +#ifdef QT_WIDGETS_LIB # include #endif +#ifdef QT_SVG_LIB +# include +#endif + +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif + +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include +#endif + #endif/*__cplusplus*/ #endif // STABLE_H diff --git a/src/libs/vmisc/testpath.cpp b/src/libs/vmisc/testpath.cpp index 3a7eb8f78..4d9ef4aca 100644 --- a/src/libs/vmisc/testpath.cpp +++ b/src/libs/vmisc/testpath.cpp @@ -34,8 +34,6 @@ #include #include -#include "vsapoint.h" - //--------------------------------------------------------------------------------------------------------------------- #if !defined(V_NO_ASSERT) // Use for writing tests diff --git a/src/libs/vmisc/vabstractapplication.cpp b/src/libs/vmisc/vabstractapplication.cpp index a1782e1c1..e8434f152 100644 --- a/src/libs/vmisc/vabstractapplication.cpp +++ b/src/libs/vmisc/vabstractapplication.cpp @@ -268,6 +268,7 @@ void VAbstractApplication::LoadTranslation(QString locale) LoadQM(qtTranslator, QStringLiteral("qt_"), locale, qtQmDir); installTranslator(qtTranslator); +#if defined(Q_OS_WIN) && !defined(QBS_BUILD) qtxmlTranslator = new QTranslator(this); LoadQM(qtxmlTranslator, QStringLiteral("qtxmlpatterns_"), locale, qtQmDir); installTranslator(qtxmlTranslator); @@ -275,6 +276,7 @@ void VAbstractApplication::LoadTranslation(QString locale) qtBaseTranslator = new QTranslator(this); LoadQM(qtBaseTranslator, QStringLiteral("qtbase_"), locale, qtQmDir); installTranslator(qtBaseTranslator); +#endif // defined(Q_OS_WIN) && !defined(QBS_BUILD) appTranslator = new QTranslator(this); LoadQM(appTranslator, QStringLiteral("valentina_"), locale, appQmDir); @@ -296,6 +298,7 @@ void VAbstractApplication::ClearTranslation() delete qtTranslator; } +#if defined(Q_OS_WIN) && !defined(QBS_BUILD) if (not qtxmlTranslator.isNull()) { removeTranslator(qtxmlTranslator); @@ -307,6 +310,7 @@ void VAbstractApplication::ClearTranslation() removeTranslator(qtBaseTranslator); delete qtBaseTranslator; } +#endif // defined(Q_OS_WIN) && !defined(QBS_BUILD) if (not appTranslator.isNull()) { diff --git a/src/libs/vmisc/vabstractapplication.h b/src/libs/vmisc/vabstractapplication.h index 91a967367..f42a278c8 100644 --- a/src/libs/vmisc/vabstractapplication.h +++ b/src/libs/vmisc/vabstractapplication.h @@ -99,8 +99,10 @@ protected: VCommonSettings *settings{nullptr}; QPointer qtTranslator{nullptr}; +#if defined(Q_OS_WIN) && !defined(QBS_BUILD) QPointer qtxmlTranslator{nullptr}; QPointer qtBaseTranslator{nullptr}; +#endif // defined(Q_OS_WIN) && !defined(QBS_BUILD) QPointer appTranslator{nullptr}; QPointer pmsTranslator{nullptr}; diff --git a/src/libs/vmisc/vcommonsettings.cpp b/src/libs/vmisc/vcommonsettings.cpp index 9d0b0fd4d..d46b427a6 100644 --- a/src/libs/vmisc/vcommonsettings.cpp +++ b/src/libs/vmisc/vcommonsettings.cpp @@ -68,7 +68,9 @@ const qreal VCommonSettings::defaultScrollingAcceleration = 1.3; const qreal VCommonSettings::scrollingAccelerationMin = 1.0; const qreal VCommonSettings::scrollingAccelerationMax = 10.0; +#ifndef QBS_BUILD Q_DECLARE_METATYPE(QMarginsF) // NOLINT +#endif namespace { diff --git a/src/libs/vmisc/vmisc.qbs b/src/libs/vmisc/vmisc.qbs new file mode 100644 index 000000000..9fe506e73 --- /dev/null +++ b/src/libs/vmisc/vmisc.qbs @@ -0,0 +1,137 @@ +VLib { + Depends { name: "Qt"; submodules: ["printsupport"] } + + name: "VMiscLib" + files: [ + "def.cpp", + "testpath.cpp", + "vabstractvalapplication.cpp", + "vabstractapplication.cpp", + "projectversion.cpp", + "vcommonsettings.cpp", + "vvalentinasettings.cpp", + "commandoptions.cpp", + "qxtcsvmodel.cpp", + "vtablesearch.cpp", + "literals.cpp", + "vmodifierkey.cpp", + "compatibility.h", + "lambdaconstants.h", + "def.h", + "testpath.h", + "vabstractvalapplication.h", + "vmath.h", + "vabstractapplication.h", + "projectversion.h", + "vcommonsettings.h", + "vvalentinasettings.h", + "debugbreak.h", + "vlockguard.h", + "vsysexits.h", + "commandoptions.h", + "qxtcsvmodel.h", + "vtablesearch.h", + "diagnostic.h", + "customevents.h", + "defglobal.h", + "testvapplication.h", + "literals.h", + "qt_dispatch/qt_dispatch.h", + "vdatastreamenum.h", + "vmodifierkey.h", + "typedef.h", + ] + + Group { + name: "AppImage" + condition: buildconfig.enableAppImage && qbs.targetOS.contains("unix") && !qbs.targetOS.contains("macos") + files: [ + "binreloc.h", + "appimage.h", + "binreloc.c", + "appimage.cpp" + ] + } + + Group { + name: "dialogs" + prefix: "dialogs/" + files: [ + "dialogexporttocsv.cpp", + "dialogselectlanguage.cpp", + "dialogexporttocsv.h", + "dialogselectlanguage.h", + "dialogexporttocsv.ui", + "dialogselectlanguage.ui" + ] + } + + Group { + name: "bpstd" + prefix: "bpstd/" + files: [ + "any.hpp", + "chrono.hpp", + "complex.hpp", + "cstddef.hpp", + "detail/config.hpp", + "detail/enable_overload.hpp", + "detail/invoke.hpp", + "detail/move.hpp", + "detail/nth_type.hpp", + "detail/proxy_iterator.hpp", + "detail/variant_base.hpp", + "detail/variant_fwds.hpp", + "detail/variant_traits.hpp", + "detail/variant_union.hpp", + "detail/variant_visitors.hpp", + "exception.hpp", + "functional.hpp", + "iterator.hpp", + "memory.hpp", + "optional.hpp", + "span.hpp", + "string.hpp", + "string_view.hpp", + "tuple.hpp", + "type_traits.hpp", + "utility.hpp", + "variant.hpp", + ] + } + + Group { + name: "backport" + prefix: "backport/" + files: [ + "qoverload.h", + "qscopeguard.h", + ] + } + + Group { + name: "fpm" + prefix: "fpm/" + files: [ + "fixed.hpp", + "math.hpp", + ] + } + + Group { + name: "Resources" + prefix: "share/resources/" + files: [ + "theme.qrc", // Windows theme icons. + "icon.qrc", // All other icons except cursors and Windows theme. + "flags.qrc", + "qdarkstyle/style.qrc" + ] + } + + Export { + Depends { name: "cpp" } + Depends { name: "Qt"; submodules: ["printsupport"] } + cpp.includePaths: [exportingProduct.sourceDirectory] + } +} diff --git a/src/libs/vmisc/vvalentinasettings.cpp b/src/libs/vmisc/vvalentinasettings.cpp index 91ceaf49d..324c1fb6f 100644 --- a/src/libs/vmisc/vvalentinasettings.cpp +++ b/src/libs/vmisc/vvalentinasettings.cpp @@ -46,7 +46,9 @@ #include "../vlayout/vbank.h" #include "qglobal.h" -Q_DECLARE_METATYPE(QMarginsF) +#ifndef QBS_BUILD +Q_DECLARE_METATYPE(QMarginsF) // NOLINT +#endif namespace { diff --git a/src/libs/vobj/delaunay.cpp b/src/libs/vobj/delaunay.cpp index 6f96d10e6..e1a6a4d2f 100644 --- a/src/libs/vobj/delaunay.cpp +++ b/src/libs/vobj/delaunay.cpp @@ -71,10 +71,10 @@ struct point2d_s; #define EPSILON (REAL_ONE / TOLERANCE) -typedef struct point2d_s point2d_t; -typedef struct face_s face_t; -typedef struct halfedge_s halfedge_t; -typedef struct delaunay_s delaunay_t; +typedef point2d_s point2d_t; +typedef face_s face_t; +typedef halfedge_s halfedge_t; +typedef delaunay_s delaunay_t; typedef real mat3_t[3][3]; struct point2d_s diff --git a/src/libs/vobj/stable.h b/src/libs/vobj/stable.h index 84d4eca93..8cc9e44c1 100644 --- a/src/libs/vobj/stable.h +++ b/src/libs/vobj/stable.h @@ -38,13 +38,45 @@ /* Add C++ includes here */ #ifdef QT_CORE_LIB -#include +# include #endif #ifdef QT_GUI_LIB # include #endif +#ifdef QT_XML_LIB +# include +#endif + +#ifdef QT_WINEXTRAS_LIB +# include +#endif + +#ifdef QT_WIDGETS_LIB +# include +#endif + +#ifdef QT_SVG_LIB +# include +#endif + +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif + +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include +#endif + #endif/*__cplusplus*/ #endif // STABLE_H diff --git a/src/libs/vobj/vobj.qbs b/src/libs/vobj/vobj.qbs new file mode 100644 index 000000000..0b2b91852 --- /dev/null +++ b/src/libs/vobj/vobj.qbs @@ -0,0 +1,19 @@ +VLib { + Depends { name: "Qt"; submodules: ["gui"] } + + name: "VObjLib" + files: [ + "vobjengine.cpp", + "vobjpaintdevice.cpp", + "delaunay.cpp", + "predicates.cpp", + "vobjengine.h", + "delaunay.h", + "vobjpaintdevice.h", + ] + + Export { + Depends { name: "cpp" } + cpp.includePaths: [exportingProduct.sourceDirectory] + } +} diff --git a/src/libs/vpatterndb/stable.h b/src/libs/vpatterndb/stable.h index 4336c791a..c234ac96b 100644 --- a/src/libs/vpatterndb/stable.h +++ b/src/libs/vpatterndb/stable.h @@ -38,13 +38,45 @@ /* Add C++ includes here */ #ifdef QT_CORE_LIB -#include +# include #endif #ifdef QT_GUI_LIB # include #endif +#ifdef QT_XML_LIB +# include +#endif + +#ifdef QT_WINEXTRAS_LIB +# include +#endif + +#ifdef QT_WIDGETS_LIB +# include +#endif + +#ifdef QT_SVG_LIB +# include +#endif + +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif + +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include +#endif + #endif/*__cplusplus*/ #endif // STABLE_H diff --git a/src/libs/vpatterndb/vpatterndb.pri b/src/libs/vpatterndb/vpatterndb.pri index 2c4d8391c..cb1234ff3 100644 --- a/src/libs/vpatterndb/vpatterndb.pri +++ b/src/libs/vpatterndb/vpatterndb.pri @@ -29,7 +29,8 @@ SOURCES += \ $$PWD/floatItemData/vabstractfloatitemdata.cpp \ $$PWD/measurements.cpp \ $$PWD/pmsystems.cpp \ - $$PWD/vpassmark.cpp + $$PWD/vpassmark.cpp \ + $$PWD/vtranslatemeasurements.cpp *msvc*:SOURCES += $$PWD/stable.cpp @@ -81,4 +82,5 @@ HEADERS += \ $$PWD/measurements.h \ $$PWD/pmsystems.h \ $$PWD/vformula_p.h \ - $$PWD/vpassmark.h + $$PWD/vpassmark.h \ + $$PWD/vtranslatemeasurements.h diff --git a/src/libs/vpatterndb/vpatterndb.qbs b/src/libs/vpatterndb/vpatterndb.qbs new file mode 100644 index 000000000..4a489817a --- /dev/null +++ b/src/libs/vpatterndb/vpatterndb.qbs @@ -0,0 +1,106 @@ +VLib { + Depends { name: "VMiscLib" } + Depends { name: "IFCLib" } + Depends { name: "VGeometryLib" } + Depends { name: "QMUParserLib" } + + name: "VPatternDBLib" + files: [ + "testpassmark.cpp", + "vcontainer.cpp", + "calculator.cpp", + "vnodedetail.cpp", + "vtranslatevars.cpp", + "vformula.cpp", + "vpiece.cpp", + "vpiecenode.cpp", + "vpiecepath.cpp", + "measurements.cpp", + "pmsystems.cpp", + "vpassmark.cpp", + "testpassmark.h", + "vcontainer.h", + "calculator.h", + "vnodedetail.h", + "vnodedetail_p.h", + "vtranslatevars.h", + "vformula.h", + "vpiece.h", + "vpiece_p.h", + "vpiecenode.h", + "vpiecenode_p.h", + "vpiecepath.h", + "vpiecepath_p.h", + "measurements.h", + "pmsystems.h", + "vformula_p.h", + "vpassmark.h", + "vtranslatemeasurements.cpp", + "vtranslatemeasurements.h" + ] + + Group { + name: "variables" + prefix: "variables/" + files: [ + "vpiecearea.cpp", + "varcradius.cpp", + "vcurveangle.cpp", + "vcurvelength.cpp", + "vcurvevariable.cpp", + "vincrement.cpp", + "vinternalvariable.cpp", + "vlineangle.cpp", + "vlinelength.cpp", + "vmeasurement.cpp", + "vvariable.cpp", + "vcurveclength.cpp", + "vpiecearea.h", + "vpiecearea_p.h", + "varcradius.h", + "varcradius_p.h", + "vcurveangle.h", + "vcurvelength.h", + "vcurvevariable.h", + "vcurvevariable_p.h", + "vincrement.h", + "vincrement_p.h", + "vinternalvariable.h", + "vinternalvariable_p.h", + "vlineangle.h", + "vlineangle_p.h", + "vlinelength.h", + "vlinelength_p.h", + "vmeasurement.h", + "vmeasurement_p.h", + "vvariable.h", + "vvariable_p.h", + "vcurveclength.h", + ] + } + + Group { + name: "floatItemData" + prefix: "floatItemData/" + files: [ + "vpiecelabeldata.cpp", + "vpatternlabeldata.cpp", + "vgrainlinedata.cpp", + "vabstractfloatitemdata.cpp", + "vpiecelabeldata.h", + "vpatternlabeldata.h", + "vgrainlinedata.h", + "vabstractfloatitemdata.h", + "vabstractfloatitemdata_p.h", + "vgrainlinedata_p.h", + "floatitemdef.h", + "vpatternlabeldata_p.h", + "vpiecelabeldata_p.h", + ] + } + + Export { + Depends { name: "cpp" } + cpp.includePaths: [exportingProduct.sourceDirectory] + } +} diff --git a/src/libs/vpatterndb/vpiece.cpp b/src/libs/vpatterndb/vpiece.cpp index 8e28eac8b..7b813d244 100644 --- a/src/libs/vpatterndb/vpiece.cpp +++ b/src/libs/vpatterndb/vpiece.cpp @@ -1135,6 +1135,70 @@ int VPiece::IsCSAStart(const QVector &records, quint32 id) return -1; } +//--------------------------------------------------------------------------------------------------------------------- +qreal VPiece::Area(const QVector &shape, const VContainer *data) const +{ + SCASSERT(data != nullptr) + + const qreal mainArea = qAbs(VAbstractPiece::SumTrapezoids(shape))/2.0; + + qreal internalPathArea = 0; + const QVector pathsId = GetInternalPaths(); + for (auto id : pathsId) + { + const VPiecePath path = data->GetPiecePath(id); + if (path.GetType() != PiecePathType::InternalPath || not path.IsVisible(data->DataVariables()) || + not path.IsCutPath()) + { + continue; + } + + QVector points; + CastTo(path.PathPoints(data, shape), points); + if (points.isEmpty() || not VFuzzyComparePoints(ConstFirst(points), ConstLast(points))) + { + continue; + } + + internalPathArea += qAbs(VAbstractPiece::SumTrapezoids(points))/2.0; + } + + return mainArea - internalPathArea; +} + +//--------------------------------------------------------------------------------------------------------------------- +auto VPiece::GlobalPassmarkLength(const VContainer *data) const -> qreal +{ + qreal length = 0; + QString passmarkLengthVariable = VAbstractValApplication::VApp()->getCurrentDocument()->GetPassmarkLengthVariable(); + if (passmarkLengthVariable.isEmpty()) + { + return 0; + } + + try + { + QSharedPointer var = data->GetVariable(passmarkLengthVariable); + length = *var->GetValue(); + + if (VAbstractValApplication::VApp()->toPixel(length) <= accuracyPointOnLine) + { + const QString errorMsg = QObject::tr("Invalid global value for a passmark length. Piece '%1'. Length is " + "less than minimal allowed.") + .arg(GetName()); + VAbstractApplication::VApp()->IsPedantic() + ? throw VException(errorMsg) + : qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; + } + } + catch (const VExceptionBadId &) + { + length = 0; + } + + return length; +} + //--------------------------------------------------------------------------------------------------------------------- #if !defined(V_NO_ASSERT) // Use for writing tests @@ -1182,37 +1246,48 @@ QJsonObject VPiece::DBToJson(const VContainer *data) const } //--------------------------------------------------------------------------------------------------------------------- -auto VPiece::GlobalPassmarkLength(const VContainer *data) const -> qreal +void VPiece::DumpPiece(const VPiece &piece, const VContainer *data, const QString &templateName) { - qreal length = 0; - QString passmarkLengthVariable = VAbstractValApplication::VApp()->getCurrentDocument()->GetPassmarkLengthVariable(); - if (passmarkLengthVariable.isEmpty()) + SCASSERT(data != nullptr) + QTemporaryFile temp; // Go to tmp folder to find dump + temp.setAutoRemove(false); // Remove dump manually + + if (not templateName.isEmpty()) { - return 0; + temp.setFileTemplate(QDir::tempPath() + QDir::separator() + templateName); } - try + if (temp.open()) { - QSharedPointer var = data->GetVariable(passmarkLengthVariable); - length = *var->GetValue(); - - if (VAbstractValApplication::VApp()->toPixel(length) <= accuracyPointOnLine) +#if defined(Q_OS_LINUX) + #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) +// On Linux, QTemporaryFile will attempt to create unnamed temporary +// files. If that succeeds, open() will return true but exists() will be +// false. If you call fileName() or any function that calls it, +// QTemporaryFile will give the file a name, so most applications will +// not see a difference. + temp.fileName(); // call to create a file on disk + #endif +#endif + QJsonObject testCase { - const QString errorMsg = QObject::tr("Invalid global value for a passmark length. Piece '%1'. Length is " - "less than minimal allowed.") - .arg(GetName()); - VAbstractApplication::VApp()->IsPedantic() - ? throw VException(errorMsg) - : qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; - } - } - catch (const VExceptionBadId &) - { - length = 0; - } + {"bd", piece.DBToJson(data)}, + {"piece", piece.MainPathToJson()}, + }; - return length; + QJsonObject json + { + {"testCase", testCase}, + }; + + QJsonDocument document(json); + + QTextStream out(&temp); + out << document.toJson(); + out.flush(); + } } +#endif // !defined(V_NO_ASSERT) //--------------------------------------------------------------------------------------------------------------------- void VPiece::TestInternalPathCuttingPathIntersection(const VContainer *data) const @@ -1334,80 +1409,6 @@ void VPiece::TestInternalPathsIntersections(const VContainer *data) const } } -//--------------------------------------------------------------------------------------------------------------------- -qreal VPiece::Area(const QVector &shape, const VContainer *data) const -{ - SCASSERT(data != nullptr) - - const qreal mainArea = qAbs(VAbstractPiece::SumTrapezoids(shape))/2.0; - - qreal internalPathArea = 0; - const QVector pathsId = GetInternalPaths(); - for (auto id : pathsId) - { - const VPiecePath path = data->GetPiecePath(id); - if (path.GetType() != PiecePathType::InternalPath || not path.IsVisible(data->DataVariables()) || - not path.IsCutPath()) - { - continue; - } - - QVector points; - CastTo(path.PathPoints(data, shape), points); - if (points.isEmpty() || not VFuzzyComparePoints(ConstFirst(points), ConstLast(points))) - { - continue; - } - - internalPathArea += qAbs(VAbstractPiece::SumTrapezoids(points))/2.0; - } - - return mainArea - internalPathArea; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VPiece::DumpPiece(const VPiece &piece, const VContainer *data, const QString &templateName) -{ - SCASSERT(data != nullptr) - QTemporaryFile temp; // Go to tmp folder to find dump - temp.setAutoRemove(false); // Remove dump manually - - if (not templateName.isEmpty()) - { - temp.setFileTemplate(QDir::tempPath() + QDir::separator() + templateName); - } - - if (temp.open()) - { -#if defined(Q_OS_LINUX) - #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) -// On Linux, QTemporaryFile will attempt to create unnamed temporary -// files. If that succeeds, open() will return true but exists() will be -// false. If you call fileName() or any function that calls it, -// QTemporaryFile will give the file a name, so most applications will -// not see a difference. - temp.fileName(); // call to create a file on disk - #endif -#endif - QJsonObject testCase - { - {"bd", piece.DBToJson(data)}, - {"piece", piece.MainPathToJson()}, - }; - - QJsonObject json - { - {"testCase", testCase}, - }; - - QJsonDocument document(json); - - QTextStream out(&temp); - out << document.toJson(); - out.flush(); - } -} - //--------------------------------------------------------------------------------------------------------------------- void VPiece::TestInternalPaths(const VContainer *data) const { @@ -1481,4 +1482,3 @@ auto VPiece::ShortNameRegExp() -> QString return regex; } -#endif // !defined(V_NO_ASSERT) diff --git a/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp b/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp index 574ef1333..ffc57b3c0 100644 --- a/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp +++ b/src/libs/vpropertyexplorer/plugins/vcolorpropertyeditor.cpp @@ -62,7 +62,7 @@ VPE::VColorPropertyEditor::VColorPropertyEditor(QWidget *parent) // The layout (a horizontal layout) QHBoxLayout* layout = new QHBoxLayout(this); layout->setSpacing(3); - layout->setMargin(0); + layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(ColorLabel); layout->addWidget(TextLabel); layout->addItem(Spacer); diff --git a/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp b/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp index 41a71187d..de52ca6b3 100644 --- a/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp +++ b/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.cpp @@ -61,7 +61,7 @@ VPE::VFileEditWidget::VFileEditWidget(QWidget *parent, bool is_directory) // The layout (a horizontal layout) QHBoxLayout* layout = new QHBoxLayout(this); layout->setSpacing(0); - layout->setMargin(0); + layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(FileLineEdit); layout->addWidget(ToolButton); diff --git a/src/libs/vpropertyexplorer/plugins/vshortcutpropertyeditor.cpp b/src/libs/vpropertyexplorer/plugins/vshortcutpropertyeditor.cpp index 7e015a355..cf809c6cd 100644 --- a/src/libs/vpropertyexplorer/plugins/vshortcutpropertyeditor.cpp +++ b/src/libs/vpropertyexplorer/plugins/vshortcutpropertyeditor.cpp @@ -41,7 +41,7 @@ VPE::VShortcutEditWidget::VShortcutEditWidget(QWidget *parent) // The layout (a horizontal layout) QHBoxLayout* layout = new QHBoxLayout(this); layout->setSpacing(0); - layout->setMargin(0); + layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(LineEdit); } diff --git a/src/libs/vpropertyexplorer/stable.h b/src/libs/vpropertyexplorer/stable.h index 4a85b4653..96f1808ea 100644 --- a/src/libs/vpropertyexplorer/stable.h +++ b/src/libs/vpropertyexplorer/stable.h @@ -34,6 +34,42 @@ # include #endif +#ifdef QT_GUI_LIB +# include +#endif + +#ifdef QT_XML_LIB +# include +#endif + +#ifdef QT_WINEXTRAS_LIB +# include +#endif + +#ifdef QT_WIDGETS_LIB +# include +#endif + +#ifdef QT_SVG_LIB +# include +#endif + +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif + +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include +#endif + #endif /*__cplusplus*/ #endif // STABLE_H diff --git a/src/libs/vpropertyexplorer/vpropertyexplorer.qbs b/src/libs/vpropertyexplorer/vpropertyexplorer.qbs new file mode 100644 index 000000000..da96a56b5 --- /dev/null +++ b/src/libs/vpropertyexplorer/vpropertyexplorer.qbs @@ -0,0 +1,97 @@ +VDynamicLib { + Depends { name: "Qt"; submodules: ["gui", "widgets"] } + Depends { name: "VMiscLib" } + Depends { name: "multibundle"; } + + name: "VPropertyExplorerLib" + version: "1.0.0" + files: [ + "vproperty.cpp", + "vpropertydelegate.cpp", + "vpropertyfactorymanager.cpp", + "vpropertyformview.cpp", + "vpropertyformwidget.cpp", + "vpropertymodel.cpp", + "vpropertyset.cpp", + "vpropertytreeview.cpp", + "vserializedproperty.cpp", + "vstandardpropertyfactory.cpp", + "checkablemessagebox.cpp", + "vpropertyexplorer_global.h", + "vpropertyfactorymanager_p.h", + "vpropertytreeview_p.h", + "vpropertyset_p.h", + "vabstractpropertyfactory.h", + "vfileproperty_p.h", + "vwidgetproperty_p.h", + "vpropertymodel_p.h", + "vstandardpropertyfactory.h", + "vpropertyformview_p.h", + "vpropertytreeview.h", + "vpropertyformwidget_p.h", + "vpropertydelegate.h", + "vproperty_p.h", + "vpropertyformwidget.h", + "vpropertyformview.h", + "vpropertyset.h", + "vpropertymodel.h", + "vproperty.h", + "vpropertyfactorymanager.h", + "vserializedproperty.h", + "vproperties.h", + "checkablemessagebox.h", + ] + + Group { + name: "plugins" + prefix: "plugins/" + files: [ + "vtextproperty.cpp", + "vwidgetproperty.cpp", + "vemptyproperty.cpp", + "vboolproperty.cpp", + "vshortcutproperty.cpp", + "vcolorproperty.cpp", + "vshortcutpropertyeditor.cpp", + "venumproperty.cpp", + "vfileproperty.cpp", + "vcolorpropertyeditor.cpp", + "vfilepropertyeditor.cpp", + "vnumberproperty.cpp", + "Vector3d/vvector3dproperty.cpp", + "vstringproperty.cpp", + "vpointfproperty.cpp", + "vobjectproperty.cpp", + "vlinetypeproperty.cpp", + "vlinecolorproperty.cpp", + "vlabelproperty.cpp", + "vtextproperty.h", + "vwidgetproperty.h", + "vcolorproperty.h", + "vboolproperty.h", + "vcolorpropertyeditor.h", + "vshortcutpropertyeditor.h", + "vemptyproperty.h", + "vshortcutproperty.h", + "venumproperty.h", + "vfilepropertyeditor.h", + "vfileproperty.h", + "vnumberproperty.h", + "Vector3d/vvector3dproperty.h", + "vstringproperty.h", + "vpointfproperty.h", + "vobjectproperty.h", + "vlinetypeproperty.h", + "vlinecolorproperty.h", + "vlabelproperty.h", + ] + } + + Export { + Depends { name: "cpp" } + cpp.includePaths: [exportingProduct.sourceDirectory] + } + + cpp.defines: "VPROPERTYEXPLORER_LIBRARY" + multibundle.targetApps: ["Valentina", "Tape", "Puzzle"] +} diff --git a/src/libs/vtest/abstracttest.cpp b/src/libs/vtest/abstracttest.cpp index 5ca43c614..274f02082 100644 --- a/src/libs/vtest/abstracttest.cpp +++ b/src/libs/vtest/abstracttest.cpp @@ -328,32 +328,59 @@ void AbstractTest::CompareLinesDistance(const QVector &result, const QVe } } +//--------------------------------------------------------------------------------------------------------------------- +QString AbstractTest::PuzzlePath() const +{ +#ifdef QBS_BUILD + return QStringLiteral(PUZZLE_BUILDDIR); +#else + const QString path = QStringLiteral("/../../../app/puzzle/bin/puzzle"); +#ifdef Q_OS_WIN + return QCoreApplication::applicationDirPath() + path + QLatin1String(".exe"); +#else + return QCoreApplication::applicationDirPath() + path; +#endif +#endif +} + //--------------------------------------------------------------------------------------------------------------------- QString AbstractTest::ValentinaPath() const { +#ifdef QBS_BUILD + return QStringLiteral(VALENTINA_BUILDDIR); +#else const QString path = QStringLiteral("/../../../app/valentina/bin/valentina"); #ifdef Q_OS_WIN return QCoreApplication::applicationDirPath() + path + QLatin1String(".exe"); #else return QCoreApplication::applicationDirPath() + path; #endif +#endif } //--------------------------------------------------------------------------------------------------------------------- QString AbstractTest::TapePath() const { +#ifdef QBS_BUILD + return QStringLiteral(TAPE_BUILDDIR); +#else const QString path = QStringLiteral("/../../../app/tape/bin/tape"); #ifdef Q_OS_WIN return QCoreApplication::applicationDirPath() + path + QLatin1String(".exe"); #else return QCoreApplication::applicationDirPath() + path; #endif +#endif } //--------------------------------------------------------------------------------------------------------------------- QString AbstractTest::TranslationsPath() const { +#ifdef QBS_BUILD + return QStringLiteral(TRANSLATIONS_DIR); +#else return QCoreApplication::applicationDirPath() + QStringLiteral("/../../../app/valentina/bin/translations"); +#endif } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtest/abstracttest.h b/src/libs/vtest/abstracttest.h index 1fd9c2fb0..9d6c6ef2f 100644 --- a/src/libs/vtest/abstracttest.h +++ b/src/libs/vtest/abstracttest.h @@ -92,6 +92,7 @@ protected: void ComparePointsDistance(const QPointF &result, const QPointF &expected, qreal testAccuracy) const; void CompareLinesDistance(const QVector &result, const QVector &expected) const; + auto PuzzlePath() const -> QString; auto ValentinaPath() const -> QString; auto TapePath() const -> QString; auto TranslationsPath() const -> QString; diff --git a/src/libs/vtest/stable.h b/src/libs/vtest/stable.h index 999790eb0..b3b97710b 100644 --- a/src/libs/vtest/stable.h +++ b/src/libs/vtest/stable.h @@ -38,13 +38,49 @@ /* Add C++ includes here */ #ifdef QT_CORE_LIB -#include +# include #endif #ifdef QT_GUI_LIB # include #endif +#ifdef QT_XML_LIB +# include +#endif + +#ifdef QT_TESTLIB_LIB +# include +#endif + +#ifdef QT_WINEXTRAS_LIB +# include +#endif + +#ifdef QT_WIDGETS_LIB +# include +#endif + +#ifdef QT_SVG_LIB +# include +#endif + +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif + +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include +#endif + #endif/*__cplusplus*/ #endif // STABLE_H diff --git a/src/libs/vtest/vtest.qbs b/src/libs/vtest/vtest.qbs new file mode 100644 index 000000000..024a1f1af --- /dev/null +++ b/src/libs/vtest/vtest.qbs @@ -0,0 +1,20 @@ +VLib { + Depends { name: "Qt"; submodules: ["testlib"] } + Depends { name: "VGeometryLib" } + Depends { name: "VPatternDBLib" } + Depends { name: "VLayoutLib" } + Depends { name: "Tape" } + Depends { name: "Valentina" } + Depends { name: "Puzzle" } + + name: "VTestLib" + files: [ + "abstracttest.cpp", + "abstracttest.h", + ] + + Export { + Depends { name: "cpp" } + cpp.includePaths: [exportingProduct.sourceDirectory] + } +} diff --git a/src/libs/vtools/dialogs/support/dialogeditlabel.ui b/src/libs/vtools/dialogs/support/dialogeditlabel.ui index 5234d9d36..5cfa5dd12 100644 --- a/src/libs/vtools/dialogs/support/dialogeditlabel.ui +++ b/src/libs/vtools/dialogs/support/dialogeditlabel.ui @@ -450,7 +450,7 @@ VLineEdit QLineEdit -
vlineedit.h
+
../vwidgets/vlineedit.h
diff --git a/src/libs/vtools/dialogs/support/dialogeditwrongformula.ui b/src/libs/vtools/dialogs/support/dialogeditwrongformula.ui index d1c282ddc..6cfa88c9c 100644 --- a/src/libs/vtools/dialogs/support/dialogeditwrongformula.ui +++ b/src/libs/vtools/dialogs/support/dialogeditwrongformula.ui @@ -415,12 +415,12 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
VElidedLabel QFrame -
velidedlabel.h
+
../vwidgets/velidedlabel.h
1
diff --git a/src/libs/vtools/dialogs/tools/dialogalongline.ui b/src/libs/vtools/dialogs/tools/dialogalongline.ui index 0867dc0b4..5fd9797d6 100644 --- a/src/libs/vtools/dialogs/tools/dialogalongline.ui +++ b/src/libs/vtools/dialogs/tools/dialogalongline.ui @@ -385,7 +385,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogarc.ui b/src/libs/vtools/dialogs/tools/dialogarc.ui index bea483bc3..0314113ac 100644 --- a/src/libs/vtools/dialogs/tools/dialogarc.ui +++ b/src/libs/vtools/dialogs/tools/dialogarc.ui @@ -721,7 +721,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogarcwithlength.h b/src/libs/vtools/dialogs/tools/dialogarcwithlength.h index 3b691b87a..7d70c8c62 100644 --- a/src/libs/vtools/dialogs/tools/dialogarcwithlength.h +++ b/src/libs/vtools/dialogs/tools/dialogarcwithlength.h @@ -36,7 +36,7 @@ #include #include "../vmisc/def.h" -#include "defglobal.h" +#include "../vmisc/defglobal.h" #include "dialogtool.h" namespace Ui diff --git a/src/libs/vtools/dialogs/tools/dialogarcwithlength.ui b/src/libs/vtools/dialogs/tools/dialogarcwithlength.ui index 2639a01e7..b6790d8c6 100644 --- a/src/libs/vtools/dialogs/tools/dialogarcwithlength.ui +++ b/src/libs/vtools/dialogs/tools/dialogarcwithlength.ui @@ -710,7 +710,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogbisector.ui b/src/libs/vtools/dialogs/tools/dialogbisector.ui index 29e9dce4a..485374cf2 100644 --- a/src/libs/vtools/dialogs/tools/dialogbisector.ui +++ b/src/libs/vtools/dialogs/tools/dialogbisector.ui @@ -7,7 +7,7 @@ 0 0 405 - 358 + 363
@@ -374,7 +374,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.ui b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.ui index 0d6038518..bd4cc72c3 100644 --- a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.ui +++ b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.ui @@ -393,7 +393,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogcutarc.ui b/src/libs/vtools/dialogs/tools/dialogcutarc.ui index 3bd921c16..b8c52e344 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutarc.ui +++ b/src/libs/vtools/dialogs/tools/dialogcutarc.ui @@ -328,7 +328,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogcutspline.ui b/src/libs/vtools/dialogs/tools/dialogcutspline.ui index bd7071a13..be57637e1 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutspline.ui +++ b/src/libs/vtools/dialogs/tools/dialogcutspline.ui @@ -320,7 +320,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.ui b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.ui index fe45553d9..01e0e0278 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.ui +++ b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.ui @@ -328,7 +328,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogellipticalarc.ui b/src/libs/vtools/dialogs/tools/dialogellipticalarc.ui index 3829efae6..ccbace2bd 100644 --- a/src/libs/vtools/dialogs/tools/dialogellipticalarc.ui +++ b/src/libs/vtools/dialogs/tools/dialogellipticalarc.ui @@ -1104,7 +1104,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogendline.ui b/src/libs/vtools/dialogs/tools/dialogendline.ui index ac58763eb..e27cb3fe2 100644 --- a/src/libs/vtools/dialogs/tools/dialogendline.ui +++ b/src/libs/vtools/dialogs/tools/dialogendline.ui @@ -570,7 +570,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.ui b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.ui index 22669040f..e63534c36 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.ui +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.ui @@ -252,7 +252,7 @@ VCompleterLineEdit QLineEdit -
vlineedit.h
+
../vwidgets/vlineedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyline.ui b/src/libs/vtools/dialogs/tools/dialogflippingbyline.ui index 88019a535..8bcb0bbaf 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyline.ui +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyline.ui @@ -252,7 +252,7 @@ VCompleterLineEdit QLineEdit -
vlineedit.h
+
../vwidgets/vlineedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialoggroup.ui b/src/libs/vtools/dialogs/tools/dialoggroup.ui index 436f2229f..092c1c361 100644 --- a/src/libs/vtools/dialogs/tools/dialoggroup.ui +++ b/src/libs/vtools/dialogs/tools/dialoggroup.ui @@ -7,7 +7,7 @@ 0 0 294 - 104 + 107
@@ -78,7 +78,7 @@ VCompleterLineEdit QLineEdit -
vlineedit.h
+
../vwidgets/vlineedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogline.cpp b/src/libs/vtools/dialogs/tools/dialogline.cpp index 3e04fcc8f..87f84f2c4 100644 --- a/src/libs/vtools/dialogs/tools/dialogline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogline.cpp @@ -39,7 +39,7 @@ #include "../../visualization/visualization.h" #include "../../visualization/line/vistoolline.h" #include "../ifc/ifcdef.h" -#include "dialogs/tools/dialogtool.h" +#include "dialogtool.h" #include "ui_dialogline.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.ui b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.ui index 6b4ca5976..1ca3ed8cb 100644 --- a/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.ui +++ b/src/libs/vtools/dialogs/tools/dialoglineintersectaxis.ui @@ -392,7 +392,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogmove.ui b/src/libs/vtools/dialogs/tools/dialogmove.ui index b475ff9de..0b49b2d83 100644 --- a/src/libs/vtools/dialogs/tools/dialogmove.ui +++ b/src/libs/vtools/dialogs/tools/dialogmove.ui @@ -794,12 +794,12 @@ VCompleterLineEdit QLineEdit -
vlineedit.h
+
../vwidgets/vlineedit.h
VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialognormal.ui b/src/libs/vtools/dialogs/tools/dialognormal.ui index 154d3a852..eb7dfaaa4 100644 --- a/src/libs/vtools/dialogs/tools/dialognormal.ui +++ b/src/libs/vtools/dialogs/tools/dialognormal.ui @@ -565,7 +565,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.cpp b/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.cpp index 9955c3aec..9721ee242 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointfromarcandtangent.cpp @@ -34,7 +34,7 @@ #include "../../visualization/visualization.h" #include "../../visualization/line/vistoolpointfromarcandtangent.h" -#include "dialogs/tools/dialogtool.h" +#include "dialogtool.h" #include "ui_dialogpointfromarcandtangent.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.ui b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.ui index cf91ae0d1..7359668d6 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.ui +++ b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.ui @@ -349,7 +349,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogpointofcontact.h b/src/libs/vtools/dialogs/tools/dialogpointofcontact.h index 5330bdb96..2da5aec73 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofcontact.h +++ b/src/libs/vtools/dialogs/tools/dialogpointofcontact.h @@ -37,7 +37,6 @@ #include "../vmisc/def.h" #include "dialogtool.h" -#include "ui_dialogpointofcontact.h" namespace Ui { diff --git a/src/libs/vtools/dialogs/tools/dialogpointofcontact.ui b/src/libs/vtools/dialogs/tools/dialogpointofcontact.ui index 8808f4299..4b90f4560 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofcontact.ui +++ b/src/libs/vtools/dialogs/tools/dialogpointofcontact.ui @@ -383,7 +383,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.cpp b/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.cpp index 4034baa57..d994aa519 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectionarcs.cpp @@ -37,7 +37,7 @@ #include "../../visualization/visualization.h" #include "../../visualization/line/vistoolpointofintersectionarcs.h" #include "../vmisc/vabstractapplication.h" -#include "dialogs/tools/dialogtool.h" +#include "dialogtool.h" #include "ui_dialogpointofintersectionarcs.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.ui b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.ui index 64db825df..820b3a0f3 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.ui +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.ui @@ -529,7 +529,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogrotation.ui b/src/libs/vtools/dialogs/tools/dialogrotation.ui index 00f232911..16f6e0c6c 100644 --- a/src/libs/vtools/dialogs/tools/dialogrotation.ui +++ b/src/libs/vtools/dialogs/tools/dialogrotation.ui @@ -418,12 +418,12 @@ VCompleterLineEdit QLineEdit -
vlineedit.h
+
../vwidgets/vlineedit.h
VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogshoulderpoint.ui b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.ui index 9e06473b0..6c26a65d9 100644 --- a/src/libs/vtools/dialogs/tools/dialogshoulderpoint.ui +++ b/src/libs/vtools/dialogs/tools/dialogshoulderpoint.ui @@ -422,7 +422,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogspline.cpp b/src/libs/vtools/dialogs/tools/dialogspline.cpp index 8376b196e..0a88391dc 100644 --- a/src/libs/vtools/dialogs/tools/dialogspline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogspline.cpp @@ -55,7 +55,7 @@ #include "../vpatterndb/vcontainer.h" #include "../vwidgets/vmaingraphicsscene.h" #include "ui_dialogspline.h" -#include "vtranslatevars.h" +#include "../vpatterndb/vtranslatevars.h" #include "../qmuparser/qmudef.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogspline.ui b/src/libs/vtools/dialogs/tools/dialogspline.ui index 9afc1f1cf..c0a0123ef 100644 --- a/src/libs/vtools/dialogs/tools/dialogspline.ui +++ b/src/libs/vtools/dialogs/tools/dialogspline.ui @@ -984,7 +984,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp b/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp index fe15f41de..65fc93776 100644 --- a/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp +++ b/src/libs/vtools/dialogs/tools/dialogsplinepath.cpp @@ -63,7 +63,7 @@ #include "../vwidgets/vabstractmainwindow.h" #include "../vwidgets/vmaingraphicsscene.h" #include "ui_dialogsplinepath.h" -#include "vtranslatevars.h" +#include "../vpatterndb/vtranslatevars.h" #include "../qmuparser/qmudef.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/dialogsplinepath.ui b/src/libs/vtools/dialogs/tools/dialogsplinepath.ui index 2df1d2fd3..e5efb482e 100644 --- a/src/libs/vtools/dialogs/tools/dialogsplinepath.ui +++ b/src/libs/vtools/dialogs/tools/dialogsplinepath.ui @@ -961,7 +961,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp index 666267ece..0cce7d10b 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp @@ -30,7 +30,7 @@ #include "ui_dialogpiecepath.h" #include "../vpatterndb/vpiecenode.h" #include "../vpatterndb/variables/vincrement.h" -#include "visualization/path/vistoolpiecepath.h" +#include "../../../visualization/path/vistoolpiecepath.h" #include "../../../tools/vtoolseamallowance.h" #include "../../support/dialogeditwrongformula.h" #include "../vmisc/vmodifierkey.h" diff --git a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.ui b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.ui index abf5627fc..189be3c2c 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.ui +++ b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.ui @@ -21,7 +21,7 @@ - 0 + 2 @@ -1040,7 +1040,6 @@ 36 - 75 true @@ -1658,7 +1657,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/piece/dialogpin.cpp b/src/libs/vtools/dialogs/tools/piece/dialogpin.cpp index 44a322ac2..9ad9df9fe 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogpin.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogpin.cpp @@ -28,7 +28,7 @@ #include "dialogpin.h" #include "ui_dialogpin.h" -#include "visualization/line/vistoolspecialpoint.h" +#include "../../../visualization/line/vistoolspecialpoint.h" #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #include "../vmisc/backport/qoverload.h" #endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0) diff --git a/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp b/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp index 3fe3fd764..a7d96794e 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp @@ -28,7 +28,7 @@ #include "dialogplacelabel.h" #include "ui_dialogplacelabel.h" -#include "visualization/line/vistoolspecialpoint.h" +#include "../../../visualization/line/vistoolspecialpoint.h" #include "../../support/dialogeditwrongformula.h" #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #include "../vmisc/backport/qoverload.h" diff --git a/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.ui b/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.ui index 6b0113e46..259a54727 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.ui +++ b/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.ui @@ -846,7 +846,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp index 7022d1ac3..f6de22fea 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp @@ -40,8 +40,8 @@ #include "../vpatterndb/calculator.h" #include "../vpatterndb/variables/vincrement.h" #include "../vpatterndb/variables/vmeasurement.h" -#include "visualization/path/vistoolpiece.h" -#include "visualization/path/vispiecespecialpoints.h" +#include "../../../visualization/path/vistoolpiece.h" +#include "../../../visualization/path/vispiecespecialpoints.h" #include "dialogpiecepath.h" #include "dialogplacelabel.h" #include "../../../undocommands/savepiecepathoptions.h" diff --git a/src/libs/vtools/dialogs/tools/piece/tabs/tabgrainline.ui b/src/libs/vtools/dialogs/tools/piece/tabs/tabgrainline.ui index 29b074ae2..98bf02fe3 100644 --- a/src/libs/vtools/dialogs/tools/piece/tabs/tabgrainline.ui +++ b/src/libs/vtools/dialogs/tools/piece/tabs/tabgrainline.ui @@ -530,7 +530,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/piece/tabs/tablabels.ui b/src/libs/vtools/dialogs/tools/piece/tabs/tablabels.ui index 36305f486..64188ff5e 100644 --- a/src/libs/vtools/dialogs/tools/piece/tabs/tablabels.ui +++ b/src/libs/vtools/dialogs/tools/piece/tabs/tablabels.ui @@ -1769,12 +1769,12 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
VLineEdit QLineEdit -
vlineedit.h
+
../vwidgets/vlineedit.h
diff --git a/src/libs/vtools/dialogs/tools/piece/tabs/tabpassmarks.ui b/src/libs/vtools/dialogs/tools/piece/tabs/tabpassmarks.ui index e107004f1..340e39c70 100644 --- a/src/libs/vtools/dialogs/tools/piece/tabs/tabpassmarks.ui +++ b/src/libs/vtools/dialogs/tools/piece/tabs/tabpassmarks.ui @@ -566,7 +566,7 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
diff --git a/src/libs/vtools/dialogs/tools/piece/tabs/tabpaths.ui b/src/libs/vtools/dialogs/tools/piece/tabs/tabpaths.ui index e257d60a1..b5657ab83 100644 --- a/src/libs/vtools/dialogs/tools/piece/tabs/tabpaths.ui +++ b/src/libs/vtools/dialogs/tools/piece/tabs/tabpaths.ui @@ -1157,12 +1157,12 @@ VPlainTextEdit QPlainTextEdit -
vplaintextedit.h
+
../vwidgets/vplaintextedit.h
VLineEdit QLineEdit -
vlineedit.h
+
../vwidgets/vlineedit.h
diff --git a/src/libs/vtools/stable.h b/src/libs/vtools/stable.h index 020976a32..89cef7694 100644 --- a/src/libs/vtools/stable.h +++ b/src/libs/vtools/stable.h @@ -39,9 +39,9 @@ #include /*In all cases we need include core header for getting defined values*/ -//#ifdef QT_CORE_LIB -//# include -//#endif +#ifdef QT_CORE_LIB +# include +#endif #ifdef QT_GUI_LIB # include @@ -51,29 +51,33 @@ # include #endif -//In Windows you can't use same header in all modes. -#if !defined(Q_OS_WIN) -# ifdef QT_WIDGETS_LIB -# include -# endif +#ifdef QT_WINEXTRAS_LIB +# include +#endif -# ifdef QT_SVG_LIB -# include -# endif +#ifdef QT_WIDGETS_LIB +# include +#endif -# ifdef QT_PRINTSUPPORT_LIB -# include -# endif +#ifdef QT_SVG_LIB +# include +#endif - //Build doesn't work, if include this headers on Windows. -# ifdef QT_XMLPATTERNS_LIB -# include -# endif +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif -# ifdef QT_NETWORK_LIB -# include -# endif -#endif/*Q_OS_WIN*/ +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include +#endif #endif /*__cplusplus*/ diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp index 52bba943b..c64eebf6c 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp @@ -291,11 +291,11 @@ QString VToolCutArc::MakeToolTip() const ->FormulaToUser(formula, VAbstractApplication::VApp()->Settings()->GetOsSeparator()); const qreal length = Visualization::FindValFromUser(expression, VAbstractTool::data.DataVariables()); - const QString arcStr = tr("Arc"); - const QString lengthStr = tr("length"); - const QString startAngleStr = tr("start angle"); - const QString endAngleStr = tr("end angle"); - const QString radiusStr = tr("radius"); + const QString arcStr = QCoreApplication::translate("VToolCutArc", "Arc"); + const QString lengthStr = QCoreApplication::translate("VToolCutArc", "length"); + const QString startAngleStr = QCoreApplication::translate("VToolCutArc", "start angle"); + const QString endAngleStr = QCoreApplication::translate("VToolCutArc", "end angle"); + const QString radiusStr = QCoreApplication::translate("VToolCutArc", "radius"); const QSharedPointer point = VAbstractTool::data.GeometricObject(m_id); @@ -326,7 +326,9 @@ QString VToolCutArc::MakeToolTip() const .arg(arc.GetStartAngle()) .arg(arcStr + arcNumber + QChar(QChar::Space) + endAngleStr) .arg(arc.GetEndAngle()) - .arg(arcStr + arcNumber + QChar(QChar::Space) + tr("label"), arc.ObjectName()); + .arg(arcStr + arcNumber + + QChar(QChar::Space) + QCoreApplication::translate("VToolCutArc", "label"), + arc.ObjectName()); return toolTip; }; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp index 78bb9c347..37a6d543f 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp @@ -302,8 +302,8 @@ auto VToolCutSpline::MakeToolTip() const -> QString VSpline spline2 = VSpline(VPointF(point), spl2p2, spl2p3, spl->GetP4()); spline2.SetAliasSuffix(m_aliasSuffix2); - const QString curveStr = tr("Curve"); - const QString lengthStr = tr("length"); + const QString curveStr = QCoreApplication::translate("VToolCutSpline", "Curve"); + const QString lengthStr = QCoreApplication::translate("VToolCutSpline", "length"); const QString toolTip = QString("" "" @@ -316,8 +316,10 @@ auto VToolCutSpline::MakeToolTip() const -> QString .arg(UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true), curveStr + QStringLiteral("2 ") + lengthStr) .arg(VAbstractValApplication::VApp()->fromPixel(spline2.GetLength())) - .arg(curveStr + QStringLiteral(" 1") + tr("label"), spline1.ObjectName(), - curveStr + QStringLiteral(" 2") + tr("label"), spline2.ObjectName()); + .arg(curveStr + QStringLiteral(" 1") + QCoreApplication::translate("VToolCutSpline", "label"), + spline1.ObjectName(), + curveStr + QStringLiteral(" 2") + QCoreApplication::translate("VToolCutSpline", "label"), + spline2.ObjectName()); return toolTip; } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp index 0b8730303..db2c2929d 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp @@ -393,8 +393,8 @@ QString VToolCutSplinePath::MakeToolTip() const splPath1->SetAliasSuffix(m_aliasSuffix1); splPath2->SetAliasSuffix(m_aliasSuffix2); - const QString curveStr = tr("Curve"); - const QString lengthStr = tr("length"); + const QString curveStr = QCoreApplication::translate("VToolCutSplinePath", "Curve"); + const QString lengthStr = QCoreApplication::translate("VToolCutSplinePath", "length"); const QString toolTip = QString("
%6: %7
" "" @@ -407,8 +407,10 @@ QString VToolCutSplinePath::MakeToolTip() const .arg(UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true), curveStr + QLatin1String("2 ") + lengthStr) .arg(VAbstractValApplication::VApp()->fromPixel(splPath2->GetLength())) - .arg(curveStr + QLatin1String(" 1") + tr("label"), splPath1->ObjectName(), - curveStr + QLatin1String(" 2") + tr("label"), splPath2->ObjectName()); + .arg(curveStr + QLatin1String(" 1") + QCoreApplication::translate("VToolCutSplinePath", "label"), + splPath1->ObjectName(), + curveStr + QLatin1String(" 2") + QCoreApplication::translate("VToolCutSplinePath", "label"), + splPath2->ObjectName()); delete splPath1; delete splPath2; diff --git a/src/libs/vtools/tools/vtoolseamallowance.cpp b/src/libs/vtools/tools/vtoolseamallowance.cpp index 94d1e99d6..fde121e23 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.cpp +++ b/src/libs/vtools/tools/vtoolseamallowance.cpp @@ -56,14 +56,14 @@ #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #include "../vmisc/backport/qoverload.h" #endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0) -#include "tools/nodeDetails/vtoolpin.h" -#include "tools/nodeDetails/vnodepoint.h" -#include "tools/nodeDetails/vtoolpiecepath.h" -#include "tools/nodeDetails/vnodearc.h" -#include "tools/nodeDetails/vnodeellipticalarc.h" -#include "tools/nodeDetails/vnodespline.h" -#include "tools/nodeDetails/vnodesplinepath.h" -#include "tools/nodeDetails/vtoolplacelabel.h" +#include "nodeDetails/vtoolpin.h" +#include "nodeDetails/vnodepoint.h" +#include "nodeDetails/vtoolpiecepath.h" +#include "nodeDetails/vnodearc.h" +#include "nodeDetails/vnodeellipticalarc.h" +#include "nodeDetails/vnodespline.h" +#include "nodeDetails/vnodesplinepath.h" +#include "nodeDetails/vtoolplacelabel.h" #include "../vformat/vlabeltemplate.h" #include diff --git a/src/libs/vtools/undocommands/addpiece.h b/src/libs/vtools/undocommands/addpiece.h index c605aa276..35e32ad00 100644 --- a/src/libs/vtools/undocommands/addpiece.h +++ b/src/libs/vtools/undocommands/addpiece.h @@ -37,7 +37,7 @@ #include #include "../tools/vtoolseamallowance.h" -#include "vpiece.h" +#include "../vpatterndb/vpiece.h" #include "vundocommand.h" class AddPiece : public VUndoCommand diff --git a/src/libs/vtools/undocommands/deletepiece.h b/src/libs/vtools/undocommands/deletepiece.h index a97fd6030..c05b420f0 100644 --- a/src/libs/vtools/undocommands/deletepiece.h +++ b/src/libs/vtools/undocommands/deletepiece.h @@ -32,7 +32,7 @@ #include #include "../tools/vtoolseamallowance.h" -#include "vpiece.h" +#include "../vpatterndb/vpiece.h" #include "vundocommand.h" class DeletePiece : public VUndoCommand diff --git a/src/libs/vtools/undocommands/image/hideallbackgroundimages.h b/src/libs/vtools/undocommands/image/hideallbackgroundimages.h index 37bd59953..ec02153ae 100644 --- a/src/libs/vtools/undocommands/image/hideallbackgroundimages.h +++ b/src/libs/vtools/undocommands/image/hideallbackgroundimages.h @@ -37,6 +37,7 @@ class HideAllBackgroundImages : public VUndoCommand { + Q_OBJECT // NOLINT public: HideAllBackgroundImages(bool hide, VAbstractPattern *doc, QUndoCommand *parent = nullptr); ~HideAllBackgroundImages() override =default; diff --git a/src/libs/vtools/undocommands/image/hidebackgroundimage.h b/src/libs/vtools/undocommands/image/hidebackgroundimage.h index ec244d916..d9ebd27a3 100644 --- a/src/libs/vtools/undocommands/image/hidebackgroundimage.h +++ b/src/libs/vtools/undocommands/image/hidebackgroundimage.h @@ -37,6 +37,7 @@ class HideBackgroundImage : public VUndoCommand { + Q_OBJECT // NOLINT public: HideBackgroundImage(QUuid id, bool hide, VAbstractPattern *doc, QUndoCommand *parent = nullptr); ~HideBackgroundImage() override =default; diff --git a/src/libs/vtools/undocommands/image/holdallbackgroundimages.h b/src/libs/vtools/undocommands/image/holdallbackgroundimages.h index 515ddc5c3..93a455cf9 100644 --- a/src/libs/vtools/undocommands/image/holdallbackgroundimages.h +++ b/src/libs/vtools/undocommands/image/holdallbackgroundimages.h @@ -36,6 +36,7 @@ class HoldAllBackgroundImages : public VUndoCommand { + Q_OBJECT // NOLINT public: HoldAllBackgroundImages(bool hold, VAbstractPattern *doc, QUndoCommand *parent = nullptr); ~HoldAllBackgroundImages() override =default; diff --git a/src/libs/vtools/undocommands/image/holdbackgroundimage.h b/src/libs/vtools/undocommands/image/holdbackgroundimage.h index e64e10fbd..7a60f3228 100644 --- a/src/libs/vtools/undocommands/image/holdbackgroundimage.h +++ b/src/libs/vtools/undocommands/image/holdbackgroundimage.h @@ -37,6 +37,7 @@ class HoldBackgroundImage : public VUndoCommand { + Q_OBJECT // NOLINT public: HoldBackgroundImage(QUuid id, bool hold, VAbstractPattern *doc, QUndoCommand *parent = nullptr); ~HoldBackgroundImage() override =default; diff --git a/src/libs/vtools/undocommands/image/opaquebackgroundimage.h b/src/libs/vtools/undocommands/image/opaquebackgroundimage.h index 3132dfa20..f483bbabb 100644 --- a/src/libs/vtools/undocommands/image/opaquebackgroundimage.h +++ b/src/libs/vtools/undocommands/image/opaquebackgroundimage.h @@ -36,6 +36,7 @@ class OpaqueBackgroundImage : public VUndoCommand { + Q_OBJECT // NOLINT public: OpaqueBackgroundImage(QUuid id, qreal opacity, VAbstractPattern *doc, QUndoCommand *parent = nullptr); ~OpaqueBackgroundImage() override =default; diff --git a/src/libs/vtools/undocommands/image/renamebackgroundimage.h b/src/libs/vtools/undocommands/image/renamebackgroundimage.h index 0d8b3f371..74b2b053b 100644 --- a/src/libs/vtools/undocommands/image/renamebackgroundimage.h +++ b/src/libs/vtools/undocommands/image/renamebackgroundimage.h @@ -37,6 +37,7 @@ class RenameBackgroundImage : public VUndoCommand { + Q_OBJECT // NOLINT public: RenameBackgroundImage(QUuid id, const QString &name, VAbstractPattern *doc, QUndoCommand *parent = nullptr); ~RenameBackgroundImage() override =default; diff --git a/src/libs/vtools/undocommands/image/resetbackgroundimage.h b/src/libs/vtools/undocommands/image/resetbackgroundimage.h index ba1348ad1..027cad5a9 100644 --- a/src/libs/vtools/undocommands/image/resetbackgroundimage.h +++ b/src/libs/vtools/undocommands/image/resetbackgroundimage.h @@ -39,6 +39,7 @@ class ResetBackgroundImage : public VUndoCommand { + Q_OBJECT // NOLINT public: ResetBackgroundImage(QUuid id, VAbstractPattern *doc, QUndoCommand *parent = nullptr); ~ResetBackgroundImage() override = default; diff --git a/src/libs/vtools/undocommands/image/rotatebackgroundimage.h b/src/libs/vtools/undocommands/image/rotatebackgroundimage.h index d518580a8..2188c49bd 100644 --- a/src/libs/vtools/undocommands/image/rotatebackgroundimage.h +++ b/src/libs/vtools/undocommands/image/rotatebackgroundimage.h @@ -40,6 +40,7 @@ class RotateBackgroundImage : public VUndoCommand { + Q_OBJECT // NOLINT public: RotateBackgroundImage(QUuid id, const QTransform &matrix, VAbstractPattern *doc, bool allowMerge = false, QUndoCommand *parent = nullptr); diff --git a/src/libs/vtools/undocommands/image/zvaluemovebackgroundimage.h b/src/libs/vtools/undocommands/image/zvaluemovebackgroundimage.h index e80e182a7..e685bb330 100644 --- a/src/libs/vtools/undocommands/image/zvaluemovebackgroundimage.h +++ b/src/libs/vtools/undocommands/image/zvaluemovebackgroundimage.h @@ -44,6 +44,7 @@ enum class ZValueMoveType class ZValueMoveBackgroundImage : public VUndoCommand { + Q_OBJECT // NOLINT public: ZValueMoveBackgroundImage(QUuid id, ZValueMoveType move, VAbstractPattern *doc, QUndoCommand *parent = nullptr); ~ZValueMoveBackgroundImage() override =default; diff --git a/src/libs/vtools/undocommands/savepieceoptions.h b/src/libs/vtools/undocommands/savepieceoptions.h index d68d42273..d20f9de65 100644 --- a/src/libs/vtools/undocommands/savepieceoptions.h +++ b/src/libs/vtools/undocommands/savepieceoptions.h @@ -31,7 +31,7 @@ #include -#include "vpiece.h" +#include "../vpatterndb/vpiece.h" #include "vundocommand.h" class SavePieceOptions : public VUndoCommand diff --git a/src/libs/vtools/visualization/line/vistoolendline.cpp b/src/libs/vtools/visualization/line/vistoolendline.cpp index 6d7bbc2c4..a46353ed0 100644 --- a/src/libs/vtools/visualization/line/vistoolendline.cpp +++ b/src/libs/vtools/visualization/line/vistoolendline.cpp @@ -44,7 +44,7 @@ #include "../vpatterndb/vcontainer.h" #include "../visualization.h" #include "visline.h" -#include "vtranslatevars.h" +#include "../vpatterndb/vtranslatevars.h" //--------------------------------------------------------------------------------------------------------------------- VisToolEndLine::VisToolEndLine(const VContainer *data, QGraphicsItem *parent) diff --git a/src/libs/vtools/visualization/line/vistoolline.cpp b/src/libs/vtools/visualization/line/vistoolline.cpp index 189a3c1dd..2ad6b9a6b 100644 --- a/src/libs/vtools/visualization/line/vistoolline.cpp +++ b/src/libs/vtools/visualization/line/vistoolline.cpp @@ -37,7 +37,7 @@ #include "../vgeometry/vpointf.h" #include "../vpatterndb/vcontainer.h" #include "../visualization.h" -#include "visualization/line/visline.h" +#include "visline.h" //--------------------------------------------------------------------------------------------------------------------- VisToolLine::VisToolLine(const VContainer *data, QGraphicsItem *parent) diff --git a/src/libs/vtools/visualization/line/vistoolpointofintersectionarcs.cpp b/src/libs/vtools/visualization/line/vistoolpointofintersectionarcs.cpp index a725ba90b..d6e75970d 100644 --- a/src/libs/vtools/visualization/line/vistoolpointofintersectionarcs.cpp +++ b/src/libs/vtools/visualization/line/vistoolpointofintersectionarcs.cpp @@ -42,7 +42,7 @@ #include "../vgeometry/varc.h" #include "../vpatterndb/vcontainer.h" #include "../visualization.h" -#include "visualization/line/visline.h" +#include "../line/visline.h" //--------------------------------------------------------------------------------------------------------------------- VisToolPointOfIntersectionArcs::VisToolPointOfIntersectionArcs(const VContainer *data, QGraphicsItem *parent) diff --git a/src/libs/vtools/visualization/path/vistoolarc.cpp b/src/libs/vtools/visualization/path/vistoolarc.cpp index e8290ac26..d55299cfe 100644 --- a/src/libs/vtools/visualization/path/vistoolarc.cpp +++ b/src/libs/vtools/visualization/path/vistoolarc.cpp @@ -40,9 +40,9 @@ #include "../vgeometry/vpointf.h" #include "../vpatterndb/vcontainer.h" #include "../visualization.h" -#include "def.h" +#include "../vmisc/def.h" #include "qnamespace.h" -#include "vgeometrydef.h" +#include "../vgeometry/vgeometrydef.h" #include "vispath.h" #include "../vwidgets/scalesceneitems.h" #include "../vmisc/vmodifierkey.h" diff --git a/src/libs/vtools/visualization/path/vistoolarc.h b/src/libs/vtools/visualization/path/vistoolarc.h index 3ce230bb5..18daacb0a 100644 --- a/src/libs/vtools/visualization/path/vistoolarc.h +++ b/src/libs/vtools/visualization/path/vistoolarc.h @@ -37,7 +37,7 @@ #include #include "../vmisc/def.h" -#include "defglobal.h" +#include "../vmisc/defglobal.h" #include "vispath.h" class VisToolArc final : public VisPath diff --git a/src/libs/vtools/visualization/path/vistoolarcwithlength.h b/src/libs/vtools/visualization/path/vistoolarcwithlength.h index c4493e11b..562c31d17 100644 --- a/src/libs/vtools/visualization/path/vistoolarcwithlength.h +++ b/src/libs/vtools/visualization/path/vistoolarcwithlength.h @@ -38,7 +38,7 @@ #include "../vmisc/def.h" #include "vispath.h" -#include "defglobal.h" +#include "../vmisc/defglobal.h" class VisToolArcWithLength final : public VisPath { diff --git a/src/libs/vtools/visualization/path/vistoolpointofintersectioncurves.cpp b/src/libs/vtools/visualization/path/vistoolpointofintersectioncurves.cpp index 8d570ffbd..a57e39d9a 100644 --- a/src/libs/vtools/visualization/path/vistoolpointofintersectioncurves.cpp +++ b/src/libs/vtools/visualization/path/vistoolpointofintersectioncurves.cpp @@ -40,7 +40,7 @@ #include "../vpatterndb/vcontainer.h" #include "../vwidgets/scalesceneitems.h" #include "../visualization.h" -#include "visualization/path/vispath.h" +#include "../../visualization/path/vispath.h" //--------------------------------------------------------------------------------------------------------------------- VisToolPointOfIntersectionCurves::VisToolPointOfIntersectionCurves(const VContainer *data, QGraphicsItem *parent) diff --git a/src/libs/vtools/vtools.qbs b/src/libs/vtools/vtools.qbs new file mode 100644 index 000000000..409f8b2b9 --- /dev/null +++ b/src/libs/vtools/vtools.qbs @@ -0,0 +1,475 @@ +VLib { + Depends { name: "Qt"; submodules: ["widgets", "xml", "svg"] } + Depends { name: "IFCLib"; } + Depends { name: "VLayoutLib"; } + Depends { name: "VFormatLib"; } + Depends { name: "VWidgetsLib"; } + + name: "VToolsLib" + + Group { + name: "dialogs" + prefix: "dialogs/" + files: [ + "tooldialogs.h", + "tools/dialogalongline.h", + "tools/dialogarc.h", + "tools/dialogarcwithlength.h", + "tools/dialogbisector.h", + "tools/dialogcurveintersectaxis.h", + "tools/dialogcutarc.h", + "tools/dialogcutspline.h", + "tools/dialogcutsplinepath.h", + "tools/dialogendline.h", + "tools/dialogheight.h", + "tools/dialogline.h", + "tools/dialoglineintersect.h", + "tools/dialoglineintersectaxis.h", + "tools/dialognormal.h", + "tools/dialogpointfromarcandtangent.h", + "tools/dialogpointfromcircleandtangent.h", + "tools/dialogpointofcontact.h", + "tools/dialogpointofintersection.h", + "tools/dialogpointofintersectionarcs.h", + "tools/dialogpointofintersectioncircles.h", + "tools/dialogshoulderpoint.h", + "tools/dialogsinglepoint.h", + "tools/dialogspline.h", + "tools/dialogsplinepath.h", + "tools/dialogtool.h", + "tools/dialogtriangle.h", + "tools/dialoguniondetails.h", + "support/dialogeditwrongformula.h", + "support/dialogundo.h", + "tools/dialogtruedarts.h", + "tools/dialogpointofintersectioncurves.h", + "tools/dialogcubicbezier.h", + "tools/dialogcubicbezierpath.h", + "tools/dialoggroup.h", + "tools/dialogrotation.h", + "tools/dialogflippingbyline.h", + "tools/dialogflippingbyaxis.h", + "tools/dialogmove.h", + "tools/dialogellipticalarc.h", + "tools/piece/dialogseamallowance.h", + "tools/piece/dialogpiecepath.h", + "tools/piece/dialogpin.h", + "tools/piece/dialoginsertnode.h", + "support/dialogeditlabel.h", + "tools/piece/dialogplacelabel.h", + "tools/piece/dialogduplicatedetail.h", + "dialogtoolbox.h", + "tools/piece/dialogpatternmaterials.h", + "tools/dialogalongline.cpp", + "tools/dialogarc.cpp", + "tools/dialogarcwithlength.cpp", + "tools/dialogbisector.cpp", + "tools/dialogcurveintersectaxis.cpp", + "tools/dialogcutarc.cpp", + "tools/dialogcutspline.cpp", + "tools/dialogcutsplinepath.cpp", + "tools/dialogendline.cpp", + "tools/dialogheight.cpp", + "tools/dialogline.cpp", + "tools/dialoglineintersect.cpp", + "tools/dialoglineintersectaxis.cpp", + "tools/dialognormal.cpp", + "tools/dialogpointfromarcandtangent.cpp", + "tools/dialogpointfromcircleandtangent.cpp", + "tools/dialogpointofcontact.cpp", + "tools/dialogpointofintersection.cpp", + "tools/dialogpointofintersectionarcs.cpp", + "tools/dialogpointofintersectioncircles.cpp", + "tools/dialogshoulderpoint.cpp", + "tools/dialogsinglepoint.cpp", + "tools/dialogspline.cpp", + "tools/dialogsplinepath.cpp", + "tools/dialogtool.cpp", + "tools/dialogtriangle.cpp", + "tools/dialoguniondetails.cpp", + "support/dialogeditwrongformula.cpp", + "support/dialogundo.cpp", + "tools/dialogtruedarts.cpp", + "tools/dialogpointofintersectioncurves.cpp", + "tools/dialogcubicbezier.cpp", + "tools/dialogcubicbezierpath.cpp", + "tools/dialoggroup.cpp", + "tools/dialogrotation.cpp", + "tools/dialogflippingbyline.cpp", + "tools/dialogflippingbyaxis.cpp", + "tools/dialogmove.cpp", + "tools/dialogellipticalarc.cpp", + "tools/piece/dialogseamallowance.cpp", + "tools/piece/dialogpiecepath.cpp", + "tools/piece/dialogpin.cpp", + "tools/piece/dialoginsertnode.cpp", + "support/dialogeditlabel.cpp", + "tools/piece/dialogplacelabel.cpp", + "tools/piece/dialogduplicatedetail.cpp", + "dialogtoolbox.cpp", + "tools/piece/dialogpatternmaterials.cpp", + "tools/dialogalongline.ui", + "tools/dialogarc.ui", + "tools/dialogarcwithlength.ui", + "tools/dialogbisector.ui", + "tools/dialogcurveintersectaxis.ui", + "tools/dialogcutarc.ui", + "tools/dialogcutspline.ui", + "tools/dialogcutsplinepath.ui", + "tools/dialogendline.ui", + "tools/dialogheight.ui", + "tools/dialogline.ui", + "tools/dialoglineintersect.ui", + "tools/dialoglineintersectaxis.ui", + "tools/dialognormal.ui", + "tools/dialogpointfromarcandtangent.ui", + "tools/dialogpointfromcircleandtangent.ui", + "tools/dialogpointofcontact.ui", + "tools/dialogpointofintersection.ui", + "tools/dialogpointofintersectionarcs.ui", + "tools/dialogpointofintersectioncircles.ui", + "tools/dialogshoulderpoint.ui", + "tools/dialogsinglepoint.ui", + "tools/dialogspline.ui", + "tools/dialogsplinepath.ui", + "tools/dialogtriangle.ui", + "tools/dialoguniondetails.ui", + "support/dialogeditwrongformula.ui", + "support/dialogundo.ui", + "tools/dialogtruedarts.ui", + "tools/dialogpointofintersectioncurves.ui", + "tools/dialogcubicbezier.ui", + "tools/dialogcubicbezierpath.ui", + "tools/dialoggroup.ui", + "tools/dialogrotation.ui", + "tools/dialogflippingbyline.ui", + "tools/dialogflippingbyaxis.ui", + "tools/dialogmove.ui", + "tools/dialogellipticalarc.ui", + "tools/piece/dialogseamallowance.ui", + "tools/piece/dialogpiecepath.ui", + "tools/piece/dialogpin.ui", + "tools/piece/tabs/tabpaths.ui", + "tools/piece/tabs/tablabels.ui", + "tools/piece/tabs/tabgrainline.ui", + "tools/piece/tabs/tabpins.ui", + "tools/piece/dialoginsertnode.ui", + "tools/piece/tabs/tabpassmarks.ui", + "support/dialogeditlabel.ui", + "tools/piece/dialogplacelabel.ui", + "tools/piece/tabs/tabplacelabels.ui", + "tools/piece/dialogduplicatedetail.ui", + "tools/piece/dialogpatternmaterials.ui" + ] + } + + Group { + name: "tools" + prefix: "tools/" + files: [ + "backgroundimage/vbackgroundimagecontrols.h", + "backgroundimage/vbackgroundpixmapitem.h", + "backgroundimage/vbackgroundsvgitem.h", + "toolsdef.h", + "backgroundimage/vbackgroundimageitem.h", + "vdatatool.h", + "vabstracttool.h", + "drawTools/toolpoint/toolsinglepoint/vtooltriangle.h", + "drawTools/toolcurve/vtoolsplinepath.h", + "drawTools/toolcurve/vtoolspline.h", + "drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.h", + "drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.h", + "drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.h", + "drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.h", + "drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h", + "drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.h", + "drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.h", + "drawTools/toolpoint/toolsinglepoint/vtoollineintersect.h", + "drawTools/vtoolline.h", + "drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.h", + "drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.h", + "drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.h", + "drawTools/toolcurve/vtoolarc.h", + "drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.h", + "drawTools/vdrawtool.h", + "nodeDetails/vnodesplinepath.h", + "nodeDetails/vnodespline.h", + "nodeDetails/vnodepoint.h", + "nodeDetails/vnodearc.h", + "nodeDetails/vabstractnode.h", + "drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.h", + "drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.h", + "vtooluniondetails.h", + "drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.h", + "drawTools/toolcurve/vabstractspline.h", + "drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.h", + "drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.h", + "drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h", + "drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.h", + "drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.h", + "drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.h", + "drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.h", + "drawTools/toolcurve/vtoolarcwithlength.h", + "drawTools/toolpoint/vabstractpoint.h", + "drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.h", + "drawTools/toolpoint/tooldoublepoint/vtooltruedarts.h", + "drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.h", + "drawTools/toolcurve/vtoolcubicbezier.h", + "drawTools/toolcurve/vtoolcubicbezierpath.h", + "drawTools/operation/vtoolrotation.h", + "drawTools/operation/flipping/vtoolflippingbyline.h", + "drawTools/operation/vabstractoperation.h", + "drawTools/operation/flipping/vtoolflippingbyaxis.h", + "drawTools/operation/flipping/vabstractflipping.h", + "drawTools/operation/vtoolmove.h", + "drawTools/toolcurve/vtoolellipticalarc.h", + "nodeDetails/vnodeellipticalarc.h", + "vtoolseamallowance.h", + "nodeDetails/vtoolpiecepath.h", + "nodeDetails/vtoolpin.h", + "vinteractivetool.h", + "nodeDetails/vtoolplacelabel.h", + "backgroundimage/vbackgroundimagecontrols.cpp", + "backgroundimage/vbackgroundpixmapitem.cpp", + "backgroundimage/vbackgroundsvgitem.cpp", + "toolsdef.cpp", + "backgroundimage/vbackgroundimageitem.cpp", + "vdatatool.cpp", + "vabstracttool.cpp", + "drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp", + "drawTools/toolcurve/vtoolsplinepath.cpp", + "drawTools/toolcurve/vtoolspline.cpp", + "drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp", + "drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp", + "drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp", + "drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp", + "drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp", + "drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp", + "drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp", + "drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp", + "drawTools/vtoolline.cpp", + "drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp", + "drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp", + "drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp", + "drawTools/toolcurve/vtoolarc.cpp", + "drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp", + "drawTools/vdrawtool.cpp", + "nodeDetails/vnodesplinepath.cpp", + "nodeDetails/vnodespline.cpp", + "nodeDetails/vnodepoint.cpp", + "nodeDetails/vnodearc.cpp", + "nodeDetails/vabstractnode.cpp", + "drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp", + "drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp", + "vtooluniondetails.cpp", + "drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp", + "drawTools/toolcurve/vabstractspline.cpp", + "drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.cpp", + "drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp", + "drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp", + "drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp", + "drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp", + "drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp", + "drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp", + "drawTools/toolcurve/vtoolarcwithlength.cpp", + "drawTools/toolpoint/vabstractpoint.cpp", + "drawTools/toolpoint/tooldoublepoint/vtooldoublepoint.cpp", + "drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp", + "drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp", + "drawTools/toolcurve/vtoolcubicbezier.cpp", + "drawTools/toolcurve/vtoolcubicbezierpath.cpp", + "drawTools/operation/vtoolrotation.cpp", + "drawTools/operation/flipping/vtoolflippingbyline.cpp", + "drawTools/operation/vabstractoperation.cpp", + "drawTools/operation/flipping/vtoolflippingbyaxis.cpp", + "drawTools/operation/flipping/vabstractflipping.cpp", + "drawTools/operation/vtoolmove.cpp", + "drawTools/toolcurve/vtoolellipticalarc.cpp", + "nodeDetails/vnodeellipticalarc.cpp", + "vtoolseamallowance.cpp", + "nodeDetails/vtoolpiecepath.cpp", + "nodeDetails/vtoolpin.cpp", + "vinteractivetool.cpp", + "nodeDetails/vtoolplacelabel.cpp" + ] + } + + Group { + name: "undocommands" + prefix: "undocommands/" + files: [ + "addtocalc.h", + "addpatternpiece.h", + "image/addbackgroundimage.h", + "image/deletebackgroundimage.h", + "image/hideallbackgroundimages.h", + "image/hidebackgroundimage.h", + "image/holdallbackgroundimages.h", + "image/holdbackgroundimage.h", + "image/movebackgroundimage.h", + "image/opaquebackgroundimage.h", + "image/renamebackgroundimage.h", + "image/resetbackgroundimage.h", + "image/rotatebackgroundimage.h", + "image/scalebackgroundimage.h", + "image/zvaluemovebackgroundimage.h", + "movespoint.h", + "movespline.h", + "movesplinepath.h", + "savetooloptions.h", + "deltool.h", + "deletepatternpiece.h", + "undogroup.h", + "vundocommand.h", + "renamepp.h", + "label/movelabel.h", + "label/movedoublelabel.h", + "label/moveabstractlabel.h", + "label/operationmovelabel.h", + "addpiece.h", + "deletepiece.h", + "movepiece.h", + "savepieceoptions.h", + "savepiecepathoptions.h", + "label/showlabel.h", + "label/showdoublelabel.h", + "label/operationshowlabel.h", + "saveplacelabeloptions.h", + "togglepiecestate.h", + "addtocalc.cpp", + "addpatternpiece.cpp", + "image/addbackgroundimage.cpp", + "image/deletebackgroundimage.cpp", + "image/hideallbackgroundimages.cpp", + "image/hidebackgroundimage.cpp", + "image/holdallbackgroundimages.cpp", + "image/holdbackgroundimage.cpp", + "image/movebackgroundimage.cpp", + "image/opaquebackgroundimage.cpp", + "image/renamebackgroundimage.cpp", + "image/resetbackgroundimage.cpp", + "image/rotatebackgroundimage.cpp", + "image/scalebackgroundimage.cpp", + "image/zvaluemovebackgroundimage.cpp", + "movespoint.cpp", + "movespline.cpp", + "movesplinepath.cpp", + "savetooloptions.cpp", + "deltool.cpp", + "deletepatternpiece.cpp", + "undogroup.cpp", + "vundocommand.cpp", + "renamepp.cpp", + "label/movelabel.cpp", + "label/movedoublelabel.cpp", + "label/moveabstractlabel.cpp", + "label/operationmovelabel.cpp", + "addpiece.cpp", + "deletepiece.cpp", + "movepiece.cpp", + "savepieceoptions.cpp", + "savepiecepathoptions.cpp", + "label/showlabel.cpp", + "label/showdoublelabel.cpp", + "label/operationshowlabel.cpp", + "saveplacelabeloptions.cpp", + "togglepiecestate.cpp", + ] + } + + Group { + name: "visualization" + prefix: "visualization/" + files: [ + "visualization.h", + "line/visline.h", + "line/vistoolline.h", + "line/vistoolendline.h", + "line/vistoolalongline.h", + "line/vistoolbisector.h", + "line/vistoolshoulderpoint.h", + "line/vistoolnormal.h", + "line/vistoolheight.h", + "line/vistoolpointofintersection.h", + "line/vistooltriangle.h", + "line/vistoolpointofcontact.h", + "line/vistoollineintersect.h", + "line/vistoollineintersectaxis.h", + "line/vistooltruedarts.h", + "line/vistoolcurveintersectaxis.h", + "line/vistoolpointofintersectionarcs.h", + "line/vistoolpointofintersectioncircles.h", + "line/vistoolpointfromcircleandtangent.h", + "line/vistoolpointfromarcandtangent.h", + "line/operation/vistoolrotation.h", + "line/operation/vistoolflippingbyline.h", + "path/vispath.h", + "path/vistoolarc.h", + "path/vistoolcutarc.h", + "path/vistoolspline.h", + "path/vistoolcutspline.h", + "path/vistoolsplinepath.h", + "path/vistoolcutsplinepath.h", + "path/vistoolarcwithlength.h", + "path/vistoolpointofintersectioncurves.h", + "path/vistoolcubicbezier.h", + "path/vistoolcubicbezierpath.h", + "line/operation/visoperation.h", + "line/operation/vistoolflippingbyaxis.h", + "line/operation/vistoolmove.h", + "path/vistoolellipticalarc.h", + "path/vistoolpiece.h", + "path/vistoolpiecepath.h", + "path/vispiecespecialpoints.h", + "line/vistoolspecialpoint.h", + "path/vistoolduplicatedetail.h", + "visualization.cpp", + "line/visline.cpp", + "line/vistoolline.cpp", + "line/vistoolendline.cpp", + "line/vistoolalongline.cpp", + "line/vistoolbisector.cpp", + "line/vistoolshoulderpoint.cpp", + "line/vistoolnormal.cpp", + "line/vistoolheight.cpp", + "line/vistoolpointofintersection.cpp", + "line/vistooltriangle.cpp", + "line/vistoolpointofcontact.cpp", + "line/vistoollineintersect.cpp", + "line/vistoollineintersectaxis.cpp", + "line/vistooltruedarts.cpp", + "line/vistoolcurveintersectaxis.cpp", + "line/vistoolpointofintersectionarcs.cpp", + "line/vistoolpointofintersectioncircles.cpp", + "line/vistoolpointfromcircleandtangent.cpp", + "line/vistoolpointfromarcandtangent.cpp", + "line/operation/vistoolrotation.cpp", + "line/operation/vistoolflippingbyline.cpp", + "path/vispath.cpp", + "path/vistoolarc.cpp", + "path/vistoolcutarc.cpp", + "path/vistoolspline.cpp", + "path/vistoolcutspline.cpp", + "path/vistoolsplinepath.cpp", + "path/vistoolcutsplinepath.cpp", + "path/vistoolarcwithlength.cpp", + "path/vistoolpointofintersectioncurves.cpp", + "path/vistoolcubicbezier.cpp", + "path/vistoolcubicbezierpath.cpp", + "line/operation/visoperation.cpp", + "line/operation/vistoolflippingbyaxis.cpp", + "line/operation/vistoolmove.cpp", + "path/vistoolellipticalarc.cpp", + "path/vistoolpiece.cpp", + "path/vistoolpiecepath.cpp", + "path/vispiecespecialpoints.cpp", + "line/vistoolspecialpoint.cpp", + "path/vistoolduplicatedetail.cpp" + ] + } + + Export { + Depends { name: "cpp" } + cpp.includePaths: [exportingProduct.sourceDirectory] + } +} diff --git a/src/libs/vwidgets/qtcolorpicker.cpp b/src/libs/vwidgets/qtcolorpicker.cpp index c4d143ae0..be52abcd6 100644 --- a/src/libs/vwidgets/qtcolorpicker.cpp +++ b/src/libs/vwidgets/qtcolorpicker.cpp @@ -682,7 +682,7 @@ auto ColorPickerPopup::CustomItems() const ->QVector for (auto *item : items) { - if (item!= nullptr && item->text() == tr("Custom")) + if (item!= nullptr && item->text() == QCoreApplication::translate("ColorPickerPopup", "Custom")) { customItems.append(item); } diff --git a/src/libs/vwidgets/stable.h b/src/libs/vwidgets/stable.h index 86a62d003..927f68493 100644 --- a/src/libs/vwidgets/stable.h +++ b/src/libs/vwidgets/stable.h @@ -38,13 +38,45 @@ /* Add C++ includes here */ #ifdef QT_CORE_LIB -#include +# include #endif #ifdef QT_GUI_LIB # include #endif +#ifdef QT_XML_LIB +# include +#endif + +#ifdef QT_WINEXTRAS_LIB +# include +#endif + +#ifdef QT_WIDGETS_LIB +# include +#endif + +#ifdef QT_SVG_LIB +# include +#endif + +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif + +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include +#endif + #endif/*__cplusplus*/ #endif // STABLE_H diff --git a/src/libs/vwidgets/vwidgets.qbs b/src/libs/vwidgets/vwidgets.qbs new file mode 100644 index 000000000..1f68787a9 --- /dev/null +++ b/src/libs/vwidgets/vwidgets.qbs @@ -0,0 +1,68 @@ +VLib { + Depends { name: "Qt"; submodules: ["widgets"] } + Depends { name: "VMiscLib" } + Depends { name: "VPropertyExplorerLib" } + + name: "VWidgetsLib" + files: [ + "qtcolorpicker.cpp", + "vcomboboxdelegate.cpp", + "vdecorationaligningdelegate.cpp", + "velidedlabel.cpp", + "vmaingraphicsscene.cpp", + "vmaingraphicsview.cpp", + "vwidgetpopup.cpp", + "vcontrolpointspline.cpp", + "vgraphicssimpletextitem.cpp", + "vsimplepoint.cpp", + "vabstractsimple.cpp", + "vnobrushscalepathitem.cpp", + "vsimplecurve.cpp", + "vabstractmainwindow.cpp", + "vtextgraphicsitem.cpp", + "vgrainlineitem.cpp", + "vpieceitem.cpp", + "fancytabbar/fancytab.cpp", + "fancytabbar/fancytabbar.cpp", + "fancytabbar/stylehelper.cpp", + "vcurvepathitem.cpp", + "global.cpp", + "vscenepoint.cpp", + "scalesceneitems.cpp", + "vlineedit.cpp", + "vplaintextedit.cpp", + "vhighlighter.cpp", + "qtcolorpicker.h", + "vcomboboxdelegate.h", + "vdecorationaligningdelegate.h", + "velidedlabel.h", + "vmaingraphicsscene.h", + "vmaingraphicsview.h", + "vwidgetpopup.h", + "vcontrolpointspline.h", + "vgraphicssimpletextitem.h", + "vsimplepoint.h", + "vabstractsimple.h", + "vnobrushscalepathitem.h", + "vsimplecurve.h", + "vabstractmainwindow.h", + "vtextgraphicsitem.h", + "vgrainlineitem.h", + "vpieceitem.h", + "fancytabbar/fancytab.h", + "fancytabbar/fancytabbar.h", + "fancytabbar/stylehelper.h", + "vcurvepathitem.h", + "global.h", + "vscenepoint.h", + "scalesceneitems.h", + "vlineedit.h", + "vplaintextedit.h", + "vhighlighter.h" + ] + + Export { + Depends { name: "cpp" } + cpp.includePaths: [exportingProduct.sourceDirectory] + } +} diff --git a/src/src.qbs b/src/src.qbs new file mode 100644 index 000000000..ca15a733e --- /dev/null +++ b/src/src.qbs @@ -0,0 +1,7 @@ +Project { + references: [ + "app/app.qbs", + "libs/libs.qbs", + "test/test.qbs", + ] +} diff --git a/src/test/CollectionTest/CollectionTest.qbs b/src/test/CollectionTest/CollectionTest.qbs new file mode 100644 index 000000000..228abf5f9 --- /dev/null +++ b/src/test/CollectionTest/CollectionTest.qbs @@ -0,0 +1,176 @@ +import qbs.FileInfo +import qbs.File + +VTestApp { + Depends { name: "buildconfig" } + Depends { name: "Qt"; submodules: ["testlib", "gui", "printsupport"] } + Depends { name: "VTestLib" } + + name: "CollectionTest" + buildconfig.appTarget: qbs.targetOS.contains("macos") ? "CollectionTest" : "collectionTest" + targetName: buildconfig.appTarget + type: base.concat("tst_files") + + files: [ + "qttestmainlambda.cpp", + "tst_tapecommandline.cpp", + "tst_valentinacommandline.cpp", + "tst_tapecommandline.h", + "tst_valentinacommandline.h", + ] + + Group { + name: "Tape test files" + prefix: "tst_tape/" + files: [ + "keiko.vit", + "empty.vit", + "all_measurements_v0.3.0.vit", + "all_measurements_v0.4.0.vst", + "GOST_man_ru_v0.3.0.vst", + "all_measurements_v0.3.3.vit", + "all_measurements_v0.4.2.vst", + "GOST_man_ru_v0.4.2.vst", + "broken1.vit", + "broken2.vit", + "broken3.vit", + "broken4.vit", + "text.vit", + "text.vst" + ] + fileTags: ["tst_tape_files"] + } + + Group { + name: "Valentina test files" + prefix: "tst_valentina/" + files: [ + "empty.val", + "issue_372.val", + "wrong_obj_type.val", + "text.val", + "issue_256.val", + "issue_256_wrong_path.val", + "issue_256_correct.vit", + "issue_256_wrong.vit", + "issue_256_correct.vst", + "wrong_formula.val", + "test_pedantic.val" + ] + fileTags: ["tst_valentina_files"] + } + + Group { + name: "Collection files" + prefix: project.sourceDirectory + "/src/app/share/" + files: [ + "collection/bra.val", + "collection/bra.vit", + "collection/jacketM1_52-176.val", + "collection/jacketM2_40-146.val", + "collection/jacketM3_40-146.val", + "collection/jacketM4_40-146.val", + "collection/jacketM5_30-110.val", + "collection/jacketM6_30-110.val", + "collection/pantsM1_52-176.val", + "collection/pantsM2_40-146.val", + "collection/pantsM7.val", + "collection/TShirt_test.val", + "collection/TestDart.val", + "collection/pattern_blusa.val", + "collection/blusa.vit", + "collection/PajamaTopWrap2.val", + "collection/Susan.vit", + "collection/Moulage_0.5_armhole_neckline.val", + "collection/0.7_Armhole_adjustment_0.10.val", + "collection/my_calculated_measurements_for_val.vit", + "collection/Keiko_skirt.val", + "collection/keiko.vit", + "collection/medidas_eli2015.vit", + "collection/pantalon_base_Eli.val", + "collection/Razmernye_priznaki_dlya_zhenskogo_zhaketa.vit", + "collection/IMK_Zhaketa_poluprilegayuschego_silueta.val", + "collection/Lara_Jil.vit", + "collection/modell_2.val", + "collection/MaleShirt/MaleShirt.val", + "collection/MaleShirt/MaleShirt.vit", + "collection/Trousers/Trousers.val", + "collection/Trousers/trousers.vit", + "collection/Steampunk_trousers.val", + "collection/Steampunk_trousers.vit", + "collection/Basic_block_women-2016.val", + "collection/Gent_Jacket_with_tummy.val", + "tables/multisize/GOST_man_ru.vst" + ] + fileTags: ["tst_collection_files"] + } + + Rule { + multiplex: true +// alwaysRun: true + inputs: ["tst_tape_files", "tst_valentina_files", "tst_collection_files"] + outputFileTags: ["tst_files"] + outputArtifacts: { + var artifactNames = inputs["tst_valentina_files"].map(function(file){ + return FileInfo.joinPaths(product.buildDirectory, "tst_valentina", file.fileName); + }); + + artifactNames = artifactNames.concat(inputs["tst_collection_files"].map(function(file){ + return FileInfo.joinPaths(product.buildDirectory, "tst_valentina_collection", file.fileName); + })); + + artifactNames = artifactNames.concat(inputs["tst_tape_files"].map(function(file){ + return FileInfo.joinPaths(product.buildDirectory, "tst_tape", file.fileName); + })); + + var artifacts = artifactNames.map(function(art){ + var a = { + filePath: art, + fileTags: ["tst_files"] + } + return a; + }); + return artifacts; + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "Preparing Valentina test file"; + cmd.highlight = "filegen"; + + var sources = inputs["tst_valentina_files"].map(function(file) { + return file.filePath; + }); + + sources = sources.concat(inputs["tst_collection_files"].map(function(file) { + return file.filePath; + })); + + sources = sources.concat(inputs["tst_tape_files"].map(function(file) { + return file.filePath; + })); + + cmd.sources = sources; + + var destination = inputs["tst_valentina_files"].map(function(file) { + return FileInfo.joinPaths(product.buildDirectory, "tst_valentina", file.fileName); + }); + + destination = destination.concat(inputs["tst_collection_files"].map(function(file) { + return FileInfo.joinPaths(product.buildDirectory, "tst_valentina_collection", file.fileName); + })); + + destination = destination.concat(inputs["tst_tape_files"].map(function(file) { + return FileInfo.joinPaths(product.buildDirectory, "tst_tape", file.fileName); + })); + + cmd.destination = destination; + + cmd.sourceCode = function() { + for (var i in sources) { + File.copy(sources[i], destination[i]); + } + }; + return [cmd]; + } + } +} diff --git a/src/test/CollectionTest/stable.h b/src/test/CollectionTest/stable.h index 80f208570..b9f7c0985 100644 --- a/src/test/CollectionTest/stable.h +++ b/src/test/CollectionTest/stable.h @@ -51,29 +51,37 @@ # include #endif -//In Windows you can't use same header in all modes. -#if !defined(Q_OS_WIN) -# ifdef QT_WIDGETS_LIB -# include -# endif +#ifdef QT_TESTLIB_LIB +# include +#endif -# ifdef QT_SVG_LIB -# include -# endif +#ifdef QT_WINEXTRAS_LIB +# include +#endif -# ifdef QT_PRINTSUPPORT_LIB -# include -# endif +#ifdef QT_WIDGETS_LIB +# include +#endif - //Build doesn't work, if include this headers on Windows. -# ifdef QT_XMLPATTERNS_LIB -# include -# endif +#ifdef QT_SVG_LIB +# include +#endif -# ifdef QT_NETWORK_LIB -# include -# endif -#endif/*Q_OS_WIN*/ +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif + +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include +#endif #endif /*__cplusplus*/ diff --git a/src/test/ParserTest/ParserTest.qbs b/src/test/ParserTest/ParserTest.qbs new file mode 100644 index 000000000..a00289df3 --- /dev/null +++ b/src/test/ParserTest/ParserTest.qbs @@ -0,0 +1,13 @@ +VTestApp { + Depends { name: "buildconfig" } + Depends { name: "QMUParserLib" } + + name: "ParserTest" + buildconfig.appTarget: qbs.targetOS.contains("macos") ? "ParserTest" : "parserTest" + targetName: buildconfig.appTarget + consoleApplication: true + + files: [ + "main.cpp" + ] +} diff --git a/src/test/ParserTest/main.cpp b/src/test/ParserTest/main.cpp index 67a217937..ee0c65a98 100644 --- a/src/test/ParserTest/main.cpp +++ b/src/test/ParserTest/main.cpp @@ -32,7 +32,7 @@ #include "../qmuparser/qmuparsertest.h" //--------------------------------------------------------------------------------------------------------------------- -void testMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) +inline void testMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) { QByteArray localMsg = msg.toLocal8Bit(); switch (type) diff --git a/src/test/ParserTest/stable.h b/src/test/ParserTest/stable.h index ca13ddf6c..96c9967eb 100644 --- a/src/test/ParserTest/stable.h +++ b/src/test/ParserTest/stable.h @@ -38,7 +38,47 @@ /* Add C++ includes here */ #ifdef QT_CORE_LIB -#include +# include +#endif + +#ifdef QT_GUI_LIB +# include +#endif + +#ifdef QT_XML_LIB +# include +#endif + +#ifdef QT_TESTLIB_LIB +# include +#endif + +#ifdef QT_WINEXTRAS_LIB +# include +#endif + +#ifdef QT_WIDGETS_LIB +# include +#endif + +#ifdef QT_SVG_LIB +# include +#endif + +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif + +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include #endif #endif diff --git a/src/test/TranslationsTest/TranslationsTest.qbs b/src/test/TranslationsTest/TranslationsTest.qbs new file mode 100644 index 000000000..ea1804a95 --- /dev/null +++ b/src/test/TranslationsTest/TranslationsTest.qbs @@ -0,0 +1,31 @@ +import qbs.FileInfo + +VTestApp { + Depends { name: "buildconfig" } + Depends { name: "VTestLib" } + Depends { name: "Qt"; submodules: ["testlib", "xml", "gui", "printsupport"] } + + name: "TranslationsTest" + buildconfig.appTarget: qbs.targetOS.contains("macos") ? "TranslationsTest" : "translationsTest" + targetName: buildconfig.appTarget + + files: [ + "qttestmainlambda.cpp", + "tst_measurementregexp.cpp", + "tst_qmuparsererrormsg.cpp", + "tst_tstranslation.cpp", + "tst_buitinregexp.cpp", + "tst_abstractregexp.cpp", + "tst_tslocaletranslation.cpp", + "tst_abstracttranslation.cpp", + "tst_measurementregexp.h", + "tst_qmuparsererrormsg.h", + "tst_tstranslation.h", + "tst_buitinregexp.h", + "tst_abstractregexp.h", + "tst_tslocaletranslation.h", + "tst_abstracttranslation.h", + ] + + cpp.defines: 'TS_DIR="' + FileInfo.joinPaths(project.sourceDirectory, "share", "translations") + '"' +} diff --git a/src/test/TranslationsTest/stable.h b/src/test/TranslationsTest/stable.h index ef1144077..82ed14435 100644 --- a/src/test/TranslationsTest/stable.h +++ b/src/test/TranslationsTest/stable.h @@ -51,29 +51,37 @@ # include #endif -//In Windows you can't use same header in all modes. -#if !defined(Q_OS_WIN) -# ifdef QT_WIDGETS_LIB -# include -# endif +#ifdef QT_TESTLIB_LIB +# include +#endif -# ifdef QT_SVG_LIB -# include -# endif +#ifdef QT_WINEXTRAS_LIB +# include +#endif -# ifdef QT_PRINTSUPPORT_LIB -# include -# endif +#ifdef QT_WIDGETS_LIB +# include +#endif - //Build doesn't work, if include this headers on Windows. -# ifdef QT_XMLPATTERNS_LIB -# include -# endif +#ifdef QT_SVG_LIB +# include +#endif -# ifdef QT_NETWORK_LIB -# include -# endif -#endif/*Q_OS_WIN*/ +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif + +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include +#endif #endif /*__cplusplus*/ diff --git a/src/test/ValentinaTest/ValentinaTest.qbs b/src/test/ValentinaTest/ValentinaTest.qbs new file mode 100644 index 000000000..6f08262cd --- /dev/null +++ b/src/test/ValentinaTest/ValentinaTest.qbs @@ -0,0 +1,73 @@ +VTestApp { + Depends { name: "buildconfig" } + Depends { name: "VTestLib" } + Depends { name: "Qt"; submodules: ["testlib"] } + Depends { name: "VToolsLib" } + Depends { name: "VGeometryLib" } + Depends { name: "IFCLib" } + Depends { name: "VDXFLib" } + Depends { name: "VFormatLib" } + Depends { name: "ebr" } + + name: "ValentinaTest" + buildconfig.appTarget: qbs.targetOS.contains("macos") ? "ValentinaTest" : "valentinaTest" + targetName: buildconfig.appTarget + + files: [ + "qttestmainlambda.cpp", + "tst_dxf.cpp", + "tst_vdomdocument.cpp", + "tst_vposter.cpp", + "tst_vspline.cpp", + "tst_nameregexp.cpp", + "tst_vlayoutdetail.cpp", + "tst_varc.cpp", + "tst_qmutokenparser.cpp", + "tst_vmeasurements.cpp", + "tst_vlockguard.cpp", + "tst_misc.cpp", + "tst_vcommandline.cpp", + "tst_vpiece.cpp", + "tst_vabstractcurve.cpp", + "tst_findpoint.cpp", + "tst_vellipticalarc.cpp", + "tst_vcubicbezierpath.cpp", + "tst_vgobject.cpp", + "tst_vsplinepath.cpp", + "tst_vpointf.cpp", + "tst_readval.cpp", + "tst_vtranslatevars.cpp", + "tst_vabstractpiece.cpp", + "tst_vtooluniondetails.cpp", + "tst_dxf.h", + "tst_vdomdocument.h", + "tst_vposter.h", + "tst_vspline.h", + "tst_nameregexp.h", + "tst_vlayoutdetail.h", + "tst_varc.h", + "tst_qmutokenparser.h", + "tst_vmeasurements.h", + "tst_vlockguard.h", + "tst_misc.h", + "tst_vcommandline.h", + "tst_vpiece.h", + "tst_vabstractcurve.h", + "tst_findpoint.h", + "tst_vellipticalarc.h", + "tst_vcubicbezierpath.h", + "tst_vgobject.h", + "tst_vsplinepath.h", + "tst_vpointf.h", + "tst_readval.h", + "tst_vtranslatevars.h", + "tst_vabstractpiece.h", + "tst_vtooluniondetails.h", + ] + + Group { + name: "Test data" + files: "share/test_data.qrc" + fileTags: "ebr.external_qrc" + } +} diff --git a/src/test/ValentinaTest/stable.h b/src/test/ValentinaTest/stable.h index 580aa712e..14e519112 100644 --- a/src/test/ValentinaTest/stable.h +++ b/src/test/ValentinaTest/stable.h @@ -51,29 +51,37 @@ # include #endif -//In Windows you can't use same header in all modes. -#if !defined(Q_OS_WIN) -# ifdef QT_WIDGETS_LIB -# include -# endif +#ifdef QT_TESTLIB_LIB +# include +#endif -# ifdef QT_SVG_LIB -# include -# endif +#ifdef QT_WINEXTRAS_LIB +# include +#endif -# ifdef QT_PRINTSUPPORT_LIB -# include -# endif +#ifdef QT_WIDGETS_LIB +# include +#endif - //Build doesn't work, if include this headers on Windows. -# ifdef QT_XMLPATTERNS_LIB -# include -# endif +#ifdef QT_SVG_LIB +# include +#endif -# ifdef QT_NETWORK_LIB -# include -# endif -#endif/*Q_OS_WIN*/ +#ifdef QT_PRINTSUPPORT_LIB +# include +#endif + +#ifdef QT_XMLPATTERNS_LIB +# include +#endif + +#ifdef QT_NETWORK_LIB +# include +#endif + +#ifdef QT_CONCURRENT_LIB +# include +#endif #endif /*__cplusplus*/ diff --git a/src/test/test.qbs b/src/test/test.qbs new file mode 100644 index 000000000..437daf349 --- /dev/null +++ b/src/test/test.qbs @@ -0,0 +1,8 @@ +Project { + references: [ + "ParserTest/ParserTest.qbs", + "ValentinaTest/ValentinaTest.qbs", + "TranslationsTest/TranslationsTest.qbs", + "CollectionTest/CollectionTest.qbs" + ] +} diff --git a/valentina.qbs b/valentina.qbs new file mode 100644 index 000000000..38c2f2971 --- /dev/null +++ b/valentina.qbs @@ -0,0 +1,12 @@ +Project { + name: "Valentina" + minimumQbsVersion: "1.16" + references: [ + "src/src.qbs", + "share/translations/translations.qbs", + "share/translations/measurements.qbs", + ] + qbsSearchPaths: "qbs" + + AutotestRunner {} +}
%6: %7