Mercurial > hg > easaier-soundaccess
diff widgets/SearchWidget.cpp @ 228:a6b881972a62
add FileProperty to browse file on local system for query by humming
author | lbajardsilogic |
---|---|
date | Fri, 29 Feb 2008 11:08:09 +0000 |
parents | faafebcf67a2 |
children | 60e84bb658bc |
line wrap: on
line diff
--- a/widgets/SearchWidget.cpp Wed Feb 27 16:00:02 2008 +0000 +++ b/widgets/SearchWidget.cpp Fri Feb 29 11:08:09 2008 +0000 @@ -26,6 +26,7 @@ #include <iostream> #include "sv/main/MainWindow.h" +#include "BrowseLineEdit.h" SearchWidget::SearchWidget() : QWidget(), m_curThemeWidget(0), @@ -175,6 +176,8 @@ PropertyContainer::PropertyType type = curTheme->getPropertyType(name); + QString unit = curTheme->getPropertyUnit(name); + switch (type) //draw a different widget according to the datatype { case PropertyContainer::StringProperty: @@ -224,6 +227,18 @@ break; } + case PropertyContainer::FileProperty: + { + BrowseLineEdit * browseLineEdit = new BrowseLineEdit(); + + connect(browseLineEdit, SIGNAL(textChanged(const QString &)), curTheme, SLOT(setProperty(QString))); + + m_curBoxLayout->addWidget(browseLineEdit, m_curBoxRow, 2); + + field = browseLineEdit; + + break; + } default: break; @@ -234,9 +249,7 @@ field->setObjectName(name); m_curBoxLayout->addWidget(field, m_curBoxRow, 1); } - - QString unit = curTheme->getPropertyUnit(name); - + if (unit != "") { m_curBoxLayout->addWidget(new QLabel(unit), m_curBoxRow, 2);