Long life tape.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2015-07-10 12:49:37 +03:00
parent d4804a700e
commit 4cecde8941
9 changed files with 446 additions and 1 deletions

View file

@ -1,3 +1,4 @@
TEMPLATE = subdirs
SUBDIRS = \
valentina
valentina \
tape

39
src/app/tape/main.cpp Normal file
View file

@ -0,0 +1,39 @@
/************************************************************************
**
** @file main.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 10 7, 2015
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2015 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#include "tmainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
TMainWindow w;
w.show();
return a.exec();
}

30
src/app/tape/stable.cpp Normal file
View file

@ -0,0 +1,30 @@
/************************************************************************
**
** @file stable.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date November 15, 2013
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2013-2015 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
// Build the precompiled headers.
#include "stable.h"

74
src/app/tape/stable.h Normal file
View file

@ -0,0 +1,74 @@
/************************************************************************
**
** @file stable.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date November 15, 2013
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2013-2015 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef STABLE_H
#define STABLE_H
/* I like to include this pragma too, so the build log indicates if pre-compiled headers were in use. */
#ifndef __clang__
#pragma message("Compiling precompiled headers for tape utility.\n")
#endif
/* Add C includes here */
#if defined __cplusplus
/* Add C++ includes here */
#include <csignal>
/*In all cases we need include core header for getting defined values*/
#ifdef QT_CORE_LIB
# include <QtCore>
#endif
#ifdef QT_GUI_LIB
# include <QtGui>
#endif
#ifdef QT_XML_LIB
# include <QtXml>
#endif
//In Windows you can't use same header in all modes.
#if !defined(Q_OS_WIN)
# ifdef QT_WIDGETS_LIB
# include <QtWidgets>
# endif
//Build doesn't work, if include this headers on Windows.
# ifdef QT_XMLPATTERNS_LIB
# include <QtXmlPatterns>
# endif
# ifdef QT_NETWORK_LIB
# include <QtNetwork>
# endif
#endif/*Q_OS_WIN*/
#endif /*__cplusplus*/
#endif // STABLE_H

14
src/app/tape/tape.pri Normal file
View file

@ -0,0 +1,14 @@
# ADD TO EACH PATH $$PWD VARIABLE!!!!!!
# This need for corect working file translations.pro
SOURCES += \
$$PWD/main.cpp \
$$PWD/tmainwindow.cpp \
$$PWD/stable.cpp
HEADERS += \
$$PWD/tmainwindow.h \
$$PWD/stable.h
FORMS += \
$$PWD/tmainwindow.ui

167
src/app/tape/tape.pro Normal file
View file

