connect(boneWeights, SIGNAL(enabled(bool)), this, SLOT(toggleBoneWeights(bool)), Qt::UniqueConnection);
        connect(boneWeightsUI, SIGNAL(returnToParent()), this, SLOT(returnToWidget()), Qt::UniqueConnection);
        connect(table, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(viewSelected(int,int)), Qt::UniqueConnection);
    }else{
        disconnect(name, SIGNAL(textEdited(QString)), this, SLOT(setName(QString)));
        disconnect(enable, SIGNAL(released()), this, SLOT(setEnable()));
        disconnect(maxForce, SIGNAL(editingFinished()), this, SLOT(setMaxForce()));
        disconnect(tau, SIGNAL(editingFinished()), this, SLOT(setTau()));
        disconnect(damping, SIGNAL(editingFinished()), this, SLOT(setDamping()));
        disconnect(proportionalRecoveryVelocity, SIGNAL(released()), this, SLOT(setProportionalRecoveryVelocity()));
        disconnect(constantRecoveryVelocity, SIGNAL(released()), this, SLOT(setConstantRecoveryVelocity()));
        disconnect(poseMatchingBone0, SIGNAL(editingFinished()), this, SLOT(setPoseMatchingBone0()));
        disconnect(poseMatchingBone1, SIGNAL(editingFinished()), this, SLOT(setPoseMatchingBone1()));
        disconnect(poseMatchingBone2, SIGNAL(editingFinished()), this, SLOT(setPoseMatchingBone2()));
        disconnect(mode, SIGNAL(currentIndexChanged(int)), this, SLOT(setMode(int)));
        disconnect(bones, SIGNAL(pressed()), this, SLOT(viewBones()));
        disconnect(bones, SIGNAL(enabled(bool)), this, SLOT(toggleBones(bool)));
        disconnect(boneIndexUI, SIGNAL(returnToParent()), this, SLOT(returnToWidget()));
        disconnect(boneWeights, SIGNAL(pressed()), this, SLOT(viewBoneWeights()));
        disconnect(boneWeights, SIGNAL(enabled(bool)), this, SLOT(toggleBoneWeights(bool)));
        disconnect(boneWeightsUI, SIGNAL(returnToParent()), this, SLOT(returnToWidget()));
        disconnect(table, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(viewSelected(int,int)));
    }
}

