mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Ref T369, text edit as dialog
This commit is contained in:
33
src/blackgui/components/texteditdialog.cpp
Normal file
33
src/blackgui/components/texteditdialog.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
/* Copyright (C) 2018
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "texteditdialog.h"
|
||||
#include "ui_texteditdialog.h"
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
CTextEditDialog::CTextEditDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::CTextEditDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
}
|
||||
|
||||
CTextEditDialog::~CTextEditDialog()
|
||||
{ }
|
||||
|
||||
QTextEdit *CTextEditDialog::textEdit() const
|
||||
{
|
||||
return ui->te_TextEdit;
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
45
src/blackgui/components/texteditdialog.h
Normal file
45
src/blackgui/components/texteditdialog.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* Copyright (C) 2018
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKGUI_COMPONENTS_TEXTEDITDIALOG_H
|
||||
#define BLACKGUI_COMPONENTS_TEXTEDITDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QScopedPointer>
|
||||
|
||||
class QTextEdit;
|
||||
|
||||
namespace Ui { class CTextEditDialog; }
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
//! Text edit as dialog
|
||||
class CTextEditDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
explicit CTextEditDialog(QWidget *parent = nullptr);
|
||||
|
||||
//! Dtor
|
||||
virtual ~CTextEditDialog();
|
||||
|
||||
//! Access to text edit
|
||||
QTextEdit *textEdit() const;
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CTextEditDialog> ui;
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
#endif // guard
|
||||
67
src/blackgui/components/texteditdialog.ui
Normal file
67
src/blackgui/components/texteditdialog.ui
Normal file
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CTextEditDialog</class>
|
||||
<widget class="QDialog" name="CTextEditDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>640</width>
|
||||
<height>480</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Text edit dialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="vl_TextEditDialog">
|
||||
<item>
|
||||
<widget class="QTextEdit" name="te_TextEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="bb_TextEditDialog">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>bb_TextEditDialog</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>CTextEditDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>bb_TextEditDialog</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>CTextEditDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user