# HG changeset patch # User unc0rr # Date 1168210448 0 # Node ID b95fd124cb09bf6d1f040fbc02f19bfec63e4793 # Parent 56b937b1c780be904459ca0ef1a69b81f0c2ee57 Fix for middle column not being growing in width diff -r 56b937b1c780 -r b95fd124cb09 QTfrontend/SquareLabel.cpp --- a/QTfrontend/SquareLabel.cpp Sun Jan 07 17:48:18 2007 +0000 +++ b/QTfrontend/SquareLabel.cpp Sun Jan 07 22:54:08 2007 +0000 @@ -21,7 +21,7 @@ #include "SquareLabel.h" SquareLabel::SquareLabel(QWidget * parent) : - QLabel(parent) + QWidget(parent) { } @@ -37,5 +37,11 @@ pixsize = width(); painter.translate(0, (height() - pixsize) / 2); } - painter.drawPixmap(0, 0, pixsize, pixsize, pixmap()->scaled(pixsize, pixsize, Qt::KeepAspectRatio)); + painter.drawPixmap(0, 0, pixsize, pixsize, pixmap.scaled(pixsize, pixsize, Qt::KeepAspectRatio)); } + +void SquareLabel::setPixmap(const QPixmap & pixmap) +{ + this->pixmap = pixmap; + repaint(); +} diff -r 56b937b1c780 -r b95fd124cb09 QTfrontend/SquareLabel.h --- a/QTfrontend/SquareLabel.h Sun Jan 07 17:48:18 2007 +0000 +++ b/QTfrontend/SquareLabel.h Sun Jan 07 22:54:08 2007 +0000 @@ -19,17 +19,23 @@ #ifndef _SQUARELABEL_H #define _SQUARELABEL_H -#include +#include +#include -class SquareLabel : public QLabel +class SquareLabel : public QWidget { Q_OBJECT public: SquareLabel(QWidget * parent = 0); + void setPixmap(const QPixmap & pixmap); protected: virtual void paintEvent(QPaintEvent * event); + +private: + QPixmap pixmap; + }; #endif // _SQUARELABEL_H diff -r 56b937b1c780 -r b95fd124cb09 QTfrontend/pages.cpp --- a/QTfrontend/pages.cpp Sun Jan 07 17:48:18 2007 +0000 +++ b/QTfrontend/pages.cpp Sun Jan 07 22:54:08 2007 +0000 @@ -111,11 +111,11 @@ { QFont * font14 = new QFont("MS Shell Dlg", 14); QGridLayout * pageLayout = new QGridLayout(this); - pageLayout->setColumnStretch(0, 100); + pageLayout->setColumnStretch(0, 1); pageLayout->setColumnMinimumWidth(0, 150); pageLayout->setColumnStretch(1, 100); pageLayout->setColumnMinimumWidth(1, 200); - pageLayout->setColumnStretch(2, 250); + pageLayout->setColumnStretch(2, 150); pageLayout->setColumnMinimumWidth(2, 250); GBoxTeam = new QGroupBox(this); @@ -214,8 +214,8 @@ CBFort->setMaxCount(65535); GBFLayout->addWidget(CBFort, 0, 0); FortPreview = new SquareLabel(GBoxFort); + FortPreview->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); FortPreview->setPixmap(QPixmap()); - FortPreview->setScaledContents(true); GBFLayout->addWidget(FortPreview, 1, 0); pageLayout->addWidget(GBoxFort, 2, 2, 1, 1);