mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
generic: get QImage and QPixmap objects width and height via the specialized methods
QImage::size() and QPixmap::size() construct QSize object from the internal width and height members Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
55428d34e1
commit
6ed94914fe
3 changed files with 8 additions and 8 deletions
|
@ -879,8 +879,8 @@ void KStatusNotifierItemPrivate::minimizeRestore(bool show)
|
|||
KDbusImageStruct KStatusNotifierItemPrivate::imageToStruct(const QImage &image)
|
||||
{
|
||||
KDbusImageStruct icon;
|
||||
icon.width = image.size().width();
|
||||
icon.height = image.size().height();
|
||||
icon.width = image.width();
|
||||
icon.height = image.height();
|
||||
if (image.format() == QImage::Format_ARGB32) {
|
||||
icon.data = QByteArray((const char*)image.constBits(), image.byteCount());
|
||||
} else {
|
||||
|
|
|
@ -729,8 +729,8 @@ void KWindowSystem::setIcons( WId win, const QPixmap& icon, const QPixmap& miniI
|
|||
NETWinInfo info( QX11Info::display(), win, QX11Info::appRootWindow(), 0 );
|
||||
QImage img = icon.toImage().convertToFormat( QImage::Format_ARGB32 );
|
||||
NETIcon ni;
|
||||
ni.size.width = img.size().width();
|
||||
ni.size.height = img.size().height();
|
||||
ni.size.width = img.width();
|
||||
ni.size.height = img.height();
|
||||
ni.data = (unsigned char *) img.bits();
|
||||
info.setIcon( ni, true );
|
||||
if ( miniIcon.isNull() )
|
||||
|
@ -738,8 +738,8 @@ void KWindowSystem::setIcons( WId win, const QPixmap& icon, const QPixmap& miniI
|
|||
img = miniIcon.toImage().convertToFormat( QImage::Format_ARGB32 );
|
||||
if ( img.isNull() )
|
||||
return;
|
||||
ni.size.width = img.size().width();
|
||||
ni.size.height = img.size().height();
|
||||
ni.size.width = img.width();
|
||||
ni.size.height = img.height();
|
||||
ni.data = (unsigned char *) img.bits();
|
||||
info.setIcon( ni, false );
|
||||
}
|
||||
|
|
|
@ -633,8 +633,8 @@ void SignalPlotter::drawWidget(QPainter *p, uint w, uint height, int horizontalS
|
|||
h -= fontheight;
|
||||
}
|
||||
if (d->backgroundPixmap.isNull() ||
|
||||
(uint)d->backgroundPixmap.size().height() != height ||
|
||||
(uint)d->backgroundPixmap.size().width() != w) {
|
||||
(uint)d->backgroundPixmap.height() != height ||
|
||||
(uint)d->backgroundPixmap.width() != w) {
|
||||
// recreate on resize etc
|
||||
d->backgroundPixmap = QPixmap(w, height);
|
||||
d->backgroundPixmap.fill(Qt::transparent);
|
||||
|
|
Loading…
Add table
Reference in a new issue