mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
NewVersionWidget -> Dialog
This commit is contained in:
@@ -47,7 +47,7 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
|
|||||||
|
|
||||||
setLanguageInterfase();
|
setLanguageInterfase();
|
||||||
|
|
||||||
connectorToServer = new ConnectorToServer(/*this*/nullptr);
|
connectorToServer = new ConnectorToServer(this);
|
||||||
connect(connectorToServer, &ConnectorToServer::sigLoginResult, this, &InstructorsAndTraineesWidget::slot_checkLoginResult);
|
connect(connectorToServer, &ConnectorToServer::sigLoginResult, this, &InstructorsAndTraineesWidget::slot_checkLoginResult);
|
||||||
connect(connectorToServer, &ConnectorToServer::sigDeLoginResult, this, &InstructorsAndTraineesWidget::slot_checkDeLoginResult);
|
connect(connectorToServer, &ConnectorToServer::sigDeLoginResult, this, &InstructorsAndTraineesWidget::slot_checkDeLoginResult);
|
||||||
connect(connectorToServer,&ConnectorToServer::signal_AnswerDocsChanged,this, &InstructorsAndTraineesWidget::slot_AnswerDocsChanged);
|
connect(connectorToServer,&ConnectorToServer::signal_AnswerDocsChanged,this, &InstructorsAndTraineesWidget::slot_AnswerDocsChanged);
|
||||||
|
|||||||
@@ -2,12 +2,21 @@
|
|||||||
#include "ui_newversionwidget.h"
|
#include "ui_newversionwidget.h"
|
||||||
|
|
||||||
NewVersionWidget::NewVersionWidget(QWidget *parent) :
|
NewVersionWidget::NewVersionWidget(QWidget *parent) :
|
||||||
QWidget(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::NewVersionWidget)
|
ui(new Ui::NewVersionWidget),
|
||||||
|
versionSelectWidget(nullptr),
|
||||||
|
validator(nullptr)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setWindowFlags(Qt::SubWindow);
|
|
||||||
setAttribute(Qt::WA_ShowModal,true);
|
setMinimumSize(200, 100);
|
||||||
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
setWindowTitle(tr("New version"));
|
||||||
|
}
|
||||||
|
|
||||||
|
NewVersionWidget::~NewVersionWidget()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewVersionWidget::initialize(VersionSelectWidget *versionSelectWidget, QString prevName)
|
void NewVersionWidget::initialize(VersionSelectWidget *versionSelectWidget, QString prevName)
|
||||||
@@ -18,24 +27,18 @@ void NewVersionWidget::initialize(VersionSelectWidget *versionSelectWidget, QStr
|
|||||||
ui->lineEdit->setValidator(validator);
|
ui->lineEdit->setValidator(validator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void NewVersionWidget::on_createButton_clicked()
|
void NewVersionWidget::on_createButton_clicked()
|
||||||
{
|
{
|
||||||
if(ui->lineEdit->text() != "")
|
if(ui->lineEdit->text() != "")
|
||||||
{
|
{
|
||||||
versionSelectWidget->sendCopyEmit(ui->lineEdit->text());
|
versionSelectWidget->sendCopyEmit(ui->lineEdit->text());
|
||||||
hide();
|
close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewVersionWidget::on_cancelButton_clicked()
|
void NewVersionWidget::on_cancelButton_clicked()
|
||||||
{
|
{
|
||||||
hide();
|
close();
|
||||||
}
|
|
||||||
|
|
||||||
NewVersionWidget::~NewVersionWidget()
|
|
||||||
{
|
|
||||||
delete ui;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewVersionWidget::on_lineEdit_inputRejected()
|
void NewVersionWidget::on_lineEdit_inputRejected()
|
||||||
|
|||||||
@@ -11,15 +11,18 @@ class NewVersionWidget;
|
|||||||
}
|
}
|
||||||
|
|
||||||
class VersionSelectWidget;
|
class VersionSelectWidget;
|
||||||
class NewVersionWidget : public QWidget
|
|
||||||
|
class NewVersionWidget : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit NewVersionWidget(QWidget *parent = nullptr);
|
explicit NewVersionWidget(QWidget *parent = nullptr);
|
||||||
void initialize(VersionSelectWidget *versionSelectWidget,QString prevName);
|
|
||||||
~NewVersionWidget();
|
~NewVersionWidget();
|
||||||
|
|
||||||
|
public:
|
||||||
|
void initialize(VersionSelectWidget *versionSelectWidget, QString prevName);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_createButton_clicked();
|
void on_createButton_clicked();
|
||||||
void on_cancelButton_clicked();
|
void on_cancelButton_clicked();
|
||||||
@@ -31,6 +34,6 @@ private:
|
|||||||
QRegExpValidator *validator;
|
QRegExpValidator *validator;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // NEWVERSIONWIDGET_Hvoid on_lineEdit_inputRejected();
|
#endif // NEWVERSIONWIDGET_H
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<string>Create copy...</string>
|
<string>Create copy...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||||
<normaloff>:/resources/icons/lms.png</normaloff>:/resources/icons/lms.png</iconset>
|
<normaloff>:/resources/icons/lms.png</normaloff>:/resources/icons/lms.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="autoFillBackground">
|
<property name="autoFillBackground">
|
||||||
@@ -31,23 +31,7 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="NewVerBackground">
|
<layout class="QVBoxLayout" name="verticalLayout_Main">
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::StyledPanel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Raised</enum>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="baseVerLayout">
|
<layout class="QHBoxLayout" name="baseVerLayout">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
@@ -166,6 +150,19 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<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>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
@@ -248,12 +245,11 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../InstructorsAndTrainees.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -83,21 +83,10 @@ void VersionSelectWidget::on_createDuplicateButton_clicked()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NewVersionWidget *newVersionWidget = new NewVersionWidget();
|
NewVersionWidget *newVersionWidget = new NewVersionWidget(this);
|
||||||
newVersionWidget->initialize(this,selectedVersion->getViewName());
|
newVersionWidget->initialize(this,selectedVersion->getViewName());
|
||||||
|
newVersionWidget->exec();
|
||||||
/*
|
|
||||||
QDialog* dialog = new QDialog(this);
|
|
||||||
QHBoxLayout *layout = new QHBoxLayout(dialog);
|
|
||||||
layout->addWidget(newVersionWidget);
|
|
||||||
dialog->setWindowTitle(tr("Editor of instructors"));
|
|
||||||
dialog->setMinimumSize(200, 100);
|
|
||||||
dialog->setStyleSheet(this->styleSheet());
|
|
||||||
dialog->exec();
|
|
||||||
delete newVersionWidget;
|
delete newVersionWidget;
|
||||||
*/
|
|
||||||
|
|
||||||
newVersionWidget->show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VersionSelectWidget::sendCopyEmit(QString newName)
|
void VersionSelectWidget::sendCopyEmit(QString newName)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../InstructorsAndTrainees.qrc">
|
||||||
<normaloff>:/resources/icons/lms.png</normaloff>:/resources/icons/lms.png</iconset>
|
<normaloff>:/resources/icons/lms.png</normaloff>:/resources/icons/lms.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="autoFillBackground">
|
<property name="autoFillBackground">
|
||||||
@@ -204,7 +204,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../InstructorsAndTrainees.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
Reference in New Issue
Block a user