void PoweredRagdollControlsModifierUI::connectToTables(GenericTableWidget *variables, GenericTableWidget *properties, GenericTableWidget *ragdollBones){
    if (variables && properties && ragdollBones){
        disconnect(variables, SIGNAL(elementSelected(int,QString)), 0, 0);
        disconnect(properties, SIGNAL(elementSelected(int,QString)), 0, 0);
        disconnect(ragdollBones, SIGNAL(elementSelected(int,QString)), 0, 0);
        connect(variables, SIGNAL(elementSelected(int,QString)), this, SLOT(setBindingVariable(int,QString)), Qt::UniqueConnection);
Пример #2
0
InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, TrackContainerView* tcv ) :
	TrackView( _it, tcv ),
	m_window( NULL ),
	m_lastPos( -1, -1 )
{
	setAcceptDrops( true );
	setFixedHeight( 32 );

	m_tlb = new TrackLabelButton( this, getTrackSettingsWidget() );
	m_tlb->setCheckable( true );
	m_tlb->setIcon( embed::getIconPixmap( "instrument_track" ) );
	m_tlb->move( 3, 1 );
	m_tlb->show();

	connect( m_tlb, SIGNAL( toggled( bool ) ),
			this, SLOT( toggleInstrumentWindow( bool ) ) );

	connect( _it, SIGNAL( nameChanged() ),
			m_tlb, SLOT( update() ) );

	// creation of widgets for track-settings-widget
	int widgetWidth;
	if( ConfigManager::inst()->value( "ui",
					  "compacttrackbuttons" ).toInt() )
	{
		widgetWidth = DEFAULT_SETTINGS_WIDGET_WIDTH_COMPACT;
	}
	else
	{
		widgetWidth = DEFAULT_SETTINGS_WIDGET_WIDTH;
	}

	m_volumeKnob = new Knob( knobSmall_17, getTrackSettingsWidget(),
							tr( "Volume" ) );
	m_volumeKnob->setVolumeKnob( true );
	m_volumeKnob->setModel( &_it->m_volumeModel );
	m_volumeKnob->setHintText( tr( "Volume:" ), "%" );
	m_volumeKnob->move( widgetWidth-2*24, 2 );
	m_volumeKnob->setLabel( tr( "VOL" ) );
	m_volumeKnob->show();
	m_volumeKnob->setWhatsThis( tr( volume_help ) );

	m_panningKnob = new Knob( knobSmall_17, getTrackSettingsWidget(),
							tr( "Panning" ) );
	m_panningKnob->setModel( &_it->m_panningModel );
    m_panningKnob->setHintText( tr( "Panning:" ), "%" );
	m_panningKnob->move( widgetWidth-24, 2 );
	m_panningKnob->setLabel( tr( "PAN" ) );
	m_panningKnob->show();

	m_midiMenu = new QMenu( tr( "MIDI" ), this );

	// sequenced MIDI?
	if( !Engine::mixer()->midiClient()->isRaw() )
	{
		_it->m_midiPort.m_readablePortsMenu = new MidiPortMenu(
							MidiPort::Input );
		_it->m_midiPort.m_writablePortsMenu = new MidiPortMenu(
							MidiPort::Output );
		_it->m_midiPort.m_readablePortsMenu->setModel(
							&_it->m_midiPort );
		_it->m_midiPort.m_writablePortsMenu->setModel(
							&_it->m_midiPort );
		m_midiInputAction = m_midiMenu->addMenu(
					_it->m_midiPort.m_readablePortsMenu );
		m_midiOutputAction = m_midiMenu->addMenu(
					_it->m_midiPort.m_writablePortsMenu );
	}
	else
	{
		m_midiInputAction = m_midiMenu->addAction( "" );
		m_midiOutputAction = m_midiMenu->addAction( "" );
		m_midiInputAction->setCheckable( true );
		m_midiOutputAction->setCheckable( true );
		connect( m_midiInputAction, SIGNAL( changed() ), this,
						SLOT( midiInSelected() ) );
		connect( m_midiOutputAction, SIGNAL( changed() ), this,
					SLOT( midiOutSelected() ) );
		connect( &_it->m_midiPort, SIGNAL( modeChanged() ),
				this, SLOT( midiConfigChanged() ) );
	}

	m_midiInputAction->setText( tr( "Input" ) );
	m_midiOutputAction->setText( tr( "Output" ) );

	m_activityIndicator = new FadeButton( QApplication::palette().color( QPalette::Active,
							QPalette::Background),
						QApplication::palette().color( QPalette::Active,
							QPalette::BrightText ),
						getTrackSettingsWidget() );
	m_activityIndicator->setGeometry(
					 widgetWidth-2*24-11, 2, 8, 28 );
	m_activityIndicator->show();
	connect( m_activityIndicator, SIGNAL( pressed() ),
				this, SLOT( activityIndicatorPressed() ) );
	connect( m_activityIndicator, SIGNAL( released() ),
				this, SLOT( activityIndicatorReleased() ) );
	connect( _it, SIGNAL( newNote() ),
			 m_activityIndicator, SLOT( activate() ) );
	connect( &_it->m_mutedModel, SIGNAL( dataChanged() ), this, SLOT( muteChanged() ) );

	setModel( _it );
}
Пример #3
0
CConnector::CConnector(QWidget *pMainWindow)
	: QDialogEx(pMainWindow)
{
	m_pMainLayout = new QFormLayout();
	m_pMainLayout->setMargin(5);

	m_Mode = -1;

	int Counter = 0;
	m_pMainLayout->setWidget(Counter, QFormLayout::SpanningRole, new QLabel(tr(	"Setup NeoLoader Mode of operation\r\n"
																				"\r\n"
																				"Unified - Single Process\r\n"
																				"Separate - GUI in a separate process\r\n"
																				"Local - Core in a separate console process\r\n"
																				"Remote - No Core, only remote GUI \r\n"
																				"\r\n"
																				)));

	Counter++;
	m_pLabel = new QLabel(tr("<b>Restart NeoLoader to apply changes.</b><br />"));
	m_pLabel->setVisible(false);
	m_pMainLayout->setWidget(Counter, QFormLayout::SpanningRole, m_pLabel);

	Counter++;
	m_pMainLayout->setWidget(Counter, QFormLayout::LabelRole, new QLabel(tr("Operation Mode")));
	m_pMode = new QComboBox();
	m_pMode->addItem(tr("Single Process"), "Unified");
	m_pMode->addItem(tr("Separated Process"), "Separate");
	m_pMode->addItem(tr("Local Core"), "Local");
	m_pMode->addItem(tr("Remote Core"), "Remote");
	connect(m_pMode, SIGNAL(currentIndexChanged(int)), this, SLOT(OnModeChanged(int)));
	m_pMainLayout->setWidget(Counter, QFormLayout::FieldRole, m_pMode);

	Counter++;
	m_pMainLayout->setWidget(Counter, QFormLayout::LabelRole, new QLabel(tr("Password")));
	m_pPassword = new QLineEdit();
	m_pMainLayout->setWidget(Counter, QFormLayout::FieldRole, m_pPassword);

	Counter++;
	m_pMainLayout->setWidget(Counter, QFormLayout::LabelRole, new QLabel(tr("Host Port")));
	m_pHostPort = new QLineEdit();
	m_pMainLayout->setWidget(Counter, QFormLayout::FieldRole, m_pHostPort);

	Counter++;
	m_pMainLayout->setWidget(Counter, QFormLayout::LabelRole, new QLabel(tr("Host Name")));
	m_pHostName = new QLineEdit();
	m_pMainLayout->setWidget(Counter, QFormLayout::FieldRole, m_pHostName);

	Counter++;
	m_pMainLayout->setWidget(Counter, QFormLayout::LabelRole, new QLabel(tr("Pipe Name")));
	m_pPipeName = new QLineEdit();
	m_pMainLayout->setWidget(Counter, QFormLayout::FieldRole, m_pPipeName);

	Counter++;
	m_pMainLayout->setWidget(Counter, QFormLayout::LabelRole, new QLabel(tr("Auto Connect")));
	m_pAutoConnect = new QComboBox();
	m_pAutoConnect->addItem(tr("No"));
	m_pAutoConnect->addItem(tr("Yes"));
	m_pAutoConnect->addItem(tr("Yes &  Start"));
	m_pMainLayout->setWidget(Counter, QFormLayout::FieldRole, m_pAutoConnect);

	/*QtServiceController svc(theLoader->Cfg()->GetString("Core/ServiceName"));

	Counter++;
	m_pServiceBtn = new QPushButton(svc.isInstalled() ? tr("Remove Service") : tr("Install Service"));
	connect(m_pServiceBtn, SIGNAL(pressed()), this, SLOT(OnService()));
	m_pMainLayout->setWidget(Counter, QFormLayout::LabelRole, m_pServiceBtn);
	m_pServiceName = new QLineEdit();
	m_pMainLayout->setWidget(Counter, QFormLayout::FieldRole, m_pServiceName);*/


	Counter++;
	//m_pStartBtn = new QPushButton(tr("Start"));
	//connect(m_pStartBtn, SIGNAL(pressed()), this, SLOT(OnStart()));
	//m_pMainLayout->setWidget(Counter, QFormLayout::LabelRole, m_pStartBtn);
	m_pConnectBtn = new QPushButton(tr("Connect"));
	connect(m_pConnectBtn, SIGNAL(pressed()), this, SLOT(OnConnect()));
	m_pMainLayout->setWidget(Counter, QFormLayout::FieldRole, m_pConnectBtn);

	Counter++;
	m_pButtonBox = new QDialogButtonBox(QDialogButtonBox::Apply | QDialogButtonBox::Cancel, Qt::Horizontal, this);
	QObject::connect(m_pButtonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(OnClicked(QAbstractButton*)));
	m_pMainLayout->setWidget(Counter, QFormLayout::SpanningRole, m_pButtonBox);

	setLayout(m_pMainLayout);

	Load();

	m_uTimerID = startTimer(100);
}
Пример #4
0
CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
  ModelPanel(parent, model, generalSettings, firmware),
  initialized(false)
#if defined(PHONON)
  ,
  phononCurrent(-1),
  clickObject(NULL),
  clickOutput(NULL)
#endif
{
  QGridLayout * gridLayout = new QGridLayout(this);

  addLabel(gridLayout, tr("Switch"), 1);
  addLabel(gridLayout, tr("Action"), 2);
  addLabel(gridLayout, tr("Parameters"), 3);
  addLabel(gridLayout, tr("Enable"), 4, true );
  addEmptyLabel(gridLayout, 5 );

  lock = true;
  int num_fsw = firmware->getCapability(CustomFunctions);

  if (!firmware->getCapability(VoicesAsNumbers)) {
    tracksSet = getFilesSet(getSoundsPath(generalSettings), QStringList() << "*.wav" << "*.WAV", firmware->getCapability(VoicesMaxLength));
    for (int i=0; i<num_fsw; i++) {
      if (model.funcSw[i].func==FuncPlayPrompt || model.funcSw[i].func==FuncBackgroundMusic) {
        QString temp = model.funcSw[i].paramarm;
        if (!temp.isEmpty()) {
          tracksSet.insert(temp);
        }
      }
    }
    qDebug() << tracksSet;
  }

  if (IS_TARANIS(firmware->getBoard())) {
    scriptsSet = getFilesSet(g.profile[g.id()].sdPath() + "/SCRIPTS", QStringList() << "*.lua", firmware->getCapability(VoicesMaxLength));
    for (int i=0; i<num_fsw; i++) {
      if (model.funcSw[i].func==FuncPlayScript) {
        QString temp = model.funcSw[i].paramarm;
        if (!temp.isEmpty()) {
          scriptsSet.insert(temp);
        }
      }
    }
    qDebug() << scriptsSet;
  }

  CompanionIcon playIcon("play.png");

  for (int i=0; i<num_fsw; i++) {
    // The label
    QLabel * label = new QLabel(this);
    label->setContextMenuPolicy(Qt::CustomContextMenu);
    label->setMouseTracking(true);
    label->setProperty("index", i);
    label->setText(tr("SF%1").arg(i+1));
    label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
    connect(label, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(fsw_customContextMenuRequested(QPoint)));
    gridLayout->addWidget(label, i+1, 0);

    // The switch
    fswtchSwtch[i] = new QComboBox(this);
    fswtchSwtch[i]->setProperty("index", i);
    fswtchSwtch[i]->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum);
    connect(fswtchSwtch[i], SIGNAL(currentIndexChanged(int)), this, SLOT(customFunctionEdited()));
    gridLayout->addWidget(fswtchSwtch[i], i+1, 1);

    // The function
    fswtchFunc[i] = new QComboBox(this);
    fswtchFunc[i]->setProperty("index", i);
    connect(fswtchFunc[i], SIGNAL(currentIndexChanged(int)), this, SLOT(functionEdited()));
    gridLayout->addWidget(fswtchFunc[i], i+1, 2);

    QHBoxLayout *paramLayout = new QHBoxLayout();
    gridLayout->addLayout(paramLayout, i+1, 3);

    fswtchGVmode[i] = new QComboBox(this);
    fswtchGVmode[i]->setProperty("index", i);
    connect(fswtchGVmode[i], SIGNAL(currentIndexChanged(int)), this, SLOT(customFunctionEdited()));
    paramLayout->addWidget(fswtchGVmode[i]);

    fswtchParamGV[i] = new QCheckBox(this);
    fswtchParamGV[i]->setProperty("index", i);
    fswtchParamGV[i]->setText("GV");
    fswtchParamGV[i]->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum);
    connect(fswtchParamGV[i], SIGNAL(stateChanged(int)), this, SLOT(customFunctionEdited()));
    paramLayout->addWidget(fswtchParamGV[i]);

    fswtchParam[i] = new QDoubleSpinBox(this);
    fswtchParam[i]->setProperty("index", i);
    fswtchParam[i]->setAccelerated(true);
    fswtchParam[i]->setDecimals(0);
    connect(fswtchParam[i], SIGNAL(editingFinished()), this, SLOT(customFunctionEdited()));
    paramLayout->addWidget(fswtchParam[i]);

    fswtchParamTime[i] = new QTimeEdit(this);
    fswtchParamTime[i]->setProperty("index", i);
    fswtchParamTime[i]->setAccelerated(true);
    fswtchParamTime[i]->setDisplayFormat("hh:mm:ss");
    connect(fswtchParamTime[i], SIGNAL(editingFinished()), this, SLOT(customFunctionEdited()));
    paramLayout->addWidget(fswtchParamTime[i]);

    fswtchParamT[i] = new QComboBox(this);
    fswtchParamT[i]->setProperty("index", i);
    paramLayout->addWidget(fswtchParamT[i]);
    connect(fswtchParamT[i], SIGNAL(currentIndexChanged(int)), this, SLOT(customFunctionEdited()));

    fswtchParamArmT[i] = new QComboBox(this);
    fswtchParamArmT[i]->setProperty("index", i);
    fswtchParamArmT[i]->setEditable(true);
    paramLayout->addWidget(fswtchParamArmT[i]);

    connect(fswtchParamArmT[i], SIGNAL(currentIndexChanged(int)), this, SLOT(customFunctionEdited()));
    connect(fswtchParamArmT[i], SIGNAL(editTextChanged ( const QString)), this, SLOT(customFunctionEdited()));

    fswtchBLcolor[i] = new QSlider(this);
    fswtchBLcolor[i]->setProperty("index", i);
    fswtchBLcolor[i]->setMinimum(0);
    fswtchBLcolor[i]->setMaximum(100);
    fswtchBLcolor[i]->setSingleStep(1);
    fswtchBLcolor[i]->setOrientation(Qt::Horizontal);
    paramLayout->addWidget(fswtchBLcolor[i]);
    connect(fswtchBLcolor[i], SIGNAL(sliderReleased()), this, SLOT(customFunctionEdited()));

#ifdef PHONON
    playBT[i] = new QPushButton(this);
    playBT[i]->setProperty("index", i);
    playBT[i]->setIcon(playIcon);
    paramLayout->addWidget(playBT[i]);
    connect(playBT[i], SIGNAL(pressed()), this, SLOT(playMusic()));
#endif

    QHBoxLayout *repeatLayout = new QHBoxLayout();
    gridLayout->addLayout(repeatLayout, i+1, 4);
    fswtchRepeat[i] = new RepeatComboBox(this, model.funcSw[i].repeatParam);
    repeatLayout->addWidget(fswtchRepeat[i], i+1);
    connect(fswtchRepeat[i], SIGNAL(modified()), this, SLOT(onChildModified()));

    fswtchEnable[i] = new QCheckBox(this);
    fswtchEnable[i]->setProperty("index", i);
    fswtchEnable[i]->setText(tr("ON"));
    fswtchEnable[i]->setFixedWidth( 80 );
    repeatLayout->addWidget(fswtchEnable[i], i+1);
    connect(fswtchEnable[i], SIGNAL(stateChanged(int)), this, SLOT(customFunctionEdited()));
  }

  // Push rows upward
  addDoubleSpring(gridLayout, 5, num_fsw+1);

  disableMouseScrolling();

  lock = false;
}
Пример #5
0
EditorMainWindow::EditorMainWindow(QWidget *parent)
	: QMainWindow(parent)
{
	camera_ = 0;

	ui.setupUi(this);
	QApplication::connect(ui.action_Open, SIGNAL(triggered()), this, SLOT(openRequested()));
	QApplication::connect(ui.action_Save, SIGNAL(triggered()), this, SLOT(saveRequested()));
	QApplication::connect(ui.actionDerive_map, SIGNAL(triggered()), this, SLOT(deriveMap()));
	QApplication::connect(ui.action_Quit, SIGNAL(triggered()), QApplication::instance(), SLOT(quit()));
	QApplication::connect(ui.actionZoom_In, SIGNAL(triggered()), this, SLOT(zoominRequested()));
	QApplication::connect(ui.actionZoom_Out, SIGNAL(triggered()), this, SLOT(zoomoutRequested()));
	QApplication::connect(ui.horizontalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(horzScroll(int)));
	QApplication::connect(ui.verticalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(vertScroll(int)));
	QApplication::connect(ui.actionRotate_Left, SIGNAL(triggered()), this, SLOT(rotateLeft()));
	QApplication::connect(ui.actionRotate_Right, SIGNAL(triggered()), this, SLOT(rotateRight()));
	QApplication::connect(ui.actionTilt_Up, SIGNAL(triggered()), this, SLOT(tiltUp()));
	QApplication::connect(ui.actionTilt_Down, SIGNAL(triggered()), this, SLOT(tiltDown()));
	QApplication::connect(ui.actionUndo, SIGNAL(triggered()), this, SLOT(undo()));
	QApplication::connect(ui.actionRedo, SIGNAL(triggered()), this, SLOT(redo()));

	QApplication::connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_S),this), SIGNAL(activated()), this, SLOT(saveRequested()));
	QApplication::connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_O),this), SIGNAL(activated()), this, SLOT(openRequested()));
	QApplication::connect(new QShortcut(QKeySequence(Qt::Key_Z),this), SIGNAL(activated()), this, SLOT(zoominRequested()));
	QApplication::connect(new QShortcut(QKeySequence(Qt::Key_X),this), SIGNAL(activated()), this, SLOT(zoomoutRequested()));
	QApplication::connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Left),this), SIGNAL(activated()), this, SLOT(rotateLeft()));
	QApplication::connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Right),this), SIGNAL(activated()), this, SLOT(rotateRight()));
	QApplication::connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Up),this), SIGNAL(activated()), this, SLOT(tiltUp()));
	QApplication::connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Down),this), SIGNAL(activated()), this, SLOT(tiltDown()));
	QApplication::connect(new QShortcut(QKeySequence(Qt::Key_Left),this), SIGNAL(activated()), this, SLOT(panLeft()));
	QApplication::connect(new QShortcut(QKeySequence(Qt::Key_Right),this), SIGNAL(activated()), this, SLOT(panRight()));
	QApplication::connect(new QShortcut(QKeySequence(Qt::Key_Up),this), SIGNAL(activated()), this, SLOT(panUp()));
	QApplication::connect(new QShortcut(QKeySequence(Qt::Key_Down),this), SIGNAL(activated()), this, SLOT(panDown()));

	ui.action_Save->setEnabled(false);
	ui.editorGLWidget->setEnabled(false);

	QToolButton* party_button = new QToolButton();
	party_button->setText("Parties");
	party_button->setCheckable(true);
	party_button->setChecked(false);
	handlers_.push_back(new TerrainHandler(*this, "party", false, tool_buttons_.size()));
	QApplication::connect(party_button, SIGNAL(pressed()), handlers_.back(), SLOT(terrainSelected()));
	QApplication::connect(new QShortcut(QKeySequence(Qt::Key_P),this), SIGNAL(activated()), handlers_.back(), SLOT(terrainSelected()));
	ui.tilesToolBar->addWidget(party_button);
	tool_buttons_.push_back(party_button);

	QToolButton* height_button = new QToolButton();
	height_button->setText("Height");
	height_button->setCheckable(true);
	height_button->setChecked(true);
	handlers_.push_back(new TerrainHandler(*this, "", false, tool_buttons_.size()));
	QApplication::connect(height_button, SIGNAL(pressed()), handlers_.back(), SLOT(terrainSelected()));
	QApplication::connect(new QShortcut(QKeySequence(Qt::Key_H),this), SIGNAL(activated()), handlers_.back(), SLOT(terrainSelected()));
	ui.tilesToolBar->addWidget(height_button);
	tool_buttons_.push_back(height_button);

	QToolButton* picker_button = new QToolButton();
	picker_button->setText("Picker");
	picker_button->setCheckable(true);
	handlers_.push_back(new TerrainHandler(*this, "", true, tool_buttons_.size()));
	QApplication::connect(picker_button, SIGNAL(pressed()), handlers_.back(), SLOT(terrainSelected()));
	ui.tilesToolBar->addWidget(picker_button);
	tool_buttons_.push_back(picker_button);

	std::vector<std::string> terrain_ids;
	hex::base_terrain::get_terrain_ids(terrain_ids);
	for(int n = 0; n != terrain_ids.size(); ++n) {
		QToolButton* b = new QToolButton();
		b->setText(hex::base_terrain::get(terrain_ids[n])->name().c_str());
		b->setCheckable(true);
		handlers_.push_back(new TerrainHandler(*this, terrain_ids[n], false, tool_buttons_.size()));
		QApplication::connect(b, SIGNAL(pressed()), handlers_.back(), SLOT(terrainSelected()));
		ui.tilesToolBar->addWidget(b);
		tool_buttons_.push_back(b);
	}

	terrain_ids.clear();
	hex::terrain_feature::get_feature_ids(terrain_ids);
	for(int n = 0; n != terrain_ids.size(); ++n) {
		QToolButton* b = new QToolButton();
		b->setText(hex::terrain_feature::get(terrain_ids[n])->name().c_str());
		b->setCheckable(true);
		handlers_.push_back(new TerrainHandler(*this, terrain_ids[n], true, tool_buttons_.size()));
		QApplication::connect(b, SIGNAL(pressed()), handlers_.back(), SLOT(terrainSelected()));
		ui.tilesToolBar->addWidget(b);
		tool_buttons_.push_back(b);
	}
}
Пример #6
0
void TaskBarContainer::reconnectWindowListButton()
{
    connect( windowListButton, SIGNAL( pressed() ), SLOT( showWindowListMenu() ) );
}
Пример #7
0
  m_pStyle(0)
{
	parentButton = new QToolButton(this);
	parentButton->setMaximumSize( QSize( 22, 22 ) );
	parentButton->setCheckable( true );
	parentButton->setText( tr("P", "P as in Parent"));
	parentButton->setToolTip( tr("Use parent style's alignment instead of overriding it"));
	GroupAlignLayout->addWidget( parentButton );
	resize(minimumSizeHint());
	parentButton->hide();
}

void SMAlignSelect::setStyle(int i)
{
	disconnect(this, SIGNAL(State(int)), this, SLOT(styleChanged()));
	disconnect(parentButton, SIGNAL(pressed()), this, SLOT(pbPressed()));
	setFont(false);
	m_hasParent = false;
	m_pStyle = 0;
	parentButton->hide();
	AlignSelect::setStyle(i);
}

void SMAlignSelect::setStyle(int i, bool isParentValue)
{
	disconnect(this, SIGNAL(State(int)), this, SLOT(styleChanged()));
	disconnect(parentButton, SIGNAL(pressed()), this, SLOT(pbPressed()));
	m_hasParent = true;
	m_pStyle = i;
	setFont(!isParentValue);
	if (isParentValue)
Пример #8
0
void ResetWidgetPushButton::myPressed()
{
    emit pressed(m_name);
}
Пример #9
0
Motion::Motion(GraphicsView* view, QWidget* parent)
	: m_pOSGView(view), QWidget(parent)
{
	ui.setupUi(this);

	addSphere();

	connect(ui.radioButton, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_2, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_3, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_4, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_5, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_6, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_7, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_8, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_9, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_10, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_11, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_12, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_13, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_14, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_15, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_16, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_17, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_18, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_19, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_20, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_21, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_22, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_23, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_24, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_25, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_26, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
	connect(ui.radioButton_27, SIGNAL(pressed()), this, SLOT(slotRadioChanged()));
}
Пример #10
0
Calendar::Calendar()
{
    eventListCounter = 0;
    loadEvents();

    actualDate = new QDate;
    *actualDate = QDate::currentDate();                      //get's information about current date and sets proper label
    int actualDay, actualMonth, actualYear;
    actualDate->getDate(&actualDay, &actualMonth, &actualYear);

    // essential variables initialization

    actualDate->getDate(&year,&month,&day);
    QDate dayOfWeek(year,month,1);      //gets information about first day of selected month and year
    whatDay = dayOfWeek.dayOfWeek();

    // end of essential variables initialization

    actualWeek = actualDate->weekNumber();

    // future note: array are better than days[0], days[1], days[2]... :P

    days = new Day*[7];

    days[0] = new Day("Monday");
    days[1] = new Day("Tuesday");
    days[2] = new Day("Wednesday");
    days[3] = new Day("Thursday");
    days[4] = new Day("Friday");
    days[5] = new Day("Saturday");
    days[6] = new Day("Sunday");


    daysLayout = new QHBoxLayout;

    navigationLayout = new QHBoxLayout;            // horizontal layout for navigation elements

    // creating elements for navigation box
    navigationLeft = new QPushButton("<<");
    navigationRight = new QPushButton(">>");
    dateLabel = new QLabel();                       // QLabel initialization

    navigationLayout->addWidget(navigationLeft);
    navigationLayout->addWidget(dateLabel);
    navigationLayout->addWidget(navigationRight);

    mainLayout = new QVBoxLayout;                  // vertical layout for navigation and days boxes
    mainLayout->addLayout(navigationLayout);
    mainLayout->addLayout(daysLayout);
    this->setLayout(mainLayout);

    QString initialDateLabel = dateToString(actualYear, actualMonth, actualDay);
    dateLabel->setText("<center>" + initialDateLabel + "</center>");
    sortButtons();
    connect(navigationLeft,SIGNAL(pressed()),this,SLOT(navigationLeftClicked()));   //connects navigation buttons with action (changing day's range or month)
    connect(navigationRight,SIGNAL(pressed()),this,SLOT(navigationRightClicked()));


/* Signal mapper is used to send parameter to slot method. The parameter here is
 * integer which reprenets offset of certain days of week. */

    QSignalMapper* signalMapper = new QSignalMapper(this);              // signal mapping is needed to parametrize slot :(

    connect(days[0], SIGNAL(pressed()), signalMapper, SLOT(map()));
    connect(days[1], SIGNAL(pressed()), signalMapper, SLOT(map()));
    connect(days[2], SIGNAL(pressed()), signalMapper, SLOT(map()));
    connect(days[3], SIGNAL(pressed()), signalMapper, SLOT(map()));
    connect(days[4], SIGNAL(pressed()), signalMapper, SLOT(map()));
    connect(days[5], SIGNAL(pressed()), signalMapper, SLOT(map()));
    connect(days[6], SIGNAL(pressed()), signalMapper, SLOT(map()));

    signalMapper->setMapping(days[0], 0);
    signalMapper->setMapping(days[1], 1);
    signalMapper->setMapping(days[2], 2);
    signalMapper->setMapping(days[3], 3);
    signalMapper->setMapping(days[4], 4);
    signalMapper->setMapping(days[5], 5);
    signalMapper->setMapping(days[6], 6);

    connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(scheduleDay(int)));

    colorTask();
}
Пример #11
0
ResetWidgetPushButton::ResetWidgetPushButton(QWidget *parent) : QPushButton(parent)
{
    connect(this, SIGNAL(pressed()), this, SLOT(myPressed()));
}
Пример #12
0
QgsMapStylingWidget::QgsMapStylingWidget( QgsMapCanvas* canvas, QWidget *parent )
    : QWidget( parent )
    , mMapCanvas( canvas )
    , mBlockAutoApply( false )
    , mCurrentLayer( nullptr )
    , mVectorStyleWidget( nullptr )
{
  QBoxLayout* layout = new QVBoxLayout();
  layout->setContentsMargins( 0, 0, 0, 0 );
  this->setLayout( layout );

  mAutoApplyTimer = new QTimer( this );
  mAutoApplyTimer->setSingleShot( true );
  connect( mAutoApplyTimer, SIGNAL( timeout() ), this, SLOT( apply() ) );

  mStackedWidget = new QStackedWidget( this );
  mMapStyleTabs = new QTabWidget( this );
  mMapStyleTabs->setDocumentMode( true );
  mNotSupportedPage = mStackedWidget->addWidget( new QLabel( "Not supported currently" ) );
  mVectorPage = mStackedWidget->addWidget( mMapStyleTabs );

  // create undo widget
  mUndoWidget = new QgsUndoWidget( this->mMapStyleTabs, mMapCanvas );
  mUndoWidget->setObjectName( "Undo Styles" );

  mLayerTitleLabel = new QLabel();
  mLayerTitleLabel->setAlignment( Qt::AlignHCenter );
  layout->addWidget( mLayerTitleLabel );
  layout->addWidget( mStackedWidget );
  mButtonBox = new QDialogButtonBox( QDialogButtonBox::Apply );
  mLiveApplyCheck = new QCheckBox( "Live update" );
  mLiveApplyCheck->setChecked( true );

  mUndoButton = new QToolButton( this );
  mUndoButton->setIcon( QgsApplication::getThemeIcon( "mActionUndo.png" ) );
  mRedoButton = new QToolButton( this );
  mRedoButton->setIcon( QgsApplication::getThemeIcon( "mActionRedo.png" ) );

  connect( mUndoButton, SIGNAL( pressed() ), mUndoWidget, SLOT( undo() ) );
  connect( mRedoButton, SIGNAL( pressed() ), mUndoWidget, SLOT( redo() ) );

  QHBoxLayout* bottomLayout = new QHBoxLayout( );
  bottomLayout->addWidget( mUndoButton );
  bottomLayout->addWidget( mRedoButton );
  bottomLayout->addWidget( mButtonBox );
  bottomLayout->addWidget( mLiveApplyCheck );
  layout->addLayout( bottomLayout );

  mLabelingWidget = new QgsLabelingWidget( 0, mMapCanvas, this );
  mLabelingWidget->setDockMode( true );
  connect( mLabelingWidget, SIGNAL( widgetChanged() ), this, SLOT( autoApply() ) );

  // Only labels for now but styles and diagrams will come later
  QScrollArea* stylescroll = new QScrollArea;
  stylescroll->setWidgetResizable( true );
  stylescroll->setFrameStyle( QFrame::NoFrame );
  QScrollArea* labelscroll = new QScrollArea;
  labelscroll->setWidgetResizable( true );
  labelscroll->setFrameStyle( QFrame::NoFrame );
  labelscroll->setWidget( mLabelingWidget );

  mStyleTabIndex = mMapStyleTabs->addTab( stylescroll, QgsApplication::getThemeIcon( "propertyicons/symbology.png" ), "Styles" );
  mLabelTabIndex = mMapStyleTabs->addTab( labelscroll, QgsApplication::getThemeIcon( "labelingSingle.svg" ), "Labeling" );
  mMapStyleTabs->addTab( mUndoWidget, QgsApplication::getThemeIcon( "labelingSingle.svg" ), "History" );
//  int diagramTabIndex = mMapStyleTabs->addTab( new QWidget(), QgsApplication::getThemeIcon( "propertyicons/diagram.png" ), "Diagrams" );
//  mMapStyleTabs->setTabEnabled( styleTabIndex, false );
//  mMapStyleTabs->setTabEnabled( diagramTabIndex, false );
  mMapStyleTabs->setCurrentIndex( mStyleTabIndex );

  connect( mMapStyleTabs, SIGNAL( currentChanged( int ) ), this, SLOT( updateCurrentWidgetLayer( int ) ) );

  connect( mLiveApplyCheck, SIGNAL( toggled( bool ) ), mButtonBox->button( QDialogButtonBox::Apply ), SLOT( setDisabled( bool ) ) );

  connect( mButtonBox->button( QDialogButtonBox::Apply ), SIGNAL( clicked() ), this, SLOT( apply() ) );

  mButtonBox->button( QDialogButtonBox::Apply )->setEnabled( false );

}
Пример #13
0
MainWidget::MainWidget(const QString &token, const QString &user_id, QWidget *parent)
    : QWidget(parent), m_token(token), m_user_id(user_id), m_playState(false)
{
    m_removeCurrent = false;
    m_player = new QMediaPlayer;
    m_player->setVolume(100);

    m_mediaWebPlaylist = new QMediaPlaylist(m_player);
    m_mediaWebPlaylist->setObjectName("web");
    m_player->setPlaylist(m_mediaWebPlaylist);

    loadUserPlaylist();
    this->resize(800, 600);
    this->setWindowTitle("VK Music Player");


    QDir dir("./cache/");
    if(!dir.exists())
        dir.mkpath(".");

    QGridLayout* mainLayout = new QGridLayout;

    m_currentLabel = new QLabel;
    m_currentLabel->setFont(QFont("Arial", 16));
    m_currentLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
    mainLayout->addWidget(m_currentLabel, 0, 0, 1, 9, Qt::AlignCenter);

    ImageButton *prevButton = new ImageButton("prevbutton.png");
    mainLayout->addWidget(prevButton, 2, 3, 1, 1, Qt::AlignTop | Qt::AlignRight);

    m_playPauseButton = new ImageButton("playbutton.png");
    mainLayout->addWidget(m_playPauseButton, 2, 4, 1, 1, Qt::AlignTop);

    ImageButton *nextButton = new ImageButton("nextbutton.png");
    mainLayout->addWidget(nextButton, 2, 5, 1, 1, Qt::AlignTop | Qt::AlignLeft);

    m_playlistWidget = new PlaylistWidget;
    mainLayout->addWidget(m_playlistWidget, 3, 0, 3, 9);

    m_seekslider = new QSlider;
    m_seekslider->setOrientation(Qt::Horizontal);
    mainLayout->addWidget(m_seekslider, 1, 0, 1, 7);

    m_volumeSlider = new QSlider;
    m_volumeSlider->setOrientation(Qt::Horizontal);
    m_volumeSlider->setMaximum(100);
    m_volumeSlider->setValue(100);
    m_volumeSlider->setSingleStep(1);
    mainLayout->addWidget(m_volumeSlider, 1, 7, 1, 2);

    m_timeLabel = new QLabel;
    m_timeLabel->setText("0:00");
    mainLayout->addWidget(m_timeLabel, 2, 0, 1, 2, Qt::AlignTop);

    m_volumeLabel = new QLabel;
    m_volumeLabel->setText(QString::number(m_player->volume())+"%");
    mainLayout->addWidget(m_volumeLabel, 2, 7, 1, 2, Qt::AlignTop | Qt::AlignHCenter);

    m_cacheCurrent = new QCheckBox(tr("&Save"));
    mainLayout->addWidget(m_cacheCurrent, 2, 7, 1, 2, Qt::AlignBottom | Qt::AlignRight);

    m_searchEdit = new QLineEdit;
    m_searchEdit->setPlaceholderText(tr("Search"));
    mainLayout->addWidget(m_searchEdit, 2, 0, 1, 8, Qt::AlignBottom);

    this->setLayout(mainLayout);

    connect(this, SIGNAL(playlistReady()),
            SLOT(fillPlaylistWidget_slot()));
    connect(this, SIGNAL(playStateChanged(bool)),
            SLOT(playStateChanged_slot(bool)));

    connect(m_playPauseButton, SIGNAL(pressed()), this, SLOT(playOrPause()));

    connect(nextButton, &ImageButton::pressed,
            [=](){
                m_playlistWidget->setCurrent(m_playlistWidget->getCurrentId()+1);
                m_player->play();
                emit playStateChanged(true);
            });

    connect(prevButton, &ImageButton::pressed,
            [=](){
                m_playlistWidget->setCurrent(m_playlistWidget->getCurrentId()-1);
                m_player->play();
                emit playStateChanged(true);
            });


    connect(m_player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),
            this, SLOT(mediaStatusChanged_slot(QMediaPlayer::MediaStatus)));

    connect(m_playlistWidget, SIGNAL(currentChanged(PlaylistMember*)),
            this, SLOT(currentChanged_slot(PlaylistMember*)));

    connect(m_player, SIGNAL(positionChanged(qint64)),
            this, SLOT(updateSlider(qint64)));

    connect(m_player, &QMediaPlayer::volumeChanged,
            [=](int v){ m_volumeLabel->setText(QString::number(v)+"%"); });

    connect(m_seekslider, &QSlider::sliderReleased,
            [=](){ m_player->setPosition(m_seekslider->value()); } );
    connect(m_seekslider, &QSlider::sliderMoved,
            [=](int time){
                m_timeLabel->setText(QString("%1:%2").arg((int)time/1000/60).arg(time/1000-time/1000/60*60 < 10 ?
                                                                                     QString("0")+QString::number(time/1000-time/1000/60*60) : QString::number(time/1000-time/1000/60*60)));
            });

    connect(m_volumeSlider,
            &QSlider::valueChanged,
            [=](int v){ m_player->setVolume(v); });

    connect(m_cacheCurrent, SIGNAL(toggled(bool)),
            this, SLOT(cacheCurrentCheckboxChecked(bool)));

    connect(m_searchEdit, SIGNAL(textChanged(QString)),
            m_playlistWidget, SLOT(searchMembersByName(QString)));
}
Пример #14
0
// constructor
MyWindow::MyWindow(int w, int h) : 
  red_active(false),
  red_set(*(new Polygon_set)),
  blue_set(*(new Polygon_set)),
  res_set(*(new Polygon_set))										  
{
  widget = new CGAL::Qt_widget(this); //Constructs a widget which is a child of this window


  /* Sets the central widget for this main window to w.
   * The central widget is surrounded by the left, top, right and bottom dock areas.
   * The menu bar is above the top dock area
   */
  setCentralWidget(widget);

  file_name= QString::null;

  //create a timer for checking if somthing changed
  QTimer *timer = new QTimer( this ); // constructs a timer whose parent is this window

  connect( timer, SIGNAL(timeout()),
           this, SLOT(timer_done()) );  // connects the timer to the window
  timer->start( 200, FALSE ); // Starts the timer with a msec milliseconds timeout

  // file menu
  QPopupMenu * file = new QPopupMenu( this );
  menuBar()->insertItem( "&File", file );
  file->insertItem("&New", this, SLOT(new_instance()), CTRL+Key_N);
  file->insertItem("New &Window", this, SLOT(new_window()), CTRL+Key_W);
  file->insertSeparator();
  file->insertItem("&Open Linear Polygon file", this, SLOT(open_linear_polygon_file()),CTRL+Key_O);
  file->insertItem("&Open DXF file", this, SLOT(open_dxf_file()),CTRL+Key_D);
  file->insertSeparator();
  //file->insertItem("&Save",this ,SLOT(save_file()),CTRL+Key_S);
  //file->insertItem("&Save as",this ,SLOT(save_file_as()));
  file->insertSeparator();
  file->insertItem("Print", widget, SLOT(print_to_ps()), CTRL+Key_P);
  file->insertSeparator();
  file->insertItem( "&Close", this, SLOT(close()), CTRL+Key_X );
  file->insertItem( "&Quit", qApp, SLOT( closeAllWindows() ), CTRL+Key_Q );

  // help menu
  QPopupMenu * help = new QPopupMenu( this );
  menuBar()->insertItem( "&Help", help );
  help->insertItem("How To", this, SLOT(howto()), Key_F1);
  help->insertSeparator();
  help->insertItem("&About", this, SLOT(about()), CTRL+Key_A );
  help->insertItem("About &Qt", this, SLOT(aboutQt()) );

  //the standard toolbar
  stoolbar = new CGAL::Qt_widget_standard_toolbar (widget, this, "ST");

  radiotoolbar = new QToolBar(this, "polygon type");
  blue_pgn = new QRadioButton ("Blue", radiotoolbar);
  blue_pgn->toggle();
  red_pgn = new QRadioButton("Red", radiotoolbar);
  radio_group = new QVButtonGroup(this,"Radios");
  radio_group->insert(blue_pgn);
  radio_group->insert(red_pgn);
  radio_group->setRadioButtonExclusive(true);


  connect(blue_pgn, SIGNAL(toggled (bool)),
	  this, SLOT(radio_selected()));
  connect(red_pgn, SIGNAL(toggled (bool)),
	  this, SLOT(radio_selected()));


  //layers
  //widget->attach(&testlayer);

  //the new tools toolbar
  newtoolbar = new Tools_toolbar(widget, this);

  // voronoi toolbar
  bops_toolbar = new QToolBar(this, "Boolean operations");

  QIconSet set0(QPixmap( (const char**)intersection_xpm ),
		QPixmap( (const char**)intersection_xpm ));

  intersection_but = new QToolButton(bops_toolbar, "Boolean operations");
  intersection_but->setAutoRaise(TRUE);

  intersection_but->setIconSet(set0);
  intersection_but->setTextLabel("Intersection ");
  connect(intersection_but,SIGNAL(pressed()),
	  this, SLOT(perform_intersection()));

  QIconSet set1(QPixmap( (const char**)union_xpm ),
		QPixmap( (const char**)union_xpm ));

  bops_toolbar->addSeparator();
  union_but = new QToolButton(bops_toolbar, "Boolean operations");
  union_but->setAutoRaise(TRUE);

  union_but->setIconSet(set1);
  union_but->setTextLabel("Union ");
  connect(union_but,SIGNAL(pressed()),
	  this, SLOT(perform_union()));

  QIconSet set2(QPixmap( (const char**)diff_PQ_xpm ),
		QPixmap( (const char**)diff_PQ_xpm ));

  bops_toolbar->addSeparator();
  diff_but2 = new QToolButton(bops_toolbar, "Boolean operations");
  diff_but2->setAutoRaise(TRUE);

  diff_but2->setIconSet(set2);
  diff_but2->setTextLabel("Difference between Blue and Red");
  connect(diff_but2, SIGNAL(pressed()),
	  this, SLOT(perform_diff2()));

  QIconSet set3(QPixmap( (const char**)diff_QP_xpm ),
		QPixmap( (const char**)diff_QP_xpm ));

  bops_toolbar->addSeparator();
  diff_but = new QToolButton(bops_toolbar, "Boolean operations");
  diff_but->setAutoRaise(TRUE);

  diff_but->setIconSet(set3);
  diff_but->setTextLabel("Difference between Red and Blue");
  connect(diff_but, SIGNAL(pressed()),
	  this, SLOT(perform_diff()));

  QIconSet set4(QPixmap( (const char**)symm_diff_xpm ),
		QPixmap( (const char**)symm_diff_xpm ));
  bops_toolbar->addSeparator();

  symm_diff_but = new QToolButton(bops_toolbar, "Boolean operations");
  symm_diff_but->setAutoRaise(TRUE);

  symm_diff_but->setIconSet(set4);
  symm_diff_but->setTextLabel("Symmetric Difference ");
  connect(symm_diff_but, SIGNAL(pressed()),
	  this, SLOT(perform_symm_diff()));

  QIconSet set12(QPixmap( (const char**)mink_sum_xpm ),
		 QPixmap( (const char**)mink_sum_xpm ));
  bops_toolbar->addSeparator();
  mink_sum_but = new QToolButton(bops_toolbar, "Boolean operations");
  mink_sum_but->setAutoRaise(TRUE);
  mink_sum_but->setIconSet(set12);
  mink_sum_but->setTextLabel("Minkowski Sum ");
  connect(mink_sum_but, SIGNAL(pressed()),
	  this, SLOT(perform_mink_sum()));

  QIconSet set5(QPixmap( (const char**)comp_P_xpm ),
		QPixmap( (const char**)comp_P_xpm ));
  bops_toolbar->addSeparator();

  blue_complement_but = new QToolButton(bops_toolbar, "Boolean operations");
  blue_complement_but->setAutoRaise(TRUE);

  blue_complement_but->setIconSet(set5);
  blue_complement_but->setTextLabel("Blue Complement ");
  connect(blue_complement_but, SIGNAL(pressed()),
	  this, SLOT(perform_blue_complement()));

  QIconSet set6(QPixmap( (const char**)comp_Q_xpm ),
		QPixmap( (const char**)comp_Q_xpm ));
  bops_toolbar->addSeparator();

  red_complement_but = new QToolButton(bops_toolbar, "Boolean operations");
  red_complement_but->setAutoRaise(TRUE);

  red_complement_but->setIconSet(set6);
  red_complement_but->setTextLabel("Red Complement ");
  connect(red_complement_but, SIGNAL(pressed()),
	  this, SLOT(perform_red_complement()));


  QIconSet set7(QPixmap( (const char**)make_P_xpm ),
		QPixmap( (const char**)make_P_xpm ));
  bops_toolbar->addSeparator();
  make_res_blue_but = new QToolButton(bops_toolbar, "Boolean operations");
  make_res_blue_but->setAutoRaise(TRUE);


  make_res_blue_but->setIconSet(set7);
  make_res_blue_but->setTextLabel("Make Result Blue");
  connect(make_res_blue_but,SIGNAL(pressed()),
	  this, SLOT(make_res_blue()));

  QIconSet set8(QPixmap( (const char**)make_Q_xpm ),
		QPixmap( (const char**)make_Q_xpm ));
  bops_toolbar->addSeparator();
  make_res_red_but = new QToolButton(bops_toolbar, "Boolean operations");
  make_res_red_but->setAutoRaise(TRUE);


  make_res_red_but->setIconSet(set8);
  make_res_red_but->setTextLabel("Make Result Red");
  connect(make_res_red_but,SIGNAL(pressed()),
	  this, SLOT(make_res_red()));

  QIconSet set9(QPixmap( (const char**)refresh_xpm ),
		QPixmap( (const char**)refresh_xpm ));
  bops_toolbar->addSeparator();

  refresh_but = new QToolButton(bops_toolbar, "Boolean operations");
  refresh_but->setAutoRaise(TRUE);

  refresh_but->setIconSet(set9);
  refresh_but->setTextLabel("Refresh ");
  connect(refresh_but,SIGNAL(pressed()),
	  this, SLOT(refresh()));

  QIconSet set10(QPixmap( (const char**)del_P_xpm ),
		 QPixmap( (const char**)del_P_xpm ));
  bops_toolbar->addSeparator();

  delete_blue_but = new QToolButton(bops_toolbar, "Boolean operations");
  delete_blue_but->setAutoRaise(TRUE);

  delete_blue_but->setIconSet(set10);
  delete_blue_but->setTextLabel("Delete Blue Polygons");
  connect(delete_blue_but,SIGNAL(pressed()),
	  this, SLOT(delete_blue_polygons()));


  QIconSet set11(QPixmap( (const char**)del_Q_xpm ),
		 QPixmap( (const char**)del_Q_xpm ));
  bops_toolbar->addSeparator();

  delete_red_but = new QToolButton(bops_toolbar, "Boolean operations");
  delete_red_but->setAutoRaise(TRUE);

  delete_red_but->setIconSet(set11);
  delete_red_but->setTextLabel("Delete Red Polygons");
  connect(delete_red_but,SIGNAL(pressed()),
	  this, SLOT(delete_red_polygons()));




  *widget << CGAL::LineWidth(2) << CGAL::BackgroundColor (CGAL::BLACK);

  resize(w,h);
  widget->set_window(-1, 1, -1, 1);
  widget->setMouseTracking(TRUE);

  //connect the widget to the main function that receives the objects
  connect(widget, SIGNAL(new_cgal_object(CGAL::Object)),
	  this, SLOT(get_new_object(CGAL::Object)));

  //application flag stuff
  old_state = 0;
  current_state = 1;
  red_active = false;
  red_set.clear();
  blue_set.clear();
  res_set.clear();
}
Пример #15
0
ClientSettings::ClientSettings(ClientInterface* par)
{
    m_parent = par;
    setParent(par);
    setWhatsThis(tr("Ici, vous pouvez régler bon nombre d'options du logiciel."));

    setWindowFlags(Qt::Dialog|Qt::CustomizeWindowHint|Qt::WindowTitleHint|Qt::WindowCloseButtonHint|Qt::WindowContextHelpButtonHint);

    m_settings = allocateSettings(this);

    QVBoxLayout* la = new QVBoxLayout;
    QVBoxLayout* la2 = new QVBoxLayout;
    QHBoxLayout* hla= new QHBoxLayout;
    setLayout(hla);
    hla->addLayout(la);
    hla->addLayout(la2);

    {
        QGroupBox *gb = new QGroupBox(tr("Général"));
        la->addWidget(gb);
        QVBoxLayout* v_la = new QVBoxLayout;
        gb->setLayout(v_la);

        {
            QHBoxLayout* h_la = new QHBoxLayout;
            v_la->addLayout(h_la);

            m_nickname = new QLineEdit(m_settings->value(PARAM_NICK).toString(), this);
            m_nickname->setMaxLength(MAX_NICKNAME_LENGHT);
            m_nickname->setWhatsThis(tr("Entrez ici le pseudo que vous utiliserez sur le chat. A contrario de la commande /pseudo, ce pseudo sera automatiquement appliqué à chaque connexion."));
            h_la->addWidget(new QLabel(tr("Pseudo :")));
            h_la->addWidget(m_nickname);
        }

    }

    {
        QGroupBox *gb = new QGroupBox(tr("Interface"));
        la->addWidget(gb);
        QVBoxLayout* v_la = new QVBoxLayout;
        gb->setLayout(v_la);
        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);
        m_selectInterface = new QPushButton("...", this);
        m_selectInterface->setWhatsThis(tr("Parcourir le disque dur..."));
        connect(m_selectInterface, SIGNAL(pressed()), this, SLOT(selectInterface()));
        m_interfacePath = new QLineEdit(m_settings->value(PARAM_INTERFACE, DEFAULT_INTERFACE).toString(), this);
        connect(m_interfacePath, SIGNAL(returnPressed()), this, SLOT(openInterface()));
        h_la->addWidget(m_interfacePath);
        h_la->addWidget(m_selectInterface);
        }

        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        m_saveInterface = new QPushButton(tr("Sauvegarder"), this);
        m_saveInterface->setWhatsThis(tr("Sauvegarder une interface."));
        connect(m_saveInterface, SIGNAL(pressed()), this, SLOT(saveInterface()));
        h_la->addWidget(m_saveInterface);

        m_openInterface = new QPushButton(tr("Charger"), this);
        m_openInterface->setWhatsThis(tr("Charger l'interface marquée plus haut."));
        connect(m_openInterface, SIGNAL(pressed()), this, SLOT(openInterface()));
        h_la->addWidget(m_openInterface);
        }
    }

    {
        QGroupBox *gb = new QGroupBox(tr("Thème"));
        la->addWidget(gb);
        QVBoxLayout* v_la = new QVBoxLayout;
        gb->setLayout(v_la);
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);
        m_selectCSS = new QPushButton("...", this);
        m_selectCSS->setWhatsThis(tr("Parcourir le disque dur..."));
        connect(m_selectCSS, SIGNAL(pressed()), this, SLOT(selectCSS()));
        m_CSSPath = new QLineEdit(m_settings->value(PARAM_CSS).toString(), this);
        connect(m_CSSPath, SIGNAL(returnPressed()), this, SLOT(openCSS()));
        h_la->addWidget(m_CSSPath);
        h_la->addWidget(m_selectCSS);

        m_openCSS = new QPushButton(tr("Charger"), this);
        m_openCSS->setWhatsThis(tr("Charger la feuille de style indiquée plus haut."));
        connect(m_openCSS, SIGNAL(pressed()), this, SLOT(openCSS()));
        v_la->addWidget(m_openCSS);
    }

    {
        QGroupBox *gb = new QGroupBox(tr("Paramètres de connexion"));
        gb->setWhatsThis(tr("Ces options ne sont disponibles que lorsque vous n'êtes pas connecté à un serveur."));
        la->addWidget(gb);
        QVBoxLayout* v_la = new QVBoxLayout;
        gb->setLayout(v_la);

        v_la->addWidget(new QLabel(tr("Addresse IP et port du serveur :")));

        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        m_serverIP = new QLineEdit(m_settings->value(PARAM_IP, SERVER_IP).toString(), this);
        m_serverIP->setInputMask("000.000.000.000;");
        m_serverPort = new QSpinBox(this);
        m_serverPort->setMinimum(1024);
        m_serverPort->setMaximum(65535);
        m_serverPort->setValue(m_settings->value(PARAM_PORT, SERVER_PORT).toInt());
        h_la->addWidget(m_serverIP);
        h_la->addWidget(new QLabel(":"));
        h_la->addWidget(m_serverPort);

        if(par->isConnected())
            gb->setEnabled(false);
    }

    {
        QGroupBox *gb = new QGroupBox(tr("Paramètres du son"));
        la2->addWidget(gb);
        QVBoxLayout* v_la = new QVBoxLayout;
        gb->setLayout(v_la);

        v_la->addWidget(new QLabel(tr("Volume des sons d'ambiance :")));

        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        m_sound = new QSlider(this);
        m_sound->setMaximum(1000);
        m_sound->setOrientation(Qt::Horizontal);
        m_sound->setValue(static_cast<int>(m_settings->value(PARAM_SOUND, 100.f).toFloat()*10));
        connect(m_sound, SIGNAL(valueChanged(int)), this, SLOT(soundSliderChanged(int)));
        m_soundSpinBox=new QDoubleSpinBox(this);
        m_soundSpinBox->setMaximum(100); m_soundSpinBox->setMinimum(0); m_soundSpinBox->setMaximum(100); m_soundSpinBox->setDecimals(1);
        m_soundSpinBox->setValue(m_settings->value(PARAM_SOUND, 100.f).toFloat());
        connect(m_soundSpinBox, SIGNAL(valueChanged(double)), this, SLOT(soundSpinBoxChanged(double)));
        h_la->addWidget(m_sound);
        h_la->addWidget(m_soundSpinBox);
        }
        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        h_la->addWidget(new QLabel(tr("Périphériques sonore :")));
        m_chb_dvc_out=new QCheckBox(tr("Utiliser le périphérique par défaut"), this);
        v_la->addWidget(m_chb_dvc_out);
        m_cb_dvc_out=new QComboBox(this);
        m_cb_dvc_out->addItems(getOALDevices(true));
        m_cb_dvc_out->setCurrentIndex(m_cb_dvc_out->findText(getOALCurrentDevice(true)));
        h_la->addWidget(m_cb_dvc_out);

        }
        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        h_la->addWidget(new QLabel(tr("Périphériques de capture :")));
        m_chb_dvc_in=new QCheckBox(tr("Utiliser le périphérique par défaut"), this);
        v_la->addWidget(m_chb_dvc_in);
        m_cb_dvc_in=new QComboBox(this);
        m_cb_dvc_in->addItems(getOALDevices(false));
        int ind=m_cb_dvc_in->findText(getOALCurrentDevice(false));
        if(ind==-1)
        {
            QString d=getOALCurrentDevice(false);
            m_cb_dvc_in->addItem(d);
            m_cb_dvc_in->setCurrentIndex(m_cb_dvc_in->findText(d));
        }
        else
            m_cb_dvc_in->setCurrentIndex(ind);

        h_la->addWidget(m_cb_dvc_in);
        }

    }

    {
        m_voip = new QGroupBox(tr("Paramètres de la VOIP"));
        m_voip->setCheckable(true);
        m_voip->setChecked(m_settings->value(PARAM_VOIP_ENABLED, true).toBool());
        la2->addWidget(m_voip);
        QVBoxLayout* v_la = new QVBoxLayout;
        m_voip->setLayout(v_la);

        v_la->addWidget(new QLabel(tr("Volume de la reception :")));

        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        m_VOIPSound = new QSlider(this);
        m_VOIPSound->setMaximum(1000);
        m_VOIPSound->setOrientation(Qt::Horizontal);
        m_VOIPSound->setValue(static_cast<int>(m_settings->value(PARAM_VOIP_SOUND, 100.f).toFloat()*10));
        connect(m_VOIPSound, SIGNAL(valueChanged(int)), this, SLOT(VOIPSoundSliderChanged(int)));
        m_VOIPSoundSpinBox=new QDoubleSpinBox(this);
        m_VOIPSoundSpinBox->setMaximum(100); m_VOIPSoundSpinBox->setMinimum(0); m_VOIPSoundSpinBox->setDecimals(1);
        m_VOIPSoundSpinBox->setValue(m_settings->value(PARAM_VOIP_SOUND, 100.f).toFloat());
        connect(m_VOIPSoundSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VOIPSoundSpinBoxChanged(double)));
        h_la->addWidget(m_VOIPSound);
        h_la->addWidget(m_VOIPSoundSpinBox);
        }

        v_la->addWidget(new QLabel(tr("Qualité de la VOIP (sortant) :")));

        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        m_VOIPQuality = new QSlider(this);
        m_VOIPQuality->setMinimum(1); m_VOIPQuality->setMaximum(100);
        m_VOIPQuality->setOrientation(Qt::Horizontal);
        m_VOIPQuality->setValue(static_cast<int>(m_settings->value(PARAM_VOIP_QUALITY, 4).toFloat()*10));
        connect(m_VOIPQuality, SIGNAL(valueChanged(int)), this, SLOT(VOIPQualitySliderChanged(int)));
        h_la->addWidget(new QLabel(tr("Plus rapide")));
        h_la->addWidget(m_VOIPQuality);
        h_la->addWidget(new QLabel(tr("Plus clair")));
        }
    }

    {
        QGroupBox *gb = new QGroupBox(tr("Bibliothèques de sons"));
        la2->addWidget(gb);

        QPushButton* m_libsListRefresh = new QPushButton(tr("Rafraichir"), this);
        connect(m_libsListRefresh, SIGNAL(pressed()), this, SLOT(refreshLibs()));
        QPushButton* m_libsListLoad = new QPushButton(tr("Charger"), this);
        connect(m_libsListLoad, SIGNAL(pressed()), this, SLOT(loadLibs()));

        QScrollArea* m_libsScroll=new QScrollArea(this);
        {
        QVBoxLayout* v = new QVBoxLayout;
        gb->setLayout(v);
        v->addWidget(m_libsListRefresh);
        v->addWidget(m_libsScroll);
        v->addWidget(m_libsListLoad);
        }
        m_libs_la = new QVBoxLayout;
        {
        gar=new QWidget(this);
        m_libsScroll->setWidget(gar);
        gar->setLayout(m_libs_la);
        }


    }

    {
        m_ok = new QPushButton(tr("Valider"), this);
        m_ok->setDefault(true);
        connect(m_ok, SIGNAL(pressed()), this, SLOT(ok()));
        m_cancel = new QPushButton(tr("Annuler"), this);
        connect(m_cancel, SIGNAL(pressed()), this, SLOT(reject()));
        QHBoxLayout* h_la = new QHBoxLayout;
        h_la->addWidget(m_ok);
        h_la->addWidget(m_cancel);
        la->addLayout(h_la);
    }
    refreshLibs();
}
Пример #16
0
void DlgTrackInfo::init() {
    setupUi(this);

    cueTable->hideColumn(0);
    coverBox->insertWidget(1, m_pWCoverArtLabel);

    // It is essential to make the QPlainTextEdit transparent.
    // Without this, the background is always solid (white by default).
    txtLocation->viewport()->setAutoFillBackground(false);

    connect(btnNext, SIGNAL(clicked()),
            this, SLOT(slotNext()));
    connect(btnPrev, SIGNAL(clicked()),
            this, SLOT(slotPrev()));
    connect(btnApply, SIGNAL(clicked()),
            this, SLOT(apply()));
    connect(btnOK, SIGNAL(clicked()),
            this, SLOT(OK()));
    connect(btnCancel, SIGNAL(clicked()),
            this, SLOT(cancel()));

    connect(btnFetchTag, SIGNAL(clicked()),
            this, SLOT(fetchTag()));

    connect(bpmDouble, SIGNAL(clicked()),
            this, SLOT(slotBpmDouble()));
    connect(bpmHalve, SIGNAL(clicked()),
            this, SLOT(slotBpmHalve()));
    connect(bpmTwoThirds, SIGNAL(clicked()),
            this, SLOT(slotBpmTwoThirds()));
    connect(bpmThreeFourth, SIGNAL(clicked()),
            this, SLOT(slotBpmThreeFourth()));
    connect(bpmClear, SIGNAL(clicked()),
            this, SLOT(slotBpmClear()));

    connect(bpmConst, SIGNAL(stateChanged(int)),
            this, SLOT(slotBpmConstChanged(int)));

    connect(spinBpm, SIGNAL(valueChanged(double)),
            this, SLOT(slotSpinBpmValueChanged(double)));



    connect(btnCueActivate, SIGNAL(clicked()),
            this, SLOT(cueActivate()));
    connect(btnCueDelete, SIGNAL(clicked()),
            this, SLOT(cueDelete()));
    connect(bpmTap, SIGNAL(pressed()),
            m_pTapFilter.data(), SLOT(tap()));
    connect(m_pTapFilter.data(), SIGNAL(tapped(double, int)),
            this, SLOT(slotBpmTap(double, int)));
    connect(btnReloadFromFile, SIGNAL(clicked()),
            this, SLOT(reloadTrackMetadata()));
    connect(btnOpenFileBrowser, SIGNAL(clicked()),
            this, SLOT(slotOpenInFileBrowser()));

    CoverArtCache* pCache = CoverArtCache::instance();
    if (pCache != NULL) {
        connect(pCache, SIGNAL(coverFound(const QObject*, const int, const CoverInfo&, QPixmap, bool)),
                this, SLOT(slotCoverFound(const QObject*, const int, const CoverInfo&, QPixmap, bool)));
    }
    addWidget(groupBox);
    addWidget(boneWeightArrayUI);
    returnPB->setVisible(false);
    toggleSignals(true);
}

