Drawing Frames arround Widgets
-
@J-Hilk
No it still has the same Issue:
auto topLayout = new QHBoxLayout; topLayout->setSpacing(0); topLayout->setContentsMargins(0,0,0,0); topLayout->addWidget(mLcdDisplayMinesLeft); topLayout->addWidget(mSmileyPushButton); topLayout->addWidget(mLcdDisplayElapsedTime); mTopFrame->setLayout(topLayout); auto bottomLayout = new QHBoxLayout; bottomLayout->setSpacing(0); bottomLayout->setContentsMargins(0,0,0,0); bottomLayout->addWidget(mMinefield); mBottomFrame->setLayout(bottomLayout); auto mainLayout = new QVBoxLayout; mainLayout->setSpacing(0); mainLayout->setContentsMargins(0,0,0,0); mainLayout->addWidget(mTopFrame); mainLayout->addWidget(mBottomFrame); mMainFrame->setLayout(mainLayout); auto layout = new QVBoxLayout; layout->setSpacing(0); layout->setContentsMargins(0,0,0,0); layout->addWidget(mMainFrame); setLayout(layout);Result:

@sandro4912
mmh, strange.I'm out of easy ideas to try 😞
sry -
Hi
What about INSIDE minefield ?
Did you use layout there ? -
Yes inside the Minfield I place the Cells like this in the constructor:
auto layout = new QGridLayout; layout->setSpacing(0); for(int i = 0; i < mCells.size(); ++i) { auto column = static_cast<int>(i % mFieldWidth); auto row = static_cast<int>(i / mFieldWidth); layout->addWidget(mCells[i], row, column); } setLayout(layout); -
Yes inside the Minfield I place the Cells like this in the constructor:
auto layout = new QGridLayout; layout->setSpacing(0); for(int i = 0; i < mCells.size(); ++i) { auto column = static_cast<int>(i % mFieldWidth); auto row = static_cast<int>(i / mFieldWidth); layout->addWidget(mCells[i], row, column); } setLayout(layout);But you dont seem to call setContentsMargins(0,0,0,0);
so maybe that is the space ? -
But you dont seem to call setContentsMargins(0,0,0,0);
so maybe that is the space ?@mrjj said in Drawing Frames arround Widgets:
setContentsMargins(0,0,0,0);
thats it!

I thought i tryed it before but i think i tryed:
setContentsMargins(0,0,0,0);and not
layout->setContentsMargins(0,0,0,0);