#include "merchandisetabledelegatewidget.h"
MerchandiseTableDelegateWidget
::MerchandiseTableDelegateWidget(QWidget* parent
){
Q_ASSERT_X(textLayout()!=0,
"Text Layout object allocation",
"Text Layout object could not be allocated.");
m_pMerchandiseName
=new QLabel(this);
Q_ASSERT_X(merchandiseName()!=0,
"Merchandise name label object allocation",
"Merchandise name label object could not be allocated.");
m_pMerchandiseDescription
=new QLabel(this);
Q_ASSERT_X(merchandiseDescription()!=0,
"Merchandise description label object allocation",
"Merchandise description label object could not be allocated.");
textLayout()->addWidget(merchandiseName());
textLayout()->addWidget(merchandiseDescription());
Q_ASSERT_X(priceLayout()!=0,
"Price layout object allocation",
"Price layout object could not be allocated.");
m_pMerchandisePrice
=new QLabel(this);
Q_ASSERT_X(merchandisePrice()!=0,
"Merchandise price label object allocation",
"Merchandise price label object could not be allocated.");
m_pMerchandiseQuantity
=new QLabel(this);
Q_ASSERT_X(merchandiseQuantity()!=0,
"Merchandise quantity label object allocation",
"Merchandise quantity label object could not be allocated.");
m_pMerchandiseSubtotal
=new QLabel(this);
Q_ASSERT_X(merchandiseSubtotal()!=0,
"Merchandise subtotal label object allocation",
"Merchandise subtotal label object could not be allocated.");
priceLayout()->addWidget(merchandisePrice());
priceLayout()->addWidget(merchandiseQuantity());
priceLayout()->addWidget(merchandiseSubtotal());
textLayout()->addLayout(priceLayout());
Q_ASSERT_X(operationsLayout()!=0,
"Operations layout object allocation",
"Operations layout could not be allocated.");
tr(""),
this);
Q_ASSERT_X(buttonIncreaseQuantity()!=0,
"Increase quantity pushbutton object allocation",
"Increase quantity pushbutton object could not be allocated.");
buttonIncreaseQuantity
()->setSizePolicy
(QSizePolicy::Fixed,
buttonIncreaseQuantity
()->setIconSize
(QSize(ICON_WIDTH,
ICON_HEIGHT));
buttonIncreaseQuantity()->setAutoRepeat(true);
connect(buttonIncreaseQuantity(),
SIGNAL(clicked()),
this,
SLOT(quantityIncrease()));
tr(""),
this);
Q_ASSERT_X(buttonDecreaseQuantity()!=0,
"Decrease quantity pushbutton object allocation",
"Decrease quantity pushbutton object could not be allocated.");
buttonDecreaseQuantity
()->setSizePolicy
(QSizePolicy::Fixed,
buttonDecreaseQuantity
()->setIconSize
(QSize(ICON_WIDTH,
ICON_HEIGHT));
buttonDecreaseQuantity()->setAutoRepeat(true);
connect(buttonDecreaseQuantity(),
SIGNAL(clicked()),
this,
SLOT(quantityDecrease()));
tr(""),
this);
Q_ASSERT_X(buttonTrash()!=0,
"Trash pushbutton object allocation",
"Trash pushbutton object could not be allocated.");
buttonTrash
()->setIconSize
(QSize(ICON_WIDTH,
ICON_HEIGHT));
buttonTrash()->setAutoRepeat(false);
connect(buttonTrash(),
SIGNAL(clicked()),
this,
SLOT(quantityZero()));
Q_ASSERT_X(mainLayout()!=0,
"Main layout object allocation",
"Main layout object could not be allocated");
m_pMerchandisePic
=new QPixmap(ICON_WIDTH
+DELTA,
ICON_HEIGHT+DELTA);
Q_ASSERT_X(merchandisePic()!=0,
"Merchandise pic object allocation",
"Merchandise pic object could not be allocated.");
// mainLayout()->addWidget(merchandisePic());
mainLayout()->addLayout(textLayout());
mainLayout()->addLayout(operationsLayout());
setLayout(mainLayout());
}
void MerchandiseTableDelegateWidget::quantityIncrease()
{
}
void MerchandiseTableDelegateWidget::quantityDecrease()
{
}
void MerchandiseTableDelegateWidget::quantityZero()
{
}
#include "merchandisetabledelegatewidget.h"
MerchandiseTableDelegateWidget::MerchandiseTableDelegateWidget(QWidget* parent)
: QWidget(parent)
{
m_pTextLayout=new QVBoxLayout();
Q_ASSERT_X(textLayout()!=0,
"Text Layout object allocation",
"Text Layout object could not be allocated.");
m_pMerchandiseName=new QLabel(this);
Q_ASSERT_X(merchandiseName()!=0,
"Merchandise name label object allocation",
"Merchandise name label object could not be allocated.");
m_pMerchandiseDescription=new QLabel(this);
Q_ASSERT_X(merchandiseDescription()!=0,
"Merchandise description label object allocation",
"Merchandise description label object could not be allocated.");
textLayout()->addWidget(merchandiseName());
textLayout()->addWidget(merchandiseDescription());
m_pPriceLayout=new QHBoxLayout();
Q_ASSERT_X(priceLayout()!=0,
"Price layout object allocation",
"Price layout object could not be allocated.");
m_pMerchandisePrice=new QLabel(this);
Q_ASSERT_X(merchandisePrice()!=0,
"Merchandise price label object allocation",
"Merchandise price label object could not be allocated.");
m_pMerchandiseQuantity=new QLabel(this);
Q_ASSERT_X(merchandiseQuantity()!=0,
"Merchandise quantity label object allocation",
"Merchandise quantity label object could not be allocated.");
m_pMerchandiseSubtotal=new QLabel(this);
Q_ASSERT_X(merchandiseSubtotal()!=0,
"Merchandise subtotal label object allocation",
"Merchandise subtotal label object could not be allocated.");
priceLayout()->addWidget(merchandisePrice());
priceLayout()->addWidget(merchandiseQuantity());
priceLayout()->addWidget(merchandiseSubtotal());
textLayout()->addLayout(priceLayout());
m_pOperationsLayout=new QVBoxLayout();
Q_ASSERT_X(operationsLayout()!=0,
"Operations layout object allocation",
"Operations layout could not be allocated.");
m_pButtonIncreaseQuantity=new QPushButton(QIcon(":/delegateIcons/quaInc"),
tr(""),
this);
Q_ASSERT_X(buttonIncreaseQuantity()!=0,
"Increase quantity pushbutton object allocation",
"Increase quantity pushbutton object could not be allocated.");
buttonIncreaseQuantity()->setSizePolicy(QSizePolicy::Fixed,
QSizePolicy::Fixed);
buttonIncreaseQuantity()->setIconSize(QSize(ICON_WIDTH,
ICON_HEIGHT));
buttonIncreaseQuantity()->setAutoRepeat(true);
connect(buttonIncreaseQuantity(),
SIGNAL(clicked()),
this,
SLOT(quantityIncrease()));
m_pButtonDecreaseQuantity=new QPushButton(QIcon(":/delegateIcons/quaDec"),
tr(""),
this);
Q_ASSERT_X(buttonDecreaseQuantity()!=0,
"Decrease quantity pushbutton object allocation",
"Decrease quantity pushbutton object could not be allocated.");
buttonDecreaseQuantity()->setSizePolicy(QSizePolicy::Fixed,
QSizePolicy::Fixed);
buttonDecreaseQuantity()->setIconSize(QSize(ICON_WIDTH,
ICON_HEIGHT));
buttonDecreaseQuantity()->setAutoRepeat(true);
connect(buttonDecreaseQuantity(),
SIGNAL(clicked()),
this,
SLOT(quantityDecrease()));
m_pButtonTrash=new QPushButton(QIcon(":/delegateIcons/quaZereo"),
tr(""),
this);
Q_ASSERT_X(buttonTrash()!=0,
"Trash pushbutton object allocation",
"Trash pushbutton object could not be allocated.");
buttonTrash()->setSizePolicy(QSizePolicy::Fixed,
QSizePolicy::Fixed);
buttonTrash()->setIconSize(QSize(ICON_WIDTH,
ICON_HEIGHT));
buttonTrash()->setAutoRepeat(false);
connect(buttonTrash(),
SIGNAL(clicked()),
this,
SLOT(quantityZero()));
m_pMainLayout=new QHBoxLayout();
Q_ASSERT_X(mainLayout()!=0,
"Main layout object allocation",
"Main layout object could not be allocated");
m_pMerchandisePic=new QPixmap(ICON_WIDTH+DELTA,
ICON_HEIGHT+DELTA);
Q_ASSERT_X(merchandisePic()!=0,
"Merchandise pic object allocation",
"Merchandise pic object could not be allocated.");
// mainLayout()->addWidget(merchandisePic());
mainLayout()->addLayout(textLayout());
mainLayout()->addLayout(operationsLayout());
setLayout(mainLayout());
}
void MerchandiseTableDelegateWidget::quantityIncrease()
{
}
void MerchandiseTableDelegateWidget::quantityDecrease()
{
}
void MerchandiseTableDelegateWidget::quantityZero()
{
}
To copy to clipboard, switch view to plain text mode
Can someone please help me, why layoutng is not working, because I have no idea and I am losing mind.
Bookmarks