void BallotVoteWindow::setModel(WalletModel *model)
{
    if (!model)
        return;

    tableModel = model->getBallotVoteTableModel();
    if (!tableModel)
        return;

    proxyModel = new BallotVoteFilterProxyModel(this);
    proxyModel->setSourceModel(tableModel);

    tableView->setModel(proxyModel);
    tableView->setAlternatingRowColors(true);
    tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
    tableView->setSelectionMode(QAbstractItemView::ExtendedSelection);
    tableView->setSortingEnabled(true);
    tableView->sortByColumn(BallotVoteTableModel::Height, Qt::AscendingOrder);
    tableView->verticalHeader()->hide();

    tableView->setColumnWidth(BallotVoteTableModel::Height, HEIGHT_COLUMN_WIDTH);
    tableView->setColumnWidth(BallotVoteTableModel::Address, ADDRESS_COLUMN_WIDTH);

    connect(tableView->selectionModel(),
       SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
       this, SLOT(currentRowChanged(QModelIndex, QModelIndex)));
}
void Lvk::FE::ChatHistoryWidget::connectSignals()
{
    connect(ui->dateContactTable->selectionModel(),
            SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
            SLOT(onDateContactRowChanged(QModelIndex,QModelIndex)));

    connect(ui->conversationTable->selectionModel(),
            SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
            SLOT(onConversationRowChanged(QModelIndex,QModelIndex)));

    connect(ui->conversationTable,
            SIGNAL(cellDoubleClicked(int,int)),
            SLOT(onCellDoubleClicked(int,int)));

    connect(ui->filter,
            SIGNAL(textChanged(QString)),
            SLOT(onFilterTextChanged(QString)));

    // Toolbar signals

    connect(ui->teachRuleButton,     SIGNAL(clicked()),   SLOT(onTeachRuleClicked()));
    connect(ui->showRuleButton,      SIGNAL(clicked()),   SLOT(onShowRuleClicked()));
    connect(ui->removeHistoryButton, SIGNAL(clicked()),   SLOT(removeSelectedWithDialog()));
    connect(ui->removeAllAction,     SIGNAL(triggered()), SLOT(removeAllWithDialog()));
    connect(ui->removeSelAction,     SIGNAL(triggered()), SLOT(removeSelectedWithDialog()));
}
void mantenimientoTitulo::on_btmBuscar_clicked()
{
    if(m_ui->btmTitulo->isChecked()) {

        QSqlQueryModel *model = new QSqlQueryModel(m_ui->titulos);
        model->setQuery("SELECT tituloObra, isbn FROM titulo WHERE tituloObra LIKE '%"+m_ui->busqueda->text()+"%';", QSqlDatabase::database("sibcues"));
        if (model->lastError().isValid())
            qDebug() << model->lastError();

        model->setHeaderData(0, Qt::Horizontal, QObject::tr("Titulo Material Bibliografico"));
        model->setHeaderData(1, Qt::Horizontal, QObject::tr("ISBN"));
        m_ui->titulos->setModel(model);
        connect(m_ui->titulos->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), this, SLOT(on_titulos_activated(QModelIndex)));
        m_ui->labelTitulo->setText("Titulos: "+QString::number(model->rowCount())+" resultados.");
    }
    else {

        QSqlQueryModel *model = new QSqlQueryModel(m_ui->titulos);
        model->setQuery("SELECT titulo.tituloObra, titulo.isbn FROM obrade left join titulo on titulo.idTitulo=obrade.idTitulo left join autor on obrade.idAutor=autor.idAutor WHERE autor.nombreAutor LIKE '%"+m_ui->busqueda->text()+"%';", QSqlDatabase::database("sibcues"));

        if (model->lastError().isValid())
            qDebug() << model->lastError();

        model->setHeaderData(0, Qt::Horizontal, QObject::tr("Titulo Material Bibliografico"));
        model->setHeaderData(1, Qt::Horizontal, QObject::tr("ISBN"));
        m_ui->titulos->setModel(model);
        connect(m_ui->titulos->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), this, SLOT(on_titulos_activated(QModelIndex)));
        m_ui->labelTitulo->setText("Titulos: "+QString::number(model->rowCount())+" resultados.");
    }
}
	LayoutsConfigWidget::LayoutsConfigWidget (QWidget *parent)
	: QWidget (parent)
	, AvailableModel_ (new QStandardItemModel (this))
	, EnabledModel_ (new QStandardItemModel (this))
	{
		QStringList availHeaders { tr ("Code"), tr ("Description") };
		AvailableModel_->setHorizontalHeaderLabels (availHeaders);
		EnabledModel_->setHorizontalHeaderLabels (availHeaders << tr ("Variant"));

		FillModels ();

		Ui_.setupUi (this);
		Ui_.AvailableView_->setModel (AvailableModel_);
		Ui_.EnabledView_->setModel (EnabledModel_);

		Ui_.EnabledView_->setItemDelegate (new EnabledItemDelegate (Ui_.EnabledView_));

		connect (Ui_.AvailableView_->selectionModel (),
				SIGNAL (currentRowChanged (QModelIndex, QModelIndex)),
				this,
				SLOT (updateActionsState ()));
		connect (Ui_.EnabledView_->selectionModel (),
				SIGNAL (currentRowChanged (QModelIndex, QModelIndex)),
				this,
				SLOT (updateActionsState ()));
		updateActionsState ();
	}
