Get rid of QPixmap pointers
According to my understanding of Qt documentation, there should be no need to manually create QPixmap with new and delete. This also makes things simpler for the model.
This commit is contained in:
parent
dafe9d2c3e
commit
061251bc26
2 changed files with 17 additions and 17 deletions
|
@ -38,7 +38,7 @@ namespace Danbooru {
|
|||
|
||||
const QMap<QString, Rating> DanbooruPost::RATING_MAP = initRatingMap();
|
||||
|
||||
DanbooruPost::DanbooruPost(QVariantMap postData, QPixmap* pixmap,
|
||||
DanbooruPost::DanbooruPost(QVariantMap postData, QPixmap pixmap,
|
||||
QObject* parent):
|
||||
QObject(parent),
|
||||
m_pixmap(pixmap)
|
||||
|
@ -56,9 +56,7 @@ namespace Danbooru {
|
|||
|
||||
}
|
||||
|
||||
DanbooruPost::DanbooruPost(QXmlStreamAttributes& postData,
|
||||
QPixmap* pixmap,
|
||||
QObject* parent):
|
||||
DanbooruPost::DanbooruPost(QXmlStreamAttributes& postData, QPixmap pixmap, QObject* parent):
|
||||
QObject(parent),
|
||||
m_pixmap(pixmap)
|
||||
{
|
||||
|
@ -101,7 +99,7 @@ namespace Danbooru {
|
|||
}
|
||||
|
||||
|
||||
void DanbooruPost::setPixmap(const QPixmap* pixmap)
|
||||
void DanbooruPost::setPixmap(const QPixmap pixmap)
|
||||
{
|
||||
m_pixmap = pixmap;
|
||||
}
|
||||
|
@ -138,7 +136,7 @@ namespace Danbooru {
|
|||
return m_thumbnailUrl;
|
||||
}
|
||||
|
||||
const QPixmap* DanbooruPost::pixmap() const
|
||||
const QPixmap DanbooruPost::pixmap() const
|
||||
{
|
||||
return m_pixmap;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue