[license] Fix the height of each item

- needs a qwidget to put the top-items (license name, button) in
 - fixes issue where the gap between the button and the hrule would
   change depending on what is expanded
This commit is contained in:
Adriaan de Groot 2019-12-09 17:08:35 +01:00
parent 7330afd96a
commit 8a912e6ca1

View File

@ -66,18 +66,21 @@ LicenseWidget::LicenseWidget( LicenseEntry entry, QWidget* parent )
setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum );
setContentsMargins( 4, 4, 4, 4 );
QVBoxLayout* vLayout = new QVBoxLayout;
QWidget* topPart = new QWidget( this );
vLayout->addWidget( topPart );
QHBoxLayout* wiLayout = new QHBoxLayout;
topPart->setLayout( wiLayout );
m_label->setWordWrap( true );
m_label->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
wiLayout->addWidget( m_label );
wiLayout->addSpacing( 1 );
m_viewLicenseButton->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
wiLayout->addSpacing( 10 );
m_viewLicenseButton->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed );
wiLayout->addWidget( m_viewLicenseButton );
QVBoxLayout* vLayout = new QVBoxLayout;
vLayout->addLayout( wiLayout );
m_licenceTextLabel->setStyleSheet( "border-top: 1px solid black; margin-top: 0px; padding-top: 1em;" );
m_licenceTextLabel->setObjectName( "licenseItemFullText" );