void LibrarySettingsPage::Load() {
  if (!initialised_model_) {
    if (ui_->list->selectionModel()) {
      disconnect(ui_->list->selectionModel(),
                 SIGNAL(currentRowChanged(QModelIndex, QModelIndex)),
                 this, SLOT(CurrentRowChanged(QModelIndex)));
    }

    ui_->list->setModel(dialog()->library_directory_model());
    initialised_model_ = true;

    connect(ui_->list->selectionModel(),
            SIGNAL(currentRowChanged(QModelIndex, QModelIndex)),
            SLOT(CurrentRowChanged(QModelIndex)));
  }

  QSettings s;
  s.beginGroup(LibraryView::kSettingsGroup);
  ui_->auto_open->setChecked(s.value("auto_open", true).toBool());
  ui_->pretty_covers->setChecked(s.value("pretty_covers", true).toBool());
  ui_->show_dividers->setChecked(s.value("show_dividers", true).toBool());
  s.endGroup();

  s.beginGroup(LibraryWatcher::kSettingsGroup);
  ui_->startup_scan->setChecked(s.value("startup_scan", true).toBool());
  ui_->monitor->setChecked(s.value("monitor", true).toBool());
  
  QStringList filters = s.value("cover_art_patterns",
      QStringList() << "front" << "cover").toStringList();
  ui_->cover_art_patterns->setText(filters.join(","));
  
  s.endGroup();
}
Exemple #6
0
void EditEntryWidget::setupAutoType()
{
    m_autoTypeUi->setupUi(m_autoTypeWidget);
    add(tr("Auto-Type"), m_autoTypeWidget);

    m_autoTypeDefaultSequenceGroup->addButton(m_autoTypeUi->inheritSequenceButton);
    m_autoTypeDefaultSequenceGroup->addButton(m_autoTypeUi->customSequenceButton);
    m_autoTypeWindowSequenceGroup->addButton(m_autoTypeUi->defaultWindowSequenceButton);
    m_autoTypeWindowSequenceGroup->addButton(m_autoTypeUi->customWindowSequenceButton);
    m_autoTypeAssocModel->setAutoTypeAssociations(m_autoTypeAssoc);
    m_autoTypeUi->assocView->setModel(m_autoTypeAssocModel);
    m_autoTypeUi->assocView->setColumnHidden(1, true);
    connect(m_autoTypeUi->enableButton, SIGNAL(toggled(bool)), SLOT(updateAutoTypeEnabled()));
    connect(m_autoTypeUi->customSequenceButton, SIGNAL(toggled(bool)),
            m_autoTypeUi->sequenceEdit, SLOT(setEnabled(bool)));
    connect(m_autoTypeUi->customWindowSequenceButton, SIGNAL(toggled(bool)),
            m_autoTypeUi->windowSequenceEdit, SLOT(setEnabled(bool)));
    connect(m_autoTypeUi->assocAddButton, SIGNAL(clicked()), SLOT(insertAutoTypeAssoc()));
    connect(m_autoTypeUi->assocRemoveButton, SIGNAL(clicked()), SLOT(removeAutoTypeAssoc()));
    connect(m_autoTypeUi->assocView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
            SLOT(updateAutoTypeEnabled()));
    connect(m_autoTypeAssocModel, SIGNAL(modelReset()), SLOT(updateAutoTypeEnabled()));
    connect(m_autoTypeUi->assocView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
            SLOT(loadCurrentAssoc(QModelIndex)));
    connect(m_autoTypeAssocModel, SIGNAL(modelReset()), SLOT(clearCurrentAssoc()));
    connect(m_autoTypeUi->windowTitleCombo, SIGNAL(editTextChanged(QString)),
            SLOT(applyCurrentAssoc()));
    connect(m_autoTypeUi->defaultWindowSequenceButton, SIGNAL(toggled(bool)),
            SLOT(applyCurrentAssoc()));
    connect(m_autoTypeUi->windowSequenceEdit, SIGNAL(textChanged(QString)),
            SLOT(applyCurrentAssoc()));
}
void ModuloUsuarios::Buscar()
{
  QItemSelectionModel * sm = ui->list_tableView->selectionModel();
  disconnect(sm,SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),this,SLOT(selectionChangedHandle(QModelIndex,QModelIndex)));
  ui_BuscarUsuario* b = new ui_BuscarUsuario;
  QDialog* dialogBuscar = makeBusquedaDialog(b);
  int result = dialogBuscar->exec();
  if(result == QDialog::Rejected)
    return;
  QString query = "nombre_usuario like '%%1%'"
      "and nombres like '%%2%' "
      "and primer_apellido like '%%3%' "
      "and nro_doc like '%%4%'";
  query = query.arg(b->ui->le_nick->text())
      .arg(b->ui->le_nombre->text())
      .arg(b->ui->le_apellido->text())
      .arg(b->ui->le_dni->text());
  relTableModel->setFilter(query);
  relTableModel->select();
  if(relTableModel->lastError().isValid())
    QMessageBox::critical(this,"Error",relTableModel->lastError().text(),0,0);
  ui->list_tableView->setModel(relTableModel);
  sm = ui->list_tableView->selectionModel();
  connect(sm,SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),this,SLOT(selectionChangedHandle(QModelIndex,QModelIndex)));
  ui->list_tableView->hideColumn(0);
  ui->list_tableView->hideColumn(17);
  delete dialogBuscar;
}
Exemple #8
0
IConfigLogging::IConfigLogging(config *cfg, QWidget *parent) :
    QWidget(parent),
    ui(new Ui::IConfigLogging),
    conf(cfg)
{
    ui->setupUi(this);

    QList<int> size;
    size << 50 << 200;

    ui->splitter->setSizes(size);

    QFont f( conf->fontName );
    f.setPixelSize( conf->fontSize );

    ui->logList->setFont(f);
    ui->logText->setFont(f);

    ui->edLogPath->setText( conf->logPath );

    ui->chkEnable->setChecked( conf->logEnabled );
    ui->chkChannels->setChecked( conf->logChannel );
    ui->chkPrivates->setChecked( conf->logPM );

    model = new QStandardItemModel(ui->logList);
    ui->logList->setModel(model);
    selection = ui->logList->selectionModel();

    connect(selection, SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
            this, SLOT(currentRowChanged(QModelIndex,QModelIndex)));

    loadFiles();
}
void TB_PokeChoice::setModel(QAbstractItemModel *model)
{
    if (selectionModel()) {
        selectionModel()->disconnect(SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),this);
    }
    QTableView::setModel(model);

    connect(selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), SLOT(selectedCell(QModelIndex)));
}
Exemple #10
0
void NotesDialog::createConnections() {
    connect(ui->saveButton,   SIGNAL(clicked()), this, SLOT(save()));
    connect(ui->openButton,   SIGNAL(clicked()), this, SLOT(open()));
    connect(ui->appendButton, SIGNAL(clicked()), this, SLOT(append()));
    connect(ui->removeButton, SIGNAL(clicked()), this, SLOT(remove()));
    connect(ui->editModeCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeEditMode(bool)));
    connect(ui->tableView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
            this, SLOT(currentRowChanged(QModelIndex,QModelIndex)));

    connect(ui->textEdit, SIGNAL(textChanged()), this, SLOT(notesChanged()));
    connect(data->model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(notesChanged()));
}
SampleChooserDialog::SampleChooserDialog(const K::File& lastFile, QWidget *parent) :
	QDialog(parent), ui(new Ui::SampleChooserDialog) {

	ui->setupUi(this);

	// create directory model
	K::File root("samples");
	std::string rootPath =  root.getAbsolutePath();
	dirModel = new QFileSystemModel(this);
	dirModel->setFilter(QDir::NoDotAndDotDot | QDir::Dirs);
	ui->treeFolders->setModel(dirModel);
	ui->treeFolders->setRootIndex(dirModel->setRootPath( rootPath.c_str() ));
	ui->treeFolders->hideColumn(1);
	ui->treeFolders->hideColumn(2);
	ui->treeFolders->hideColumn(3);

	// create file model
	fileModel = new QFileSystemModel(this);
	fileModel->setFilter(QDir::NoDotAndDotDot | QDir::Files);
	ui->listFiles->setModel(fileModel);
	//ui->listFiles->setRootIndex(fileModel->setRootPath( rootPath.c_str() ));

	// select start path
	std::string startPath = "";
	std::string startFile = "";
	if (lastFile.isFolder()) {
		startPath = lastFile.getAbsolutePath();
	} else {
		startPath = lastFile.getParent().getAbsolutePath();
		startFile = lastFile.getAbsolutePath();
	}
	ui->treeFolders->setCurrentIndex(dirModel->index( startPath.c_str() ));
	ui->listFiles->setRootIndex(fileModel->setRootPath( startPath.c_str() ));
	if (!startFile.empty()) {
		ui->listFiles->setCurrentIndex(fileModel->index( startFile.c_str() ));
	}

	// signals
	connect(ui->btnCancel, SIGNAL(clicked()), this, SLOT(onCancel()));

	connect(ui->btnOk, SIGNAL(clicked()), this, SLOT(onOK()));

	connect(ui->treeFolders->selectionModel(), SIGNAL(currentRowChanged(QModelIndex, QModelIndex)),
			this, SLOT(onFolderSelect(QModelIndex, QModelIndex)));

	connect(ui->listFiles->selectionModel(), SIGNAL(currentRowChanged(QModelIndex, QModelIndex)),
			this, SLOT(onFileSelect(QModelIndex, QModelIndex)));

}
void ImportMidiPanel::tweakUi()
      {
      connect(updateUiTimer, SIGNAL(timeout()), this, SLOT(updateUi()));
      connect(ui->pushButtonImport, SIGNAL(clicked()), SLOT(doMidiImport()));
      connect(ui->pushButtonUp, SIGNAL(clicked()), SLOT(moveTrackUp()));
      connect(ui->pushButtonDown, SIGNAL(clicked()), SLOT(moveTrackDown()));
      connect(ui->toolButtonHideMidiPanel, SIGNAL(clicked()), SLOT(hidePanel()));

      const QItemSelectionModel *sm = ui->tableViewTracks->selectionModel();
      connect(sm, SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
              SLOT(onCurrentTrackChanged(QModelIndex)));
      connect(ui->treeViewOperations->model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
              SLOT(onOperationChanged(QModelIndex)));

      updateUiTimer->start(100);
      updateUi();

      ui->tableViewTracks->verticalHeader()->setDefaultSectionSize(22);
      ui->tableViewTracks->setHorizontalHeader(new CustomHorizHeaderView());
      ui->tableViewTracks->horizontalHeader()->setResizeMode(TrackCol::TRACK_NUMBER,
                                                             QHeaderView::ResizeToContents);
      ui->tableViewTracks->horizontalHeader()->setResizeMode(TrackCol::DO_IMPORT,
                                                             QHeaderView::ResizeToContents);
      ui->tableViewTracks->horizontalHeader()->setResizeMode(TrackCol::LYRICS,
                                                             QHeaderView::Stretch);
      ui->tableViewTracks->horizontalHeader()->setResizeMode(TrackCol::STAFF_NAME,
                                                             QHeaderView::Stretch);
      ui->tableViewTracks->horizontalHeader()->setResizeMode(TrackCol::INSTRUMENT,
                                                             QHeaderView::Stretch);
      ui->treeViewOperations->header()->resizeSection(0, 285);
      ui->treeViewOperations->setAllColumnsShowFocus(true);
      ui->comboBoxCharset->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon);

      fillCharsetList();
      }
Exemple #13
0
void PackagesPage::createModel()
{
    _model = new QSqlRelationalTableModel(_ui->_listPackages);
    _model->setEditStrategy(QSqlTableModel::OnManualSubmit);
    _model->setTable(PackageTable::tableName);

    int idIndex = _model->fieldIndex(PackageTable::fieldId);
    _model->setHeaderData(idIndex, Qt::Horizontal, tr("Id"));
    int idName = _model->fieldIndex(PackageTable::fieldName);
    _model->setHeaderData(idName, Qt::Horizontal, tr("Name"));
    int idDescr = _model->fieldIndex(PackageTable::fieldDescr);
    _model->setHeaderData(idDescr, Qt::Horizontal, tr("Description"));

    if(!_model->select())
    {
        return;
    }

    _ui->_listPackages->setModel(_model);
    _ui->_listPackages->setColumnHidden(0, true);
    _ui->_listPackages->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch);

    connect(_ui->_listPackages->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), SLOT(onCurrentRowChanged(QModelIndex)));

    _ui->_listPackages->setCurrentIndex(_model->index(0,0));
}
Exemple #14
0
PoolWindow::PoolWindow(QWidget *parent)
	: QMainWindow(parent)
	, ui_()
	, poolTableModel_()
	, itemDelegate_(new PoolItemDelegate(poolTableModel_))
	, rootFilterNode_()
{
	setWindowFlags(Qt::NoDropShadowWindowHint);
	ui_.setupUi(this);
	ui_.poolTbl_->setItemDelegate(itemDelegate_.data());
	ui_.poolTbl_->setModel(&poolTableModel_);
	ui_.poolTbl_->setSortingEnabled(true);
	ui_.poolTbl_->setSelectionBehavior(QAbstractItemView::SelectRows);
	ui_.poolTbl_->horizontalHeader()->setSectionsMovable(true);
	ui_.poolTbl_->horizontalHeader()->setContextMenuPolicy(Qt::CustomContextMenu);
	connect(ui_.poolTbl_->horizontalHeader(), SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(hideColumnsContextMenuRequested(QPoint)));
	connect(ui_.poolTbl_->selectionModel(), SIGNAL(currentRowChanged(QModelIndex, QModelIndex)), this, SLOT(currentRowChanged(QModelIndex, QModelIndex)));
	connect(ui_.actionAdvancedFilter, SIGNAL(triggered()), this, SLOT(actionAdvancedFilter()));
	connect(ui_.actionEnableFilter, SIGNAL(triggered(bool)), this, SLOT(actionEnableFilter(bool)));
	connect(ui_.actionAddToCollection, SIGNAL(triggered()), this, SLOT(actionAddToCollection()));
	connect(ui_.actionRemoveFromCollection, SIGNAL(triggered()), this, SLOT(actionRemoveFromCollection()));
	connect(ui_.actionAddToDeck, SIGNAL(triggered()), this, SLOT(actionAddToDeck()));
	connect(ui_.actionRemoveFromDeck, SIGNAL(triggered()), this, SLOT(actionRemoveFromDeck()));
	connect(ui_.actionDownloadCardArt, SIGNAL(triggered()), this, SLOT(actionDownloadCardArt()));
	connect(ui_.actionFetchOnlineData, SIGNAL(triggered()), this, SLOT(actionFetchOnlineData()));
	connect(this, SIGNAL(fontChanged()), ui_.poolTbl_, SLOT(handleFontChanged()));

	ui_.statusBar->addPermanentWidget(new QLabel("Search: "));
	QLabel* permanentStatusBarLabel = new QLabel();
	ui_.statusBar->addPermanentWidget(permanentStatusBarLabel);
	connect(ui_.poolTbl_, SIGNAL(searchStringChanged(QString)), permanentStatusBarLabel, SLOT(setText(QString)));
}
Exemple #15
0
FormPrefEmail::FormPrefEmail(QWidget* parent, Qt::WFlags fl)
: EVentana( parent, fl ), Ui::FormPrefEmailBase()
{
        setupUi(this);
        servidores = new EServidorEmail( LVServidores );

        LVServidores->setModel( servidores );
        LVServidores->setModelColumn( servidores->fieldIndex( "nombre" ) );

        mapeador = new QDataWidgetMapper( this );
        mapeador->setModel( servidores );
        mapeador->addMapping( LENombre, servidores->fieldIndex( "nombre" ) );
        mapeador->addMapping( LEDireccion, servidores->fieldIndex( "direccion" ) );
        mapeador->addMapping( SBPuerto, servidores->fieldIndex( "puerto" ) );
        mapeador->addMapping( LEUsuario, servidores->fieldIndex( "usuario" ) );
        mapeador->addMapping( LEPass, servidores->fieldIndex( "pass" ) );
        mapeador->addMapping( CkBPredeterminado, servidores->fieldIndex( "predeterminado" ) );
        mapeador->addMapping( LEFrom, servidores->fieldIndex( "de" ) );
        mapeador->setSubmitPolicy( QDataWidgetMapper::ManualSubmit );

        connect(LVServidores->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
             mapeador, SLOT(setCurrentModelIndex(QModelIndex)));

        mapeador->toFirst();

        connect( PBAgregar, SIGNAL( clicked() ), this, SLOT( agregar() ) );
        connect( PBEliminar, SIGNAL( clicked() ), this, SLOT( eliminar() ) );

        PBAgregar->setIcon( QIcon( ":/imagenes/add.png" ) );
        PBEliminar->setIcon( QIcon( ":/imagenes/stop.png" ) );

        this->setWindowTitle( "Servidor Em@il" );
        this->setWindowIcon( QIcon( ":/imagenes/servidor_email.png" ) );
}
Exemple #16
0
void RoomSetting::initTable(){
    /*********过道************/
    updateBuild();
    /*********房间*********/
    ui->table2->setSortingEnabled(true);
    ui->table2->setItemDelegate(new TrackDelegate(TRACKTYPE::DATA_ROOM));

    model_room =Dbconnect::getTbModel("room");
    model_room->setSort(model_room->fieldIndex("room_no"),Qt::AscendingOrder);
    model_room->setHeaderData(model_room->fieldIndex("build_no"), Qt::Horizontal, "楼栋");
    model_room->setHeaderData(model_room->fieldIndex("room_no"), Qt::Horizontal, "房间号");
    model_room->setHeaderData(model_room->fieldIndex("is_used"), Qt::Horizontal, "客人入住");
    model_room->setHeaderData(model_room->fieldIndex("is_carded"), Qt::Horizontal, "插卡状态");
    model_room->setHeaderData(model_room->fieldIndex("is_quiet"), Qt::Horizontal, "安静模式");
    model_room->setHeaderData(model_room->fieldIndex("is_need_server"), Qt::Horizontal, "服务请求");
    model_room->setHeaderData(model_room->fieldIndex("is_need_clean"), Qt::Horizontal, "清洁请求");
    model_room->setHeaderData(model_room->fieldIndex("is_need_repaire"), Qt::Horizontal, "维修请求");
    model_room->setHeaderData(model_room->fieldIndex("is_need_help"), Qt::Horizontal, "求助请求");
    model_room->setHeaderData(model_room->fieldIndex("air_temp"), Qt::Horizontal, "空调温度");
    model_room->setHeaderData(model_room->fieldIndex("light_1"), Qt::Horizontal, "房间主灯");
    model_room->setHeaderData(model_room->fieldIndex("light_2"), Qt::Horizontal, "房间次灯");
    model_room->setHeaderData(model_room->fieldIndex("light_3"), Qt::Horizontal, "床头灯");
    model_room->setHeaderData(model_room->fieldIndex("light_4"), Qt::Horizontal, "浴室灯");
    model_room->setHeaderData(model_room->fieldIndex("light_5"), Qt::Horizontal, "阳台灯");
    ui->table2->setModel(model_room);
    for(int i=2;i<model_room->columnCount();i++){
        ui->table2->hideColumn(i);
    }

    changeBuild();
    connect(ui->table1->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
            this, SLOT(changeBuild()));

}
QFFitFunctionSelectDialog::QFFitFunctionSelectDialog(QWidget *parent) :
    QFDialog(parent),
    ui(new Ui::QFFitFunctionSelectDialog)
{
    currentFunction="";
    setWindowTitle(tr("Select fit model function ..."));
    model=NULL;
    ui->setupUi(this);
    filterModel.setDynamicSortFilter(true);
    filterModel.setFilterCaseSensitivity(Qt::CaseInsensitive);
    filterModel.setFilterRole(Qt::UserRole+10);
    ui->lstModels->setModel(&filterModel);
    ui->lstModels->expandAll();
    connect(ui->lstModels->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(currentRowChanged(QModelIndex,QModelIndex)));
    connect(ui->lstModels, SIGNAL(clicked(QModelIndex)), this, SLOT(currentRowChanged(QModelIndex)));
    connect(ui->lstModels, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(currentRowAccepted(QModelIndex)));
    ui->splitter->setStretchFactor(0,1);
    ui->splitter->setStretchFactor(0,2);

    QSettings* set=ProgramOptions::getInstance()->getQSettings();
    if (set) {
        loadWidgetGeometry(*set, this, pos(), size(), "QFFitFunctionSelectDialog/windowsize");
        loadSplitter(*set, ui->splitter, "QFFitFunctionSelectDialog/splitter");
    }
    setWindowFlags(windowFlags()|Qt::WindowMinMaxButtonsHint);
}
CategoryFilterWidget::CategoryFilterWidget(QWidget *parent)
    : QTreeView(parent)
{
    CategoryFilterProxyModel *proxyModel = new CategoryFilterProxyModel(this);
    proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
    proxyModel->setSourceModel(new CategoryFilterModel(this));
    setModel(proxyModel);
    setFrameShape(QFrame::NoFrame);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    setUniformRowHeights(true);
    setHeaderHidden(true);
    setIconSize(Utils::Misc::smallIconSize());
#if defined(Q_OS_MAC)
    setAttribute(Qt::WA_MacShowFocusRect, false);
#endif
    setContextMenuPolicy(Qt::CustomContextMenu);
    sortByColumn(0, Qt::AscendingOrder);
    setCurrentIndex(model()->index(0, 0));

    connect(this, SIGNAL(collapsed(QModelIndex)), SLOT(callUpdateGeometry()));
    connect(this, SIGNAL(expanded(QModelIndex)), SLOT(callUpdateGeometry()));
    connect(this, SIGNAL(customContextMenuRequested(QPoint)), SLOT(showMenu(QPoint)));
    connect(selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex))
            , SLOT(onCurrentRowChanged(QModelIndex,QModelIndex)));
    connect(model(), SIGNAL(modelReset()), SLOT(callUpdateGeometry()));
}
Exemple #19
0
	void GraffitiTab::SetupViews ()
	{
		FSModel_->setRootPath (QDir::rootPath ());
		FSModel_->setFilter (QDir::Dirs | QDir::NoDotAndDotDot);
		FSModel_->setReadOnly (true);
		Ui_.DirectoryTree_->setModel (FSModel_);
		Ui_.DirectoryTree_->sortByColumn (0, Qt::AscendingOrder);

		auto idx = FSModel_->index (QDir::homePath ());
		while (idx.isValid ())
		{
			Ui_.DirectoryTree_->expand (idx);
			idx = idx.parent ();
		}

		Ui_.FilesList_->setModel (FilesModel_);

		connect (Ui_.FilesList_->selectionModel (),
				SIGNAL (currentRowChanged (QModelIndex, QModelIndex)),
				this,
				SLOT (currentFileChanged (QModelIndex)));

		connect (Ui_.PathLine_,
				SIGNAL (activated (QString)),
				this,
				SLOT (handlePathLine ()));
	}
