122 |
122 |
|
123 |
123 |
void QgsQueryBuilder::on_btnSampleValues_clicked()
|
124 |
124 |
{
|
|
125 |
|
|
126 |
|
125 |
127 |
lstValues->setCursor( Qt::WaitCursor );
|
|
128 |
|
|
129 |
//if a query is existing, save it and temporarily clear it to get all the values
|
|
130 |
QString subsetQuery= txtSQL->toPlainText();
|
|
131 |
if ( ! subsetQuery.isNull() )
|
|
132 |
{
|
|
133 |
mLayer->setSubsetString("");
|
|
134 |
}
|
126 |
135 |
|
127 |
136 |
//delete connection mModelValues and lstValues
|
128 |
137 |
QStandardItemModel *tmp = new QStandardItemModel();
|
... | ... | |
131 |
140 |
fillValues( mModelFields->data( lstFields->currentIndex(), Qt::UserRole + 1 ).toInt(), 25 );
|
132 |
141 |
lstValues->setModel( mModelValues );
|
133 |
142 |
lstValues->setCursor( Qt::ArrowCursor );
|
|
143 |
|
|
144 |
//Restore the existing query
|
|
145 |
if ( ! subsetQuery.isNull() )
|
|
146 |
{
|
|
147 |
mLayer->setSubsetString(subsetQuery);
|
|
148 |
}
|
|
149 |
|
134 |
150 |
//delete the tmp
|
135 |
151 |
delete tmp;
|
136 |
152 |
|
... | ... | |
139 |
155 |
void QgsQueryBuilder::on_btnGetAllValues_clicked()
|
140 |
156 |
{
|
141 |
157 |
lstValues->setCursor( Qt::WaitCursor );
|
142 |
|
|
|
158 |
|
|
159 |
//if a query is existing, save it and temporarily clear it to get all the values
|
|
160 |
QString subsetQuery= txtSQL->toPlainText();
|
|
161 |
if ( ! subsetQuery.isNull() )
|
|
162 |
{
|
|
163 |
//mLayer->setSubsetString("");
|
|
164 |
}
|
|
165 |
|
143 |
166 |
//delete connection mModelValues and lstValues
|
144 |
167 |
QStandardItemModel *tmp = new QStandardItemModel();
|
145 |
168 |
lstValues->setModel( tmp );
|
... | ... | |
147 |
170 |
fillValues( mModelFields->data( lstFields->currentIndex(), Qt::UserRole + 1 ).toInt(), -1 );
|
148 |
171 |
lstValues->setModel( mModelValues );
|
149 |
172 |
lstValues->setCursor( Qt::ArrowCursor );
|
|
173 |
|
|
174 |
//Restore the existing query
|
|
175 |
if ( ! subsetQuery.isNull() )
|
|
176 |
{
|
|
177 |
//mLayer->setSubsetString(subsetQuery);
|
|
178 |
}
|
|
179 |
|
150 |
180 |
//delete the tmp
|
151 |
181 |
delete tmp;
|
152 |
182 |
}
|