Fix missing headers, fix for precompiled header on Windows, fix zooming.

--HG--
branch : develop
This commit is contained in:
dismine 2014-07-13 15:49:00 +03:00
parent e670ab0fd8
commit e2ffad7146
14 changed files with 57 additions and 28 deletions

View File

@ -31,6 +31,8 @@
#include <QPushButton> #include <QPushButton>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QStackedWidget>
#include <QCloseEvent>
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
ConfigDialog::ConfigDialog(QWidget *parent) : ConfigDialog::ConfigDialog(QWidget *parent) :

View File

@ -43,6 +43,7 @@
#include <QTableWidget> #include <QTableWidget>
#include <QPushButton> #include <QPushButton>
#include <QFileDialog> #include <QFileDialog>
#include <QHeaderView>
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
PathPage::PathPage(QWidget *parent) PathPage::PathPage(QWidget *parent)

View File

@ -36,6 +36,7 @@
#include <QCheckBox> #include <QCheckBox>
#include <QSpinBox> #include <QSpinBox>
#include <QLineEdit> #include <QLineEdit>
#include <QVBoxLayout>
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
PatternPage::PatternPage(QWidget *parent): PatternPage::PatternPage(QWidget *parent):

View File

@ -31,6 +31,8 @@
#include "../tools/dialogtool.h" #include "../tools/dialogtool.h"
#include <QDomElement>
class VPattern; class VPattern;
class VToolRecord; class VToolRecord;

View File

@ -33,6 +33,7 @@
#include <QMessageBox> #include <QMessageBox>
#include <QPushButton> #include <QPushButton>
#include <QSettings> #include <QSettings>
#include <QDesktopWidget>
#include "../../widgets/vapplication.h" #include "../../widgets/vapplication.h"
#include "../../container/vcontainer.h" #include "../../container/vcontainer.h"

View File

@ -30,6 +30,7 @@
#include "ui_dialogstandardmeasurements.h" #include "ui_dialogstandardmeasurements.h"
#include <QDir> #include <QDir>
#include <QPushButton> #include <QPushButton>
#include <QDesktopWidget>
#include "../../xml/vstandardmeasurements.h" #include "../../xml/vstandardmeasurements.h"
#include "../../widgets/vapplication.h" #include "../../widgets/vapplication.h"
#include "../../container/vcontainer.h" #include "../../container/vcontainer.h"

View File

@ -47,8 +47,6 @@
#include <QSettings> #include <QSettings>
#include <QPushButton> #include <QPushButton>
#include <QDoubleSpinBox> #include <QDoubleSpinBox>
#include <QListWidget>
#include <QRadioButton>
#define DIALOGARC_MAX_FORMULA_HEIGHT 64 #define DIALOGARC_MAX_FORMULA_HEIGHT 64

View File

@ -31,15 +31,16 @@
#include <QDialog> #include <QDialog>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QLineEdit>
#include <QListWidget>
#include <QRadioButton>
#include "../../widgets/vapplication.h" #include "../../widgets/vapplication.h"
#include <QPushButton> #include <QPushButton>
class QDoubleSpinBox; class QDoubleSpinBox;
class QLabel; class QLabel;
class QRadioButton;
class QComboBox; class QComboBox;
class QListWidgetItem; class QListWidgetItem;
class QListWidget;
class VContainer; class VContainer;
class QPlainTextEdit; class QPlainTextEdit;
class VAbstractTool; class VAbstractTool;

View File

@ -28,6 +28,8 @@
#include "vabstractcurve.h" #include "vabstractcurve.h"
#include <QPainterPath>
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VAbstractCurve::VAbstractCurve(const GOType &type, const quint32 &idObject, const Draw &mode) VAbstractCurve::VAbstractCurve(const GOType &type, const quint32 &idObject, const Draw &mode)
:VGObject(type, idObject, mode) :VGObject(type, idObject, mode)

View File

@ -182,6 +182,10 @@ int main(int argc, char *argv[])
parser.addPositionalArgument("filename", QCoreApplication::translate("main", "Pattern file.")); parser.addPositionalArgument("filename", QCoreApplication::translate("main", "Pattern file."));
parser.process(app); parser.process(app);
const QStringList args = parser.positionalArguments(); const QStringList args = parser.positionalArguments();
//Before we load pattern show window.
w.show();
for(int i=0;i<args.size();++i) for(int i=0;i<args.size();++i)
{ {
if (i == 0) if (i == 0)
@ -193,6 +197,6 @@ int main(int argc, char *argv[])
VApplication::NewValentina(args.at(i)); VApplication::NewValentina(args.at(i));
} }
} }
w.show();
return app.exec(); return app.exec();
} }

View File

@ -1113,6 +1113,7 @@ void MainWindow::currentDrawChanged( int index )
{ {
ArrowTool(); ArrowTool();
view->fitInView(doc->ActiveDrawBoundingRect(), Qt::KeepAspectRatio); view->fitInView(doc->ActiveDrawBoundingRect(), Qt::KeepAspectRatio);
view->NewFactor(view->transform().m11());
} }
} }
} }

View File

@ -40,6 +40,7 @@
#if defined __cplusplus #if defined __cplusplus
/* Add C++ includes here */ /* Add C++ includes here */
/*In all cases we need include core header for getting defined values*/
#ifdef QT_CORE_LIB #ifdef QT_CORE_LIB
# include <QtCore> # include <QtCore>
#endif #endif
@ -48,24 +49,41 @@
# include <QtGui> # include <QtGui>
#endif #endif
#ifdef QT_WIDGETS_LIB
# include <QtWidgets>
#endif
#ifdef QT_XML_LIB #ifdef QT_XML_LIB
# include <QtXml> # include <QtXml>
#endif #endif
#ifdef QT_SVG_LIB //In Windows you can't use same header in all modes.
#if defined(Q_OS_WIN)
# if defined(QT_NO_DEBUG)//release mode
# ifdef QT_WIDGETS_LIB
# include <QtWidgets>
# endif
# ifdef QT_SVG_LIB
# include <QtSvg/QtSvg> # include <QtSvg/QtSvg>
#endif # endif
#ifdef QT_PRINTSUPPORT_LIB # ifdef QT_PRINTSUPPORT_LIB
# include <QtPrintSupport> # include <QtPrintSupport>
#endif # endif
# endif/*QT_NO_DEBUG*/
#else
//Build doesn't work, if include this headers on Windows. # ifdef QT_WIDGETS_LIB
#ifndef Q_OS_WIN # include <QtWidgets>
# endif
# ifdef QT_SVG_LIB
# include <QtSvg/QtSvg>
# endif
# ifdef QT_PRINTSUPPORT_LIB
# include <QtPrintSupport>
# endif
//Build doesn't work, if include this headers on Windows.
# ifdef QT_XMLPATTERNS_LIB # ifdef QT_XMLPATTERNS_LIB
# include <QtXmlPatterns> # include <QtXmlPatterns>
# endif # endif
@ -73,7 +91,7 @@
# ifdef QT_NETWORK_LIB # ifdef QT_NETWORK_LIB
# include <QtNetwork> # include <QtNetwork>
# endif # endif
#endif /*Q_OS_WIN*/ #endif/*Q_OS_WIN*/
#endif /*__cplusplus*/ #endif /*__cplusplus*/

View File

@ -117,11 +117,8 @@ void VMainGraphicsView::scrollingTime(qreal x)
} }
else else
{ {
// if (verticalScrollBar()->value() > 0)
// {
verticalScrollBar()->setValue(qRound(verticalScrollBar()->value() - factor*3.5)); verticalScrollBar()->setValue(qRound(verticalScrollBar()->value() - factor*3.5));
emit NewFactor(factor); emit NewFactor(factor);
// }
} }
} }
@ -180,9 +177,7 @@ void VMainGraphicsView::ZoomFitBest()
} }
this->fitInView(rect, Qt::KeepAspectRatio); this->fitInView(rect, Qt::KeepAspectRatio);
VAbstractTool::NewSceneRect(this->scene(), this); emit NewFactor(this->transform().m11());
QTransform trans = this->transform();
emit NewFactor(trans.m11());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -43,6 +43,7 @@
#include "../../libs/qmuparser/qmuparsererror.h" #include "../../libs/qmuparser/qmuparsererror.h"
#include "../geometry/varc.h" #include "../geometry/varc.h"
#include <QMessageBox> #include <QMessageBox>
#include <QUndoStack>
const QString VPattern::TagPattern = QStringLiteral("pattern"); const QString VPattern::TagPattern = QStringLiteral("pattern");
const QString VPattern::TagCalculation = QStringLiteral("calculation"); const QString VPattern::TagCalculation = QStringLiteral("calculation");
@ -2005,7 +2006,7 @@ QRectF VPattern::ActiveDrawBoundingRect() const
template <typename T> template <typename T>
QRectF VPattern::ToolBoundingRect(const QRectF &rec, const quint32 &id) const QRectF VPattern::ToolBoundingRect(const QRectF &rec, const quint32 &id) const
{ {
QRectF recTool = recTool.united(rec); QRectF recTool = rec;
if (tools.contains(id)) if (tools.contains(id))
{ {
T *vTool = qobject_cast<T *>(tools.value(id)); T *vTool = qobject_cast<T *>(tools.value(id));
@ -2015,7 +2016,8 @@ QRectF VPattern::ToolBoundingRect(const QRectF &rec, const quint32 &id) const
//map to scene coordinate. //map to scene coordinate.
childrenRect.translate(vTool->scenePos()); childrenRect.translate(vTool->scenePos());
recTool = recTool | vTool->boundingRect() | childrenRect; recTool = recTool.united(vTool->boundingRect());
recTool = recTool.united(childrenRect);
} }
else else
{ {