Exemple #20
0
void ResultsPage::setModel(SiteResponseModel* model) {
    m_selectedOutput = 0;
    m_selectedRow = -1;

    // Remove the previous model and delete the selectionModel
    if (QItemSelectionModel* m = m_catalogTableView->selectionModel()) {
        m_catalogTableView->setModel(0);
        delete m;
    }

    // Need to check if the model has results -- otherwise there is a list of
    // outputs with no data associated with them.
    if (!model->hasResults())
        return;

    m_outputCatalog = model->outputCatalog();
    m_catalogTableView->setModel(m_outputCatalog);

    connect(m_outputCatalog, SIGNAL(enabledChanged(int)),
            this, SLOT(enableSelectedCurve(int)));
    connect(m_catalogTableView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
            this, SLOT(setSelectedSeries(QModelIndex,QModelIndex)));

    m_outputComboBox->clear();
    m_outputComboBox->addItems(m_outputCatalog->outputNames());

    if (m_outputComboBox->count())
        setSelectedOutput(0);
}
mantenimientoTitulo::mantenimientoTitulo(int idUnidad, QWidget *parent) :
    QDialog(parent),
    m_ui(new Ui::mantenimientoTitulo)
{
    m_ui->setupUi(this);

    m_ui->btmTitulo->setChecked(true);


    Persistencia::Persistencia *servicioPersistencia=new Persistencia(idUnidad);

    QSqlQueryModel *model = new QSqlQueryModel(m_ui->titulos);
    model->setQuery("SELECT tituloObra, isbn FROM titulo;", QSqlDatabase::database("sibcues"));
    if (model->lastError().isValid())
        qDebug() << model->lastError();

    //model->setTable("titulo");
    //model->select();

    model->setHeaderData(0, Qt::Horizontal, QObject::tr("Titulo Material Bibliografico"));
    model->setHeaderData(1, Qt::Horizontal, QObject::tr("ISBN"));
    m_ui->titulos->setModel(model);
    m_ui->titulos->alternatingRowColors();
    //m_ui->titulos->hideColumn(0);
    m_ui->titulos->horizontalHeader()->resizeSection(0, 350);
    m_ui->titulos->setSelectionMode(QAbstractItemView::SingleSelection);
    connect(m_ui->titulos->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), this, SLOT(on_titulos_activated(QModelIndex)));
    m_ui->labelTitulo->setText("Titulos: "+QString::number(model->rowCount())+" resultados.");


}
Exemple #22
0
void PersonForm::Init()
{
    persona_model = new QSqlTableModel(this);
    persona_model->setEditStrategy(QSqlTableModel::OnManualSubmit);
    persona_model->setTable("persona");
    persona_model->setHeaderData(1, Qt::Horizontal, "ФИО");
    //persona_model->setSort(1, Qt::AscendingOrder);
    ui->tablePersona->setModel(persona_model);
    ui->tablePersona->hideColumn(0);
    ui->tablePersona->connect(ui->tablePersona->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), this, SLOT(on_tablePersona_changed(QModelIndex)));
    persona_model->select();
    ui->tablePersona->horizontalHeader()->resizeSections(QHeaderView::ResizeToContents);

    schet_model = new QSqlRelationalTableModel(this);
    schet_model->setEditStrategy(QSqlTableModel::OnManualSubmit);
    schet_model->setTable("schet");
    schet_model->setHeaderData(1, Qt::Horizontal, "Банк");
    schet_model->setHeaderData(2, Qt::Horizontal, "Код вклада");
    schet_model->setHeaderData(3, Qt::Horizontal, "Лицевой счет");
    schet_model->setRelation(1, QSqlRelation("bank", "id", "name"));
    schet_model->relationModel(1)->setSort(1, Qt::AscendingOrder);
    schet_model->relationModel(1)->select();
    //schet_model->setSort(1, Qt::AscendingOrder);
    ui->tableSchet->setModel(schet_model);
    ui->tableSchet->setItemDelegate(new QSqlRelationalDelegate(ui->tableSchet));
    ui->tableSchet->hideColumn(0);
    ui->tableSchet->hideColumn(4);
    schet_model->select();
    ui->tableSchet->horizontalHeader()->resizeSections(QHeaderView::ResizeToContents);
}
NickNameDialog::NickNameDialog(QStandardItemModel *model, QWidget *parent) :
        QDialog(parent),
        m_ui(new Ui::NickNameDialog),
        m_model(model),
        m_filterModel(new QSortFilterProxyModel(this))
{
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    m_ui->setupUi(this);
    okButton()->setEnabled(false);

    // Populate model and grow tree to accommodate it
    m_filterModel->setSourceModel(model);
    m_filterModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
    m_ui->filterTreeView->setModel(m_filterModel);
    const int columnCount = m_filterModel->columnCount();
    int treeWidth = 0;
    for (int c = 0; c < columnCount; c++) {
        m_ui->filterTreeView->resizeColumnToContents(c);
        treeWidth += m_ui->filterTreeView->columnWidth(c);
    }
    m_ui->filterTreeView->setMinimumWidth(treeWidth + 20);
    connect(m_ui->filterTreeView, SIGNAL(doubleClicked(QModelIndex)), this,
            SLOT(slotDoubleClicked(QModelIndex)));
    connect(m_ui->filterTreeView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
            this, SLOT(slotCurrentItemChanged(QModelIndex)));
    connect(m_ui->filterLineEdit, SIGNAL(filterChanged(QString)),
            m_filterModel, SLOT(setFilterFixedString(QString)));
}
AnalitikaArtikliLista::~AnalitikaArtikliLista()
{
    disconnect(sm, SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), this, SLOT(selectionChanged(QModelIndex,QModelIndex)));
    disconnect(header, SIGNAL(sectionResized(int, int, int)), this, SLOT(procSectionResized(int, int, int)));
    disconnect(header_2, SIGNAL(sectionResized(int, int, int)), this, SLOT(procSectionResizedDetail(int, int, int)));


    Singleton *s = Singleton::Instance();
    QStringList tempVals = s->saveWidthList(colWidth);
    s->Set_Faktura_HeaderState(tempVals);
    QStringList tempdetailVals = s->saveWidthList(colDetailWidth);
    s->Set_FakturaDetail_HeaderState(tempdetailVals);


    delete ui;
    delete model;
    delete header;
    delete model_2;
    delete header_2;
    delete b;
    b = 0;
    delete bc;
    bc = 0;
    delete bd;
    bd = 0;
}
Exemple #25
0
	void PhotosTab::handleAccountChosen (int idx)
	{
		auto accVar = AccountsBox_->itemData (idx, AccountsManager::Role::AccountObj);
		auto accObj = accVar.value<QObject*> ();
		auto acc = qobject_cast<IAccount*> (accObj);
		if (acc == CurAcc_)
			return;

		if (CurAccObj_)
			disconnect (CurAccObj_,
					0,
					this,
					0);

		CurAccObj_ = accObj;
		CurAcc_ = acc;

		connect (CurAccObj_,
				SIGNAL (doneUpdating ()),
				this,
				SLOT (handleAccDoneUpdating ()));

		CurAcc_->UpdateCollections ();

		auto model = CurAcc_->GetCollectionsModel ();

		if (auto sel = Ui_.CollectionsTree_->selectionModel ())
			disconnect (sel,
					SIGNAL (currentRowChanged (QModelIndex, QModelIndex)),
					this,
					SLOT (handleRowChanged (QModelIndex)));
		Ui_.CollectionsTree_->setModel (model);
		connect (Ui_.CollectionsTree_->selectionModel (),
				SIGNAL (currentRowChanged (QModelIndex, QModelIndex)),
				this,
				SLOT (handleRowChanged (QModelIndex)));

		ProxyModel_->SetCurrentAccount (CurAccObj_);
		ProxyModel_->setSourceModel (model);

		ImagesView_->rootContext ()->setContextProperty ("collRootIndex", QVariant::fromValue (QModelIndex ()));
		HandleCollectionSelected ({});

		UploadAction_->setEnabled (qobject_cast<ISupportUploads*> (CurAccObj_));

		emit tabRecoverDataChanged ();
	}