@ -0,0 +1,167 @@
#-------------------------------------------------
#
# Project created by QtCreator 2015-07-07T14:35:12
#
#-------------------------------------------------
# File with common stuff for whole project
include(../../../common.pri)
QT += core gui widgets
# Name of binary file
TARGET = tape
# We want create executable file
TEMPLATE = app
# Use out-of-source builds (shadow builds)
CONFIG -= debug_and_release debug_and_release_target
# We use C++11 standard
CONFIG += c++11
# 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.
DEFINES += QT_MESSAGELOGCONTEXT
# Directory for executable file
DESTDIR = bin
# Directory for files created moc
MOC_DIR = moc
# Directory for objecs files
OBJECTS_DIR = obj
# Directory for files created rcc
RCC_DIR = rcc
# Directory for files created uic
UI_DIR = uic
# Suport subdirectories. Just better project code tree.
include(tape.pri)
# Set using ccache. Function enable_ccache() defined in common.pri.
macx {
CONFIG(debug, debug|release){
$$enable_ccache()# Use only in debug mode on Mac
}
} else {
$$enable_ccache()
}
# Set precompiled headers. Function set_PCH() defined in common.pri.
$$set_PCH()
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
}
} else {
*-g++{
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
}
}
#Calculate latest tag distance and build revision only in release mode. Change number each time requare
#recompilation precompiled headers file.
DEFINES += "LATEST_TAG_DISTANCE=0"
DEFINES += "BUILD_REVISION=\\\"unknown\\\""
}else{
# Release mode
DEFINES += V_NO_ASSERT
!unix:*-g++{
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
}
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
# do nothing
} else {
# Turn on debug symbols in release mode on Unix systems.
# On Mac OS X temporarily disabled. Need find way how to strip binary file.
!macx:!win32-msvc*{
QMAKE_CXXFLAGS_RELEASE += -g -gdwarf-3
QMAKE_CFLAGS_RELEASE += -g -gdwarf-3
QMAKE_LFLAGS_RELEASE =
}
}
macx{
HG = /usr/local/bin/hg # Can't defeat PATH variable on Mac OS.
}else {
HG = hg # All other platforms all OK.
}
#latest tag distance number for using in version
HG_DISTANCE=$$system($${HG} log -r. --template '{latesttagdistance}')
isEmpty(HG_DISTANCE){
HG_DISTANCE = 0 # if we can't find local revision left 0.
}
message("Latest tag distance:" $${HG_DISTANCE})
DEFINES += "LATEST_TAG_DISTANCE=$${HG_DISTANCE}" # Make available latest tag distance number in sources.
#build revision number for using in version
unix {
HG_HESH=$$system("$${HG} log -r. --template '{node|short}'")
} else {
# Use escape character before "|" on Windows
HG_HESH=$$system($${HG} log -r. --template "{node^|short}")
}
isEmpty(HG_HESH){
HG_HESH = "unknown" # if we can't find build revision left unknown.
}
message("Build revision:" $${HG_HESH})
DEFINES += "BUILD_REVISION=\\\"$${HG_HESH}\\\"" # Make available build revision number in sources.
}
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
# do nothing
} else {
noStripDebugSymbols { # For enable run qmake with CONFIG+=noStripDebugSymbols
# do nothing
} else {
# Strip after you link all libaries.
CONFIG(release, debug|release){
win32:!win32-msvc*{
# Strip debug symbols.
QMAKE_POST_LINK += objcopy --only-keep-debug bin/${TARGET} bin/${TARGET}.dbg &&
QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} &&
QMAKE_POST_LINK += objcopy --add-gnu-debuglink="bin/${TARGET}.dbg" bin/${TARGET}
}
unix:!macx{
# Strip debug symbols.
QMAKE_POST_LINK += objcopy --only-keep-debug ${TARGET} ${TARGET}.dbg &&
QMAKE_POST_LINK += objcopy --strip-debug ${TARGET} &&
QMAKE_POST_LINK += objcopy --add-gnu-debuglink="${TARGET}.dbg" ${TARGET}
}
}
}
}

View file

@ -0,0 +1,44 @@
/************************************************************************
**
** @file tmainwindow.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 10 7, 2015
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2015 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#include "tmainwindow.h"
#include "ui_tmainwindow.h"
//---------------------------------------------------------------------------------------------------------------------
TMainWindow::TMainWindow(QWidget *parent)
:QMainWindow(parent),
ui(new Ui::TMainWindow)
{
ui->setupUi(this);
}
//---------------------------------------------------------------------------------------------------------------------
TMainWindow::~TMainWindow()
{
delete ui;
}

View file

@ -0,0 +1,52 @@
/************************************************************************
**
** @file tmainwindow.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 10 7, 2015
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2015 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef TMAINWINDOW_H
#define TMAINWINDOW_H
#include <QMainWindow>
namespace Ui
{
class TMainWindow;
}
class TMainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit TMainWindow(QWidget *parent = 0);
virtual ~TMainWindow() Q_DECL_OVERRIDE;
private:
Q_DISABLE_COPY(TMainWindow)
Ui::TMainWindow *ui;
};
#endif // TMAINWINDOW_H

View file

@ -0,0 +1,24 @@
<ui version="4.0">
<class>TMainWindow</class>
<widget class="QMainWindow" name="TMainWindow" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle" >
<string>TMainWindow</string>
</property>
<widget class="QMenuBar" name="menuBar" />
<widget class="QToolBar" name="mainToolBar" />
<widget class="QWidget" name="centralWidget" />
<widget class="QStatusBar" name="statusBar" />
</widget>
<layoutDefault spacing="6" margin="11" />
<pixmapfunction></pixmapfunction>
<resources/>
<connections/>
</ui>