コード例 #1
0
ファイル: llmousehandler.cpp プロジェクト: HizWylder/GIS
//virtual
BOOL LLMouseHandler::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down)
{
	BOOL handled = FALSE;
	if (down)
	{
		switch (clicktype)
		{
		case CLICK_LEFT: handled = handleMouseDown(x, y, mask); break;
		case CLICK_RIGHT: handled = handleRightMouseDown(x, y, mask); break;
		case CLICK_MIDDLE: handled = handleMiddleMouseDown(x, y, mask); break;
		case CLICK_DOUBLELEFT: handled = handleDoubleClick(x, y, mask); break;
		default:
			llwarns << "Unhandled enum." << llendl;
		}
	}
	else
	{
		switch (clicktype)
		{
		case CLICK_LEFT: handled = handleMouseUp(x, y, mask); break;
		case CLICK_RIGHT: handled = handleRightMouseUp(x, y, mask); break;
		case CLICK_MIDDLE: handled = handleMiddleMouseUp(x, y, mask); break;
		case CLICK_DOUBLELEFT: handled = handleDoubleClick(x, y, mask); break;
		default:
			llwarns << "Unhandled enum." << llendl;
		}
	}
	return handled;
}
コード例 #2
0
void QgsAuthTrustedCAsDialog::btnInfoCa_clicked()
{
  if ( treeTrustedCAs->selectionModel()->selection().length() > 0 )
  {
    QTreeWidgetItem *item( treeTrustedCAs->currentItem() );
    handleDoubleClick( item, 0 );
  }
}
コード例 #3
0
ファイル: bookmarkWidget.cpp プロジェクト: WeiqiJust/CHER-Ob
/*
 * Reimplemented from QTreeWidget::keyPressEvent() to allow keyboard
 * commands from the user.
 */
void BookmarkWidget::keyPressEvent(QKeyEvent * event)
{
    QList<QTreeWidgetItem*> list = bTreeWidget->selectedItems();
    if(list.isEmpty()) return;

    foreach(QTreeWidgetItem* twi, list) {
        if(!twi) continue;

        // DT: Pressing the enter/return key will expand/close the current folder
        // or display the current bookmark.
        if(event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {
            int type = twi->data(TITLE_COLUMN, Qt::UserRole).toInt();
            if(type == BOOKMARK) {
                handleDoubleClick(twi,0);
            } else if(type == FOLDER) {
                twi->setExpanded(!twi->isExpanded());
            }
        } else if(event->key() == Qt::Key_Delete) {
            deleteItem();
        }

    }
}
コード例 #4
0
	/** Constructor */
	FileBrowser::FileBrowser(QWidget* parent) : QTableView(parent)
	{
		Settings settings;
		libRoot = settings.value(LIB_ROOT_KEY, DEFAULT_LIB_ROOT).toString();

		fsModel = new QFileSystemModel(this);
		fsModel->setFilter(QDir::AllEntries | QDir::AllDirs | QDir::NoDot); // Want ..

		setSelectionMode(QTableView::SingleSelection);
		setSelectionBehavior(QTableView::SelectRows);
		setShowGrid(false);
		setSortingEnabled(true);

		setModel(fsModel);
		horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
		horizontalHeader()->setSectionResizeMode(3, QHeaderView::ResizeToContents);
		verticalHeader()->setVisible(false);
		setRootIndex(fsModel->setRootPath(libRoot));

		connect(this, SIGNAL(activated(QModelIndex)),
			this, SLOT(handleDoubleClick(QModelIndex)));
		connect(selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
			this, SLOT(handleSelection(QModelIndex,QModelIndex)));
	}
コード例 #5
0
// Initialize the dialog widgets and connect the signals/slots
void SatellitesDialog::createDialogContent()
{
	ui->setupUi(dialog);
	ui->tabs->setCurrentIndex(0);
	connect(&StelApp::getInstance(), SIGNAL(languageChanged()),
					this, SLOT(retranslate()));

	// Settings tab / updates group
	connect(ui->internetUpdatesCheckbox, SIGNAL(stateChanged(int)), this, SLOT(setUpdatesEnabled(int)));
	connect(ui->updateButton, SIGNAL(clicked()), this, SLOT(updateTLEs()));
	connect(GETSTELMODULE(Satellites), SIGNAL(updateStateChanged(Satellites::UpdateState)), this, SLOT(updateStateReceiver(Satellites::UpdateState)));
	connect(GETSTELMODULE(Satellites), SIGNAL(tleUpdateComplete(int, int, int)), this, SLOT(updateCompleteReceiver(int, int, int)));
	connect(ui->updateFrequencySpinBox, SIGNAL(valueChanged(int)), this, SLOT(setUpdateValues(int)));
	refreshUpdateValues(); // fetch values for last updated and so on
	// if the state didn't change, setUpdatesEnabled will not be called, so we force it
	setUpdatesEnabled(ui->internetUpdatesCheckbox->checkState());

	updateTimer = new QTimer(this);
	connect(updateTimer, SIGNAL(timeout()), this, SLOT(refreshUpdateValues()));
	updateTimer->start(7000);

	connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));

	// Settings tab / General settings group
	connect(ui->labelsGroup, SIGNAL(toggled(bool)), dynamic_cast<StelGui*>(StelApp::getInstance().getGui())->getGuiAction("actionShow_Satellite_Labels"), SLOT(setChecked(bool)));
	connect(ui->fontSizeSpinBox, SIGNAL(valueChanged(int)), GETSTELMODULE(Satellites), SLOT(setLabelFontSize(int)));
	connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(restoreDefaults()));
	connect(ui->saveSettingsButton, SIGNAL(clicked()), this, SLOT(saveSettings()));

	// Settings tab / orbit lines group
	ui->orbitLinesGroup->setChecked(GETSTELMODULE(Satellites)->getOrbitLinesFlag());
	ui->orbitSegmentsSpin->setValue(Satellite::orbitLineSegments);
	ui->orbitFadeSpin->setValue(Satellite::orbitLineFadeSegments);
	ui->orbitDurationSpin->setValue(Satellite::orbitLineSegmentDuration);

	connect(ui->orbitLinesGroup, SIGNAL(toggled(bool)), GETSTELMODULE(Satellites), SLOT(setOrbitLinesFlag(bool)));
	connect(ui->orbitSegmentsSpin, SIGNAL(valueChanged(int)), this, SLOT(setOrbitParams()));
	connect(ui->orbitFadeSpin, SIGNAL(valueChanged(int)), this, SLOT(setOrbitParams()));
	connect(ui->orbitDurationSpin, SIGNAL(valueChanged(int)), this, SLOT(setOrbitParams()));


	// Satellites tab
	filterProxyModel = new QSortFilterProxyModel(this);
	filterProxyModel->setSourceModel(satellitesModel);
	filterProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
	ui->satellitesList->setModel(filterProxyModel);
	connect(ui->lineEditSearch, SIGNAL(textEdited(QString)),
	        filterProxyModel, SLOT(setFilterWildcard(QString)));
	
	QItemSelectionModel* selectionModel = ui->satellitesList->selectionModel();
	connect(selectionModel, SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
	        this, SLOT(updateSelectedInfo(QModelIndex,QModelIndex)));
	connect(ui->satellitesList, SIGNAL(doubleClicked(QModelIndex)),
	        this, SLOT(handleDoubleClick(QModelIndex)));
	connect(ui->groupsCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(listSatelliteGroup(int)));
	connect(ui->saveSatellitesButton, SIGNAL(clicked()), this, SLOT(saveSatellites()));
	connect(ui->removeSatellitesButton, SIGNAL(clicked()), this, SLOT(removeSatellites()));
	connectSatelliteGuiForm();
	
	importWindow = new SatellitesImportDialog();
	connect(ui->addSatellitesButton, SIGNAL(clicked()),
					importWindow, SLOT(setVisible()));
	connect(importWindow, SIGNAL(satellitesAccepted(TleDataList)),
					this, SLOT(addSatellites(TleDataList)));

	// Sources tab
	connect(ui->sourceList, SIGNAL(currentTextChanged(const QString&)), ui->sourceEdit, SLOT(setText(const QString&)));
	connect(ui->sourceEdit, SIGNAL(editingFinished()), this, SLOT(sourceEditingDone()));
	connect(ui->deleteSourceButton, SIGNAL(clicked()), this, SLOT(deleteSourceRow()));
	connect(ui->addSourceButton, SIGNAL(clicked()), this, SLOT(addSourceRow()));

	// About tab
	setAboutHtml();

	updateGuiFromSettings();

}