void BSBoneSwitchGeneratorBoneDataUI::toggleSignals(bool toggleconnections){
    if (toggleconnections){
        connect(boneWeightArrayUI, SIGNAL(returnToParent()), this, SLOT(returnToWidget()), Qt::UniqueConnection);
        connect(table, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(viewSelected(int,int)), Qt::UniqueConnection);
        connect(spBoneWeight, SIGNAL(pressed()), this, SLOT(viewBoneWeights()), Qt::UniqueConnection);
        connect(spBoneWeight, SIGNAL(enabled(bool)), this, SLOT(toggleBoneWeights(bool)), Qt::UniqueConnection);
        connect(returnPB, SIGNAL(clicked(bool)), this, SIGNAL(returnToParent(bool)), Qt::UniqueConnection);
    }else{
        disconnect(boneWeightArrayUI, SIGNAL(returnToParent()), this, SLOT(returnToWidget()));
        disconnect(spBoneWeight, SIGNAL(pressed()), this, SLOT(viewBoneWeights()));
        disconnect(spBoneWeight, SIGNAL(enabled(bool)), this, SLOT(toggleBoneWeights(bool)));
        disconnect(table, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(viewSelected(int,int)));
        disconnect(returnPB, SIGNAL(clicked(bool)), this, SIGNAL(returnToParent(bool)));
    }
}

