valentina/src/app/puzzle/puzzlemainwindow.cpp

589 lines
21 KiB
C++
Raw Normal View History

2020-02-16 17:17:50 +01:00
/************************************************************************
**
** @file puzzlemainwindow.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 16 2, 2020
**
** @brief
** @copyright
** This source code is part of the Valentina project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2020 Valentina project
** <https://gitlab.com/smart-pattern/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 "puzzlemainwindow.h"
2020-04-18 16:32:54 +02:00
#include <QFileDialog>
2020-02-16 17:17:50 +01:00
#include "ui_puzzlemainwindow.h"
2020-04-11 11:40:02 +02:00
#include "dialogs/dialogaboutpuzzle.h"
2020-04-18 16:32:54 +02:00
#include "xml/vpuzzlelayoutfilewriter.h"
2020-02-16 17:17:50 +01:00
2020-02-16 18:18:39 +01:00
//---------------------------------------------------------------------------------------------------------------------
2020-02-16 17:17:50 +01:00
PuzzleMainWindow::PuzzleMainWindow(QWidget *parent) :
QMainWindow(parent),
2020-04-13 12:24:26 +02:00
ui(new Ui::PuzzleMainWindow),
2020-04-18 16:32:54 +02:00
pieceCarrousel(new VPieceCarrousel),
m_layout (new VPuzzleLayout)
2020-02-16 17:17:50 +01:00
{
ui->setupUi(this);
2020-04-10 21:08:29 +02:00
InitMenuBar();
2020-04-13 12:24:26 +02:00
InitProperties();
InitPieceCarrousel();
2020-04-18 16:32:54 +02:00
// for test purposes, to be removed when we can edit the size / margins through the UI:
m_layout->SetLayoutMargins(1.5, 2.00, 4.21, 0.25);
m_layout->SetLayoutSize(21.0, 29.7);
2020-02-16 17:17:50 +01:00
}
2020-02-16 18:18:39 +01:00
//---------------------------------------------------------------------------------------------------------------------
2020-02-16 17:17:50 +01:00
PuzzleMainWindow::~PuzzleMainWindow()
{
delete ui;
2020-04-13 12:24:26 +02:00
delete pieceCarrousel;
2020-02-16 17:17:50 +01:00
}
2020-02-16 18:18:39 +01:00
//---------------------------------------------------------------------------------------------------------------------
bool PuzzleMainWindow::LoadFile(const QString &path)
{
2020-02-16 20:51:41 +01:00
Q_UNUSED(path)
return true;
2020-02-16 18:18:39 +01:00
}
2020-04-10 21:08:29 +02:00
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::ImportRawLayouts(const QStringList &layouts)
{
Q_UNUSED(layouts)
}
2020-04-10 21:08:29 +02:00
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::InitMenuBar()
{
2020-04-13 12:24:26 +02:00
// -------------------- connects the actions for the file menu
2020-04-10 21:08:29 +02:00
connect(ui->actionNew, &QAction::triggered, this, &PuzzleMainWindow::New);
connect(ui->actionOpen, &QAction::triggered, this, &PuzzleMainWindow::Open);
connect(ui->actionSave, &QAction::triggered, this, &PuzzleMainWindow::Save);
connect(ui->actionSaveAs, &QAction::triggered, this, &PuzzleMainWindow::SaveAs);
connect(ui->actionImportRawLayout, &QAction::triggered, this, &PuzzleMainWindow::ImportRawLayout);
connect(ui->actionExit, &QAction::triggered, this, &PuzzleMainWindow::close);
2020-04-13 12:24:26 +02:00
// -------------------- connects the actions for the edit menu
2020-04-10 21:08:29 +02:00
// TODO : initialise the undo / redo
2020-04-13 12:24:26 +02:00
// -------------------- connects the actions for the windows menu
2020-04-10 21:08:29 +02:00
// TODO : initialise the entries for the different windows
connect(ui->actionCloseLayout, &QAction::triggered, this, &PuzzleMainWindow::CloseLayout);
2020-04-13 12:24:26 +02:00
// Add dock properties action
QAction* actionDockWidgetToolOptions = ui->dockWidgetProperties->toggleViewAction();
ui->menuWindows->addAction(actionDockWidgetToolOptions);
2020-04-10 21:08:29 +02:00
// connects the action for the Help Menu
connect(ui->actionAboutQt, &QAction::triggered, this, &PuzzleMainWindow::AboutQt);
connect(ui->actionAboutPuzzle, &QAction::triggered, this, &PuzzleMainWindow::AboutPuzzle);
}
2020-04-11 11:17:53 +02:00
//---------------------------------------------------------------------------------------------------------------------
2020-04-13 12:24:26 +02:00
void PuzzleMainWindow::InitProperties()
2020-04-11 11:17:53 +02:00
{
2020-04-11 16:25:23 +02:00
InitPropertyTabCurrentPiece();
InitPropertyTabLayout();
InitPropertyTabLayers();
InitPropertyTabTiles();
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::InitPropertyTabCurrentPiece()
{
// ------------------------------ seamline ------------------------------------
connect(ui->checkBoxCurrentPieceShowSeamline, QOverload<bool>::of(&QCheckBox::toggled), this,
&PuzzleMainWindow::CurrentPieceShowSeamlineChanged);
// ------------------------------ geometry ------------------------------------
connect(ui->checkBoxCurrentPieceMirrorPiece, QOverload<bool>::of(&QCheckBox::toggled), this,
&PuzzleMainWindow::CurrentPieceMirrorPieceChanged);
// ------------------------------ rotation ------------------------------------
connect(ui->doubleSpinBoxCurrentPieceAngle, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::CurrentPieceAngleChanged);
// ------------------------------ placement -----------------------------------
connect(ui->doubleSpinBoxCurrentPieceBoxPositionX, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::CurrentPiecePositionChanged);
connect(ui->doubleSpinBoxCurrentPieceBoxPositionY, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::CurrentPiecePositionChanged);
2020-04-11 11:17:53 +02:00
}
2020-04-11 16:25:23 +02:00
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::InitPropertyTabLayout()
{
// -------------------- init the unit combobox ---------------------
ui->comboBoxLayoutUnit->addItem(tr("Centimeters"), QVariant(UnitsToStr(Unit::Cm)));
ui->comboBoxLayoutUnit->addItem(tr("Millimiters"), QVariant(UnitsToStr(Unit::Mm)));
ui->comboBoxLayoutUnit->addItem(tr("Inches"), QVariant(UnitsToStr(Unit::Inch)));
// set default unit - TODO when we have the setting for the unit
2020-04-13 14:05:22 +02:00
// const qint32 indexUnit = -1;//ui->comboBoxLayoutUnit->findData(qApp->ValentinaSettings()->GetUnit());
// if (indexUnit != -1)
// {
// ui->comboBoxLayoutUnit->setCurrentIndex(indexUnit);
// }
2020-04-11 16:25:23 +02:00
connect(ui->comboBoxLayoutUnit, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&PuzzleMainWindow::LayoutUnitChanged);
2020-04-11 16:25:23 +02:00
// -------------------- init the template combobox ---------------------
// TODO
connect(ui->comboBoxLayoutTemplate, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&PuzzleMainWindow::LayoutTemplateChanged);
2020-04-11 16:25:23 +02:00
// -------------------- layout width, length, orientation ------------------------
connect(ui->doubleSpinBoxLayoutWidth, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::LayoutSizeChanged);
connect(ui->doubleSpinBoxLayoutLength, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::LayoutSizeChanged);
connect(ui->radioButtonLayoutPortrait, QOverload<bool>::of(&QRadioButton::clicked), this,
&PuzzleMainWindow::LayoutOrientationChanged);
connect(ui->radioButtonLayoutLandscape, QOverload<bool>::of(&QRadioButton::clicked), this,
&PuzzleMainWindow::LayoutOrientationChanged);
connect(ui->pushButtonLayoutRemoveUnusedLength, QOverload<bool>::of(&QPushButton::clicked), this,
&PuzzleMainWindow::LayoutRemoveUnusedLength);
2020-04-11 16:25:23 +02:00
// -------------------- margins ------------------------
connect(ui->doubleSpinBoxLayoutMarginTop, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::LayoutMarginChanged);
connect(ui->doubleSpinBoxLayoutMarginRight, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::LayoutMarginChanged);
connect(ui->doubleSpinBoxLayoutMarginBottom, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::LayoutMarginChanged);
connect(ui->doubleSpinBoxLayoutMarginLeft, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::LayoutMarginChanged);
2020-04-11 16:25:23 +02:00
// ------------------- follow grainline -----------------------
connect(ui->radioButtonLayoutFollowGrainlineNo, QOverload<bool>::of(&QRadioButton::clicked), this,
&PuzzleMainWindow::LayoutFollowGrainlineChanged);
connect(ui->radioButtonLayoutFollowGrainlineVertical, QOverload<bool>::of(&QRadioButton::clicked), this,
&PuzzleMainWindow::LayoutFollowGrainlineChanged);
connect(ui->radioButtonLayoutFollowGrainlineHorizontal, QOverload<bool>::of(&QRadioButton::clicked), this,
&PuzzleMainWindow::LayoutFollowGrainlineChanged);
2020-04-11 16:25:23 +02:00
// -------------------- pieces gap and checkboxes ---------------
connect(ui->doubleSpinBoxLayoutPiecesGap, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&PuzzleMainWindow::LayoutPiecesGapChanged);
connect(ui->checkBoxLayoutWarningPiecesSuperposition, QOverload<bool>::of(&QCheckBox::toggled), this,
&PuzzleMainWindow::LayoutWarningPiecesSuperpositionChanged);
connect(ui->checkBoxLayoutWarningPiecesOutOfBound, QOverload<bool>::of(&QCheckBox::toggled), this,
&PuzzleMainWindow::LayoutWarningPiecesOutOfBoundChanged);
connect(ui->checkBoxLayoutStickyEdges, QOverload<bool>::of(&QCheckBox::toggled), this,
&PuzzleMainWindow::LayoutStickyEdgesChanged);
2020-04-11 16:25:23 +02:00
// -------------------- export ---------------------------
2020-04-11 16:32:49 +02:00
// TODO init the file format export combobox
connect(ui->pushButtonLayoutExport, QOverload<bool>::of(&QPushButton::clicked), this,
&PuzzleMainWindow::LayoutExport);
2020-04-11 16:25:23 +02:00
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::InitPropertyTabTiles()
{
// for the MVP we don't want the tiles tab.
// we remove it. As soon as we need it, update this code
ui->tabWidgetProperties->removeTab(2); // remove tiles
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::InitPropertyTabLayers()
{
// for the MVP we don't want the layers tab.
// we remove it. As soon as we need it, update this code
ui->tabWidgetProperties->removeTab(3); // remove layers
}
2020-04-13 12:24:26 +02:00
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::InitPieceCarrousel()
{
ui->dockWidgetPieceCarrousel->setWidget(pieceCarrousel);
connect(ui->dockWidgetPieceCarrousel, QOverload<Qt::DockWidgetArea>::of(&QDockWidget::dockLocationChanged), this,
&PuzzleMainWindow::PieceCarrouselLocationChanged);
}
2020-04-10 21:08:29 +02:00
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::New()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::New");
int ret = msgBox.exec();
2020-04-11 16:25:23 +02:00
Q_UNUSED(ret);
2020-04-10 21:08:29 +02:00
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::Open()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::Open");
int ret = msgBox.exec();
2020-04-11 16:25:23 +02:00
Q_UNUSED(ret);
2020-04-10 21:08:29 +02:00
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::Save()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::Save");
int ret = msgBox.exec();
2020-04-11 16:25:23 +02:00
Q_UNUSED(ret);
2020-04-10 21:08:29 +02:00
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::SaveAs()
{
2020-04-18 16:32:54 +02:00
// TODO / FIXME : See valentina how the save is done over there. we need to add the extension .vlt, check for empty file names etc.
2020-04-10 21:08:29 +02:00
2020-04-11 16:25:23 +02:00
2020-04-18 16:32:54 +02:00
QString filters(tr("Pattern files") + QLatin1String("(*.val)"));
QString fileName = QFileDialog::getSaveFileName(this, tr("Save as"),
/*dir +*/ QLatin1String("/") + tr("Layout") + QLatin1String(".vlt"),
filters, nullptr
#ifdef Q_OS_LINUX
, QFileDialog::DontUseNativeDialog
#endif
);
QFile file(fileName);
file.open(QIODevice::WriteOnly);
VPuzzleLayoutFileWriter *fileWriter = new VPuzzleLayoutFileWriter();
fileWriter->WriteFile(m_layout, &file);
2020-04-10 21:08:29 +02:00
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::ImportRawLayout()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::ImportRawLayout");
int ret = msgBox.exec();
2020-04-11 16:25:23 +02:00
Q_UNUSED(ret);
2020-04-10 21:08:29 +02:00
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::CloseLayout()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::CloseLayout");
int ret = msgBox.exec();
2020-04-11 16:25:23 +02:00
Q_UNUSED(ret);
2020-04-10 21:08:29 +02:00
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::AboutQt()
{
QMessageBox::aboutQt(this, tr("About Qt"));
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::AboutPuzzle()
{
2020-04-11 11:40:02 +02:00
auto *aboutDialog = new DialogAboutPuzzle(this);
aboutDialog->setAttribute(Qt::WA_DeleteOnClose, true);
aboutDialog->show();
2020-04-10 21:08:29 +02:00
}
2020-04-11 16:25:23 +02:00
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutUnitChanged(int index)
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutUnitChanged");
int ret = msgBox.exec();
Q_UNUSED(index);
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutTemplateChanged(int index)
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutTemplateChanged");
int ret = msgBox.exec();
Q_UNUSED(index);
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutSizeChanged()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutSizeChanged");
int ret = msgBox.exec();
Q_UNUSED(ret);
2020-04-11 16:32:49 +02:00
// TODO
2020-04-11 16:25:23 +02:00
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutOrientationChanged()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutOrientationChanged");
int ret = msgBox.exec();
Q_UNUSED(ret);
2020-04-11 16:32:49 +02:00
// TODO
2020-04-11 16:25:23 +02:00
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutRemoveUnusedLength()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutRemoveUnusedLength");
int ret = msgBox.exec();
Q_UNUSED(ret);
2020-04-11 16:32:49 +02:00
// TODO
2020-04-11 16:25:23 +02:00
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutMarginChanged()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutMarginChanged");
int ret = msgBox.exec();
Q_UNUSED(ret);
2020-04-11 16:32:49 +02:00
// TODO
2020-04-11 16:25:23 +02:00
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutFollowGrainlineChanged()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutFollowGrainlineChanged");
int ret = msgBox.exec();
Q_UNUSED(ret);
2020-04-11 16:32:49 +02:00
// TODO
2020-04-11 16:25:23 +02:00
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutPiecesGapChanged(double value)
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutPieceGapChanged");
int ret = msgBox.exec();
Q_UNUSED(value);
Q_UNUSED(ret);
2020-04-11 16:32:49 +02:00
// TODO
2020-04-11 16:25:23 +02:00
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutWarningPiecesSuperpositionChanged(bool checked)
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutWarningPiecesSuperpositionChanged");
int ret = msgBox.exec();
Q_UNUSED(checked);
Q_UNUSED(ret);
2020-04-11 16:32:49 +02:00
// TODO
2020-04-11 16:25:23 +02:00
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutWarningPiecesOutOfBoundChanged(bool checked)
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutWarningPiecesOutOfBoundChanged");
int ret = msgBox.exec();
Q_UNUSED(checked);
Q_UNUSED(ret);
2020-04-11 16:32:49 +02:00
// TODO
2020-04-11 16:25:23 +02:00
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutStickyEdgesChanged(bool checked)
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutStickyEdgesChanged");
int ret = msgBox.exec();
Q_UNUSED(checked);
Q_UNUSED(ret);
2020-04-11 16:32:49 +02:00
// TODO
2020-04-11 16:25:23 +02:00
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::LayoutExport()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::LayoutExport");
int ret = msgBox.exec();
Q_UNUSED(ret);
2020-04-11 16:32:49 +02:00
// TODO
2020-04-11 16:25:23 +02:00
}
2020-04-10 21:08:29 +02:00
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::CurrentPieceShowSeamlineChanged(bool checked)
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::CurrentPieceShowSeamlineChanged");
int ret = msgBox.exec();
Q_UNUSED(checked);
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::CurrentPieceMirrorPieceChanged(bool checked)
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::CurrentPieceMirrorPieceChanged");
int ret = msgBox.exec();
Q_UNUSED(checked);
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::CurrentPieceAngleChanged(double value)
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::CurrentPieceAngleChanged");
int ret = msgBox.exec();
Q_UNUSED(value);
Q_UNUSED(ret);
// TODO
}
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::CurrentPiecePositionChanged()
{
// just for test purpuses, to be removed:
QMessageBox msgBox;
msgBox.setText("TODO PuzzleMainWindow::CurrentPiecePositionChanged");
int ret = msgBox.exec();
Q_UNUSED(ret);
// TODO
}
2020-04-13 12:24:26 +02:00
//---------------------------------------------------------------------------------------------------------------------
void PuzzleMainWindow::PieceCarrouselLocationChanged(Qt::DockWidgetArea area)
{
if(area == Qt::BottomDockWidgetArea || area == Qt::TopDockWidgetArea)
{
pieceCarrousel->setOrientation(Qt::Horizontal);
ui->dockWidgetPieceCarrousel->setMaximumHeight(208);
ui->dockWidgetPieceCarrousel->setMaximumWidth(10000);
}
else if (area == Qt::LeftDockWidgetArea || area == Qt::RightDockWidgetArea)
{
pieceCarrousel->setOrientation(Qt::Vertical);
ui->dockWidgetPieceCarrousel->setMaximumHeight(10000);
ui->dockWidgetPieceCarrousel->setMaximumWidth(160);
}
}