Commit 3a3085ad authored by Michael Carpenter's avatar Michael Carpenter

Change of Text sizing in QuickView, to allow for smoother resizing

parent da79b6ce
......@@ -6,6 +6,8 @@ UASQuickViewItemSelect::UASQuickViewItemSelect(QWidget *parent) : QWidget(parent
ui.setupUi(this);
currcol = 0;
currrow = 0;
ui.gridLayout->setSpacing(0);
ui.gridLayout->setMargin(0);
}
void UASQuickViewItemSelect::addItem(QString item,bool enabled)
{
......
......@@ -9,14 +9,15 @@ UASQuickViewTextItem::UASQuickViewTextItem(QWidget *parent) : UASQuickViewItem(p
layout->setMargin(0);
titleLabel = new QLabel(this);
titleLabel->setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored);
titleLabel->setAlignment(Qt::AlignHCenter);
titleLabel->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
this->layout()->addWidget(titleLabel);
valueLabel = new QLabel(this);
valueLabel->setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored);
valueLabel->setAlignment(Qt::AlignHCenter);
valueLabel->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
valueLabel->setText("0.00");
this->layout()->addWidget(valueLabel);
layout->addSpacerItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Ignored));
//spacerItem = new QSpacerItem(20,40,QSizePolicy::Minimum,QSizePolicy::Ignored);
//layout->addSpacerItem(spacerItem);
QFont valuefont = valueLabel->font();
QFont titlefont = titleLabel->font();
valuefont.setPixelSize(this->height() / 2.0);
......@@ -39,6 +40,7 @@ void UASQuickViewTextItem::resizeEvent(QResizeEvent *event)
QFont titlefont = titleLabel->font();
valuefont.setPixelSize(this->height());
titlefont.setPixelSize(valuefont.pixelSize() / 2.0);
//spacerItem->setGeometry(QRect(0,0,20,this->height()/10.0));
QFontMetrics metrics(valuefont);
//valuefont.setPixelSize(this->height() / 2.0);
......
......@@ -3,6 +3,7 @@
#include "UASQuickViewItem.h"
#include <QLabel>
#include <QSpacerItem>
class UASQuickViewTextItem : public UASQuickViewItem
{
public:
......@@ -14,6 +15,7 @@ protected:
private:
QLabel *titleLabel;
QLabel *valueLabel;
QSpacerItem *spacerItem;
};
#endif // UASQUICKVIEWTEXTITEM_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment