mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-02 00:02:12 -05:00
Improving the "Add/Discover relation" dialogs
adding title, tooltips and help button to documentation
This commit is contained in:
parent
91132af5df
commit
83dba6786c
@ -15,6 +15,7 @@
|
||||
#include "qgsdiscoverrelationsdialog.h"
|
||||
#include "qgsvectorlayer.h"
|
||||
#include "qgsrelationmanager.h"
|
||||
#include "qgshelp.h"
|
||||
|
||||
#include <QPushButton>
|
||||
|
||||
@ -25,6 +26,11 @@ QgsDiscoverRelationsDialog::QgsDiscoverRelationsDialog( const QList<QgsRelation>
|
||||
setupUi( this );
|
||||
|
||||
mButtonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
|
||||
mButtonBox->addButton( QDialogButtonBox::Help );
|
||||
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, [ = ]
|
||||
{
|
||||
QgsHelp::openHelp( QStringLiteral( "working_with_vector/attribute_table.html#defining-1-n-relation" ) );
|
||||
} );
|
||||
connect( mRelationsTable->selectionModel(), &QItemSelectionModel::selectionChanged, this, &QgsDiscoverRelationsDialog::onSelectionChanged );
|
||||
|
||||
mFoundRelations = QgsRelationManager::discoverRelations( existingRelations, layers );
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "qgsfieldcombobox.h"
|
||||
#include "qgsmaplayerproxymodel.h"
|
||||
#include "qgsapplication.h"
|
||||
#include "qgshelp.h"
|
||||
|
||||
|
||||
|
||||
@ -43,11 +44,13 @@ QgsFieldPairWidget::QgsFieldPairWidget( int index, QWidget *parent )
|
||||
mAddButton = new QToolButton( this );
|
||||
mAddButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/symbologyAdd.svg" ) ) );
|
||||
mAddButton->setMinimumWidth( 30 );
|
||||
mAddButton->setToolTip( "Add new fields to pair" );
|
||||
mLayout->addWidget( mAddButton, 0, Qt::AlignLeft );
|
||||
|
||||
mRemoveButton = new QToolButton( this );
|
||||
mRemoveButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/symbologyRemove.svg" ) ) );
|
||||
mRemoveButton->setMinimumWidth( 30 );
|
||||
mRemoveButton->setToolTip( "Remove the last pair of fields" );
|
||||
mLayout->addWidget( mRemoveButton, 0, Qt::AlignLeft );
|
||||
|
||||
mSpacerItem = new QSpacerItem( 30, 30, QSizePolicy::Minimum, QSizePolicy::Maximum );
|
||||
@ -120,7 +123,8 @@ void QgsFieldPairWidget::changeEnable()
|
||||
QgsRelationAddDlg::QgsRelationAddDlg( QWidget *parent )
|
||||
: QDialog( parent )
|
||||
{
|
||||
QGridLayout *layout = new QGridLayout(); // column 0 is kept free for alignmenent purpose
|
||||
setWindowTitle( "Add New Relation" );
|
||||
QGridLayout *layout = new QGridLayout(); // column 0 is kept free for alignment purpose
|
||||
|
||||
// row 0: name
|
||||
// col 1
|
||||
@ -176,9 +180,13 @@ QgsRelationAddDlg::QgsRelationAddDlg( QWidget *parent )
|
||||
// row 6: button box
|
||||
mButtonBox = new QDialogButtonBox( this );
|
||||
mButtonBox->setOrientation( Qt::Horizontal );
|
||||
mButtonBox->setStandardButtons( QDialogButtonBox::Cancel | QDialogButtonBox::Ok );
|
||||
mButtonBox->setStandardButtons( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok );
|
||||
connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsRelationAddDlg::accept );
|
||||
connect( mButtonBox, &QDialogButtonBox::rejected, this, &QgsRelationAddDlg::reject );
|
||||
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, [ = ]
|
||||
{
|
||||
QgsHelp::openHelp( QStringLiteral( "working_with_vector/attribute_table.html#defining-1-n-relations" ) );
|
||||
} );
|
||||
layout->addWidget( mButtonBox, 7, 1, 1, 2 );
|
||||
|
||||
// set layout
|
||||
|
Loading…
x
Reference in New Issue
Block a user