1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- /*********************************************************************/
- /* */
- /* Copyright 2022-2023 Rémi Synave - remi.synave@univ-littoral.fr */
- /* */
- /* This file is part of DSL. */
- /* This software uses Qt to build the Graphical User Interface */
- /* https://www.qt.io/ */
- /* */
- /* DSL 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 3 of the License, */
- /* or (at your option) any later version. */
- /* */
- /* DSL 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 DSL. If not, see <http://www.gnu.org/licenses/>. */
- /* */
- /*********************************************************************/
- #include <QIcon>
- #include <QGuiApplication>
- #include <QScreen>
- #include <QWidget>
- #include <QMenuBar>
- #include <QFileDialog>
- #include <QUrl>
- #include <QFileInfo>
- #include <QInputDialog>
- #include <QDirIterator>
- #include <QVBoxLayout>
- #include <QDebug>
- #include <iostream>
- #include <filesystem>
- #include "MainWindow.hpp"
- MainWindow::MainWindow ()
- {
- setWindowTitle (tr ("CLF"));
- QWidget *central= new QWidget(this);
- setCentralWidget (central);
- setContentsMargins(0, 0, 0, 0);
- QVBoxLayout *layoutV = new QVBoxLayout(central);
- layoutV->setSpacing(0);
- layoutV->setContentsMargins(0, 0, 0, 0);
- central->setLayout(layoutV);
-
- wa = new WorkArea (sizeX, sizeY, central);
- wa->setContentsMargins(0, 0, 0, 0);
- wa->addSL(new StrengthLine(new QPoint((int)(sizeX*0.45),(int)(sizeY*0.1)),
- new QPoint((int)(sizeX*0.45),(int)(sizeY*0.9))));
- wa->addSL(new StrengthLine(new QPoint((int)(sizeX*0.55),(int)(sizeY*0.1)),
- new QPoint((int)(sizeX*0.55),(int)(sizeY*0.9))));
- wa->repaint();
- layoutV->addWidget(wa);
- la = new QLabel(QString("Distance entre les deux lignes : ")+QString::number(1-wa->getDistance()), central);
- layoutV->addWidget(la);
- connect (wa, SIGNAL(click()), this, SLOT(majDistance()));
- setFixedSize (sizeX, sizeY+50);
- }
- void
- MainWindow::majDistance()
- {
- la->setText(QString("Distance entre les deux lignes : ")+QString::number(1-wa->getDistance()));
- }
|