Seamly2D
Code documentation
decimalchart_dialog.cpp
Go to the documentation of this file.
1 /************************************************************************
2  **
3  ** @file decimalchart_dialog.h
4  ** @author DSCaskey <dscaskey@gmail.com>
5  ** @date 12 26, 2021
6  **
7  ** @brief
8  ** @copyright
9  ** This source code is part of the Valentine project, a pattern making
10  ** program, whose allow create and modeling patterns of clothing.
11  ** Copyright (C) 2013-2015 Seamly2D project
12  ** All Rights Reserved.
13  **
14  ** Seamly2D is free software: you can redistribute it and/or modify
15  ** it under the terms of the GNU General Public License as published by
16  ** the Free Software Foundation, either version 3 of the License, or
17  ** (at your option) any later version.
18  **
19  ** Seamly2D is distributed in the hope that it will be useful,
20  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
21  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  ** GNU General Public License for more details.
23  **
24  ** You should have received a copy of the GNU General Public License
25  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
26  **
27  *************************************************************************/
28 
29 #include "decimalchart_dialog.h"
30 #include "ui_decimalchart_dialog.h"
31 
32 #include <QFont>
33 #include <QShowEvent>
34 #include "../core/vapplication.h"
35 
36 //---------------------------------------------------------------------------------------------------------------------
38  : QDialog(parent)
39  , ui(new Ui::DecimalChartDialog)
40  , isInitialized(false)
41 {
42  ui->setupUi(this);
43  setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
44 }
45 
46 //---------------------------------------------------------------------------------------------------------------------
48 {
49  delete ui;
50 }
51 
52 //---------------------------------------------------------------------------------------------------------------------
53 void DecimalChartDialog::showEvent(QShowEvent *event)
54 {
55  QDialog::showEvent( event );
56  if ( event->spontaneous() )
57  {
58  return;
59  }
60 
61  if (isInitialized)
62  {
63  return;
64  }
65  // do your init stuff here
66 
67  setMaximumSize(size());
68  setMinimumSize(size());
69 
70  isInitialized = true;//first show windows are held
71 }
DecimalChartDialog(QWidget *parent=nullptr)
Ui::DecimalChartDialog * ui
virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE