idok-commit AT lists.psi.ch
Subject: Commit emails of the iDok project
List archive
- From: "AFS account Florian Huebner" <huebner AT savannah.psi.ch>
- To: idok-commit AT lists.psi.ch
- Subject: [idok-commit] idok commit r211 - trunk/java/ch/idok/qtgui
- Date: Thu, 11 Sep 2008 10:27:58 +0200
- List-archive: <https://lists.web.psi.ch/pipermail/idok-commit/>
- List-id: Commit emails of the iDok project <idok-commit.lists.psi.ch>
Author: huebner
Date: Thu Sep 11 10:27:58 2008
New Revision: 211
Log:
Fitting the preview picture to the widget size is now optional
Modified:
trunk/java/ch/idok/qtgui/PreviewImage.java
Modified: trunk/java/ch/idok/qtgui/PreviewImage.java
==============================================================================
--- trunk/java/ch/idok/qtgui/PreviewImage.java (original)
+++ trunk/java/ch/idok/qtgui/PreviewImage.java Thu Sep 11 10:27:58 2008
@@ -38,6 +38,7 @@
private QImage image_;
private double zoom;
private QPoint start_;
+ private boolean fitWidget_ = false;
public PreviewImage() {
}
@@ -61,10 +62,17 @@
public QSize sizeHint() {
return new QSize(500, 500);
}
+
+ public void setfitWidget(boolean fit){
+ fitWidget_ = fit;
+ }
protected void paintEvent(QPaintEvent e) {
QPainter p = new QPainter(this);
p.setRenderHint(QPainter.RenderHint.SmoothPixmapTransform);
+ if (image_!=null && fitWidget_) {
+ resize((int) Math.round(image_.width() * zoom), (int)
Math.round(image_.height() * zoom));
+ }
p.drawImage(rect(), image_);
}
- [idok-commit] idok commit r211 - trunk/java/ch/idok/qtgui, AFS account Florian Huebner, 09/11/2008
Archive powered by MHonArc 2.6.19.