Hello !
I have a QFrame that has a QGridLayout. In grid cell 0,0 I have a QLabel
that is left aligned and in cell 0,1 I have a QLabel that is right aligned.
This frame is initially raised but I have it set up so you can click the
frame and it will become sunken.
When the frame switches to sunken I want to shift the QLabel in cell 0,0 a little
bit to the right and down like buttons usually do. (aside: Maybe I could shift the
whole grid but I was thinking the right aligned label in (0,1) might get clipped by
the right edge.)
OK so I tried the obvious .. saving the initial position of the QLabel
when the frame is constructed with the line
m_pInitialTitlePos = m_lblAssetTitle->pos();
and then coding the below when I process the change in the frame's appearance ...
if (state)
{
m_lblAssetTitle->move(m_pInitialTitlePos);
}
else
{
m_lblAssetTitle
->move
(m_pInitialTitlePos
+ QPoint(10,
10));
}
if (state)
{
setFrameStyle(QFrame::Panel | QFrame::Raised);
m_lblAssetTitle->move(m_pInitialTitlePos);
}
else
{
setFrameStyle(QFrame::Panel | QFrame::Sunken);
m_lblAssetTitle->move(m_pInitialTitlePos + QPoint(10,10));
}
To copy to clipboard, switch view to plain text mode
but that does nothing.
I am obviously way off on this one .. what is the right way to do things ?
Thank you
barnaby
Bookmarks