changeset 163:77f4ef621c54

add FlowLayout.h
author lbajardsilogic
date Thu, 15 Nov 2007 16:56:18 +0000
parents faafebcf67a2
children 635b837e2801
files widgets/RelatedMediaWidget.cpp widgets/RelatedMediaWidget.h widgets/svwidgets.vcproj widgets/widgets.pro
diffstat 4 files changed, 55 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/widgets/RelatedMediaWidget.cpp	Thu Nov 15 16:48:50 2007 +0000
+++ b/widgets/RelatedMediaWidget.cpp	Thu Nov 15 16:56:18 2007 +0000
@@ -16,6 +16,7 @@
 #include <QLayoutItem>
 #include <QLinearGradient>
 #include <QScrollArea>
+#include <QVBoxLayout>
 
 #include <iostream>
 
@@ -26,18 +27,19 @@
 	m_painter(0),
 	m_relMediaMaxHeight(150)
 {
-	m_relMediaLayout = new QGridLayout; 
+	m_relMediaLayout = new FlowLayout; 
 
 	QWidget *mediaWidget = new QWidget;
 	mediaWidget->setLayout(m_relMediaLayout);
 	
-	QScrollArea * scrollArea = new QScrollArea;
+	/*QScrollArea * scrollArea = new QScrollArea;
 	scrollArea->setWidget(mediaWidget);
 	scrollArea->setWidgetResizable(true);
-	scrollArea->setMinimumHeight(m_relMediaMaxHeight + 70);
+	scrollArea->setMinimumHeight(m_relMediaMaxHeight + 70);*/
 
 	QVBoxLayout *mainLayout = new QVBoxLayout;
-	mainLayout->addWidget(scrollArea);
+	//mainLayout->addWidget(scrollArea);
+	mainLayout->addWidget(mediaWidget);
 	mainLayout->setSpacing(0);
 	mainLayout->setMargin(0);
 
@@ -93,8 +95,14 @@
 	QLabel *textLabel = new QLabel();
 	textLabel->setText("<html><a >Info may be added here</a><a href=\"" + filename + "\">...</a></html>");
 
-	m_relMediaLayout->addWidget(mediaLabel, 0, m_nbRelMedia);
-	m_relMediaLayout->addWidget(textLabel, 1, m_nbRelMedia);
+	QVBoxLayout *mediaLayout = new QVBoxLayout;
+	mediaLayout->addWidget(mediaLabel);
+	mediaLayout->addWidget(textLabel);
+
+	QWidget *mediaWidget = new QWidget;
+	mediaWidget->setLayout(mediaLayout);
+
+	m_relMediaLayout->addWidget(mediaWidget);
 
 	m_nbRelMedia++;
 }
--- a/widgets/RelatedMediaWidget.h	Thu Nov 15 16:48:50 2007 +0000
+++ b/widgets/RelatedMediaWidget.h	Thu Nov 15 16:56:18 2007 +0000
@@ -18,6 +18,8 @@
 #include <QPainter>
 #include <QGridLayout>
 
+#include "FlowLayout.h"
+
 //#include "data/model/AudioSourceInfoModel.h"
 
 class RelatedMediaWidget : public QWidget {
@@ -33,7 +35,7 @@
 	
 protected:
 
-	QGridLayout		*m_relMediaLayout;
+	FlowLayout		*m_relMediaLayout;
 	
 	QWidget *m_mediaWidget;
 
--- a/widgets/svwidgets.vcproj	Thu Nov 15 16:48:50 2007 +0000
+++ b/widgets/svwidgets.vcproj	Thu Nov 15 16:56:18 2007 +0000
@@ -206,6 +206,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\FlowLayout.cpp"
+				>
+			</File>
+			<File
 				RelativePath=".\GenericItemList.cpp"
 				>
 			</File>
@@ -578,6 +582,32 @@
 					</FileConfiguration>
 				</File>
 				<File
+					RelativePath=".\FlowLayout.h"
+					>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCustomBuildTool"
+							Description="MOC $(InputFileName)"
+							CommandLine="$(QTDIR)\bin\moc.exe -DNDEBUG -DBUILD_RELEASE -DUSE_VC -D_WINDOWS -DUNICODE -DQT_LARGEFILE_SUPPORT -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_BZ2 -DHAVE_PORTAUDIO -DHAVE_PORTAUDIO_V18 -DHAVE_OGGZ -DHAVE_FISHSOUND -DHAVE_FFTW3F -DHAVE_VAMP -DHAVE_VAMP_HOSTSDK -DHAVE_SNDFILE -DHAVE_SAMPLERATE -DQT_THREAD_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB  -I &quot;$(QTDIR)\include\QtCore&quot; -I &quot;$(QTDIR)\include\QtCore&quot; -I &quot;$(QTDIR)\include\QtGui&quot; -I &quot;$(QTDIR)\include\QtGui&quot; -I &quot;$(QTDIR)\include\QtXml&quot; -I &quot;$(QTDIR)\include\QtXml&quot; -I &quot;$(QTDIR)\include&quot; -I &quot;.&quot; -I &quot;..&quot; -I &quot;$(QTDIR)\include\ActiveQt&quot; -I &quot;tmp_moc&quot; -I &quot;.&quot; -I&quot;$(QTDIR)\mkspecs\win32-msvc2005&quot; $(InputPath) -o tmp_moc\moc_$(InputName).cpp"
+							AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+							Outputs="tmp_moc\moc_$(InputName).cpp"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCustomBuildTool"
+							Description="MOC $(InputFileName)"
+							CommandLine="$(QTDIR)\bin\moc.exe -DBUILD_DEBUG -DUSE_VC -D_WINDOWS -DUNICODE -DQT_LARGEFILE_SUPPORT -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_BZ2 -DHAVE_PORTAUDIO -DHAVE_PORTAUDIO_V18 -DHAVE_OGGZ -DHAVE_FISHSOUND -DHAVE_FFTW3F -DHAVE_VAMP -DHAVE_VAMP_HOSTSDK -DHAVE_SNDFILE -DHAVE_SAMPLERATE -DQT_THREAD_SUPPORT -DQT_DLL -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB  -I &quot;$(QTDIR)\include\QtCore&quot; -I &quot;$(QTDIR)\include\QtCore&quot; -I &quot;$(QTDIR)\include\QtGui&quot; -I &quot;$(QTDIR)\include\QtGui&quot; -I &quot;$(QTDIR)\include\QtXml&quot; -I &quot;$(QTDIR)\include\QtXml&quot; -I &quot;$(QTDIR)\include&quot; -I &quot;.&quot; -I &quot;..&quot; -I &quot;$(QTDIR)\include\ActiveQt&quot; -I &quot;tmp_moc&quot; -I &quot;.&quot; -I&quot;$(QTDIR)\mkspecs\win32-msvc2005&quot; $(InputPath) -o tmp_moc\moc_$(InputName).cpp"
+							AdditionalDependencies="$(QTDIR)\bin\moc.exe"
+							Outputs="tmp_moc\moc_$(InputName).cpp"
+						/>
+					</FileConfiguration>
+				</File>
+				<File
 					RelativePath=".\GenericItemList.h"
 					>
 					<FileConfiguration
@@ -1624,6 +1654,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\tmp_moc\moc_FlowLayout.cpp"
+				>
+			</File>
+			<File
 				RelativePath=".\tmp_moc\moc_GenericItemList.cpp"
 				>
 			</File>
--- a/widgets/widgets.pro	Thu Nov 15 16:48:50 2007 +0000
+++ b/widgets/widgets.pro	Thu Nov 15 16:56:18 2007 +0000
@@ -58,7 +58,8 @@
            WaitingWidget.h \
            CriteriaDialog.h \
            Slider.h \
-           RelatedMediaWidget.h 
+           RelatedMediaWidget.h \
+           FlowLayout.h 
 SOURCES += AudioDial.cpp \
            Fader.cpp \
            ItemEditDialog.cpp \
@@ -102,5 +103,6 @@
            WaitingWidget.cpp \
            CriteriaDialog.cpp \
            Slider.cpp \
-           RelatedMediaWidget.cpp 
+           RelatedMediaWidget.cpp \
+           FlowLayout.cpp