Hi, i have a QTableWidget and set a cellWidget for one particular cell
The problem is that my widget has a fixed size and want that widget to be centered (horizontally and vertically) within the cell
Any ideas??
Best Regards
Hi, i have a QTableWidget and set a cellWidget for one particular cell
The problem is that my widget has a fixed size and want that widget to be centered (horizontally and vertically) within the cell
Any ideas??
Best Regards
Put it in another widget along with a set of springs that centers it.
I understand how it looks in the Designer But I've asked for some code
I've tried to solve it like this
But it worked the way I didn't expect it to work. The progress bar was centered but it became 3 pixels high not 12Qt Code:
layout.addSpacing(6); layout.addWidget(holder->GetProgressBar()); layout.addSpacing(6); wdg->setLayout(&layout); table->setCellWidget(vectIndex_, 4, wdg);To copy to clipboard, switch view to plain text mode
C++ & AMD forever
Spacing is non-stretchable space. Add stretch instead of spacing.
J-P Nurmi
J-P Nurmi
Here is a screenshot and some code
I can not understand what's the problemQt Code:
movie_->setFileName(":/images/StatusIcons/ico_complete.png"); ic ->setMovie(movie_); layout ->addWidget(ic, 5, Qt::AlignRight); movie_->start(); layout ->addWidget(f); table->setCellWidget(vectIndex_, 3, pL);To copy to clipboard, switch view to plain text mode
C++ & AMD forever
Layouts have margin by default so try:
J-P Nurmi
THRESHE (22nd February 2008)
Bookmarks