diff options
Diffstat (limited to 'helper.cpp')
-rw-r--r-- | helper.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -1,6 +1,6 @@ #include <QPainter> -#include <QPalette> #include <QAction> +#include <QLabel> #include <QApplication> #include <taglib/fileref.h> @@ -35,4 +35,20 @@ namespace Helper { TagLib::AudioProperties *props = f.audioProperties(); return props->lengthInSeconds(); } + + QColor colorFromLabel(QLabel *l){ + QColor retval; + const QPixmap *pm = l->pixmap(); + if(pm){ + QImage img = pm->toImage(); + retval = img.pixelColor(0, 0); + } + return retval; + } + + void fillLabel(QLabel *l, QColor c){ + QPixmap newPm(l->sizeHint()); + newPm.fill(c); + l->setPixmap(newPm); + } } |