Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix look&feel of WFS SQL query composer on Mac
- Loading branch information
Showing
with
23 additions
and
7 deletions.
-
+5
−1
src/gui/qgscodeeditorsql.cpp
-
+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() |
|
|