Hello to all!
I've been trying for whole day to make following demand work:
I have a QDockWidget on QMainWIndow. In this QDockWIdget I want to have an QGLWidgeet containing some animation and beneath in horiz layout two QPushButtons.
I wrote following code:
{
//setAllowedAreas(Qt::LeftDockWidgetArea); // sets allowed dock area
setWindowTitle(trUtf8("Izbor ponudbe jedi in pijač")); // sets window title
// layout creation
m_pVLayout
=new QVBoxLayout(this);
// creates new vertical layout Q_CHECK_PTR(m_pVLayout); // checks creation
m_pHLayout
=new QHBoxLayout(this);
// creates new horizontal layout Q_CHECK_PTR(m_pHLayout); // checks creation
// creates merchandize browser
m_pMerchandizeBrowser=new CMerchandizeBrowser(this); // creates new merchandize selector
//m_pMerchandizeBrowser=new CMerchandizeBrowser(pParent); // creates new merchandize selector
Q_CHECK_PTR(m_pMerchandizeBrowser); // checks creation
m_pVLayout->addWidget(m_pMerchandizeBrowser); // adds merchandize selector to vertical layout
// creates Left Selector pushbutton
m_pLeftButtonMerchandizeSelector
=new QPushButton(trUtf8
("Izbira levega artikla"),
this);
//m_pLeftButtonMerchandizeSelector=new QPushButton(trUtf8("Izbira levega artikla"), pParent);
Q_CHECK_PTR(m_pLeftButtonMerchandizeSelector); // checks creation
// creates Right Selector pushbutton
m_pRightButtonMerchandizeSelector
=new QPushButton(trUtf8
("Izbira desnegs artikla"),
this);
//m_pRightButtonMerchandizeSelector=new QPushButton(trUtf8("Izbira desnegs artikla"), pParent);
Q_CHECK_PTR(m_pRightButtonMerchandizeSelector); // checks creation
m_pHLayout->addWidget(m_pLeftButtonMerchandizeSelector); // adds button to horiz. layout
m_pHLayout->addWidget(m_pRightButtonMerchandizeSelector); // adds button to horiz. layout
m_pVLayout->addLayout(m_pHLayout); // add horiz. layout to vertical layout
setLayout(m_pVLayout); // sets main layout on widget
setLayout(m_pHLayout); // sets main layout on widget
//setWidget(m_pMerchandizeBrowser);
}
COperationWIndow::COperationWIndow(QWidget* pParent) : QDockWidget(pParent)
{
//setAllowedAreas(Qt::LeftDockWidgetArea); // sets allowed dock area
setWindowTitle(trUtf8("Izbor ponudbe jedi in pijač")); // sets window title
// layout creation
m_pVLayout=new QVBoxLayout(this); // creates new vertical layout
Q_CHECK_PTR(m_pVLayout); // checks creation
m_pHLayout=new QHBoxLayout(this); // creates new horizontal layout
Q_CHECK_PTR(m_pHLayout); // checks creation
// creates merchandize browser
m_pMerchandizeBrowser=new CMerchandizeBrowser(this); // creates new merchandize selector
//m_pMerchandizeBrowser=new CMerchandizeBrowser(pParent); // creates new merchandize selector
Q_CHECK_PTR(m_pMerchandizeBrowser); // checks creation
m_pVLayout->addWidget(m_pMerchandizeBrowser); // adds merchandize selector to vertical layout
// creates Left Selector pushbutton
m_pLeftButtonMerchandizeSelector=new QPushButton(trUtf8("Izbira levega artikla"), this);
//m_pLeftButtonMerchandizeSelector=new QPushButton(trUtf8("Izbira levega artikla"), pParent);
Q_CHECK_PTR(m_pLeftButtonMerchandizeSelector); // checks creation
// creates Right Selector pushbutton
m_pRightButtonMerchandizeSelector=new QPushButton(trUtf8("Izbira desnegs artikla"), this);
//m_pRightButtonMerchandizeSelector=new QPushButton(trUtf8("Izbira desnegs artikla"), pParent);
Q_CHECK_PTR(m_pRightButtonMerchandizeSelector); // checks creation
m_pHLayout->addWidget(m_pLeftButtonMerchandizeSelector); // adds button to horiz. layout
m_pHLayout->addWidget(m_pRightButtonMerchandizeSelector); // adds button to horiz. layout
m_pVLayout->addLayout(m_pHLayout); // add horiz. layout to vertical layout
setLayout(m_pVLayout); // sets main layout on widget
setLayout(m_pHLayout); // sets main layout on widget
//setWidget(m_pMerchandizeBrowser);
}
To copy to clipboard, switch view to plain text mode
but this does not work. QGLWidget is not even seen, both qpushbuttons are located in the left upper corner one behind other. What the heck is going on???!!
Bookmarks