mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
Improve some layout and widget item
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4920 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
parent
7f5f2b0081
commit
945d8562ca
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>650</width>
|
||||
<height>550</height>
|
||||
<width>460</width>
|
||||
<height>508</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -25,122 +25,8 @@
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>50</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>450</width>
|
||||
<height>253</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="sizeIncrement">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="mouseTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignHCenter|Qt::AlignTop</set>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>630</width>
|
||||
<height>495</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>430</width>
|
||||
<height>250</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Project Status:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QComboBox" name="m_status_cb">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="3">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="3">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Range</string>
|
||||
@ -232,7 +118,39 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="4">
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Apply|QDialogButtonBox::Help</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Project Status:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Update Policy</string>
|
||||
@ -291,6 +209,19 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -377,6 +308,19 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -440,29 +384,51 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="m_status_cb">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Apply|QDialogButtonBox::Help</set>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
@ -1,113 +0,0 @@
|
||||
/*
|
||||
Copyright 2006-2017 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 "dialogautonum.h"
|
||||
#include "ui_dialogautonum.h"
|
||||
|
||||
//#include "conductorautonumerotation.h"
|
||||
#include "qetmessagebox.h"
|
||||
#include "ui/selectautonumw.h"
|
||||
|
||||
/**
|
||||
* @brief DialogAutoNum::DialogAutoNum
|
||||
* @param dg
|
||||
* @param parent
|
||||
*/
|
||||
DialogAutoNum::DialogAutoNum(Diagram *dg, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::DialogAutoNum),
|
||||
dg_ (dg)
|
||||
{
|
||||
ui -> setupUi(this);
|
||||
|
||||
ui -> configuration_layout -> addWidget (new SelectAutonumW());
|
||||
|
||||
dgselect_ = new diagramselection( dg_ -> project(), ui -> annotation_tab);
|
||||
ui -> verticalLayout_Selection -> addWidget(dgselect_);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
DialogAutoNum::~DialogAutoNum(){
|
||||
delete ui;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DialogAutoNum::on_pushButton_delete_clicked
|
||||
*/
|
||||
void DialogAutoNum::on_pushButton_delete_clicked() {
|
||||
// get list of diagrams selected
|
||||
QList<Diagram *>listDiag = dgselect_ -> list_of_DiagramSelected();
|
||||
if(listDiag.count()<=0) return;
|
||||
|
||||
QString diagramsTitle;
|
||||
for(int i=0; i<listDiag.count(); i++){
|
||||
diagramsTitle += listDiag.at(i) -> title();
|
||||
if(i+1 < listDiag.count()) diagramsTitle += ", ";
|
||||
}
|
||||
// Ask if user is sure to delete the conductor numerotation
|
||||
QMessageBox::StandardButton answer = QET::QetMessageBox::critical(
|
||||
this,
|
||||
tr("Suppression des annotations conducteurs", "Attention"),
|
||||
QString(
|
||||
tr("Voulez-vous vraiment supprimer les annotations conducteurs de :\n\n%1 ?")
|
||||
).arg(diagramsTitle),
|
||||
QMessageBox::Yes | QMessageBox::No,
|
||||
QMessageBox::No
|
||||
);
|
||||
|
||||
// if yes remove all
|
||||
if( answer == QMessageBox::Yes) {
|
||||
for(int i=0; i<listDiag.count(); i++){
|
||||
/*ConductorAutoNumerotation can(listDiag.at(i));
|
||||
can.removeNumOfDiagram();*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief set the autonum to all diagram selected
|
||||
*/
|
||||
void DialogAutoNum::on_pushButton_annotation_clicked(){
|
||||
// Get list of diagrams selected
|
||||
QList<Diagram *>listDiag = dgselect_ -> list_of_DiagramSelected();
|
||||
if(listDiag.count()<=0) return;
|
||||
|
||||
QString diagramsTitle;
|
||||
for(int i=0; i<listDiag.count(); i++){
|
||||
diagramsTitle += listDiag.at(i) -> title();
|
||||
if(i+1 < listDiag.count()) diagramsTitle += ", ";
|
||||
}
|
||||
// Ask if user is sure to numerate the conductor
|
||||
QET::QetMessageBox::warning(
|
||||
this,
|
||||
tr("Annotation des conducteurs", "Attention"),
|
||||
QString(
|
||||
tr("Voulez-vous vraiment annoter les conducteurs de :\n\n%1 ?")
|
||||
).arg(diagramsTitle),
|
||||
QMessageBox::Yes | QMessageBox::No,
|
||||
QMessageBox::No
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Close the dialog
|
||||
*/
|
||||
void DialogAutoNum::on_pushButton_close_clicked() {
|
||||
close();
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
/*
|
||||
Copyright 2006-2017 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/>.
|
||||
*/
|
||||
#ifndef DIALOGAUTONUM_H
|
||||
#define DIALOGAUTONUM_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#include "diagram.h"
|
||||
#include "ui/diagramselection.h"
|
||||
|
||||
namespace Ui {
|
||||
class DialogAutoNum;
|
||||
}
|
||||
|
||||
class DialogAutoNum : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DialogAutoNum(Diagram *dg, QWidget *parent = 0);
|
||||
~DialogAutoNum();
|
||||
|
||||
private slots:
|
||||
void on_pushButton_annotation_clicked();
|
||||
void on_pushButton_delete_clicked();
|
||||
void on_pushButton_close_clicked();
|
||||
|
||||
private:
|
||||
Ui::DialogAutoNum *ui;
|
||||
Diagram *dg_;
|
||||
diagramselection *dgselect_;
|
||||
};
|
||||
|
||||
#endif // DialogAutoNum_H
|
@ -1,162 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DialogAutoNum</class>
|
||||
<widget class="QDialog" name="DialogAutoNum">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>482</width>
|
||||
<height>416</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Annotation des schémas</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="../../qelectrotech.qrc">
|
||||
<normaloff>:/ico/oxygen-icons/32x32/apps/qelectrotech.png</normaloff>:/ico/oxygen-icons/32x32/apps/qelectrotech.png</iconset>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="configuration_tab">
|
||||
<attribute name="title">
|
||||
<string>Configuration</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="configuration_layout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="annotation_tab">
|
||||
<attribute name="title">
|
||||
<string>Annotation</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_Selection">
|
||||
<property name="title">
|
||||
<string>Sélection</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_conductor">
|
||||
<property name="text">
|
||||
<string>Conducteurs</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../qelectrotech.qrc">
|
||||
<normaloff>:/ico/22x22/conductor2.png</normaloff>:/ico/22x22/conductor2.png</iconset>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_component">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Composants</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../qelectrotech.qrc">
|
||||
<normaloff>:/ico/22x22/single_page.png</normaloff>:/ico/22x22/single_page.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_Selection"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_annotation">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Numérotée les folio sélectionné</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Annotation (alpha)</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../qelectrotech.qrc">
|
||||
<normaloff>:/ico/16x16/edit-select-all.png</normaloff>:/ico/16x16/edit-select-all.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_delete">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Supprimé la numérotation des folio sélectionné</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Supprimer l'annotation</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../qelectrotech.qrc">
|
||||
<normaloff>:/ico/16x16/edit-delete.png</normaloff>:/ico/16x16/edit-delete.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_close">
|
||||
<property name="text">
|
||||
<string>Fermer</string>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../qelectrotech.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>524</width>
|
||||
<height>550</height>
|
||||
<width>460</width>
|
||||
<height>309</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -26,76 +26,76 @@
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>50</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>450</width>
|
||||
<height>253</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="sizeIncrement">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="mouseTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignHCenter|Qt::AlignTop</set>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>504</width>
|
||||
<height>495</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>430</width>
|
||||
<height>250</height>
|
||||
</size>
|
||||
<property name="text">
|
||||
<string>Numérotation automatique de Folio :</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="m_autonums_cb">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item row="2" column="1" colspan="2">
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="Select">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Sélection:</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_create_new_tabs_rb">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Créer de nouveaux Folios</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_autonumber_tabs_rb">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>NumAuto des folios séléctionnés</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="Options">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
@ -191,74 +191,9 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QGroupBox" name="Select">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Sélection:</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_create_new_tabs_rb">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Créer de nouveaux Folios</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_autonumber_tabs_rb">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>NumAuto des folios séléctionnés</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Numérotation automatique de Folio :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QComboBox" name="m_autonums_cb">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@ -271,10 +206,6 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="sizePolicy">
|
||||
@ -289,6 +220,10 @@
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<zorder>buttonBox</zorder>
|
||||
<zorder>verticalSpacer</zorder>
|
||||
<zorder>gridLayoutWidget</zorder>
|
||||
<zorder>verticalSpacer</zorder>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
@ -40,8 +40,21 @@
|
||||
<property name="title">
|
||||
<string>Auto Naming Pattern:</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Formula:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="m_formula_le">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
@ -60,18 +73,18 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Formula:</string>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
@ -22,10 +22,11 @@
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
NumPartEditorW::NumPartEditorW(QWidget *parent) :
|
||||
NumPartEditorW::NumPartEditorW(int type, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::NumPartEditorW),
|
||||
intValidator (new QIntValidator(0,99999,this))
|
||||
intValidator (new QIntValidator(0,99999,this)),
|
||||
m_edited_type(type)
|
||||
{
|
||||
ui -> setupUi(this);
|
||||
setVisibleItems();
|
||||
@ -36,10 +37,11 @@ NumPartEditorW::NumPartEditorW(QWidget *parent) :
|
||||
* Constructor
|
||||
* Build with value of @context at position i
|
||||
*/
|
||||
NumPartEditorW::NumPartEditorW (NumerotationContext &context, int i, QWidget *parent):
|
||||
NumPartEditorW::NumPartEditorW (NumerotationContext &context, int i, int type, QWidget *parent):
|
||||
QWidget(parent),
|
||||
ui(new Ui::NumPartEditorW),
|
||||
intValidator (new QIntValidator(0,99999,this))
|
||||
intValidator (new QIntValidator(0,99999,this)),
|
||||
m_edited_type(type)
|
||||
{
|
||||
ui -> setupUi(this);
|
||||
setVisibleItems();
|
||||
@ -75,15 +77,18 @@ NumPartEditorW::~NumPartEditorW()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void NumPartEditorW::setVisibleItems() {
|
||||
void NumPartEditorW::setVisibleItems()
|
||||
{
|
||||
ui->type_cb->setInsertPolicy(QComboBox::InsertAtBottom);
|
||||
QStringList items;
|
||||
if (parentWidget()->parentWidget()->objectName()=="FolioTab") {
|
||||
if (m_edited_type == 2)
|
||||
{
|
||||
items << tr("Chiffre 1") << tr("Chiffre 01")
|
||||
<< tr("Chiffre 001")
|
||||
<< tr("Texte");
|
||||
}
|
||||
else if (parentWidget()->parentWidget()->objectName()=="ConductorTab") {
|
||||
else if (m_edited_type == 1)
|
||||
{
|
||||
items << tr("Chiffre 1") << tr("Chiffre 1 - Folio") << tr("Chiffre 01")
|
||||
<< tr("Chiffre 01 - Folio") << tr("Chiffre 001") << tr("Chiffre 001 - Folio")
|
||||
<< tr("Texte") << tr("N° folio") << tr("Folio") << tr("Machine") << tr("Locmach");
|
||||
|
@ -37,8 +37,8 @@ class NumPartEditorW : public QWidget
|
||||
|
||||
//METHODS
|
||||
public:
|
||||
explicit NumPartEditorW(QWidget *parent = 0);
|
||||
NumPartEditorW (NumerotationContext &, int, QWidget *parent=0);
|
||||
explicit NumPartEditorW(int type, QWidget *parent = 0);
|
||||
NumPartEditorW (NumerotationContext &, int, int type, QWidget *parent=0);
|
||||
~NumPartEditorW();
|
||||
|
||||
enum type {unit,unitfolio,ten,tenfolio, hundred, hundredfolio,
|
||||
@ -66,6 +66,8 @@ class NumPartEditorW : public QWidget
|
||||
private:
|
||||
Ui::NumPartEditorW *ui;
|
||||
QValidator *intValidator;
|
||||
int m_edited_type = -1; //0 == element : 1 == conductor : 2 == folio
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
@ -27,36 +27,44 @@
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
SelectAutonumW::SelectAutonumW(QWidget *parent) :
|
||||
SelectAutonumW::SelectAutonumW(int type, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::SelectAutonumW)
|
||||
ui(new Ui::SelectAutonumW),
|
||||
m_edited_type(type)
|
||||
{
|
||||
|
||||
ui->setupUi(this);
|
||||
if (this->parentWidget() -> objectName()=="ElementTab"){
|
||||
if (m_edited_type == 0)
|
||||
{
|
||||
m_feaw = new FormulaAutonumberingW();
|
||||
ui->scrollAreaWidgetContents->layout()->addWidget(m_feaw);
|
||||
m_feaw->ui->label->setHidden(true);
|
||||
ui->m_widget->layout()->addWidget(m_feaw);
|
||||
}
|
||||
else if (this->parentWidget() -> objectName()=="ConductorTab"){
|
||||
else if (m_edited_type == 1)
|
||||
{
|
||||
m_fcaw = new FormulaAutonumberingW();
|
||||
m_fcaw->ui->label->setHidden(true);
|
||||
ui->scrollAreaWidgetContents->layout()->addWidget(m_fcaw);
|
||||
ui->m_widget->layout()->addWidget(m_fcaw);
|
||||
}
|
||||
setContext(NumerotationContext());
|
||||
}
|
||||
|
||||
SelectAutonumW::SelectAutonumW(const NumerotationContext &context, QWidget *parent) :
|
||||
SelectAutonumW::SelectAutonumW(const NumerotationContext &context, int type, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::SelectAutonumW)
|
||||
ui(new Ui::SelectAutonumW),
|
||||
m_edited_type(type)
|
||||
{
|
||||
if (this->parentWidget() -> objectName()=="ElementTab"){
|
||||
if (m_edited_type == 0)
|
||||
{
|
||||
m_feaw = new FormulaAutonumberingW();
|
||||
ui->scrollAreaWidgetContents->layout()->addWidget(m_feaw);
|
||||
m_feaw->ui->label->setHidden(true);
|
||||
ui->m_widget->layout()->addWidget(m_feaw);
|
||||
}
|
||||
else if (this->parentWidget() -> objectName()=="ConductorTab"){
|
||||
else if (m_edited_type == 1)
|
||||
{
|
||||
m_fcaw = new FormulaAutonumberingW();
|
||||
m_fcaw->ui->label->setHidden(true);
|
||||
ui->scrollAreaWidgetContents->layout()->addWidget(m_fcaw);
|
||||
ui->m_widget->layout()->addWidget(m_fcaw);
|
||||
}
|
||||
ui->setupUi(this);
|
||||
setContext(context);
|
||||
@ -85,7 +93,7 @@ void SelectAutonumW::setContext(const NumerotationContext &context) {
|
||||
}
|
||||
else {
|
||||
for (int i=0; i<m_context.size(); ++i) { //build with the content of @context
|
||||
NumPartEditorW *part= new NumPartEditorW(m_context, i, this);
|
||||
NumPartEditorW *part= new NumPartEditorW(m_context, i, m_edited_type, this);
|
||||
connect (part, SIGNAL(changed()), this, SLOT(applyEnable()));
|
||||
num_part_list_ << part;
|
||||
ui -> editor_layout -> addWidget(part);
|
||||
@ -113,9 +121,10 @@ NumerotationContext SelectAutonumW::toNumContext() const {
|
||||
* @brief SelectAutonumW::on_add_button_clicked
|
||||
* Action on add_button, add a @NumPartEditor
|
||||
*/
|
||||
void SelectAutonumW::on_add_button_clicked() {
|
||||
void SelectAutonumW::on_add_button_clicked()
|
||||
{
|
||||
applyEnable(false);
|
||||
NumPartEditorW *part = new NumPartEditorW(this);
|
||||
NumPartEditorW *part = new NumPartEditorW(m_edited_type, this);
|
||||
connect (part, SIGNAL(changed()), this, SLOT(applyEnable()));
|
||||
num_part_list_ << part;
|
||||
ui -> editor_layout -> addWidget(part);
|
||||
@ -143,12 +152,14 @@ void SelectAutonumW::on_remove_button_clicked() {
|
||||
* @brief SelectAutonumW::formula
|
||||
* @return autonumbering widget formula
|
||||
*/
|
||||
QString SelectAutonumW::formula() {
|
||||
if (this->parentWidget() -> objectName()=="ElementTab")
|
||||
QString SelectAutonumW::formula()
|
||||
{
|
||||
if (m_edited_type == 0)
|
||||
return m_feaw->formula();
|
||||
else if (this->parentWidget() ->objectName()=="ConductorTab")
|
||||
else if (m_edited_type == 1)
|
||||
return m_fcaw->formula();
|
||||
else return "";
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
@ -165,7 +176,8 @@ void SelectAutonumW::on_buttonBox_clicked(QAbstractButton *button) {
|
||||
break;
|
||||
//help dialog
|
||||
case QDialogButtonBox::HelpRole:
|
||||
if (this->parentWidget() -> objectName()=="FolioTab"){
|
||||
if (m_edited_type == 2)
|
||||
{
|
||||
QMessageBox::information (this, tr("Folio Autonumérotation", "title window"),
|
||||
tr("C'est ici que vous pouvez définir la manière dont sera numéroté les nouveaux folios.\n"
|
||||
"-Une numérotation est composée d'une variable minimum.\n"
|
||||
@ -183,7 +195,8 @@ void SelectAutonumW::on_buttonBox_clicked(QAbstractButton *button) {
|
||||
));
|
||||
break;
|
||||
}
|
||||
else{
|
||||
else
|
||||
{
|
||||
QMessageBox::information (this, tr("Conducteur Autonumérotation", "title window"),
|
||||
tr("C'est ici que vous pouvez définir la manière dont sera numéroté les nouveaux conducteurs.\n"
|
||||
"-Une numérotation est composée d'une variable minimum.\n"
|
||||
@ -234,9 +247,9 @@ void SelectAutonumW::applyEnable(bool b) {
|
||||
else {
|
||||
ui -> buttonBox -> button(QDialogButtonBox::Apply) -> setEnabled(b);
|
||||
}
|
||||
if (this->parentWidget() -> objectName()=="ElementTab")
|
||||
if (m_edited_type == 0)
|
||||
contextToFormula();
|
||||
if (this->parentWidget()->objectName()=="ConductorTab")
|
||||
if (m_edited_type == 1)
|
||||
contextToFormula();
|
||||
}
|
||||
|
||||
@ -247,9 +260,9 @@ void SelectAutonumW::applyEnable(bool b) {
|
||||
void SelectAutonumW::contextToFormula()
|
||||
{
|
||||
FormulaAutonumberingW* m_faw = nullptr;
|
||||
if (this->parentWidget() -> objectName()=="ElementTab")
|
||||
if (m_edited_type == 0)
|
||||
m_faw = m_feaw;
|
||||
else if (this->parentWidget()->objectName()=="ConductorTab")
|
||||
else if (m_edited_type == 1)
|
||||
m_faw = m_fcaw;
|
||||
|
||||
if (m_faw)
|
||||
|
@ -36,8 +36,8 @@ class SelectAutonumW : public QWidget
|
||||
|
||||
//METHODS
|
||||
public:
|
||||
explicit SelectAutonumW(QWidget *parent = 0);
|
||||
explicit SelectAutonumW(const NumerotationContext &context, QWidget *parent = 0);
|
||||
explicit SelectAutonumW(int type, QWidget *parent = 0);
|
||||
explicit SelectAutonumW(const NumerotationContext &context, int type, QWidget *parent = 0);
|
||||
~SelectAutonumW();
|
||||
|
||||
void setContext (const NumerotationContext &context);
|
||||
@ -68,6 +68,7 @@ class SelectAutonumW : public QWidget
|
||||
NumerotationContext m_context;
|
||||
FormulaAutonumberingW *m_feaw;
|
||||
FormulaAutonumberingW *m_fcaw;
|
||||
int m_edited_type = -1; //0 == element : 1 == conductor : 2 == folio
|
||||
};
|
||||
|
||||
#endif // SELECTAUTONUMW_H
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>418</width>
|
||||
<height>508</height>
|
||||
<width>616</width>
|
||||
<height>421</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -21,73 +21,25 @@
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>455</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="sizeIncrement">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="mouseTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>453</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>450</height>
|
||||
</size>
|
||||
</property>
|
||||
<widget class="QWidget" name="m_widget" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="definition_groupe">
|
||||
<widget class="QGroupBox" name="m_definition_groupe">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
@ -102,7 +54,7 @@
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
@ -113,7 +65,7 @@
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
@ -134,7 +86,7 @@
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../qelectrotech.qrc">
|
||||
<iconset resource="../../../qelectrotech.qrc">
|
||||
<normaloff>:/ico/22x22/list-remove.png</normaloff>:/ico/22x22/list-remove.png</iconset>
|
||||
</property>
|
||||
<property name="flat">
|
||||
@ -151,7 +103,7 @@
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../qelectrotech.qrc">
|
||||
<iconset resource="../../../qelectrotech.qrc">
|
||||
<normaloff>:/ico/22x22/list-add.png</normaloff>:/ico/22x22/list-add.png</iconset>
|
||||
</property>
|
||||
<property name="flat">
|
||||
@ -168,7 +120,7 @@
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../qelectrotech.qrc">
|
||||
<iconset resource="../../../qelectrotech.qrc">
|
||||
<normaloff>:/ico/16x16/arrow-left.png</normaloff>:/ico/16x16/arrow-left.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@ -182,13 +134,13 @@
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../qelectrotech.qrc">
|
||||
<iconset resource="../../../qelectrotech.qrc">
|
||||
<normaloff>:/ico/16x16/arrow-right.png</normaloff>:/ico/16x16/arrow-right.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
@ -234,7 +186,7 @@
|
||||
<string>Valeur</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -258,29 +210,25 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="sizePolicy">
|
||||
@ -297,7 +245,7 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../qelectrotech.qrc"/>
|
||||
<include location="../../../qelectrotech.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -222,7 +222,6 @@ ProjectAutoNumConfigPage::ProjectAutoNumConfigPage (QETProject *project, QWidget
|
||||
ProjectConfigPage(project, parent)
|
||||
{
|
||||
initWidgets();
|
||||
initLayout();
|
||||
buildConnections();
|
||||
readValuesFromProject();
|
||||
}
|
||||
@ -254,127 +253,101 @@ void ProjectAutoNumConfigPage::applyProjectConf() {}
|
||||
* @brief ProjectAutoNumConfigPage::initWidgets
|
||||
* Init some widget of this page
|
||||
*/
|
||||
void ProjectAutoNumConfigPage::initWidgets() {
|
||||
void ProjectAutoNumConfigPage::initWidgets()
|
||||
{
|
||||
QTabWidget *tab_widget = new QTabWidget(this);
|
||||
|
||||
tab_widget = new QTabWidget(this);
|
||||
//Management tab
|
||||
m_amw = new AutoNumberingManagementW(project());
|
||||
tab_widget->addTab(m_amw, tr("Management"));
|
||||
|
||||
management_tab_widget = new QWidget(this);
|
||||
m_amw = new AutoNumberingManagementW(project(), management_tab_widget);
|
||||
//Conductor tab
|
||||
QWidget *conductor_widget = new QWidget();
|
||||
QVBoxLayout *conductor_layout = new QVBoxLayout(conductor_widget);
|
||||
QHBoxLayout *bp_conductor_layout = new QHBoxLayout();
|
||||
|
||||
//Conductor Tab
|
||||
conductor_tab_widget = new QWidget(this);
|
||||
conductor_tab_widget->setObjectName("ConductorTab");
|
||||
|
||||
m_label_conductor = new QLabel(tr("Numérotations disponibles :", "availables numerotations"), conductor_tab_widget);
|
||||
|
||||
m_context_cb_conductor= new QComboBox(conductor_tab_widget);
|
||||
QLabel *label_conductor = new QLabel(tr("Numérotations disponibles :", "availables numerotations"));
|
||||
m_context_cb_conductor= new QComboBox();
|
||||
m_context_cb_conductor->setEditable(true);
|
||||
m_context_cb_conductor->lineEdit()->setClearButtonEnabled(true);
|
||||
m_context_cb_conductor->addItem(tr("Nom de la nouvelle numérotation"));
|
||||
|
||||
m_remove_pb_conductor= new QPushButton(QET::Icons::EditDelete, QString(), conductor_tab_widget);
|
||||
m_remove_pb_conductor= new QPushButton(QET::Icons::EditDelete, QString());
|
||||
m_remove_pb_conductor-> setToolTip(tr("Supprimer la numérotation"));
|
||||
|
||||
m_saw_conductor = new SelectAutonumW(conductor_tab_widget);
|
||||
m_saw_conductor = new SelectAutonumW(1);
|
||||
|
||||
//Element Tab
|
||||
element_tab_widget = new QWidget(this);
|
||||
element_tab_widget->setObjectName("ElementTab");
|
||||
bp_conductor_layout->addWidget(label_conductor);
|
||||
bp_conductor_layout->addStretch();
|
||||
bp_conductor_layout->addWidget(m_context_cb_conductor);
|
||||
bp_conductor_layout->addWidget(m_remove_pb_conductor);
|
||||
|
||||
m_label_element = new QLabel(tr("Numérotations disponibles :", "availables numerotations"), element_tab_widget);
|
||||
conductor_layout->addLayout(bp_conductor_layout);
|
||||
conductor_layout->addWidget(m_saw_conductor);
|
||||
|
||||
m_context_cb_element = new QComboBox(element_tab_widget);
|
||||
tab_widget->addTab(conductor_widget, tr("Conducteur"));
|
||||
|
||||
//Element tab
|
||||
QWidget *element_widget = new QWidget();
|
||||
QVBoxLayout *element_layout = new QVBoxLayout(element_widget);
|
||||
QHBoxLayout *bp_element_layout = new QHBoxLayout();
|
||||
|
||||
QLabel *label_element = new QLabel(tr("Numérotations disponibles :", "availables numerotations"));
|
||||
|
||||
m_context_cb_element = new QComboBox();
|
||||
m_context_cb_element->setEditable(true);
|
||||
m_context_cb_element->lineEdit()->setClearButtonEnabled(true);
|
||||
m_context_cb_element->addItem(tr("Nom de la nouvelle numérotation"));
|
||||
|
||||
m_remove_pb_element = new QPushButton(QET::Icons::EditDelete, QString(), element_tab_widget);
|
||||
m_remove_pb_element = new QPushButton(QET::Icons::EditDelete, QString());
|
||||
m_remove_pb_element -> setToolTip(tr("Supprimer la numérotation"));
|
||||
|
||||
m_saw_element = new SelectAutonumW(element_tab_widget);
|
||||
m_saw_element = new SelectAutonumW(0);
|
||||
|
||||
bp_element_layout->addWidget(label_element);
|
||||
bp_element_layout->addStretch();
|
||||
bp_element_layout->addWidget(m_context_cb_element);
|
||||
bp_element_layout->addWidget(m_remove_pb_element);
|
||||
|
||||
element_layout->addLayout(bp_element_layout);
|
||||
element_layout->addWidget(m_saw_element);
|
||||
|
||||
tab_widget->addTab(element_widget, tr("Element"));
|
||||
|
||||
//Folio Tab
|
||||
folio_tab_widget = new QWidget(this);
|
||||
folio_tab_widget->setObjectName("FolioTab");
|
||||
QWidget *folio_widget = new QWidget();
|
||||
QVBoxLayout *folio_layout = new QVBoxLayout(folio_widget);
|
||||
QHBoxLayout *bp_folio_layout = new QHBoxLayout();
|
||||
|
||||
m_label_folio = new QLabel(tr("Numérotations disponibles :", "availables numerotations"), folio_tab_widget);
|
||||
QLabel *label_folio = new QLabel(tr("Numérotations disponibles :", "availables numerotations"));
|
||||
|
||||
m_context_cb_folio = new QComboBox(folio_tab_widget);
|
||||
m_context_cb_folio = new QComboBox();
|
||||
m_context_cb_folio->setEditable(true);
|
||||
m_context_cb_folio->lineEdit()->setClearButtonEnabled(true);
|
||||
m_context_cb_folio->addItem(tr("Nom de la nouvelle numérotation"));
|
||||
|
||||
m_remove_pb_folio = new QPushButton(QET::Icons::EditDelete, QString(), folio_tab_widget);
|
||||
m_remove_pb_folio = new QPushButton(QET::Icons::EditDelete, QString());
|
||||
m_remove_pb_folio -> setToolTip(tr("Supprimer la numérotation"));
|
||||
|
||||
m_saw_folio = new SelectAutonumW(folio_tab_widget);
|
||||
m_saw_folio = new SelectAutonumW(2);
|
||||
|
||||
bp_folio_layout->addWidget(label_folio);
|
||||
bp_folio_layout->addStretch();
|
||||
bp_folio_layout->addWidget(m_context_cb_folio);
|
||||
bp_folio_layout->addWidget(m_remove_pb_folio);
|
||||
|
||||
folio_layout->addLayout(bp_folio_layout);
|
||||
folio_layout->addWidget(m_saw_folio);
|
||||
|
||||
tab_widget->addTab(folio_widget, tr("Folio"));
|
||||
|
||||
//AutoNumbering Tab
|
||||
autoNumbering_tab_widget = new QWidget(this);
|
||||
m_faw = new FolioAutonumberingW(project(),autoNumbering_tab_widget);
|
||||
}
|
||||
m_faw = new FolioAutonumberingW(project());
|
||||
tab_widget->addTab(m_faw, tr("Folio autonumérotation"));
|
||||
|
||||
/**
|
||||
* @brief ProjectAutoNumConfigPage::initLayout
|
||||
* Init the layout of this page
|
||||
*/
|
||||
void ProjectAutoNumConfigPage::initLayout() {
|
||||
|
||||
//Management Tab
|
||||
tab_widget->addTab(management_tab_widget, tr("Management"));
|
||||
|
||||
//Conductor Tab
|
||||
tab_widget->addTab(conductor_tab_widget, tr("Conductor"));
|
||||
|
||||
QHBoxLayout *context_layout_conductor = new QHBoxLayout();
|
||||
context_layout_conductor -> addWidget (m_label_conductor);
|
||||
context_layout_conductor -> addWidget (m_context_cb_conductor);
|
||||
context_layout_conductor -> addWidget (m_remove_pb_conductor);
|
||||
|
||||
QVBoxLayout *main_layout_conductor = new QVBoxLayout();
|
||||
QVBoxLayout *aux_layout_conductor = new QVBoxLayout();
|
||||
aux_layout_conductor->addLayout(context_layout_conductor);
|
||||
aux_layout_conductor->addWidget(m_saw_conductor);
|
||||
|
||||
main_layout_conductor->addLayout(aux_layout_conductor);
|
||||
conductor_tab_widget -> setLayout (main_layout_conductor);
|
||||
|
||||
//Element Tab
|
||||
tab_widget->addTab(element_tab_widget,tr ("Element"));
|
||||
|
||||
QHBoxLayout *element_context_layout = new QHBoxLayout();
|
||||
element_context_layout -> addWidget (m_label_element);
|
||||
element_context_layout -> addWidget (m_context_cb_element);
|
||||
element_context_layout -> addWidget (m_remove_pb_element);
|
||||
|
||||
QVBoxLayout *main_layout_element = new QVBoxLayout();
|
||||
QVBoxLayout *aux_layout_element = new QVBoxLayout();
|
||||
aux_layout_element->addLayout(element_context_layout);
|
||||
aux_layout_element->addWidget(m_saw_element);
|
||||
|
||||
main_layout_element->addLayout(aux_layout_element);
|
||||
element_tab_widget->setLayout(main_layout_element);
|
||||
|
||||
// Folio Tab
|
||||
tab_widget->addTab(folio_tab_widget, tr("Folio"));
|
||||
|
||||
QHBoxLayout *context_layout_folio = new QHBoxLayout();
|
||||
context_layout_folio -> addWidget (m_label_folio);
|
||||
context_layout_folio -> addWidget (m_context_cb_folio);
|
||||
context_layout_folio -> addWidget (m_remove_pb_folio);
|
||||
|
||||
QVBoxLayout *main_layout_folio = new QVBoxLayout();
|
||||
QVBoxLayout *aux_layout_folio = new QVBoxLayout();
|
||||
aux_layout_folio->addLayout(context_layout_folio);
|
||||
aux_layout_folio->addWidget(m_saw_folio);
|
||||
|
||||
main_layout_folio->addLayout(aux_layout_folio);
|
||||
folio_tab_widget->setLayout(main_layout_folio);
|
||||
|
||||
//Auto Numbering Tab
|
||||
tab_widget->addTab(autoNumbering_tab_widget,tr ("Folio Auto Numbering"));
|
||||
|
||||
tab_widget->resize(850,590);
|
||||
m_main_layout = new QHBoxLayout();
|
||||
m_main_layout->addWidget(tab_widget);
|
||||
setLayout(m_main_layout);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -417,7 +390,7 @@ void ProjectAutoNumConfigPage::adjustReadOnly() {
|
||||
*/
|
||||
void ProjectAutoNumConfigPage::buildConnections() {
|
||||
|
||||
connect(tab_widget,SIGNAL(currentChanged(int)),this,SLOT(tabChanged(int)));
|
||||
//connect(m_tab_widget,SIGNAL(currentChanged(int)),this,SLOT(tabChanged(int)));
|
||||
|
||||
//Management Tab
|
||||
connect (m_amw, SIGNAL(applyPressed()), this, SLOT(applyManagement()));
|
||||
@ -724,26 +697,7 @@ void ProjectAutoNumConfigPage::removeContext_folio() {
|
||||
* @param tab index
|
||||
* Change to Selected Tab
|
||||
*/
|
||||
void ProjectAutoNumConfigPage::changeToTab(int i){
|
||||
tab_widget->setCurrentIndex(i);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ProjectAutoNumConfigPage::tabChanged
|
||||
* @param tab index
|
||||
* Used to resize window to correct size
|
||||
*/
|
||||
void ProjectAutoNumConfigPage::tabChanged(int i){
|
||||
if (i>=1){
|
||||
if (tab_widget->currentIndex() == 4){
|
||||
tab_widget->resize(520,tab_widget->height());
|
||||
}
|
||||
else if (tab_widget->currentIndex() == 1 || tab_widget->currentIndex() == 2 ){
|
||||
tab_widget->resize(495,tab_widget->height());
|
||||
}
|
||||
else tab_widget->resize(475,tab_widget->height());
|
||||
}
|
||||
else {
|
||||
tab_widget->resize(850,tab_widget->height());
|
||||
}
|
||||
void ProjectAutoNumConfigPage::changeToTab(int i)
|
||||
{
|
||||
Q_UNUSED(i);
|
||||
}
|
||||
|
@ -33,8 +33,8 @@ class QPushButton;
|
||||
class FolioAutonumberingW;
|
||||
class FormulaAutonumberingW;
|
||||
class AutoNumberingManagementW;
|
||||
class QTabWidget;
|
||||
class QScrollArea;
|
||||
class QHBoxLayout;
|
||||
|
||||
/**
|
||||
This class, derived from ConfigPage, aims at providing the basic skeleton
|
||||
@ -134,7 +134,7 @@ class ProjectAutoNumConfigPage : public ProjectConfigPage {
|
||||
virtual void changeToTab(int);
|
||||
protected:
|
||||
virtual void initWidgets();
|
||||
virtual void initLayout();
|
||||
virtual void initLayout() {}
|
||||
virtual void readValuesFromProject();
|
||||
virtual void adjustReadOnly();
|
||||
private:
|
||||
@ -153,8 +153,6 @@ class ProjectAutoNumConfigPage : public ProjectConfigPage {
|
||||
void applyAutoNum();
|
||||
void applyManagement();
|
||||
|
||||
void tabChanged(int);
|
||||
|
||||
signals:
|
||||
void setAutoNum(QString);
|
||||
void setAutoNum(int,int);
|
||||
@ -163,16 +161,13 @@ class ProjectAutoNumConfigPage : public ProjectConfigPage {
|
||||
|
||||
//Attributes
|
||||
private:
|
||||
QTabWidget *tab_widget;
|
||||
QWidget *management_tab_widget;
|
||||
QHBoxLayout *m_main_layout = nullptr;
|
||||
QWidget *m_management_tab_widget;
|
||||
QWidget *conductor_tab_widget;
|
||||
QWidget *element_tab_widget;
|
||||
QWidget *folio_tab_widget;
|
||||
QWidget *autoNumbering_tab_widget;
|
||||
QScrollArea *scrollArea;
|
||||
QLabel *m_label_conductor;
|
||||
QLabel *m_label_folio;
|
||||
QLabel *m_label_element;
|
||||
QComboBox *m_context_cb_conductor;
|
||||
QComboBox *m_context_cb_folio;
|
||||
QComboBox *m_context_cb_element;
|
||||
|
@ -43,8 +43,6 @@
|
||||
#include "elementscollectionwidget.h"
|
||||
#include "autonumberingdockwidget.h"
|
||||
|
||||
#include "ui/dialogautonum.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QStandardPaths>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user