forked from qt-creator/qt-creator
Qt Quick Designer: Enable HighDPI items in ItemLibrary
Item library icons and the drag pixmap could be avalible as @2x variants. Change-Id: Ice2254e769351fe4b715f911b3c14aa61813636c Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
****************************************************************************/
|
||||
#include "itemlibraryimageprovider.h"
|
||||
|
||||
#include <utils/stylehelper.h>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
namespace Internal {
|
||||
@@ -35,7 +37,7 @@ ItemLibraryImageProvider::ItemLibraryImageProvider() :
|
||||
|
||||
QPixmap ItemLibraryImageProvider::requestPixmap(const QString &id, QSize *size, const QSize &requestedSize)
|
||||
{
|
||||
QPixmap pixmap(id);
|
||||
const QPixmap pixmap(Utils::StyleHelper::dpiSpecificImageFile(id));
|
||||
if (size) {
|
||||
size->setWidth(pixmap.width());
|
||||
size->setHeight(pixmap.height());
|
||||
|
@@ -356,7 +356,8 @@ void ItemLibraryWidget::startDragAndDrop(QVariant itemLibraryId)
|
||||
QMimeData *mimeData = m_itemLibraryModel->getMimeData(m_currentitemLibraryEntry);
|
||||
QDrag *drag = new QDrag(this);
|
||||
|
||||
drag->setPixmap(m_currentitemLibraryEntry.libraryEntryIconPath());
|
||||
drag->setPixmap(Utils::StyleHelper::dpiSpecificImageFile(
|
||||
m_currentitemLibraryEntry.libraryEntryIconPath()));
|
||||
drag->setMimeData(mimeData);
|
||||
|
||||
drag->exec();
|
||||
|
Reference in New Issue
Block a user