Mercurial > hg > easaier-soundaccess
comparison widgets/RelatedMediaWidget.cpp @ 163:77f4ef621c54
add FlowLayout.h
author | lbajardsilogic |
---|---|
date | Thu, 15 Nov 2007 16:56:18 +0000 |
parents | a535f9cb792e |
children | 00ab90498dcc |
comparison
equal
deleted
inserted
replaced
162:faafebcf67a2 | 163:77f4ef621c54 |
---|---|
14 #include "RelatedMediaWidget.h" | 14 #include "RelatedMediaWidget.h" |
15 | 15 |
16 #include <QLayoutItem> | 16 #include <QLayoutItem> |
17 #include <QLinearGradient> | 17 #include <QLinearGradient> |
18 #include <QScrollArea> | 18 #include <QScrollArea> |
19 #include <QVBoxLayout> | |
19 | 20 |
20 #include <iostream> | 21 #include <iostream> |
21 | 22 |
22 #include "sv/main/MainWindow.h" | 23 #include "sv/main/MainWindow.h" |
23 | 24 |
24 RelatedMediaWidget::RelatedMediaWidget() : QWidget() , | 25 RelatedMediaWidget::RelatedMediaWidget() : QWidget() , |
25 m_nbRelMedia(0), | 26 m_nbRelMedia(0), |
26 m_painter(0), | 27 m_painter(0), |
27 m_relMediaMaxHeight(150) | 28 m_relMediaMaxHeight(150) |
28 { | 29 { |
29 m_relMediaLayout = new QGridLayout; | 30 m_relMediaLayout = new FlowLayout; |
30 | 31 |
31 QWidget *mediaWidget = new QWidget; | 32 QWidget *mediaWidget = new QWidget; |
32 mediaWidget->setLayout(m_relMediaLayout); | 33 mediaWidget->setLayout(m_relMediaLayout); |
33 | 34 |
34 QScrollArea * scrollArea = new QScrollArea; | 35 /*QScrollArea * scrollArea = new QScrollArea; |
35 scrollArea->setWidget(mediaWidget); | 36 scrollArea->setWidget(mediaWidget); |
36 scrollArea->setWidgetResizable(true); | 37 scrollArea->setWidgetResizable(true); |
37 scrollArea->setMinimumHeight(m_relMediaMaxHeight + 70); | 38 scrollArea->setMinimumHeight(m_relMediaMaxHeight + 70);*/ |
38 | 39 |
39 QVBoxLayout *mainLayout = new QVBoxLayout; | 40 QVBoxLayout *mainLayout = new QVBoxLayout; |
40 mainLayout->addWidget(scrollArea); | 41 //mainLayout->addWidget(scrollArea); |
42 mainLayout->addWidget(mediaWidget); | |
41 mainLayout->setSpacing(0); | 43 mainLayout->setSpacing(0); |
42 mainLayout->setMargin(0); | 44 mainLayout->setMargin(0); |
43 | 45 |
44 setLayout(mainLayout); | 46 setLayout(mainLayout); |
45 } | 47 } |
91 connect(mediaLabel, SIGNAL(linkActivated(QString)), MainWindow::instance(), SLOT(runExternProcess(QString))); | 93 connect(mediaLabel, SIGNAL(linkActivated(QString)), MainWindow::instance(), SLOT(runExternProcess(QString))); |
92 | 94 |
93 QLabel *textLabel = new QLabel(); | 95 QLabel *textLabel = new QLabel(); |
94 textLabel->setText("<html><a >Info may be added here</a><a href=\"" + filename + "\">...</a></html>"); | 96 textLabel->setText("<html><a >Info may be added here</a><a href=\"" + filename + "\">...</a></html>"); |
95 | 97 |
96 m_relMediaLayout->addWidget(mediaLabel, 0, m_nbRelMedia); | 98 QVBoxLayout *mediaLayout = new QVBoxLayout; |
97 m_relMediaLayout->addWidget(textLabel, 1, m_nbRelMedia); | 99 mediaLayout->addWidget(mediaLabel); |
100 mediaLayout->addWidget(textLabel); | |
101 | |
102 QWidget *mediaWidget = new QWidget; | |
103 mediaWidget->setLayout(mediaLayout); | |
104 | |
105 m_relMediaLayout->addWidget(mediaWidget); | |
98 | 106 |
99 m_nbRelMedia++; | 107 m_nbRelMedia++; |
100 } | 108 } |