void BSBoneSwitchGeneratorBoneDataUI::loadData(HkxObject *data, int childindex){
    toggleSignals(false);
    if (data){
        if (data->getSignature() == BS_BONE_SWITCH_GENERATOR_BONE_DATA){
            childIndex = childindex;
            bsData = static_cast<BSBoneSwitchGeneratorBoneData *>(data);
            (bsData->getSpBoneWeight().data()) ? spBoneWeight->setChecked(true) : spBoneWeight->setChecked(false);
            table->item(GENERATOR_ROW, VALUE_COLUMN)->setText(bsData->getPGeneratorName());
            auto varBind = bsData->getVariableBindingSetData();
Пример #18
0
void Dialog::setConnections() {
	connect(myButtonSet, SIGNAL(pressed()), this, SLOT(setInterval()));
	connect(myButtonStop, SIGNAL(pressed()), this, SLOT(stopTimer()));
}
Пример #19
0
void QQuickMultiPointTouchArea::updateTouchData(QEvent *event)
{
    bool ended = false;
    bool moved = false;
    bool started = false;
    bool isMouseEvent = false;

    clearTouchLists();
    QList<QTouchEvent::TouchPoint> touchPoints;

    switch (event->type()) {
    case QEvent::TouchBegin:
    case QEvent::TouchUpdate:
    case QEvent::TouchEnd:
        touchPoints = static_cast<QTouchEvent*>(event)->touchPoints();
        break;
    case QEvent::MouseButtonPress:
    case QEvent::MouseMove:
    case QEvent::MouseButtonRelease: {
        QMouseEvent *me = static_cast<QMouseEvent*>(event);
        _mouseQpaTouchPoint.setPos(me->localPos());
        _mouseQpaTouchPoint.setScenePos(me->windowPos());
        _mouseQpaTouchPoint.setScreenPos(me->screenPos());
        if (event->type() == QEvent::MouseMove)
            _mouseQpaTouchPoint.setState(Qt::TouchPointMoved);
        else if (event->type() == QEvent::MouseButtonRelease)
            _mouseQpaTouchPoint.setState(Qt::TouchPointReleased);
        else { // QEvent::MouseButtonPress
            addTouchPoint(me);
            started = true;
            _mouseQpaTouchPoint.setState(Qt::TouchPointPressed);
        }
        touchPoints << _mouseQpaTouchPoint;
        isMouseEvent = true;
        break;
    }
    default:
        qWarning("updateTouchData: unhandled event type %d", event->type());
        break;
    }

    if (!isMouseEvent && _mouseTouchPoint) {
        QQuickWindow *c = window();
        if (c && c->mouseGrabberItem() == this)
            touchPoints << _mouseQpaTouchPoint;
    }
    int numTouchPoints = touchPoints.count();
    //always remove released touches, and make sure we handle all releases before adds.
    for (const QTouchEvent::TouchPoint &p : qAsConst(touchPoints)) {
        Qt::TouchPointState touchPointState = p.state();
        int id = p.id();
        if (touchPointState & Qt::TouchPointReleased) {
            QQuickTouchPoint* dtp = static_cast<QQuickTouchPoint*>(_touchPoints.value(id));
            if (!dtp)
                continue;
            updateTouchPoint(dtp, &p);
            dtp->setPressed(false);
            _releasedTouchPoints.append(dtp);
            _touchPoints.remove(id);
            ended = true;
        }
    }
    if (numTouchPoints >= _minimumTouchPoints && numTouchPoints <= _maximumTouchPoints) {
        for (const QTouchEvent::TouchPoint &p : qAsConst(touchPoints)) {
            Qt::TouchPointState touchPointState = p.state();
            int id = p.id();
            if (touchPointState & Qt::TouchPointReleased) {
                //handled above
            } else if (!_touchPoints.contains(id)) { //could be pressed, moved, or stationary
                // (we may have just obtained enough points to start tracking them -- in that case moved or stationary count as newly pressed)
                addTouchPoint(&p);
                started = true;
            } else if (touchPointState & Qt::TouchPointMoved) {
                QQuickTouchPoint* dtp = static_cast<QQuickTouchPoint*>(_touchPoints.value(id));
                Q_ASSERT(dtp);
                _movedTouchPoints.append(dtp);
                updateTouchPoint(dtp,&p);
                moved = true;
            } else {
                QQuickTouchPoint* dtp = static_cast<QQuickTouchPoint*>(_touchPoints.value(id));
                Q_ASSERT(dtp);
                updateTouchPoint(dtp,&p);
            }
        }

        //see if we should be grabbing the gesture
        if (!_stealMouse /* !ignoring gesture*/) {
            bool offerGrab = false;
            const int dragThreshold = QGuiApplication::styleHints()->startDragDistance();
            for (const QTouchEvent::TouchPoint &p : qAsConst(touchPoints)) {
                if (p.state() == Qt::TouchPointReleased)
                    continue;
                const QPointF &currentPos = p.scenePos();
                const QPointF &startPos = p.startScenePos();
                if (qAbs(currentPos.x() - startPos.x()) > dragThreshold)
                    offerGrab = true;
                else if (qAbs(currentPos.y() - startPos.y()) > dragThreshold)
                    offerGrab = true;
                if (offerGrab)
                    break;
            }

            if (offerGrab) {
                QQuickGrabGestureEvent event;
                event._touchPoints = _touchPoints.values();
                emit gestureStarted(&event);
                if (event.wantsGrab())
                    grabGesture();
            }
        }

        if (ended)
            emit released(_releasedTouchPoints);
        if (moved)
            emit updated(_movedTouchPoints);
        if (started)
            emit pressed(_pressedTouchPoints);
        if (ended || moved || started) emit touchUpdated(_touchPoints.values());
    }
}
void GenericTimeDataUI::initControlWidget() {
    QWidget * _widget=new QWidget();//Create the widget for these controls
    //setting font base dimension
    QFont f=*(new QFont());
    f.setPointSize(PLOTWIDGET_DEFAULT_PLOT_DIMENSION);

    //Widget  layout
    QVBoxLayout * l=new QVBoxLayout();
    l->setSizeConstraint(QLayout::SetMinimumSize);
    _widget->setLayout(l);
    _widget->setFont(f);

    //Name the curve
    QLabel * _nameLabel=new QLabel("Curve name",this);
    _nameLabel->setFont(f);
    _nameLabel->setAlignment(Qt::AlignCenter);

    m_baseControl.lineName= new QLineEdit("m_genericTimeData->name()",this);
    m_baseControl.lineName->setFont(f);
    connect( m_baseControl.lineName,SIGNAL(editingFinished()), this ,SLOT(nameUpdated()));

    //Show curve
    m_baseControl.checkBoxShowCurve=new QCheckBox("Show curve",this);
    m_baseControl.checkBoxShowCurve->setFont(f);
    connect(m_baseControl.checkBoxShowCurve,SIGNAL(toggled(bool)),this,SIGNAL(showCurveUIChanged(bool)));

    //Enable curve
    m_baseControl.checkBoxEnableCurve=new QCheckBox("Enable curve",this);
    m_baseControl.checkBoxEnableCurve->setFont(f);
    connect(m_baseControl.checkBoxEnableCurve,SIGNAL(toggled(bool)),this,SIGNAL(enableCurveUIChanged(bool)));

    //Curve color
    m_baseControl.comboColor=new ComboBoxWidgetColor();
    m_baseControl.comboColor->setFont(f);
    connect(m_baseControl.comboColor, SIGNAL(colorChanged(QColor)),this,SIGNAL(colorUIChanged(QColor)));

    //XML Button
    m_baseControl.exportXML=new QPushButton("Export");
    m_baseControl.exportXML->setFont(f);
    connect(m_baseControl.exportXML ,SIGNAL(pressed()),this,SIGNAL(buttonExportXMLPressed()));

    m_baseControl.importXML=new QPushButton("Import");
    m_baseControl.importXML->setFont(f);
    connect(m_baseControl.importXML ,SIGNAL(pressed()),this,SIGNAL(buttonImportXMLPressed()));

    m_baseControl.showXML=new QPushButton("Show data");
    m_baseControl.showXML->setFont(f);
  //  connect(m_baseControl.showXML ,SIGNAL(clicked()),this,SLOT(showXML()));

    //C&P Button
    m_baseControl.copy=new QPushButton("Copy");
    m_baseControl.copy->setFont(f);
    connect(m_baseControl.copy ,SIGNAL(pressed()),this,SIGNAL(buttonCopyPressed()));

    m_baseControl.paste=new QPushButton("Paste");
    m_baseControl.paste->setFont(f);
    connect(m_baseControl.paste ,SIGNAL(pressed()),this,SIGNAL(buttonPastePressed()));


    //Layouting XML button & C&P button
    QGridLayout * _lButton=new QGridLayout();
    _lButton->addWidget(m_baseControl.exportXML,0,0,1,1,Qt::AlignLeft);
    _lButton->addWidget(m_baseControl.importXML,0,1,1,1,Qt::AlignLeft);
    _lButton->addWidget(m_baseControl.showXML,0,2,1,1,Qt::AlignLeft);
    _lButton->addWidget(m_baseControl.copy,1,0,1,1,Qt::AlignLeft);
    _lButton->addWidget(m_baseControl.paste,1,1,1,1,Qt::AlignLeft);
    _lButton->setSizeConstraint(QLayout::SetMaximumSize);
    QWidget *_buttonWidget=new QWidget(this);
    _buttonWidget->setLayout((QLayout*)_lButton);

    //Lay out all the controls
    l->addWidget(_nameLabel,1,Qt::AlignLeft);
    l->addWidget(m_baseControl.lineName,1,Qt::AlignLeft);
    l->addWidget(m_baseControl.checkBoxEnableCurve,1,Qt::AlignLeft);
    l->addWidget(m_baseControl.checkBoxShowCurve,1,Qt::AlignLeft);
    l->addWidget(m_baseControl.comboColor,1,Qt::AlignLeft);
    l->addWidget(_buttonWidget,1,Qt::AlignLeft);

    //Add the local widget to the framework widget
    this->addWidget(_widget, "Generic time Controls");
}
Пример #21
0
void LayerView::mousePressEvent(QGraphicsSceneMouseEvent*)
{
    emit pressed();
}
Пример #22
0
 void mousePressEvent(QGraphicsSceneMouseEvent *)
 {
     emit pressed();
     update();
 }
Пример #23
0
void DlgTrackInfo::init() {
    setupUi(this);

    cueTable->hideColumn(0);
    coverBox->insertWidget(1, m_pWCoverArtLabel);

    connect(btnNext, SIGNAL(clicked()),
            this, SLOT(slotNext()));
    connect(btnPrev, SIGNAL(clicked()),
            this, SLOT(slotPrev()));
    connect(btnApply, SIGNAL(clicked()),
            this, SLOT(apply()));
    connect(btnOK, SIGNAL(clicked()),
            this, SLOT(OK()));
    connect(btnCancel, SIGNAL(clicked()),
            this, SLOT(cancel()));

    connect(bpmDouble, SIGNAL(clicked()),
            this, SLOT(slotBpmDouble()));
    connect(bpmHalve, SIGNAL(clicked()),
            this, SLOT(slotBpmHalve()));
    connect(bpmTwoThirds, SIGNAL(clicked()),
            this, SLOT(slotBpmTwoThirds()));
    connect(bpmThreeFourth, SIGNAL(clicked()),
            this, SLOT(slotBpmThreeFourth()));
    connect(bpmFourThirds, SIGNAL(clicked()),
            this, SLOT(slotBpmFourThirds()));
    connect(bpmThreeHalves, SIGNAL(clicked()),
            this, SLOT(slotBpmThreeHalves()));
    connect(bpmClear, SIGNAL(clicked()),
            this, SLOT(slotBpmClear()));

    connect(bpmConst, SIGNAL(stateChanged(int)),
            this, SLOT(slotBpmConstChanged(int)));

    connect(spinBpm, SIGNAL(valueChanged(double)),
            this, SLOT(slotSpinBpmValueChanged(double)));

    connect(txtKey, SIGNAL(editingFinished()),
            this, SLOT(slotKeyTextChanged()));

    connect(btnCueActivate, SIGNAL(clicked()),
            this, SLOT(cueActivate()));
    connect(btnCueDelete, SIGNAL(clicked()),
            this, SLOT(cueDelete()));
    connect(bpmTap, SIGNAL(pressed()),
            m_pTapFilter.data(), SLOT(tap()));
    connect(m_pTapFilter.data(), SIGNAL(tapped(double, int)),
            this, SLOT(slotBpmTap(double, int)));

    connect(btnImportMetadataFromFile, SIGNAL(clicked()),
            this, SLOT(slotImportMetadataFromFile()));
    connect(btnImportMetadataFromMusicBrainz, SIGNAL(clicked()),
            this, SLOT(slotImportMetadataFromMusicBrainz()));
    connect(btnOpenFileBrowser, SIGNAL(clicked()),
            this, SLOT(slotOpenInFileBrowser()));

    CoverArtCache* pCache = CoverArtCache::instance();
    if (pCache != NULL) {
        connect(pCache, SIGNAL(coverFound(const QObject*, const CoverInfoRelative&, QPixmap, bool)),
                this, SLOT(slotCoverFound(const QObject*, const CoverInfoRelative&, QPixmap, bool)));
    }
Пример #24
0
//--------------------------------------------------------------------------------------------
//
//--------------------------------------------------------------------------------------------
tApVrfCalibrationWizard::tApVrfCalibrationWizard( tPilotController& pilotDevice, QWidget* pParent )
: tDialog( tDialog::Partial, pParent )
, m_CalibrationStep( eCS_Initial )
, m_pText( 0 )
, m_pYesAct( 0 )
, m_pNoAct( 0 )
, m_pCancelAct( 0 )
, m_pMovePortBtn( 0 )
, m_pNextAct( 0 )
, m_pCloseAct( 0 )
, m_pDummyAct( 0 )
, m_pDummy2Act( 0 )
, m_TurnState( eTS_Normal )
, m_PilotDevice( pilotDevice )
{
    setWindowTitle( tr( "Virtual Rudder Feedback Calibration" ) );

    QGridLayout* pLayout = new QGridLayout;
    pLayout->setContentsMargins( 30, 0, 10, 0 );
    pLayout->setSpacing( 5 );
    
    m_pText = new QLabel( tr( "Use wheel to center the rudder." ) );
    m_pText->setWordWrap(true);
    m_pText->setMinimumHeight( m_pText->fontMetrics().height() * 3 + 20 );

    m_pMovePortBtn = new tPushButton();
    m_pMovePortBtn->hide();
    Connect( m_pMovePortBtn, SIGNAL( pressed() ), this, SLOT( OnLeftBtnPressed() ) );
    Connect( m_pMovePortBtn, SIGNAL( released() ), this, SLOT( OnLeftBtnReleased() ) );

    pLayout->addWidget( m_pText, 0, 0, 1, 3 );
    pLayout->addWidget( m_pMovePortBtn, 0, 4, 1, 1 );

    setLayout( pLayout );

    m_pNextAct = new tAction( tr( "Next", "button" ), this );
    Connect( m_pNextAct, SIGNAL( triggered() ), this, SLOT( OnNext() ) );

    m_pCancelAct = new tAction( tr( "Cancel", "button" ), this );
    Connect( m_pCancelAct, SIGNAL( triggered() ), this, SLOT( reject() ) );

    m_pYesAct = new tAction( tr( "Yes", "button" ), this );
    Connect( m_pYesAct, SIGNAL( triggered() ), this, SLOT( OnYes() ) );

    m_pNoAct = new tAction( tr( "No", "button" ), this );
    Connect( m_pNoAct, SIGNAL( triggered() ), this, SLOT( OnNo() ) );

    m_pCloseAct = new tAction( tr( "Close", "button" ), this );
    Connect( m_pCloseAct, SIGNAL( triggered() ), this, SLOT( accept() ) );

    m_pDummyAct = new tAction( this );
    m_pDummyAct->setSeparator( true );
    m_pDummy2Act = new tAction( this );
    m_pDummy2Act->setSeparator( true );
 
    // add dummy to provide space for max of 3 softkeys
    m_ActionList << m_pDummyAct << m_pNextAct << m_pCancelAct;    
    setSoftKeys( m_ActionList, true );

    SoftKeyBar()->SetFocus( m_pNextAct );

    // Connect to the pilot virtual device for rudder test mode changes
    Connect( m_PilotDevice.GetRudderTestInterface(), SIGNAL( RudderTestModeChanged(tDriveProxy::eRudderTestMode) ),
             this, SLOT( OnRudderTestModeChanged(tDriveProxy::eRudderTestMode) ) );
}
Пример #25
0
bool InputDevice::any_pressed() const
{
	return pressed(_last_button);
}
Пример #26
0
/**
  * Constructor for MainWindow. It will initialize the entire board and create the necessary starting elements for the game
  */
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    //Global variables
    hasFinished = false; //Has the game finished?
    cellsRevealed = 0; //Number of current cells revealed
    flagsFlagged = 0; //Number of flags that have been flagged
    minesFlagged = 0; //Number of mines that have been flagged
    hasStarted = false; //If the game has started yet
    currentTime = 0; //The current time in seconds

    ui->setupUi(this);

    //Layout designs
    ui->mineContainer->setSpacing(0); //Forces the board cells to be spaced next to each other

    //Timer for the number of seconds that has passed by
    timer = new QTimer();

    //The display of the number of flags that have been put up (Mines left to solve)
    ui->lcdFlagCount->setDigitCount(2);
    ui->lcdFlagCount->display ( NUMBER_OF_MINES - flagsFlagged );

    //Initialize statuses
    // 0 = Empty, 1 = flagged, 2 = ?
    for ( int i = 0; i < 10; i++)
    {
        for ( int j = 0; j < 10; j++)
            mineStatus[i][j] = 0;
    }

    //Connect the UI elements
    connect(ui->actionHelp, SIGNAL(triggered()), this, SLOT(handleHelpButton()));
    connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(handleAboutButton()));
    connect(ui->action_Reset, SIGNAL(triggered()), this, SLOT(reset()));
    connect(ui->smileyFace, SIGNAL(clicked()), this, SLOT(handleSmileyFace()));
    connect(ui->actionTop_Ten, SIGNAL(triggered()), this, SLOT(handleTopTen()));
    connect(timer, SIGNAL(timeout()), this, SLOT(updateTimer()));

    //Now handle the actual game.. enough of this extra feature stuff. Now for the real deal!
    game = new Minesweeper();

    //We will need to map the click to an object's coordinates
    signalMapper = new QSignalMapper(this);
    signalMapper2 = new QSignalMapper(this);

    //Generate all the buttons for the game
    for( int i = 0; i < 10; i++)
    {
        for( int j = 0; j < 10; j++ )
        {
            MineSweeperButton* button = new MineSweeperButton("");

            //Button Styling
            button->setAttribute(Qt::WA_LayoutUsesWidgetRect); //Forces Mac OS X styled minesweeper to look like linux/windows
            button->setMaximumHeight(30);
            button->setMaximumWidth(30);
            button->setIcon (QIcon(QString(":/images/not_flat_button.png")));
            button->setIconSize (QSize(30,30));

            //Actually add the button to the container
            ui->mineContainer->addWidget(button, i, j);
            QString coordinates = QString::number(i)+","+QString::number(j); //Coordinate of the button
            //Map the coordinates to a particular MineSweeperButton
            signalMapper->setMapping(button, coordinates);
            signalMapper2->setMapping(button, coordinates);

            //Connections for the buttons
            connect(button, SIGNAL(clicked()), signalMapper, SLOT(map()));
            connect(button, SIGNAL(rightButtonClicked()), signalMapper2, SLOT(map()));
            connect(button, SIGNAL(pressed()), this, SLOT(handleButtonPressed()));
            connect(button, SIGNAL(released()), this, SLOT(handleButtonReleased()));
        }
    }

    //Connect the signal mapper to this class so that we can handle its clicks
    connect(signalMapper, SIGNAL(mapped(QString)), this, SLOT(revealCell(QString))); //Left click
    connect(signalMapper2, SIGNAL(mapped(QString)), this, SLOT(hasRightClicked(QString))); //Right click
}
Пример #27
0
/**
 * Constructor.
 */
QG_LayerWidget::QG_LayerWidget(QG_ActionHandler* ah, QWidget* parent,
                               const char* name, Qt::WindowFlags f)
        : QWidget(parent, f) {

    setObjectName(name);
    actionHandler = ah;
	layerList = nullptr;
    showByBlock = false;
	lastLayer = nullptr;

    layerModel = new QG_LayerModel(this);
    layerView = new QTableView(this);
    layerView->setModel(layerModel);
    layerView->setShowGrid(true);
    layerView->setSelectionMode(QAbstractItemView::SingleSelection);
    layerView->setEditTriggers(QAbstractItemView::NoEditTriggers);
    layerView->setFocusPolicy(Qt::NoFocus);
    layerView->setMinimumHeight(140);
    layerView->setColumnWidth(QG_LayerModel::VISIBLE, 24);
    layerView->setColumnWidth(QG_LayerModel::LOCKED, 24);
    layerView->setColumnWidth(QG_LayerModel::PRINT, 24);
    layerView->setColumnWidth(QG_LayerModel::CONSTRUCTION, 24);
    layerView->setColumnWidth(QG_LayerModel::COLOR_SAMPLE, 24);
    layerView->verticalHeader()->hide();
    layerView->horizontalHeader()->setStretchLastSection(true);
    layerView->horizontalHeader()->hide();

	QVBoxLayout* lay = new QVBoxLayout(this);
    lay->setContentsMargins(2, 2, 2, 2);

	QHBoxLayout* layButtons = new QHBoxLayout;
    QToolButton* but;
    const QSize minButSize(28,28);
    // show all layer:
    but = new QToolButton(this);
    but->setIcon(QIcon(":/icons/visible.svg"));
    but->setMinimumSize(minButSize);
    but->setToolTip(tr("Show all layers"));
    connect(but, SIGNAL(clicked()),
            actionHandler, SLOT(slotLayersDefreezeAll()));
    layButtons->addWidget(but);
    // hide all layer:
    but = new QToolButton(this);
    but->setIcon(QIcon(":/icons/invisible.svg"));
    but->setMinimumSize(minButSize);
    but->setToolTip(tr("Hide all layers"));
    connect(but, SIGNAL(clicked()),
            actionHandler, SLOT(slotLayersFreezeAll()));
    layButtons->addWidget(but);
    // add layer:
    but = new QToolButton(this);
    but->setIcon(QIcon(":/icons/add.svg"));
    but->setMinimumSize(minButSize);
    but->setToolTip(tr("Add a layer"));
    connect(but, SIGNAL(clicked()),
            actionHandler, SLOT(slotLayersAdd()));
    layButtons->addWidget(but);
    // remove layer:
    but = new QToolButton(this);
    but->setIcon(QIcon(":/icons/remove.svg"));
    but->setMinimumSize(minButSize);
    but->setToolTip(tr("Remove the current layer"));
    connect(but, SIGNAL(clicked()),
            actionHandler, SLOT(slotLayersRemove()));
    layButtons->addWidget(but);
    // rename layer:
    but = new QToolButton(this);
    but->setIcon(QIcon(":/icons/rename_active_block.svg"));
    but->setMinimumSize(minButSize);
    but->setToolTip(tr("Modify layer attributes / rename"));
    connect(but, SIGNAL(clicked()),
            actionHandler, SLOT(slotLayersEdit()));
    layButtons->addWidget(but);

    // lineEdit to filter layer list with RegEx
    matchLayerName = new QLineEdit(this);
    matchLayerName->setReadOnly(false);
    //matchLayerName->setText("*");
    matchLayerName->setToolTip(tr("Looking for matching layer names"));
    connect(matchLayerName, SIGNAL( textChanged(QString) ), this, SLOT( slotUpdateLayerList() ) );

    //lay->addWidget(caption);
    lay->addWidget(matchLayerName);
    lay->addLayout(layButtons);
    lay->addWidget(layerView);
	this->setLayout(lay);

    connect(layerView, SIGNAL(pressed(QModelIndex)), this, SLOT(slotActivated(QModelIndex)));
}
Пример #28
0
  // populate the groups
  groupsCombo->addItem( "" );
  populateGroups();
  QStringList groups = style->smartgroupNames();
  Q_FOREACH ( const QString& group, groups )
  {
    groupsCombo->addItem( group, QVariant( "smart" ) );
  }

  QStandardItemModel* model = new QStandardItemModel( viewSymbols );
  viewSymbols->setModel( model );
  connect( viewSymbols->selectionModel(), SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ), this, SLOT( setSymbolFromStyle( const QModelIndex & ) ) );

  connect( mStyle, SIGNAL( symbolSaved( QString, QgsSymbolV2* ) ), this, SLOT( symbolAddedToStyle( QString, QgsSymbolV2* ) ) );
  connect( openStyleManagerButton, SIGNAL( pressed() ), this, SLOT( openStyleManager() ) );

  lblSymbolName->setText( "" );
  populateSymbolView();

  if ( mSymbol )
  {
    updateSymbolInfo();
  }

  // select correct page in stacked widget
  // there's a correspondence between symbol type number and page numbering => exploit it!
  stackedWidget->setCurrentIndex( symbol->type() );
  connect( btnColor, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( setSymbolColor( const QColor& ) ) );
  connect( spinAngle, SIGNAL( valueChanged( double ) ), this, SLOT( setMarkerAngle( double ) ) );
  connect( spinSize, SIGNAL( valueChanged( double ) ), this, SLOT( setMarkerSize( double ) ) );
Пример #29
0
//#include <QDebug>
Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);

    QTextCodec *utfcodec = QTextCodec::codecForName("UTF-8"); //qt4
    QTextCodec::setCodecForTr(utfcodec);
    QTextCodec::setCodecForCStrings(utfcodec);

    filePath =qApp->applicationDirPath();

    myWeb = new QWebView;

    timerDec.setInterval(350);
    timerInc.setInterval(350);

    ui->vltWeb->addWidget(myWeb);
    ui->splitter->setStretchFactor(0,0);
    ui->splitter->setStretchFactor(1,3);

    connect(ui->pbBack, SIGNAL(clicked()), myWeb, SLOT(back()));
    connect(ui->pbForward, SIGNAL(clicked()), myWeb,SLOT(forward()));

    connect(ui->pbFontDec, SIGNAL(clicked()), this, SLOT(zoomDec()));
    connect(ui->pbFontInc, SIGNAL(clicked()), this, SLOT(zoomInc()));
    connect(ui->pbFontNorm, SIGNAL(clicked()), this, SLOT(zoomNorm()));

    connect(ui->pbFontDec, SIGNAL(pressed()), &timerDec, SLOT(start()));
    connect(ui->pbFontInc, SIGNAL(pressed()), &timerInc, SLOT(start()));

    connect(ui->pbFontDec,SIGNAL(released()), &timerDec, SLOT(stop()));
    connect(ui->pbFontInc,SIGNAL(released()), &timerInc, SLOT(stop()));

    connect(&timerDec,SIGNAL(timeout()), this, SLOT(zoomDec()));
    connect(&timerInc, SIGNAL(timeout()), this, SLOT(zoomInc()));

    connect(myWeb, SIGNAL(loadProgress(int)), ui->pbrLoad , SLOT(setValue(int)));
    connect(myWeb, SIGNAL(loadFinished(bool)), SLOT(slotFinished(bool)));
    connect(myWeb, SIGNAL(loadStarted()), this, SLOT(startLoad()));
