Skip to content
Permalink
Browse files

Fix look&feel of WFS SQL query composer on Mac

  • Loading branch information
rouault committed May 16, 2016
1 parent c198b1a commit 2bbd5ca50943a3961b037d1f4a11a54dfdb3b28c
Showing with 23 additions and 7 deletions.
  1. +5 −1 src/gui/qgscodeeditorsql.cpp
  2. +18 −6 src/providers/wfs/qgswfssourceselect.cpp
@@ -19,6 +19,7 @@
#include <QWidget>
#include <QString>
#include <QFont>
#include <QLabel>
#include <Qsci/qscilexersql.h>


@@ -58,7 +59,10 @@ class QgsCaseInsensitiveLexerSQL: public QsciLexerSQL
void QgsCodeEditorSQL::setSciLexerSQL()
{
QFont font = getMonospaceFont();

#ifdef Q_OS_MAC
// The font size gotten from getMonospaceFont() is too small on Mac
font.setPointSize( QLabel().font().pointSize() );
#endif
QsciLexerSQL* sqlLexer = new QgsCaseInsensitiveLexerSQL( this );
sqlLexer->setDefaultFont( font );
sqlLexer->setFont( font, -1 );
@@ -628,14 +628,26 @@ void QgsWFSSourceSelect::buildQuery( const QModelIndex& index )

d->setSql( sql );

d->setAttribute( Qt::WA_DeleteOnClose );
d->setModal( true );
// For testability, do not use exec()
if ( !property( "hideDialogs" ).toBool() )
d->open();
connect( d, SIGNAL( accepted() ), this, SLOT( updateSql() ) );
mSQLIndex = index;
mSQLComposerDialog = d;
// For testability, do not use exec()
if ( property( "hideDialogs" ).toBool() )
{
d->setAttribute( Qt::WA_DeleteOnClose );
d->setModal( true );
d->open();
connect( d, SIGNAL( accepted() ), this, SLOT( updateSql() ) );
}
else
{
// But we need to use exec() for real GUI, otherwise it does not look
// right on Mac
if ( d->exec() )
{
updateSql();
}
delete d;
}
}

void QgsWFSSourceSelect::updateSql()

0 comments on commit 2bbd5ca

Please sign in to comment.
You can’t perform that action at this time.