mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-05 18:20:33 -08:00
Compare commits
2 commits
7a4918cc4b
...
7ae3cfb04a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ae3cfb04a | ||
|
|
1411f44994 |
3 changed files with 13 additions and 11 deletions
|
|
@ -186,8 +186,8 @@ QVariant QT::sqlQuery(const QVariant& vQuery, const QVariant& vValues, const QVa
|
|||
while (sqlQuery.next()) {
|
||||
if (cols > 1) {
|
||||
QVariantList list;
|
||||
for (auto r = 0; r < cols; r++) {
|
||||
list << sqlQuery.value(r);
|
||||
for (auto c = 0; c < cols; c++) {
|
||||
list << sqlQuery.value(c);
|
||||
}
|
||||
results << QVariant(list);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ QVariant QT::sqlQuery(const QVariant& vQuery, const QVariant& vValues, const QVa
|
|||
while (sqlQuery.next()) {
|
||||
if (cols > 1) {
|
||||
QVariantList list;
|
||||
for (auto r = 0; r < cols; r++) {
|
||||
list << sqlQuery.value(r);
|
||||
for (auto c = 0; c < cols; c++) {
|
||||
list << sqlQuery.value(c);
|
||||
}
|
||||
results << QVariant(list);
|
||||
} else {
|
||||
|
|
@ -82,12 +82,14 @@ QPixmap DatabaseImageProvider::requestPixmap(const QString& name, QSize* size, c
|
|||
auto result = qt->sqlQuery(
|
||||
"select data from images where name = ?",
|
||||
QVariantList() << name,
|
||||
1); // number of returned columns
|
||||
1).value<QVariantList>(); // number of returned columns
|
||||
QPixmap pixmap;
|
||||
pixmap.loadFromData(result.value<QVariantList>().first().toByteArray());
|
||||
*size = pixmap.size();
|
||||
if (requestedSize.isValid() && (pixmap.size() != requestedSize)) {
|
||||
pixmap = pixmap.scaled(requestedSize);
|
||||
if (!result.isEmpty()) {
|
||||
pixmap.loadFromData(result.first().toByteArray());
|
||||
*size = pixmap.size();
|
||||
if (requestedSize.isValid() && (pixmap.size() != requestedSize)) {
|
||||
pixmap = pixmap.scaled(requestedSize);
|
||||
}
|
||||
}
|
||||
return pixmap;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
(progn
|
||||
(db:delete-all-images)
|
||||
(dolist (file files)
|
||||
(db:save-image (pathname-name file) (file-bytes file)))))
|
||||
(x:d "No 'blob/' directory found."))))
|
||||
(db:save-image (pathname-name file) (file-bytes file))))
|
||||
(x:d "No 'blob/' directory found.")))))
|
||||
|
||||
(qlater 'ini)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue