[qet] [835] Modification du comportement de la fenetre "Apercu avant impression" suite a quelques soucis avec xfwm.

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 835
Author:   xavier
Date:     2010-01-10 02:53:31 +0100 (Sun, 10 Jan 2010)
Log Message:
-----------
Modification du comportement de la fenetre "Apercu avant impression" suite a quelques soucis avec xfwm.

Modified Paths:
--------------
    trunk/sources/diagramprintdialog.cpp
    trunk/sources/qetdiagrameditor.cpp
    trunk/sources/qetdiagrameditor.h
    trunk/sources/qetprintpreviewdialog.cpp

Modified: trunk/sources/diagramprintdialog.cpp
===================================================================
--- trunk/sources/diagramprintdialog.cpp	2010-01-03 19:51:02 UTC (rev 834)
+++ trunk/sources/diagramprintdialog.cpp	2010-01-10 01:53:31 UTC (rev 835)
@@ -121,7 +121,12 @@
 	}
 	
 	// Apercu avant impression
+#if defined Q_WS_X11
+	// suite a quelques soucis avec xfwm, on se contente d'une fenetre sous X11
+	QETPrintPreviewDialog preview_dialog(project_, printer_, parentWidget(), Qt::Window);
+#else
 	QETPrintPreviewDialog preview_dialog(project_, printer_, parentWidget());
+#endif
 	connect(
 		&preview_dialog,
 		SIGNAL(paintRequested(const QList<Diagram *> &, bool, const ExportProperties, QPrinter *)),

Modified: trunk/sources/qetdiagrameditor.cpp
===================================================================
--- trunk/sources/qetdiagrameditor.cpp	2010-01-03 19:51:02 UTC (rev 834)
+++ trunk/sources/qetdiagrameditor.cpp	2010-01-10 01:53:31 UTC (rev 835)
@@ -27,6 +27,7 @@
 #include "qeticons.h"
 #include "qetelementeditor.h"
 #include "qetmessagebox.h"
+#include "qelectrotechmodel.h"
 
 /**
 	constructeur
@@ -73,6 +74,19 @@
 	connect(pa, SIGNAL(requestForNewDiagram(QETProject *)),     this, SLOT(addDiagramToProject(QETProject *)));
 	connect(pa, SIGNAL(requestForDiagramDeletion(Diagram *)),   this, SLOT(removeDiagram(Diagram *)));
 	
+	// 
+	QElectroTechModel *qet_model = new QElectroTechModel(this);
+	QTreeView *tree_view = new QTreeView();
+	
+	
+	// ajout d'un second panel d'element, en MVC
+	qdw_pa2 = new QDockWidget(tr("Panel d'\351l\351ments MVC", "dock title"), this);
+	qdw_pa2 -> setObjectName("elements mvc panel");
+	qdw_pa2 -> setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
+	qdw_pa2 -> setFeatures(QDockWidget::AllDockWidgetFeatures);
+	qdw_pa2 -> setMinimumWidth(160);
+	qdw_pa2 -> setWidget(tree_view); // nimp
+	
 	qdw_undo = new QDockWidget(tr("Annulations", "dock title"));
 	qdw_undo -> setObjectName("diagram_undo");
 	qdw_pa -> setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
@@ -84,6 +98,7 @@
 	qdw_undo -> setWidget(undo_view);
 	
 	addDockWidget(Qt::LeftDockWidgetArea, qdw_undo);
+	addDockWidget(Qt::RightDockWidgetArea, qdw_pa2);
 	tabifyDockWidget(qdw_undo, qdw_pa);
 	
 	// mise en place des actions
@@ -124,6 +139,12 @@
 	
 	// si aucun schema n'a ete ouvert jusqu'a maintenant, on ouvre un nouveau schema
 	if (!opened_projects) newProject();
+	tree_view -> setSelectionMode(QAbstractItemView::SingleSelection);
+	tree_view -> setExpandsOnDoubleClick(false);
+	tree_view -> header() -> hide();
+	tree_view -> setIconSize(QSize(50, 50));
+	tree_view -> setModel(qet_model);
+	
 }
 
 /**

Modified: trunk/sources/qetdiagrameditor.h
===================================================================
--- trunk/sources/qetdiagrameditor.h	2010-01-03 19:51:02 UTC (rev 834)
+++ trunk/sources/qetdiagrameditor.h	2010-01-10 01:53:31 UTC (rev 835)
@@ -211,6 +211,8 @@
 	QDir open_dialog_dir;
 	/// Dock pour le Panel d'Elements
 	QDockWidget *qdw_pa;
+	/// Dock pour le Panel d'Elements MVC
+	QDockWidget *qdw_pa2;
 	/// Dock pour la liste des annulations
 	QDockWidget *qdw_undo;
 	/// Panel d'Elements

Modified: trunk/sources/qetprintpreviewdialog.cpp
===================================================================
--- trunk/sources/qetprintpreviewdialog.cpp	2010-01-03 19:51:02 UTC (rev 834)
+++ trunk/sources/qetprintpreviewdialog.cpp	2010-01-10 01:53:31 UTC (rev 835)
@@ -41,7 +41,7 @@
 	connect(diagrams_list_, SIGNAL(selectionChanged()),         preview_, SLOT(updatePreview()));
 	connect(diagrams_list_, SIGNAL(selectionChanged()),         this,     SLOT(checkDiagramsCount()));
 	
-	setWindowState(Qt::WindowMaximized);
+	setWindowState(windowState() |  Qt::WindowMaximized);
 }
 
 /**


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/