parent
d232939294
commit
0a3d7d6355
@ -0,0 +1,2 @@
|
||||
#include "dfn_browser_ctrl.h"
|
||||
|
@ -0,0 +1,4 @@
|
||||
#ifndef DFN_BROWSER_CTRL
|
||||
#define DFN_BROWSER_CTRL
|
||||
#endif
|
||||
|
@ -0,0 +1,52 @@
|
||||
#include "georges_dfn_dialog.h"
|
||||
#include <QInputDialog>
|
||||
#include <QMessageBox>
|
||||
|
||||
GeorgesDFNDialog::GeorgesDFNDialog( QWidget *parent ) :
|
||||
QDockWidget( parent )
|
||||
{
|
||||
m_ui.setupUi( this );
|
||||
setupConnections();
|
||||
|
||||
m_ui.addButton->setEnabled( false );
|
||||
m_ui.removeButton->setEnabled( false );
|
||||
}
|
||||
|
||||
GeorgesDFNDialog::~GeorgesDFNDialog()
|
||||
{
|
||||
}
|
||||
|
||||
void GeorgesDFNDialog::onAddClicked()
|
||||
{
|
||||
QString name = QInputDialog::getText( this,
|
||||
tr( "New element" ),
|
||||
tr( "Enter name of the new element" ) );
|
||||
|
||||
QList< QListWidgetItem* > list = m_ui.list->findItems( name, Qt::MatchFixedString );
|
||||
if( !list.isEmpty() )
|
||||
{
|
||||
QMessageBox::information( this,
|
||||
tr( "Item already exists" ),
|
||||
tr( "That item already exists!" ) );
|
||||
return;
|
||||
}
|
||||
|
||||
m_ui.list->addItem( name );
|
||||
}
|
||||
|
||||
void GeorgesDFNDialog::onRemoveClicked()
|
||||
{
|
||||
int row = m_ui.list->currentRow();
|
||||
if( row < 0 )
|
||||
return;
|
||||
|
||||
QListWidgetItem *item = m_ui.list->takeItem( row );
|
||||
delete item;
|
||||
}
|
||||
|
||||
void GeorgesDFNDialog::setupConnections()
|
||||
{
|
||||
connect( m_ui.addButton, SIGNAL( clicked( bool ) ), this, SLOT( onAddClicked() ) );
|
||||
connect( m_ui.removeButton, SIGNAL( clicked( bool ) ), this, SLOT( onRemoveClicked() ) );
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
#ifndef GEORGES_DFN_DIALOG
|
||||
#define GEORGES_DFN_DIALOG
|
||||
|
||||
#include "ui_georges_dfn_dialog.h"
|
||||
|
||||
class GeorgesDFNDialog : public QDockWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
GeorgesDFNDialog( QWidget *parent = NULL );
|
||||
~GeorgesDFNDialog();
|
||||
|
||||
private Q_SLOTS:
|
||||
void onAddClicked();
|
||||
void onRemoveClicked();
|
||||
|
||||
private:
|
||||
void setupConnections();
|
||||
|
||||
Ui::GeorgesDFNDialog m_ui;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>GeorgesDFNDialog</class>
|
||||
<widget class="QDockWidget" name="GeorgesDFNDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>693</width>
|
||||
<height>559</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string/>
|
||||
</property>
|
||||
<widget class="QWidget" name="dockWidgetContents">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="tabPosition">
|
||||
<enum>QTabWidget::West</enum>
|
||||
</property>
|
||||
<property name="tabShape">
|
||||
<enum>QTabWidget::Rounded</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="documentMode">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="movable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="dfnTab">
|
||||
<property name="accessibleName">
|
||||
<string/>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Dfn</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<widget class="QListWidget" name="list"/>
|
||||
<widget class="QtTreePropertyBrowser" name="browser" native="true"/>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="addButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="removeButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>466</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="commentTab">
|
||||
<attribute name="title">
|
||||
<string>Comments</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QPlainTextEdit" name="commentsEdit">
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="logTab">
|
||||
<attribute name="title">
|
||||
<string>Log</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QPlainTextEdit" name="logEdit">
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QtTreePropertyBrowser</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qttreepropertybrowser.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
Reference in New Issue