QgsWFSSourceSelect::QgsWFSSourceSelect( QWidget* parent, Qt::WindowFlags fl, bool embeddedMode )
    : QDialog( parent, fl )
    , mCapabilities( nullptr )
{
  setupUi( this );

  if ( embeddedMode )
  {
    buttonBox->button( QDialogButtonBox::Close )->hide();
  }

  mAddButton = new QPushButton( tr( "&Add" ) );
  mAddButton->setEnabled( false );

  mBuildQueryButton = new QPushButton( tr( "&Build query" ) );
  mBuildQueryButton->setToolTip( tr( "Build query" ) );
  mBuildQueryButton->setDisabled( true );


  buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
  connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addLayer() ) );

  buttonBox->addButton( mBuildQueryButton, QDialogButtonBox::ActionRole );
  connect( mBuildQueryButton, SIGNAL( clicked() ), this, SLOT( buildQueryButtonClicked() ) );

  connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
  connect( btnNew, SIGNAL( clicked() ), this, SLOT( addEntryToServerList() ) );
  connect( btnEdit, SIGNAL( clicked() ), this, SLOT( modifyEntryOfServerList() ) );
  connect( btnDelete, SIGNAL( clicked() ), this, SLOT( deleteEntryOfServerList() ) );
  connect( btnConnect, SIGNAL( clicked() ), this, SLOT( connectToServer() ) );
  connect( btnChangeSpatialRefSys, SIGNAL( clicked() ), this, SLOT( changeCRS() ) );
  connect( lineFilter, SIGNAL( textChanged( QString ) ), this, SLOT( filterChanged( QString ) ) );
  populateConnectionList();
  mProjectionSelector = new QgsGenericProjectionSelector( this );
  mProjectionSelector->setMessage();

  mItemDelegate = new QgsWFSItemDelegate( treeView );
  treeView->setItemDelegate( mItemDelegate );

  QSettings settings;
  QgsDebugMsg( "restoring settings" );
  restoreGeometry( settings.value( "/Windows/WFSSourceSelect/geometry" ).toByteArray() );
  cbxUseTitleLayerName->setChecked( settings.value( "/Windows/WFSSourceSelect/UseTitleLayerName", false ).toBool() );
  mHoldDialogOpen->setChecked( settings.value( "/Windows/WFSSourceSelect/HoldDialogOpen", false ).toBool() );

  mModel = new QStandardItemModel();
  mModel->setHorizontalHeaderItem( MODEL_IDX_TITLE, new QStandardItem( "Title" ) );
  mModel->setHorizontalHeaderItem( MODEL_IDX_NAME, new QStandardItem( "Name" ) );
  mModel->setHorizontalHeaderItem( MODEL_IDX_ABSTRACT, new QStandardItem( "Abstract" ) );
  mModel->setHorizontalHeaderItem( MODEL_IDX_FILTER, new QStandardItem( "Filter" ) );

  mModelProxy = new QSortFilterProxyModel( this );
  mModelProxy->setSourceModel( mModel );
  mModelProxy->setSortCaseSensitivity( Qt::CaseInsensitive );
  treeView->setModel( mModelProxy );

  connect( treeView, SIGNAL( doubleClicked( const QModelIndex& ) ), this, SLOT( treeWidgetItemDoubleClicked( const QModelIndex& ) ) );
  connect( treeView->selectionModel(), SIGNAL( currentRowChanged( QModelIndex, QModelIndex ) ), this, SLOT( treeWidgetCurrentRowChanged( const QModelIndex&, const QModelIndex& ) ) );
}
Exemple #27
0
Tippeligaen::Tippeligaen(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::Tippeligaen)
{
    ui->setupUi(this);


    QGroupBox *team = createTeamChooserGroupBox();
    teamOfTheRound = createTeamOfTheRoundGroupBox();
    createTeamPlayersGroupBox();
    createTeamInfoGroupBox();
    createTeamOfTheRoundChooseTeamGroupBox();
    createTeamWikiView();
    createTeamOfTheRoundShowTeam();
    crateNewTeamOfTheRound();

    makeWindowMenues();
    createMakeNewPlayerView();

    doAtStartUp();

    QGridLayout *layout = new QGridLayout;
    layout->addWidget(team, 0, 0);
    layout->addWidget(players, 1, 0);
    layout->addWidget(playerInfoGroupBox, 2 ,0);
    layout->addWidget(makePlayerGroupBox, 2, 0);
    layout->addWidget(crateNewTeamOfTheRoundGroupBox, 2, 0);
    layout->addWidget(teamOfTheRound, 0, 1, 3, 1);
    layout->addWidget(teamWiki, 0, 1, 3, 1);
    layout->addWidget(teamOfTheRoundChooseTeamGroupBox, 0, 1);
    layout->addWidget(createTeamOfTheRoundShowTeamGroupBox, 1, 1);
    layout->setColumnStretch(1, 1);
    layout->setColumnMinimumWidth(0, 500);
    layout->setColumnMinimumWidth(1, 500);

    QWidget *widget = new QWidget;
    widget->setLayout(layout);
    setCentralWidget(widget);

    this->adjustSize();
    setWindowTitle(tr("Tippeligaen 2010"));


    connect(playerTableView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
            this, SLOT(updatePlayerInformation()));
    connect(teamComboBox, SIGNAL(currentIndexChanged(int)),
            this, SLOT(updateTeamWiki(int)));
    connect(deletePlayerButton, SIGNAL(clicked()),
            this, SLOT(deletePlayer()));
    connect(createNewPlayer, SIGNAL(clicked()),
            this, SLOT(actionAddNewPlayerToDataBase()));
    connect(addToTeamOfTheRoundButton, SIGNAL(clicked()),
            this, SLOT(addPlayerToTeamOfTheRound()));
    connect(teamOfTheRoundChooseTeamComboBox, SIGNAL(currentIndexChanged(int)),
            this, SLOT(updateTeamOfTheRoundTable()));
    connect(teamOfTheRoundButton, SIGNAL(clicked()),
            this, SLOT(teamOfTheRoundButtonClicked()));
    connectMainMenuSlots();
}
Exemple #28
0
bool MainWindow::CreateConnection(QString dbDir){
    //The sql database is created, and defined as SQLite
    qDebug()<<"Connection initiated";
    db=QSqlDatabase::addDatabase("QSQLITE");

    //db.setDatabaseName(QString("%1/%1").arg(dbDir));
    QFileInfo *dbFile = new QFileInfo(dbDir);
    QDir::setCurrent(dbFile->absolutePath());
    qDebug()<<"Set current directory to: "<<dbFile->absolutePath();
    db.setDatabaseName(dbFile->fileName());
    qDebug()<<db.databaseName();

    if (!db.open()){
        qDebug()<<"No Connection made to file";
        return false;
    }
    qDebug()<<"DB Created";
    dbmodel= new MySqlTableModel(this,db);
    //dbmodel->setEditStrategy(QSqlTableModel::OnManualSubmit);
    dbmodel->select();

    //The main table is loaded. It contains all the main data.

    //The table view is prepared by setting the model and other options

    dbTableView->setModel(dbmodel);

    dbTableView->setSelectionBehavior(QAbstractItemView::SelectRows);

    //dbTableView->resizeColumnsToContents();

    //The fields array is iterated and each data column in the model is named, while the ones which should not
    //be previewd in the table are hidden.
    mapper->setModel(dbmodel);

    for(int n=0;n<dbmodel->getFields().size();n++){
        //dbmodel->setHeaderData(n,Qt::Horizontal,Fields[n][0]);
        if(!dbmodel->getField(n).getVisTable()){
            dbTableView->hideColumn(n);
        }
        //Each field is checked to see whether it should appear in the preview frame.
        if (dbmodel->getField(n).getVisPreview()){
            prwItems.push_back(new DisplayWidget(dbmodel->getField(n),false, frmPreview));
            mapper->addMapping(prwItems.last(),n,"Value");
        }
    }
    connect(dbTableView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), mapper, SLOT(setCurrentModelIndex(QModelIndex)));

    dbTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
    //Sets alternating Colors
    dbTableView->setAlternatingRowColors(true);
    dbTableView->setStyleSheet("alternate-background-color:#99DDFF;background-color:white;");
    //sets no triggers to edit the information
    dbTableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
    //qDebug()<<"EDIT StRATEGY "<<dbmodel->editStrategy();
    return true;


}
Exemple #29
0
FindArticeDialog::FindArticeDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::FindArticeDialog)
{
    ui->setupUi(this);

    db = QSqlDatabase::database("CheckGenerator");


    quArticle = new QSqlQuery(db);
    if(!quArticle->exec("select ArticleName,ArticleNo "
                        "from Article "
                        "/*where exists(select * from BarCode  where BarCode.ArticleNo=Article.ArticleNo) */"
                        "order by ArticleName"))
    {
        qDebug()<<quArticle->lastError().text();
    }
    moArticle = new QSqlQueryModel();
    moArticle->setQuery(*quArticle);
    moArticle->setHeaderData(0, Qt::Horizontal, tr("Наименование"));
    moArticle->setHeaderData(1, Qt::Horizontal, tr("Код"));



    ui->tvArticle->setModel(moArticle);
    ui->tvArticle->resizeColumnsToContents();
    ui->tvArticle->setSelectionMode(QAbstractItemView::SingleSelection);
    ui->tvArticle->setSelectionBehavior(QAbstractItemView::SelectRows);
    ui->tvArticle->setTabKeyNavigation(false);

    mapper = new QDataWidgetMapper(this);
    mapper->setModel(moArticle);
    //mapper->addMapping(ui->lineEdit, 0);
    connect(ui->tvArticle->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
            mapper, SLOT(setCurrentModelIndex(QModelIndex)));
   // mapper->setCurrentModelIndex(ui->tvArticle->selectionModel()->currentIndex());



    /*centered*/
    this->move(QApplication::desktop()->screen()->rect().center() - this->rect().center());
    setWindowState(this->windowState()^Qt::WindowMaximized);
    setWindowFlags(Qt::WindowMaximizeButtonHint);
    /*hooking kew down*/
    ui->leSearchString->installEventFilter(this);
    connect(ui->leSearchString,SIGNAL(textChanged(QString)),this,SLOT(StringToFindChanged(QString)));


    ui->groupBox_2->setTitle("");

    CreateVirtualKeyboard();
    ui->pbOK->setFocusPolicy(Qt::NoFocus);
    ui->pbCancel->setFocusPolicy(Qt::NoFocus);
    ui->leSearchString->setFocusPolicy(Qt::NoFocus);



}
QgsSourceSelectDialog::QgsSourceSelectDialog( const QString& serviceName, ServiceType serviceType, QWidget* parent, Qt::WindowFlags fl )
    : QDialog( parent, fl ), mServiceName( serviceName ), mServiceType( serviceType ), mBuildQueryButton( 0 ), mImageEncodingGroup( 0 )
{
  setupUi( this );
  setWindowTitle( QStringLiteral( "Add %1 Layer from a Server" ).arg( mServiceName ) );

  mAddButton = buttonBox->addButton( tr( "&Add" ), QDialogButtonBox::ActionRole );
  mAddButton->setEnabled( false );
  connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addButtonClicked() ) );

  if ( mServiceType == FeatureService )
  {
    mBuildQueryButton = buttonBox->addButton( tr( "&Build query" ), QDialogButtonBox::ActionRole );
    mBuildQueryButton->setDisabled( true );
    connect( mBuildQueryButton, SIGNAL( clicked() ), this, SLOT( buildQueryButtonClicked() ) );
  }

  connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
  connect( btnNew, SIGNAL( clicked() ), this, SLOT( addEntryToServerList() ) );
  connect( btnEdit, SIGNAL( clicked() ), this, SLOT( modifyEntryOfServerList() ) );
  connect( btnDelete, SIGNAL( clicked() ), this, SLOT( deleteEntryOfServerList() ) );
  connect( btnConnect, SIGNAL( clicked() ), this, SLOT( connectToServer() ) );
  connect( btnChangeSpatialRefSys, SIGNAL( clicked() ), this, SLOT( changeCrs() ) );
  connect( lineFilter, SIGNAL( textChanged( QString ) ), this, SLOT( filterChanged( QString ) ) );
  populateConnectionList();
  mProjectionSelector = new QgsGenericProjectionSelector( this );
  mProjectionSelector->setMessage();

  treeView->setItemDelegate( new QgsSourceSelectItemDelegate( treeView ) );

  QSettings settings;
  restoreGeometry( settings.value( QStringLiteral( "/Windows/SourceSelectDialog/geometry" ) ).toByteArray() );
  cbxUseTitleLayerName->setChecked( settings.value( QStringLiteral( "/Windows/SourceSelectDialog/UseTitleLayerName" ), false ).toBool() );

  mModel = new QStandardItemModel();
  mModel->setHorizontalHeaderItem( 0, new QStandardItem( QStringLiteral( "Title" ) ) );
  mModel->setHorizontalHeaderItem( 1, new QStandardItem( QStringLiteral( "Name" ) ) );
  mModel->setHorizontalHeaderItem( 2, new QStandardItem( QStringLiteral( "Abstract" ) ) );
  if ( serviceType == FeatureService )
  {
    mModel->setHorizontalHeaderItem( 3, new QStandardItem( QStringLiteral( "Cache Feature" ) ) );
    mModel->setHorizontalHeaderItem( 4, new QStandardItem( QStringLiteral( "Filter" ) ) );
    gbImageEncoding->hide();
  }
  else
  {
    cbxFeatureCurrentViewExtent->hide();
    mImageEncodingGroup = new QButtonGroup( this );
  }

  mModelProxy = new QSortFilterProxyModel( this );
  mModelProxy->setSourceModel( mModel );
  mModelProxy->setSortCaseSensitivity( Qt::CaseInsensitive );
  treeView->setModel( mModelProxy );

  connect( treeView, SIGNAL( doubleClicked( const QModelIndex& ) ), this, SLOT( treeWidgetItemDoubleClicked( const QModelIndex& ) ) );
  connect( treeView->selectionModel(), SIGNAL( currentRowChanged( QModelIndex, QModelIndex ) ), this, SLOT( treeWidgetCurrentRowChanged( const QModelIndex&, const QModelIndex& ) ) );
}