remove Qt4.3 dependency

git-svn-id: http://svn.osgeo.org/qgis/trunk@7622 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
jef 2007-11-20 16:15:32 +00:00
parent 194d12ae51
commit 9597e23fb8
2 changed files with 11 additions and 3 deletions

View File

@ -159,13 +159,15 @@ void QgsDbSourceSelect::on_cmbConnections_activated(int)
void QgsDbSourceSelect::updateTypeInfo(int row, QString type)
{
QComboBox *cb = static_cast<QComboBox *>(lstTables->cellWidget(row,dbssType));
if(cb)
lstTables->removeCellWidget(row, dbssType);
else
if(!cb)
{
QTableWidgetItem *item = lstTables->takeItem(row,dbssType);
delete item;
}
#if 0 // Qt 4.3
else
lstTables->removeCellWidget(row, dbssType);
#endif
if( type.contains(",") )
{
@ -177,8 +179,10 @@ void QgsDbSourceSelect::updateTypeInfo(int row, QString type)
}
cb->setCurrentIndex(0);
cb->setToolTip( tr("select import type for multi type layer") );
#if 0 // Qt 4.3
cb->setMinimumContentsLength(mCbMinLength);
cb->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon);
#endif
lstTables->setCellWidget(row, dbssType, cb);
}
else
@ -442,6 +446,7 @@ void QgsDbSourceSelect::on_btnConnect_clicked()
qMakePair(tr("Unknown layer type"),
QIcon(myThemePath+"/mIconUnknownLayerType.png")));
#if 0 // Qt 4.3
mCbMinLength = 0;
QMapIterator <QString, QPair < QString, QIcon > > it(mLayerIcons);
while( it.hasNext() ) {
@ -449,6 +454,7 @@ void QgsDbSourceSelect::on_btnConnect_clicked()
int len = it.value().first.length();;
mCbMinLength = mCbMinLength<len ? len : mCbMinLength;
}
#endif
}
//qDebug("Connection succeeded");
// tell the DB that we want text encoded in UTF8

View File

@ -128,8 +128,10 @@ class QgsDbSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
QStringList m_selectedTables;
// Storage for the range of layer type icons
QMap<QString, QPair<QString, QIcon> > mLayerIcons;
#if 0
// minlength of layer type combobox
int mCbMinLength;
#endif
//! Pointer to the qgis application mainwindow
QgisApp *qgisApp;
PGconn *pd;