From d248c4f18a25e6529432a36ff26751593119629c Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Mon, 25 Jul 2016 19:23:00 +0300 Subject: [PATCH] Added VAbstractMainWindow class. --HG-- branch : feature --- src/app/valentina/mainwindowsnogui.cpp | 2 +- src/app/valentina/mainwindowsnogui.h | 3 +- src/libs/vwidgets/vabstractmainwindow.cpp | 36 +++++++++++++++ src/libs/vwidgets/vabstractmainwindow.h | 45 ++++++++++++++++++ src/libs/vwidgets/vwidgets.pri | 56 ++++++++++++----------- 5 files changed, 113 insertions(+), 29 deletions(-) create mode 100644 src/libs/vwidgets/vabstractmainwindow.cpp create mode 100644 src/libs/vwidgets/vabstractmainwindow.h diff --git a/src/app/valentina/mainwindowsnogui.cpp b/src/app/valentina/mainwindowsnogui.cpp index b3e6b9e72..326fbb387 100644 --- a/src/app/valentina/mainwindowsnogui.cpp +++ b/src/app/valentina/mainwindowsnogui.cpp @@ -57,7 +57,7 @@ //--------------------------------------------------------------------------------------------------------------------- MainWindowsNoGUI::MainWindowsNoGUI(QWidget *parent) - : QMainWindow(parent), listDetails(QVector()), currentScene(nullptr), tempSceneLayout(nullptr), + : VAbstractMainWindow(parent), listDetails(QVector()), currentScene(nullptr), tempSceneLayout(nullptr), pattern(new VContainer(qApp->TrVars(), qApp->patternUnitP())), doc(nullptr), papers(QList()), shadows(QList()), scenes(QList()), details(QList >()), undoAction(nullptr), redoAction(nullptr), actionDockWidgetToolOptions(nullptr), actionDockWidgetGroups(nullptr), diff --git a/src/app/valentina/mainwindowsnogui.h b/src/app/valentina/mainwindowsnogui.h index dbff87c6c..25b446e37 100644 --- a/src/app/valentina/mainwindowsnogui.h +++ b/src/app/valentina/mainwindowsnogui.h @@ -37,13 +37,14 @@ #include "xml/vpattern.h" #include "dialogs/dialogsavelayout.h" #include "../vlayout/vlayoutgenerator.h" +#include "../vwidgets/vabstractmainwindow.h" class QGraphicsScene; class QPrinter; class PosterData; -class MainWindowsNoGUI : public QMainWindow +class MainWindowsNoGUI : public VAbstractMainWindow { Q_OBJECT public: diff --git a/src/libs/vwidgets/vabstractmainwindow.cpp b/src/libs/vwidgets/vabstractmainwindow.cpp new file mode 100644 index 000000000..350c1e98d --- /dev/null +++ b/src/libs/vwidgets/vabstractmainwindow.cpp @@ -0,0 +1,36 @@ +/************************************************************************ + ** + ** @file + ** @author Valentina Zhuravska + ** @date 19 7, 2016 + ** + ** @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) 2016 Valentina project + ** 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 . + ** + *************************************************************************/ + +#include "vabstractmainwindow.h" + +VAbstractMainWindow::VAbstractMainWindow(QWidget *parent) : QMainWindow(parent) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VAbstractMainWindow::~VAbstractMainWindow() +{} diff --git a/src/libs/vwidgets/vabstractmainwindow.h b/src/libs/vwidgets/vabstractmainwindow.h new file mode 100644 index 000000000..c51aefb35 --- /dev/null +++ b/src/libs/vwidgets/vabstractmainwindow.h @@ -0,0 +1,45 @@ +/************************************************************************ + ** + ** @file + ** @author Valentina Zhuravska + ** @date 19 7, 2016 + ** + ** @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) 2016 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef VABSTRACTMAINWINDOW_H +#define VABSTRACTMAINWINDOW_H + +#include + +class VAbstractMainWindow : public QMainWindow +{ + Q_OBJECT +public: + explicit VAbstractMainWindow(QWidget *parent = nullptr); + virtual ~VAbstractMainWindow() Q_DECL_OVERRIDE; + +public slots: + virtual void ShowToolTip(const QString &toolTip)=0; +}; + +#endif // VABSTRACTMAINWINDOW_H diff --git a/src/libs/vwidgets/vwidgets.pri b/src/libs/vwidgets/vwidgets.pri index d80356e60..042607eb2 100644 --- a/src/libs/vwidgets/vwidgets.pri +++ b/src/libs/vwidgets/vwidgets.pri @@ -1,27 +1,29 @@ -# ADD TO EACH PATH $$PWD VARIABLE!!!!!! -# This need for corect working file translations.pro - -SOURCES += \ - $$PWD/vmaingraphicsscene.cpp \ - $$PWD/vmaingraphicsview.cpp \ - $$PWD/vwidgetpopup.cpp \ - $$PWD/vcontrolpointspline.cpp \ - $$PWD/vgraphicssimpletextitem.cpp \ - $$PWD/vsimplepoint.cpp \ - $$PWD/vabstractsimple.cpp \ - $$PWD/vnobrushscalepathitem.cpp \ - $$PWD/vsimplecurve.cpp - -win32-msvc*:SOURCES += $$PWD/stable.cpp - -HEADERS += \ - $$PWD/stable.h \ - $$PWD/vmaingraphicsscene.h \ - $$PWD/vmaingraphicsview.h \ - $$PWD/vwidgetpopup.h \ - $$PWD/vcontrolpointspline.h \ - $$PWD/vgraphicssimpletextitem.h \ - $$PWD/vsimplepoint.h \ - $$PWD/vabstractsimple.h \ - $$PWD/vnobrushscalepathitem.h \ - $$PWD/vsimplecurve.h +# ADD TO EACH PATH $$PWD VARIABLE!!!!!! +# This need for corect working file translations.pro + +SOURCES += \ + $$PWD/vmaingraphicsscene.cpp \ + $$PWD/vmaingraphicsview.cpp \ + $$PWD/vwidgetpopup.cpp \ + $$PWD/vcontrolpointspline.cpp \ + $$PWD/vgraphicssimpletextitem.cpp \ + $$PWD/vsimplepoint.cpp \ + $$PWD/vabstractsimple.cpp \ + $$PWD/vnobrushscalepathitem.cpp \ + $$PWD/vsimplecurve.cpp \ + $$PWD/vabstractmainwindow.cpp + +win32-msvc*:SOURCES += $$PWD/stable.cpp + +HEADERS += \ + $$PWD/stable.h \ + $$PWD/vmaingraphicsscene.h \ + $$PWD/vmaingraphicsview.h \ + $$PWD/vwidgetpopup.h \ + $$PWD/vcontrolpointspline.h \ + $$PWD/vgraphicssimpletextitem.h \ + $$PWD/vsimplepoint.h \ + $$PWD/vabstractsimple.h \ + $$PWD/vnobrushscalepathitem.h \ + $$PWD/vsimplecurve.h \ + $$PWD/vabstractmainwindow.h