This commit is contained in:
Ronan Le Tiec 2020-05-02 09:44:45 +02:00
parent 928c57f74b
commit e27e543fbc
3 changed files with 12 additions and 6 deletions

View File

@ -350,14 +350,14 @@ private slots:
void on_CurrentPiecePositionChanged(); void on_CurrentPiecePositionChanged();
/** /**
* @brief PieceCarrouselLocationChanged When the Piece Carrousel's location * @brief PieceCarrouselLocationChanged When the piece carrousel's location
* has been changed * has been changed
* @param area The new area where the Piece Carrousel has been placed * @param area The new area where the piece carrousel has been placed
*/ */
void on_PieceCarrouselLocationChanged(Qt::DockWidgetArea area); void on_PieceCarrouselLocationChanged(Qt::DockWidgetArea area);
/** /**
* @brief on_PieceSelected When a been has been selected * @brief on_PieceSelected When a piece has been selected
* @param piece the piece that was selected * @param piece the piece that was selected
*/ */
void on_PieceSelected(VPuzzlePiece* piece); void on_PieceSelected(VPuzzlePiece* piece);

View File

@ -35,7 +35,10 @@
Q_LOGGING_CATEGORY(pCarrouselLayer, "p.carrouselLayer") Q_LOGGING_CATEGORY(pCarrouselLayer, "p.carrouselLayer")
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VPieceCarrouselLayer::VPieceCarrouselLayer(VPuzzleLayer *layer, QWidget *parent) : QWidget(parent), m_layer(layer) VPieceCarrouselLayer::VPieceCarrouselLayer(VPuzzleLayer *layer, QWidget *parent) :
QWidget(parent),
m_layer(layer),
m_carrouselPieces(QList<VPieceCarrouselPiece*>())
{ {
Init(); Init();
} }

View File

@ -37,7 +37,9 @@
Q_LOGGING_CATEGORY(pCarrouselPiece, "p.carrouselPiece") Q_LOGGING_CATEGORY(pCarrouselPiece, "p.carrouselPiece")
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VPieceCarrouselPiece::VPieceCarrouselPiece(VPuzzlePiece *piece, QWidget *parent) : QFrame(parent), m_piece(piece) VPieceCarrouselPiece::VPieceCarrouselPiece(VPuzzlePiece *piece, QWidget *parent) :
QFrame(parent),
m_piece(piece)
{ {
Init(); Init();
} }
@ -97,6 +99,7 @@ void VPieceCarrouselPiece::Refresh()
// update the graphic view / the scene // update the graphic view / the scene
// TODO / FIXME : not perfect and maybe not the right way, still need to work on this // TODO / FIXME : not perfect and maybe not the right way, still need to work on this
// for instance: use a painter to habve a better quality, less pixeled.
QVector<QPointF> points = m_piece->GetCuttingLine(); QVector<QPointF> points = m_piece->GetCuttingLine();
QPen pen(Qt::black, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin); QPen pen(Qt::black, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
@ -117,8 +120,8 @@ void VPieceCarrouselPiece::Refresh()
QString clippedText = metrix.elidedText(m_piece->GetName(), Qt::ElideRight, width); QString clippedText = metrix.elidedText(m_piece->GetName(), Qt::ElideRight, width);
m_label->setText(clippedText); m_label->setText(clippedText);
// set the tooltip
setToolTip(m_piece->GetName()); setToolTip(m_piece->GetName());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------