<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<title>Flashmail</title>
<style type="text/css">
BODY, TABLE, TR, TD, P {margin:0;padding:0;}
BODY {background:#FFFFFF;}
</style>
</head>
<body>
<P>Hello,</P>
<P>I do not know how to have the same size for a <FONT face=Verdana size=2>QGraphicsScene and the graphicsView that contains the QGraphicsScene.</FONT></P>
<P><FONT face=Verdana size=2>When I launch my code there is two scroll bares and I just want the QGraphicsScene exactly in the graphicsView.</FONT></P>
<P> </P>
<P>Sommeone can help me.</P>
<P>Best regards.</P>
<P> </P>
<P> </P>
<P>I put two codes juste below.</P>
<P> </P>
<P> </P>
<P>Code of <SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: bold 13px verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,255); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"><SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: bold
13px verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,255); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0">TestDesin.py</SPAN></SPAN></P>
<P><SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: bold 13px verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,255); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"><SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: bold 13px
verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,255); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"><SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: 13px verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE:
normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"></SPAN></SPAN></SPAN> </P>
<P><SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: bold 13px verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,255); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"><SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: bold 13px
verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,255); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"><SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: 13px verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE:
normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"># -*- coding: utf-8 -*-<BR>#!/usr/bin/env python<BR></P></SPAN></SPAN></SPAN>
<P><SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: bold 13px verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,255); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"><SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: bold 13px
verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,255); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"><SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: 13px verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE:
normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0">import sys,math<BR>from PyQt4 import QtCore, QtGui<BR>from window_Dessin import Ui_window_Dessin<BR> <BR>class window_Dessin_Plus(QtGui.QMainWindow, Ui_window_Dessin):<BR> def __init__(self):<BR>
QtGui.QMainWindow.__init__(self)<BR> Ui_window_Dessin.__init__(self)<BR> self.setupUi(self)<BR></SPAN></SPAN></SPAN></P>
<P><SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: bold 13px verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,255); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"><SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: bold 13px
verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,255); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"><SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: 13px verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE:
normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"> self.scene = QtGui.QGraphicsScene(self)<BR> self.scene.setSceneRect(1,1, 596,479)<BR> self.
graphicsView.setScene(self.scene)<BR> <BR>if __name__ == "__main__":<BR> app = QtGui.QApplication(sys.argv)<BR> TestSouris = window_Dessin_Plus()<BR> TestSouris.show()<BR> sys.exit(app.exec_())</SPAN></SPAN></SPAN></P>
<P><SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: bold 13px verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,255); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"><SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: bold 13px
verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,255); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"><SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: 13px verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE:
normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"></SPAN></SPAN></SPAN> </P><SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: bold 13px verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,255); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-
COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"><SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: bold 13px verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,255); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-
horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"><SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: 13px verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-
decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0">
<P>Code of <SPAN class=Apple-style-span style="WORD-SPACING: 0px; FONT: bold 13px verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,255); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0">window_Dessin.py</SPAN></P><SPAN class=Apple-style-span
style="WORD-SPACING: 0px; FONT: 13px verdana; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; TEXT-ALIGN: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0">
<P> </P>
<P>from PyQt4 import QtCore, QtGui<BR> <BR>class Ui_window_Dessin(object):<BR> def setupUi(self, window_Dessin):<BR> window_Dessin.setObjectName("window_Dessin")<BR> window_Dessin.resize(697, 538)<BR> window_Dessin.setMinimumSize(QtCore.QSize(697, 538))<BR> window_Dessin.setMaximumSize(QtCore.QSize(697, 538))<BR>
self.centralwidget = QtGui.QWidget(window_Dessin)<BR> self.centralwidget.setObjectName("centralwidget")<BR> self.layoutWidget = QtGui.QWidget(self.centralwidget)<BR> self.layoutWidget.setGeometry(QtCore.QRect(9, 9, 681, 481))<BR> self.layoutWidget.setObjectName("layoutWidget")<BR>
self.horizontalLayout = QtGui.QHBoxLayout(self.layoutWidget)<BR> self.horizontalLayout.setSizeConstraint(QtGui.QLayout.SetMaximumSize)<BR> self.horizontalLayout.setObjectName("horizontalLayout")<BR> self.graphicsView = GraphicsView_1(self.modifGraph,self.layoutWidget)<BR> self.graphicsView.setMaximumSize(QtCore.QSize(596,
479))<BR> self.graphicsView.setRenderHints(QtGui.QPainter.Antialiasing|QtGui.QPainter.TextAntialiasing)<BR> self.graphicsView.setObjectName("graphicsView")<BR> self.horizontalLayout.addWidget(self.graphicsView)<BR> self.verticalLayout = QtGui.QVBoxLayout()<BR> self.verticalLayout.
setObjectName("verticalLayout")<BR> self.bouton_Effacer = QtGui.QPushButton(self.layoutWidget)<BR> self.bouton_Effacer.setCheckable(False)<BR> self.bouton_Effacer.setObjectName("bouton_Effacer")<BR> self.verticalLayout.addWidget(self.bouton_Effacer)<BR> self.bouton_Point = QtGui.QPushButton(self.
layoutWidget)<BR> self.bouton_Point.setCheckable(True)<BR> self.bouton_Point.setObjectName("bouton_Point")<BR> self.verticalLayout.addWidget(self.bouton_Point)<BR> self.bouton_Segment = QtGui.QPushButton(self.layoutWidget)<BR> self.bouton_Segment.setCheckable(True)<BR>
self.bouton_Segment.setObjectName("bouton_Segment")<BR> self.verticalLayout.addWidget(self.bouton_Segment)<BR> self.bouton_LigneBrisee = QtGui.QPushButton(self.layoutWidget)<BR> self.bouton_LigneBrisee.setCheckable(True)<BR> self.bouton_LigneBrisee.setAutoDefault(False)<BR> self.
bouton_LigneBrisee.setDefault(False)<BR> self.bouton_LigneBrisee.setFlat(False)<BR> self.bouton_LigneBrisee.setObjectName("bouton_LigneBrisee")<BR> self.verticalLayout.addWidget(self.bouton_LigneBrisee)<BR> self.bouton_Cercle = QtGui.QPushButton(self.layoutWidget)<BR> self.bouton_Cercle.
setCheckable(True)<BR> self.bouton_Cercle.setObjectName("bouton_Cercle")<BR> self.verticalLayout.addWidget(self.bouton_Cercle)<BR> self.bouton_zigZag = QtGui.QPushButton(self.layoutWidget)<BR> self.bouton_zigZag.setCheckable(True)<BR> self.bouton_zigZag.setObjectName("bouton_zigZag")<BR>
self.verticalLayout.addWidget(self.bouton_zigZag)<BR> self.horizontalLayout.addLayout(self.verticalLayout)<BR> window_Dessin.setCentralWidget(self.centralwidget)<BR> self.menubar = QtGui.QMenuBar(window_Dessin)<BR> self.menubar.setGeometry(QtCore.QRect(0, 0, 697, 21))<BR>
self.menubar.setObjectName("menubar")<BR> window_Dessin.setMenuBar(self.menubar)<BR> self.statusbar = QtGui.QStatusBar(window_Dessin)<BR> self.statusbar.setObjectName("statusbar")<BR> window_Dessin.setStatusBar(self.statusbar)<BR> <BR> self.retranslateUi(window_Dessin)<BR>
QtCore.QMetaObject.connectSlotsByName(window_Dessin)<BR> <BR> def retranslateUi(self, window_Dessin):<BR> window_Dessin.setWindowTitle(QtGui.QApplication.translate("window_Dessin", "MainWindow", None, QtGui.QApplication.UnicodeUTF8))<BR> self.bouton_Effacer.setText(QtGui.QApplication.translate("window_Dessin", "Effacer", None, QtGui.QApplication.UnicodeUTF8))<BR>
self.bouton_Point.setText(QtGui.QApplication.translate("window_Dessin", "Point", None, QtGui.QApplication.UnicodeUTF8))<BR> self.bouton_Segment.setText(QtGui.QApplication.translate("window_Dessin", "Segment", None, QtGui.QApplication.UnicodeUTF8))<BR> self.bouton_LigneBrisee.setText(QtGui.QApplication.translate("window_Dessin", "Ligne Brisée", None, QtGui.QApplication.UnicodeUTF8))
<BR> self.bouton_Cercle.setText(QtGui.QApplication.translate("window_Dessin", "Cercle", None, QtGui.QApplication.UnicodeUTF8))<BR> self.bouton_zigZag.setText(QtGui.QApplication.translate("window_Dessin", "Zig Zag", None, QtGui.QApplication.UnicodeUTF8))</SPAN></P></SPAN></SPAN></SPAN></body></html>