set flickable content position

Reza Shah rshah0385 at kireihana.com
Mon Nov 5 12:57:12 UTC 2012


Seems these codes fixed the problem.
QImageItem {
    id: comicPicture

    anchors.centerIn: parent

    width: actualSize ? comicPicture.nativeWidth : viewContainer.width
    height: actualSize ? comicPicture.nativeHeight : viewContainer.height

    smooth: true
    fillMode: QImageItem.PreserveAspectFit
    onImageChanged: {
	viewContainer.contentX = (root.isLeftToRight) ? 0 : (
viewContainer.contentWidth - viewContainer.width);
	viewContainer.contentY = (root.isTopToBottom) ? 0 : (
viewContainer.contentHeight - viewContainer.height);
    }
}

Thanks,
Reza

On Mon, Nov 5, 2012 at 9:02 PM, Reza Shah <rshah0385 at kireihana.com> wrote:
> Hi Marco,
>
> I replaced as your suggestion, it worked, but has little problem with
> the scrollbar position as in this: http://paste.opensuse.org/4552016.
> Is this fixable from my codes?
>
> Regards,
> Reza
> On Sun, Nov 4, 2012 at 9:27 PM, Marco Martin <notmart at gmail.com> wrote:
>>
>> use viewContainer.contentWidth instead of
>> comicPicture.nativeWidth
>>
>>
>> cheers,
>> Marco Martin


More information about the Plasma-devel mailing list