[qet] [2561] Add new widget for element properties

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


Revision: 2561
Author:   cfdev
Date:     2013-09-27 22:30:24 +0200 (Fri, 27 Sep 2013)
Log Message:
-----------
Add new widget for element properties

Added Paths:
-----------
    branches/0.4/sources/ui/elementproperties.cpp
    branches/0.4/sources/ui/elementproperties.h
    branches/0.4/sources/ui/elementproperties.ui

Added: branches/0.4/sources/ui/elementproperties.cpp
===================================================================
--- branches/0.4/sources/ui/elementproperties.cpp	                        (rev 0)
+++ branches/0.4/sources/ui/elementproperties.cpp	2013-09-27 20:30:24 UTC (rev 2561)
@@ -0,0 +1,66 @@
+/*
+		Copyright 2006-2013 The QElectroTech Team
+		This file is part of QElectroTech.
+		
+		QElectroTech is free software: you can redistribute it and/or modify
+		it under the terms of the GNU General Public License as published by
+		the Free Software Foundation, either version 2 of the License, or
+		(at your option) any later version.
+		
+		QElectroTech is distributed in the hope that it will be useful,
+		but WITHOUT ANY WARRANTY; without even the implied warranty of
+		MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+		GNU General Public License for more details.
+		
+		You should have received a copy of the GNU General Public License
+		along with QElectroTech.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "elementproperties.h"
+#include "ui_elementproperties.h"
+
+/**
+ * @brief constructor of elementproperties
+ * @param elmt
+ * @param parent
+ */
+elementproperties::elementproperties(Element *elmt, QWidget *parent) :
+	QWidget(parent),
+	ui(new Ui::elementproperties),
+	elmt_ (elmt)
+{
+	ui->setupUi(this);
+	
+	setWindowTitle( tr("Propri\351t\351s de l \351l\351ment") );
+	loadElementUI();
+}
+
+/**
+ * @brief destructor of ~elementproperties
+ */
+elementproperties::~elementproperties() {
+	delete ui;
+}
+
+/**
+ * @brief elementproperties::loadElementUI
+ */
+void elementproperties::loadElementUI() {
+	
+	// Load description from old format
+	QList<ElementTextItem *> elementListItem;
+	elementListItem = elmt_ -> texts();
+	QString desc;
+	for(int i=0; i<elementListItem.count(); i++){
+		desc +=elementListItem.at(i)->text();
+	}
+	ui -> textEditDesc -> setText( desc );
+}
+
+
+/**
+ * @brief elementproperties::on_buttonBox_rejected
+ */
+void elementproperties::on_buttonBox_rejected() {
+	this->close();
+}

Added: branches/0.4/sources/ui/elementproperties.h
===================================================================
--- branches/0.4/sources/ui/elementproperties.h	                        (rev 0)
+++ branches/0.4/sources/ui/elementproperties.h	2013-09-27 20:30:24 UTC (rev 2561)
@@ -0,0 +1,31 @@
+#ifndef ELEMENTPROPERTIES_H
+#define ELEMENTPROPERTIES_H
+
+#include "element.h"
+#include "elementtextitem.h"
+#include <QWidget>
+
+namespace Ui {
+	class elementproperties;
+}
+
+class elementproperties : public QWidget
+{
+	Q_OBJECT
+	
+	public:
+	explicit elementproperties(Element *elmt, QWidget *parent = 0);
+	~elementproperties();
+	
+	void loadElementUI();
+	
+	private slots:
+	void on_buttonBox_rejected();
+	
+	private:
+	Ui::elementproperties *ui;
+	
+	Element *elmt_;
+};
+
+#endif // ELEMENTPROPERTIES_H

Added: branches/0.4/sources/ui/elementproperties.ui
===================================================================
--- branches/0.4/sources/ui/elementproperties.ui	                        (rev 0)
+++ branches/0.4/sources/ui/elementproperties.ui	2013-09-27 20:30:24 UTC (rev 2561)
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>elementproperties</class>
+ <widget class="QWidget" name="elementproperties">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>628</width>
+    <height>407</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_2">
+   <item>
+    <layout class="QVBoxLayout" name="verticalLayout">
+     <item>
+      <widget class="QLabel" name="label_ico">
+       <property name="text">
+        <string/>
+       </property>
+       <property name="pixmap">
+        <pixmap resource="../../qelectrotech.qrc">:/ico/32x32/text-xml.png</pixmap>
+       </property>
+       <property name="scaledContents">
+        <bool>false</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <layout class="QGridLayout" name="gridLayout">
+       <item row="0" column="0">
+        <widget class="QGroupBox" name="groupBox_ref">
+         <property name="title">
+          <string>Références du schéma</string>
+         </property>
+         <layout class="QVBoxLayout" name="verticalLayout_4">
+          <item>
+           <layout class="QGridLayout" name="gridLayout_ref">
+            <item row="0" column="0">
+             <widget class="QLabel" name="label_ref">
+              <property name="text">
+               <string>Ref composant:</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="0">
+             <widget class="QLabel" name="label_2">
+              <property name="text">
+               <string>Ref NO:</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="1">
+             <widget class="QLineEdit" name="lineEdit_ref"/>
+            </item>
+            <item row="1" column="1">
+             <widget class="QLineEdit" name="lineEdit_refNO"/>
+            </item>
+            <item row="2" column="0">
+             <widget class="QLabel" name="label_4">
+              <property name="text">
+               <string>Ref NC:</string>
+              </property>
+             </widget>
+            </item>
+            <item row="2" column="1">
+             <widget class="QLineEdit" name="lineEdit_refNC"/>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item row="0" column="1">
+        <widget class="QGroupBox" name="groupBox_provider">
+         <property name="title">
+          <string>Fournisseur</string>
+         </property>
+         <layout class="QVBoxLayout" name="verticalLayout_5">
+          <item>
+           <layout class="QGridLayout" name="gridLayout_prov">
+            <item row="1" column="0">
+             <widget class="QLabel" name="label">
+              <property name="text">
+               <string>Ref. Catalogue:</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="0">
+             <widget class="QLabel" name="label_3">
+              <property name="text">
+               <string>Nom:</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="1">
+             <widget class="QLineEdit" name="lineEdit_provider_name"/>
+            </item>
+            <item row="1" column="1">
+             <widget class="QLineEdit" name="lineEdit_provider_ref"/>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item row="1" column="0">
+        <widget class="QGroupBox" name="groupBox_desc">
+         <property name="title">
+          <string>Description</string>
+         </property>
+         <layout class="QVBoxLayout" name="verticalLayout_3">
+          <item>
+           <layout class="QVBoxLayout" name="verticalLayout_desc">
+            <item>
+             <widget class="QTextEdit" name="textEditDesc"/>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </widget>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="../../qelectrotech.qrc"/>
+ </resources>
+ <connections/>
+</ui>


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