//    connect(myWeb, SIGNAL(linkClicked(QUrl)), this, SLOT(newUrl(QUrl)));
//tmp windows gmn    connect(myWeb, SIGNAL(urlChanged(QUrl)), SLOT(newUrl(QUrl)));

   // myWeb->load(QUrl("http://img0.liveinternet.ru/images/attach/c/5//3970/3970473_sprite198.swf"));//http://img0.liveinternet.ru/images/attach/c/5//3970/3970473_sprite198.swf
    myWeb->load(QUrl(filePath+"/html/sniffer_index.html"));

//    qDebug()<<filePath;

//    connect(myWeb,SIGNAL(titleChanged(QString)), ui->widget, SLOT(setWindowTitle(QString)));
//    myWeb->load(QUrl(filePath+"/html2/ddd.html"));
    ui->treeWidget->setSortingEnabled(0);


    QTreeWidgetItem *myItem = new QTreeWidgetItem(ui->treeWidget);
    myItem->setText(0, "EMBEE Radio Sniffer");//zmist

    QTreeWidgetItem *vstup = new QTreeWidgetItem(myItem);
    vstup->setText(0, "Введение");


    QTreeWidgetItem *vykor = new QTreeWidgetItem(myItem);
    vykor->setText(0, "Использование");

    QTreeWidgetItem *vykorNast = new QTreeWidgetItem(vykor);
    vykorNast->setText(0, "Настройка соединения");

    QTreeWidgetItem *vykorNtty = new QTreeWidgetItem(vykorNast);
    vykorNtty->setText(0, "Настройка последовательного порта");

    QTreeWidgetItem *vykorNhayes = new QTreeWidgetItem(vykorNast);
    vykorNhayes->setText(0, "Настройка соединения через Hayes-модем");

    QTreeWidgetItem *vykorNeth = new QTreeWidgetItem(vykorNast);
    vykorNeth->setText(0, "Настройка соединения через Ethernet");

    QTreeWidgetItem *vykorParam = new QTreeWidgetItem(vykor);
    vykorParam->setText(0, "Конфигурация основных параметров");

    QTreeWidgetItem *vykorParamO = new QTreeWidgetItem(vykorParam);
    vykorParamO->setText(0, "Описание параметров");

    QTreeWidgetItem *vykorParamR = new QTreeWidgetItem(vykorParam);
    vykorParamR->setText(0, "Режимы");

    QTreeWidgetItem *vykorTerm = new QTreeWidgetItem(vykor);
    vykorTerm->setText(0, "Встроенный терминал");

    QTreeWidgetItem *vykorCom = new QTreeWidgetItem(myItem);
    vykorCom->setText(0, "Command Reference");

    QTreeWidgetItem *vykorComF = new QTreeWidgetItem(vykorCom);
    vykorComF->setText(0, "The File Menu");

    QTreeWidgetItem *vykorComV = new QTreeWidgetItem(vykorCom);
    vykorComV->setText(0, "The View Menu");

    QTreeWidgetItem *vykorComA = new QTreeWidgetItem(vykorCom);
    vykorComA->setText(0, "The Advanced Menu");

    QTreeWidgetItem *vykorComSw = new QTreeWidgetItem(vykorCom);
    vykorComSw->setText(0, "The Switch Menu");

    QTreeWidgetItem *vykorComSet = new QTreeWidgetItem(vykorCom);
    vykorComSet->setText(0, "The Settings Menu");

    QTreeWidgetItem *vykorComH = new QTreeWidgetItem(vykorCom);
    vykorComH->setText(0, "The Help Menu");

    ui->treeWidget->setItemExpanded(myItem, true);
    ui->treeWidget->setItemExpanded(vykor, true);
    ui->treeWidget->setItemExpanded(vykorNast, true);
    ui->treeWidget->setItemExpanded(vykorParam, true);
    ui->treeWidget->setItemExpanded(vykorCom, true);

    ui->pbFontNorm->setToolTip(tr("x1"));
    QTimer::singleShot(50, this, SLOT(zoomChanged()));
  /*  QTreeWidgetItem *vykor = new QTreeWidgetItem(myItem);
    vykor->setText(0, "Использование");*/
    loadSettings();

}
Пример #30
0
void MainDeb::createConnections() {
    QObject::connect(ui->buttonNext,SIGNAL(pressed()),slidingStacked,SLOT(slideInNext()));
    QObject::connect(ui->buttonPrev,SIGNAL(pressed()),slidingStacked,SLOT(slideInPrev()));
    QObject::connect(ui->comboBox,SIGNAL(currentIndexChanged(int)),slidingStacked,SLOT(slideInIdx(int)));
    QObject::connect(ui->checkVertical,SIGNAL(clicked(bool)),slidingStacked,SLOT(setVerticalMode(bool)));
}