コード例 #1
0
UISettingsPage::UISettingsPage(QWidget *parent)
  : QWidget(parent)
{
  chatFontSizeList = new QComboBox;
  chatFontSizeList->setEditable(false);
  chatFontSizeList->addItem("Default");
  chatFontSizeList->addItem("10");
  chatFontSizeList->addItem("12");
  chatFontSizeList->addItem("14");
  chatFontSizeList->addItem("16");
  chatFontSizeList->addItem("18");
  chatFontSizeList->addItem("20");
  chatFontSizeList->addItem("22");
  chatFontSizeList->addItem("24");
  chatFontSizeList->addItem("26");
  chatFontSizeList->addItem("28");
  chatFontSizeList->addItem("32");
  chatFontSizeList->addItem("36");
  chatFontSizeList->addItem("40");
  chatFontSizeList->addItem("44");
  chatFontSizeList->addItem("48");
  chatFontSizeList->addItem("54");
  chatFontSizeList->addItem("60");

  QFormLayout *formLayout = new QFormLayout;
  formLayout->setSpacing(5);
  formLayout->setContentsMargins(2, 2, 2, 2);
  formLayout->addRow(tr("Chat &font size:"), chatFontSizeList);
  setLayout(formLayout);
}
コード例 #2
0
CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc) : m_buildConfiguration(0)
{
    QFormLayout *fl = new QFormLayout(this);
    fl->setContentsMargins(20, -1, 0, -1);
    fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    setLayout(fl);

    QPushButton *runCmakeButton = new QPushButton(tr("Run CMake..."));
    connect(runCmakeButton, SIGNAL(clicked()),
            this, SLOT(runCMake()));
    fl->addRow(tr("Reconfigure project:"), runCmakeButton);

    m_pathLineEdit = new QLineEdit(this);
    m_pathLineEdit->setReadOnly(true);

    QHBoxLayout *hbox = new QHBoxLayout();
    hbox->addWidget(m_pathLineEdit);

    m_changeButton = new QPushButton(this);
    m_changeButton->setText(tr("&Change"));
    connect(m_changeButton, SIGNAL(clicked()), this, SLOT(openChangeBuildDirectoryDialog()));
    hbox->addWidget(m_changeButton);

    fl->addRow(tr("Build directory:"), hbox);

    m_buildConfiguration = bc;
    m_pathLineEdit->setText(m_buildConfiguration->rawBuildDirectory().toString());
    if (m_buildConfiguration->buildDirectory() == bc->target()->project()->projectDirectory())
        m_changeButton->setEnabled(false);
    else
        m_changeButton->setEnabled(true);

    setDisplayName(tr("CMake"));
}
コード例 #3
0
AutotoolsBuildSettingsWidget::AutotoolsBuildSettingsWidget(AutotoolsTarget *target) :
    m_target(target),
    m_pathChooser(0),
    m_toolChainChooser(0),
    m_buildConfiguration(0)
{
    QFormLayout *fl = new QFormLayout(this);
    fl->setContentsMargins(0, 0, 0, 0);
    fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);

    m_pathChooser = new Utils::PathChooser(this);
    m_pathChooser->setEnabled(true);
    m_pathChooser->setExpectedKind(Utils::PathChooser::Directory);
    m_pathChooser->setBaseDirectory(m_target->autotoolsProject()->projectDirectory());
    fl->addRow(tr("Build directory:"), m_pathChooser);
    connect(m_pathChooser, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged()));

    // tool chain
    m_toolChainChooser = new QComboBox;
    m_toolChainChooser->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    updateToolChainList();

    fl->addRow(tr("Tool chain:"), m_toolChainChooser);
    connect(m_toolChainChooser, SIGNAL(activated(int)), this, SLOT(toolChainSelected(int)));
    connect(m_target->autotoolsProject(), SIGNAL(toolChainChanged(ProjectExplorer::ToolChain*)),
            this, SLOT(toolChainChanged(ProjectExplorer::ToolChain*)));
    connect(ProjectExplorer::ToolChainManager::instance(), SIGNAL(toolChainAdded(ProjectExplorer::ToolChain*)),
            this, SLOT(updateToolChainList()));
    connect(ProjectExplorer::ToolChainManager::instance(), SIGNAL(toolChainRemoved(ProjectExplorer::ToolChain*)),
            this, SLOT(updateToolChainList()));
}
コード例 #4
0
DialWindow::DialWindow(MainWindow *mainWindow) :
    GcWindow(mainWindow), mainWindow(mainWindow), average(1), isNewLap(false)
{
    rolling.resize(150); // enough for 30 seconds at 5hz

    setContentsMargins(0,0,0,0);
    setInstanceName("Dial");

    QWidget *c = new QWidget;
    QVBoxLayout *cl = new QVBoxLayout(c);
    setControls(c);

    // setup the controls
    QFormLayout *controlsLayout = new QFormLayout();
    controlsLayout->setSpacing(0);
    controlsLayout->setContentsMargins(5,5,5,5);
    cl->addLayout(controlsLayout);

    // data series selection
    QLabel *seriesLabel = new QLabel(tr("Data Series"), this);
    seriesLabel->setAutoFillBackground(true);
    seriesSelector = new QComboBox(this);
    foreach (RealtimeData::DataSeries x, RealtimeData::listDataSeries()) {
        seriesSelector->addItem(RealtimeData::seriesName(x), static_cast<int>(x));
    }
コード例 #5
0
TimelineWidget::TimelineWidget(QWidget *parent) :
    QWidget(parent)
{
    this->setWindowTitle("Timeline");
    this->setWindowIcon(QIcon(":/resources/icons/resources/timeline.png"));

    QFormLayout* propertiesLayout = new QFormLayout(this);
    propertiesLayout->setContentsMargins(2, 2, 2, 2);

    QHBoxLayout* nameLayout = new QHBoxLayout();
    QLabel* nameLabel = new QLabel("Name: ", this);
    QLineEdit* nameEdit = new QLineEdit("tml_0", this);
    nameLayout->addWidget(nameLabel);
    nameLayout->addWidget(nameEdit);
    propertiesLayout->addItem(nameLayout);

    editButton = new QPushButton("Edit", this);
    propertiesLayout->addWidget(editButton);

    QGridLayout* momButtonsLayout = new QGridLayout();
    addButton = new QPushButton("Add", this);
    momButtonsLayout->addWidget(addButton, 0, 0);
    changeButton = new QPushButton("Change", this);
    momButtonsLayout->addWidget(changeButton, 0, 1);
    deleteButton = new QPushButton("Delete", this);
    momButtonsLayout->addWidget(deleteButton, 1, 0);
    duplicateButton = new QPushButton("Duplicate", this);
    momButtonsLayout->addWidget(duplicateButton, 1, 1);
    shiftButton = new QPushButton("Shift", this);
    momButtonsLayout->addWidget(shiftButton, 2, 0);
    mergeButton = new QPushButton("Merge", this);
    momButtonsLayout->addWidget(mergeButton, 2, 1);
    propertiesLayout->addItem(momButtonsLayout);

    clearButton = new QPushButton("Clear", this);
    propertiesLayout->addWidget(clearButton);
    infoButton = new QPushButton("Information", this);
    infoButton->setIcon(QIcon(":/resources/icons/resources/info.png"));
    propertiesLayout->addWidget(infoButton);
    saveButton = new QPushButton("Save", this);
    saveButton->setIcon(QIcon(":/icons/actions/accept.png"));
    propertiesLayout->addWidget(saveButton);

    QTreeWidget* momentsTree = new QTreeWidget(this);
    momentsTree->setHeaderLabel("Moments");

    QSplitter* horizontalSplitter = new QSplitter();
    QWidget* propertiesWidget = new QWidget(this, Qt::WindowTitleHint);
    propertiesWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    propertiesWidget->setLayout(propertiesLayout);
    horizontalSplitter->addWidget(propertiesWidget);
    horizontalSplitter->addWidget(momentsTree);

    QVBoxLayout* timelineLayout = new QVBoxLayout();
    timelineLayout->setContentsMargins(2, 2, 2, 2);
    timelineLayout->addWidget(horizontalSplitter);

    this->setLayout(timelineLayout);
}
コード例 #6
0
ファイル: DebugDialog.cpp プロジェクト: uiii/GeconPC
    DebugDialog::DebugDialog(QWidget *parent) :
        QDialog(parent),
        ui_(new Ui::DebugDialog)
    {
        ui_->setupUi(this);

        motionTimeout_ = new QSpinBox;
        minimalGestureSide_ = new QSpinBox;
        minimalMotionSize_ = new QSpinBox;
        maximalSameGestureDistance_ = new QSpinBox;
        minimalObjectSizeFraction_ = new QSpinBox;
        yRange_ = new QSpinBox;
        cbRange_ = new QSpinBox;
        crRange_ = new QSpinBox;
        mouseMotionBufferSize_ = new QSpinBox;
        sleepTime_ = new QSpinBox;

        motionTimeout_->setMaximum(10000);
        minimalGestureSide_->setMaximum(10000);
        minimalMotionSize_->setMaximum(10000);
        maximalSameGestureDistance_->setMaximum(10000);
        minimalObjectSizeFraction_->setMaximum(10000);
        yRange_->setMaximum(10000);
        cbRange_->setMaximum(10000);
        crRange_->setMaximum(10000);
        mouseMotionBufferSize_->setMaximum(10000);
        sleepTime_->setMaximum(10000);

        QFormLayout* layout = new QFormLayout(ui_->configVariables);
        layout->setContentsMargins(0, 0, 0, 0);
        layout->addRow(tr("motionTimeout"),motionTimeout_);
        layout->addRow(tr("minimalGestureSide"),minimalGestureSide_);
        layout->addRow(tr("minimalMotionSize"),minimalMotionSize_);
        layout->addRow(tr("maximalSameGestureDistance"),maximalSameGestureDistance_);
        layout->addRow(tr("minimalObjectSizeFraction"),minimalObjectSizeFraction_);
        layout->addRow(tr("Y range"),yRange_);
        layout->addRow(tr("CB range"),cbRange_);
        layout->addRow(tr("CR range"),crRange_);
        layout->addRow(tr("mouse motion buffer size"),mouseMotionBufferSize_);
        layout->addRow(tr("sleep time"), sleepTime_);

        motionTimeout_->setValue(ControlInfo::MotionGestureChecker::MOTION_TIMEOUT);
        minimalGestureSide_->setValue(ControlInfo::MotionGestureChecker::MINIMAL_GESTURE_SIDE_FRACTION);
        minimalMotionSize_->setValue(ControlInfo::MotionGestureChecker::NOT_MOTION_TOLERANCE_FRACTION);
        maximalSameGestureDistance_->setValue(ControlInfo::MotionGestureChecker::MAXIMAL_SAME_GESTURE_DISTANCE);
        minimalObjectSizeFraction_->setValue(ColorObjectPolicy::MINIMAL_OBJECT_SIZE_FRACTION);
        yRange_->setValue(ControlInfo::Objects::Y_RANGE);
        cbRange_->setValue(ControlInfo::Objects::CB_RANGE);
        crRange_->setValue(ControlInfo::Objects::CR_RANGE);
        mouseMotionBufferSize_->setValue(MouseMotionActionSettings::BUFFER_SIZE);
        sleepTime_->setValue(ControlInfo::Control::SLEEP_TIME);

        connect(ui_->buttonBox, SIGNAL(accepted()), this, SLOT(apply()));
    }
コード例 #7
0
AutotoolsBuildSettingsWidget::AutotoolsBuildSettingsWidget() :
    m_buildConfiguration(0)
{
    QFormLayout *fl = new QFormLayout(this);
    fl->setContentsMargins(0, 0, 0, 0);
    fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);

    m_pathChooser = new Utils::PathChooser(this);
    m_pathChooser->setEnabled(true);
    m_pathChooser->setExpectedKind(Utils::PathChooser::Directory);
    fl->addRow(tr("Build directory:"), m_pathChooser);
    connect(m_pathChooser, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged()));
}
コード例 #8
0
timer_condition_widget::timer_condition_widget(QWidget* parent, timer_condition* cond)
: QWidget(parent)
, cond_(cond)
{
    QFormLayout* l = new QFormLayout(this);
    l->setContentsMargins(0, 0, 0, 0);
    spin_ = new QSpinBox(this);
    spin_->setMinimum(100);
    spin_->setMaximum(100000);
    spin_->setSuffix(tr(" msec"));
    spin_->setSingleStep(100);
    l->addRow(tr("Interval"), spin_);
    spin_->setValue(cond->interval());
    connect(spin_, SIGNAL(valueChanged(int)), SLOT(spin_changed(int)));
}
コード例 #9
0
void DataViewer_GameObject::_CreatePiece_GameObject()
{
	QFormLayout* form = new QFormLayout();
	form->setSpacing( 3 );
	form->setContentsMargins( 0, 0, 3, 0 );

	QWidget* savable = _CreateWidget_Bool();
	QObject::connect( static_cast<QCheckBox*>(savable), &QCheckBox::clicked, this, &DataViewer_GameObject::A_GameObject_2 );
	form->addRow( "Savable", savable );

	QWidget* name = _CreateWidget_String();
	QObject::connect( static_cast<QLineEdit*>(name), &QLineEdit::textChanged, this, &DataViewer_GameObject::A_GameObject_1 );
	form->addRow( "Name", name );

	QWidget* uniqueIndex = _CreateWidget_Int();
	static_cast<QLineEdit*>( uniqueIndex )->setReadOnly( true );
	form->addRow( "Unique Index", uniqueIndex );


	QHBoxLayout* boxLayout = new QHBoxLayout();
	boxLayout->setAlignment( Qt::AlignLeft );

	QCheckBox* titleCheck = new QCheckBox();
	QObject::connect( titleCheck, &QCheckBox::clicked, this, &DataViewer_GameObject::A_GameObject_2 );
	boxLayout->addWidget( titleCheck );

	QLabel* titleLabel = new QLabel( "GameObject" );
	titleLabel->setObjectName( "Style_Title" );
	boxLayout->addWidget( titleLabel );


	QWidget* titleWidget = new QWidget( _qtTree );
	titleWidget->setLayout( boxLayout );

	QWidget* dataWidget = new QWidget( _qtTree );
	dataWidget->setLayout( form );

	_CreatePiece( titleWidget, dataWidget );


	_dataGameObject.titleWidget = titleWidget;
	_dataGameObject.dataWidget = dataWidget;
	_dataGameObject.enable = titleCheck;
	_dataGameObject.name = name;
	_dataGameObject.uniqueIndex = uniqueIndex;
	_dataGameObject.savable = savable;
}
コード例 #10
0
PortAudioSettingsPage::PortAudioSettingsPage(QWidget *parent)
  : QWidget(parent)
{
  inputDeviceList = new QComboBox;
  inputDeviceList->setEditable(false);
  connect(inputDeviceList, SIGNAL(currentIndexChanged(int)),
          this, SLOT(deviceIndexChanged(int)));

  unmuteLocalChannelsBox = new QCheckBox(tr("Play back my audio"));
  unmuteLocalChannelsBox->setToolTip(tr("Disable if you play an acoustic instrument"));

  outputDeviceList = new QComboBox;
  outputDeviceList->setEditable(false);
  connect(outputDeviceList, SIGNAL(currentIndexChanged(int)),
          this, SLOT(deviceIndexChanged(int)));

  sampleRateList = new QComboBox;
  sampleRateList->setEditable(false);
  connect(sampleRateList, SIGNAL(currentIndexChanged(int)),
          this, SLOT(sampleRateIndexChanged(int)));

  latencyList = new QComboBox();

  hostAPIList = new QComboBox;
  hostAPIList->setEditable(false);
  connect(hostAPIList, SIGNAL(currentIndexChanged(int)),
          this, SLOT(hostAPIIndexChanged(int)));

  QVBoxLayout *vlayout = new QVBoxLayout;
  QFormLayout *formLayout = new QFormLayout;
  formLayout->setSpacing(5);
  formLayout->setContentsMargins(2, 2, 2, 2);
  formLayout->addRow(tr("&Input device:"), inputDeviceList);
  formLayout->addRow(new QLabel, unmuteLocalChannelsBox);
  formLayout->addRow(tr("&Output device:"), outputDeviceList);
  formLayout->addRow(new QLabel); /* just a spacer */
  formLayout->addRow(tr("Sample &rate (Hz):"), sampleRateList);
  formLayout->addRow(tr("&Latency (ms):"), latencyList);
  formLayout->addRow(new QLabel); /* just a spacer */
  formLayout->addRow(new QLabel(tr("<b>Troubleshooting:</b> If you experience audio problems, try selecting another audio system.")));
  formLayout->addRow(tr("Audio &system:"), hostAPIList);
  vlayout->addLayout(formLayout);
  setLayout(vlayout);

  populateHostAPIList();
  autoselectHostAPI();
}
コード例 #11
0
RideSummaryWindow::RideSummaryWindow(MainWindow *mainWindow, bool ridesummary) :
     GcChartWindow(mainWindow), mainWindow(mainWindow), ridesummary(ridesummary), useCustom(false), useToToday(false)
{
    setInstanceName("Ride Summary Window");
    setRideItem(NULL);

    // allow user to select date range if in summary mode
    dateSetting = new DateSettingsEdit(this);
    if (ridesummary) {

        setControls(NULL);
        dateSetting->hide(); // not needed, but holds property values

    } else {

        QWidget *c = new QWidget;
        c->setContentsMargins(0,0,0,0);
        QFormLayout *cl = new QFormLayout(c);
        cl->setContentsMargins(0,0,0,0);
        cl->setSpacing(0);
        setControls(c);

        cl->addRow(new QLabel(tr("Date range")), dateSetting);
    }

    QVBoxLayout *vlayout = new QVBoxLayout;
    vlayout->setSpacing(0);
    vlayout->setContentsMargins(10,10,10,10);
    rideSummary = new QWebView(this);
    rideSummary->setContentsMargins(0,0,0,0);
    rideSummary->page()->view()->setContentsMargins(0,0,0,0);
    rideSummary->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    rideSummary->setAcceptDrops(false);

    QFont defaultFont; // mainwindow sets up the defaults.. we need to apply
    rideSummary->settings()->setFontSize(QWebSettings::DefaultFontSize, defaultFont.pointSize()+1);
    rideSummary->settings()->setFontFamily(QWebSettings::StandardFont, defaultFont.family());

    vlayout->addWidget(rideSummary);

    if (ridesummary) {

        connect(this, SIGNAL(rideItemChanged(RideItem*)), this, SLOT(rideItemChanged()));
        connect(mainWindow, SIGNAL(zonesChanged()), this, SLOT(refresh()));
        connect(mainWindow, SIGNAL(intervalsChanged()), this, SLOT(refresh()));

    } else {
コード例 #12
0
ファイル: MetadataDialog.cpp プロジェクト: kaniini/hyne
void MetadataDialog::build()
{
	HelpWidget *help = new HelpWidget(32, tr("Pour être placées dans le Cloud, "
											 "les sauvegardes doivent être signées. "
											 "Ces signatures sont écrites dans un fichier "
											 "nommé metadata.xml, normalement situé "
											 "dans le même dossier que vos sauvegardes.\n"
											 "Pour trouver votre numéro d'utilisateur, "
											 "regardez le nom du dossier où se trouve vos sauvegardes. "
											 "Si vous ne voyez pas, essayez en laissant le champ vide.\n"
											 "Par défaut Hyne tente de signer les sauvegardes "
											 "automatiquement, mais en cas d'erreur, vous pouvez "
											 "essayer de le faire manuellement ici."));

	_path = new QLineEdit(this);
	_pathButton = new QPushButton(tr("Parcourir..."), this);

	QHBoxLayout *pathLayout = new QHBoxLayout;
	pathLayout->addWidget(_path);
	pathLayout->addWidget(_pathButton);
	pathLayout->setContentsMargins(QMargins());

	_userID = new QLineEdit(this);

	QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
													   Qt::Horizontal, this);

	connect(buttonBox, SIGNAL(accepted()), SLOT(accept()));
	connect(buttonBox, SIGNAL(rejected()), SLOT(reject()));

	_formWidget = new QWidget(this);

	QFormLayout *formLayout = new QFormLayout(_formWidget);
	formLayout->addRow(tr("metadata.xml"), pathLayout);
	formLayout->addRow(tr("Numéro d'utilisateur"), _userID);
	formLayout->setContentsMargins(QMargins());

	QVBoxLayout *layout = new QVBoxLayout(this);
	layout->addWidget(help);
	layout->addWidget(_formWidget);
	layout->addStretch();
	layout->addWidget(buttonBox);

	connect(_pathButton, SIGNAL(clicked()), SLOT(setMetadataPath()));
}
コード例 #13
0
GenericBuildSettingsWidget::GenericBuildSettingsWidget(GenericBuildConfiguration *bc)
    : m_buildConfiguration(0)
{
    QFormLayout *fl = new QFormLayout(this);
    fl->setContentsMargins(0, -1, 0, -1);
    fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);

    // build directory
    m_pathChooser = new Utils::PathChooser(this);
    m_pathChooser->setEnabled(true);
    fl->addRow(tr("Build directory:"), m_pathChooser);
    connect(m_pathChooser, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged()));

    m_buildConfiguration = bc;
    m_pathChooser->setBaseDirectory(bc->target()->project()->projectDirectory());
    m_pathChooser->setPath(m_buildConfiguration->rawBuildDirectory());
    setDisplayName(tr("Generic Manager"));
}
コード例 #14
0
	void resize(int nb)
	{
		if (nb == -1)
			nb = list_traits::size(m_value);
		int prevNb = m_propertyWidgets.size();

		if (m_formLayout && nb == prevNb)
			return; // No need to recreate the same widgets

		bool visible = m_scrollArea->isVisible();
		m_scrollArea->setVisible(false);
		m_propertyWidgets.clear();

		list_traits::resize(m_value, nb);
			
		auto scrollAreaWidget = new QWidget;
		m_formLayout = new QFormLayout;
		m_formLayout->setContentsMargins(3, 3, 3, 3);

		auto name = m_property->name();
		const auto& metaProperties = m_propertyValue->metaContainer().properties();

		for (int i = 0; i < nb; ++i)
		{
			auto& value = list_traits::value(m_value, i);
			auto prop = property::createRefProperty(name, value);
			auto propValue = prop->value<base_type>();
			auto& metaContainer = propValue->metaContainer();
			for (auto& metaProp : metaProperties)
				metaContainer.addExisting(metaProp);

			std::shared_ptr<BasePropertyWidget> propWidget = m_widgetCreator->create(prop, scrollAreaWidget);
			propWidget->setParent(m_parent);
			m_propertyWidgets.push_back(propWidget);
			m_formLayout->addRow(QString::number(i), propWidget->createWidgets());
		}

		scrollAreaWidget->setLayout(m_formLayout);
		m_scrollArea->setWidget(scrollAreaWidget);
		if (visible)
			m_scrollArea->setVisible(true);
	}
コード例 #15
0
void AddFacilityForm::_setupLayout()
{
    _xAxisBox           = new QLineEdit();
    _yAxisBox           = new QLineEdit();
    _facilityNameBox    = new QLineEdit();
    _areas		= new QComboBox();

    _errorMessage	= new QLabel();
    _errorMessage->setStyleSheet("QLabel { color : red; }");

    _submitButton       = new QPushButton("Submit");
    _cancelButton       = new QPushButton("Cancel");

    _submitButton->setFixedWidth(125);
    _cancelButton->setFixedWidth(125);

    QStringList areas;
    for (int i = 0; i < Convenience::NUM_AREAS; ++i)
    {
	areas << Convenience::areaIDtoQString(i);
    }
    _areas->addItems(areas);

    connect(_submitButton, SIGNAL(clicked()), SLOT(_submitClicked()));
    connect(_cancelButton, SIGNAL(clicked()), SLOT(_cancelClicked()));

    QFormLayout* q = new QFormLayout();
    q->setContentsMargins(15, 10, 15, 10);
    q->setVerticalSpacing(15);
    q->addRow("Name", _facilityNameBox);
    q->addRow("Area", _areas);
    q->addRow("X-Axis", _xAxisBox);
    q->addRow("Y-Axis", _yAxisBox);
    q->addRow(_errorMessage);
    q->addRow("", _submitButton);
    q->addRow("", _cancelButton);
    setLayout(q);
}
コード例 #16
0
AutotoolsBuildSettingsWidget::AutotoolsBuildSettingsWidget(AutotoolsBuildConfiguration *bc) :
    m_buildConfiguration(bc)
{
    QFormLayout *fl = new QFormLayout(this);
    fl->setContentsMargins(0, 0, 0, 0);
    fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);

    m_pathChooser = new Utils::PathChooser(this);
    m_pathChooser->setEnabled(true);
    m_pathChooser->setExpectedKind(Utils::PathChooser::Directory);
    m_pathChooser->setBaseFileName(bc->target()->project()->projectDirectory());
    m_pathChooser->setEnvironment(bc->environment());
    m_pathChooser->setHistoryCompleter(QLatin1String("AutoTools.BuildDir.History"));
    fl->addRow(tr("Build directory:"), m_pathChooser);
    connect(m_pathChooser, &Utils::PathChooser::changed,
            this, &AutotoolsBuildSettingsWidget::buildDirectoryChanged);

    m_pathChooser->setBaseFileName(bc->target()->project()->projectDirectory());
    m_pathChooser->setPath(m_buildConfiguration->rawBuildDirectory().toString());
    setDisplayName(tr("Autotools Manager"));

    connect(bc, SIGNAL(environmentChanged()), this, SLOT(environmentHasChanged()));
}
コード例 #17
0
PortMidiSettingsPage::PortMidiSettingsPage(QWidget *parent)
  : QWidget(parent)
{
  inputDeviceList = new QComboBox;
  inputDeviceList->setEditable(false);
  inputDeviceList->addItem(""); /* no MIDI input */

  outputDeviceList = new QComboBox;
  outputDeviceList->setEditable(false);
  outputDeviceList->addItem(""); /* no MIDI output */

  sendMidiBeatClockBox = new QCheckBox(tr("Send tempo to external apps and devices"));
  sendMidiBeatClockBox->setToolTip(tr("Enable MIDI beat clock"));

  QFormLayout *formLayout = new QFormLayout;
  formLayout->setSpacing(5);
  formLayout->setContentsMargins(2, 2, 2, 2);
  formLayout->addRow(tr("&Input device:"), inputDeviceList);
  formLayout->addRow(tr("&Output device:"), outputDeviceList);
  formLayout->addRow(new QLabel, sendMidiBeatClockBox);
  setLayout(formLayout);

  populateDeviceLists();
}
コード例 #18
0
void DataViewer_GameObject::_CreatePiece_Light( Light* light )
{
	QFormLayout* form = new QFormLayout();
	form->setSpacing( 3 );
	form->setContentsMargins( 0, 0, 3, 0 );


	QLineEdit* xWidget;
	QLineEdit* yWidget;
	QLineEdit* zWidget;

	QStringList typeNames;
	for (auto& kv : EnumConvertor::s2e_LightType)
	{
		typeNames << kv.first.ToChar();
	}
	QWidget* type = _CreateWidget_Choice( typeNames );
	QObject::connect( static_cast<QComboBox*>(type), &QComboBox::currentTextChanged, 
						this, &DataViewer_GameObject::A_Light_1 );
	form->addRow( "Type", type );

	QWidget* color = _CreateWidget_Vector3();
	xWidget = static_cast<QLineEdit*>( color->layout()->itemAt(1)->widget() );
	yWidget = static_cast<QLineEdit*>( color->layout()->itemAt(3)->widget() );
	zWidget = static_cast<QLineEdit*>( color->layout()->itemAt(5)->widget() );
	QObject::connect( xWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Light_1 );
	QObject::connect( yWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Light_1 );
	QObject::connect( zWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Light_1 );
	form->addRow( "Color", color );

	QWidget* intensity = _CreateWidget_Float();
	QObject::connect( static_cast<QLineEdit*>(intensity), &QLineEdit::textChanged, 
						this, &DataViewer_GameObject::A_Light_1 );
	form->addRow( "Intensity", intensity );

	QWidget* range = _CreateWidget_Float();
	QObject::connect( static_cast<QLineEdit*>(range), &QLineEdit::textChanged, 
						this, &DataViewer_GameObject::A_Light_1 );
	form->addRow( "Range", range );

	QWidget* spotAngle = _CreateWidget_Float();
	QObject::connect( static_cast<QLineEdit*>(spotAngle), &QLineEdit::textChanged, 
						this, &DataViewer_GameObject::A_Light_1 );
	form->addRow( "Spot Angle", spotAngle );

	QWidget* castShadows = _CreateWidget_Bool();
	QObject::connect( static_cast<QCheckBox*>(castShadows), &QCheckBox::clicked, 
						this, &DataViewer_GameObject::A_Light_2 );
	form->addRow( "Cast Shadows", castShadows );


	QCheckBox* titleCheck = new QCheckBox();
	QObject::connect( titleCheck, &QCheckBox::clicked, this, &DataViewer_GameObject::A_Light_2 );

	QLabel* titleLabel = new QLabel( "Light" );
	titleLabel->setObjectName( "Style_Title" );

	QWidget* emptySpace = new QWidget();
	emptySpace->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );

	QtRemoveButton* removeButton = new QtRemoveButton();
	removeButton->setText( "x" );
	removeButton->setMinimumSize( 20, 18 );
	removeButton->setMaximumSize( 20, 18 );
	removeButton->component = light;
	QObject::connect( removeButton, &QPushButton::clicked, removeButton, &QtRemoveButton::A_Onlick );

	QHBoxLayout* boxLayout = new QHBoxLayout();
	boxLayout->setAlignment( Qt::AlignLeft );
	boxLayout->addWidget( titleCheck );
	boxLayout->addWidget( titleLabel );
	boxLayout->addWidget( emptySpace );
	boxLayout->addWidget( removeButton );


	QWidget* titleWidget = new QWidget( _qtTree );
	titleWidget->setLayout( boxLayout );

	QWidget* dataWidget = new QWidget( _qtTree );
	dataWidget->setLayout( form );

	_CreatePiece( titleWidget, dataWidget );

	_dataLight.titleWidget = titleWidget;
	_dataLight.dataWidget = dataWidget;
	_dataLight.enable = titleCheck;
	_dataLight.type = type;
	_dataLight.color = color;
	_dataLight.intensity = intensity;
	_dataLight.range = range;
	_dataLight.spotAngle = spotAngle;
	_dataLight.castShadows = castShadows;
}
コード例 #19
0
ファイル: TimeUtils.cpp プロジェクト: ClaFio/GoldenCheetah
DateSettingsEdit::DateSettingsEdit(QWidget *parent) : parent(parent), active(false)
{
    setContentsMargins(0,0,0,0);
    QFormLayout *mainLayout = new QFormLayout(this);
    mainLayout->setContentsMargins(0,0,0,0);
    mainLayout->setSpacing(5);

    QFont sameFont;
#ifdef Q_OS_MAC
    sameFont.setPointSize(sameFont.pointSize() + 2);
#endif

    radioSelected = new QRadioButton(tr("Current selection"), this);
    radioSelected->setChecked(true);
    radioSelected->setFont(sameFont);
    QHBoxLayout *selected = new QHBoxLayout; // use same layout mechanism as custom so they align
    selected->addWidget(radioSelected);
    selected->addStretch();
    mainLayout->addRow(selected);

    radioToday = new QRadioButton(tr("Current selection thru today"), this);
    radioToday->setChecked(false);
    radioToday->setFont(sameFont);
    QHBoxLayout *today = new QHBoxLayout; // use same layout mechanism as custom so they align
    today->addWidget(radioToday);
    today->addStretch();
    mainLayout->addRow(today);

    radioFrom = new QRadioButton(tr("From"), this);
    radioFrom->setChecked(false);
    radioFrom->setFont(sameFont);
    startDateEdit = new QDateEdit(this);
    startDateEdit->setDate(QDate::currentDate().addMonths(-3));
    QHBoxLayout *from = new QHBoxLayout;
    from->addWidget(radioFrom);
    from->addWidget(startDateEdit);
    from->addWidget(new QLabel(tr("to today")));
    from->addStretch();
    mainLayout->addRow(from);

    radioCustom = new QRadioButton(tr("Between"), this);
    radioCustom->setFont(sameFont);
    radioCustom->setChecked(false);
    fromDateEdit = new QDateEdit(this);
    toDateEdit = new QDateEdit(this);
    QHBoxLayout *custom = new QHBoxLayout;
    custom->addWidget(radioCustom);
    custom->addWidget(fromDateEdit);
    custom->addWidget(new QLabel(tr("and")));
    custom->addWidget(toDateEdit);
    custom->addStretch();
    mainLayout->addRow(custom);

    radioLast = new QRadioButton(tr("Last"), this);
    radioLast->setFont(sameFont);
    radioLast->setChecked(false);
    lastn = new QDoubleSpinBox(this);
    lastn->setSingleStep(1.0);
    lastn->setDecimals(0);
    lastn->setMinimum(0);
    lastn->setMaximum(999);
    lastn->setValue(7);
    lastnx = new QComboBox(this);
    lastnx->addItem(tr("days"));
    lastnx->addItem(tr("weeks"));
    lastnx->addItem(tr("months"));
    lastnx->addItem(tr("years"));
    lastnx->setCurrentIndex(0);
    QHBoxLayout *last = new QHBoxLayout;
    last->addWidget(radioLast);
    last->addWidget(lastn);
    last->addWidget(lastnx);
    last->addStretch();
    mainLayout->addRow(last);

    radioThis = new QRadioButton(tr("This"), this);
    radioThis->setFont(sameFont);
    radioThis->setChecked(false);
    thisperiod = new QComboBox(this);
    thisperiod->addItem(tr("week"));
    thisperiod->addItem(tr("month"));
    thisperiod->addItem(tr("year"));
    thisperiod->setCurrentIndex(0);
    prevperiod = new QDoubleSpinBox(this);
    prevperiod->setSingleStep(1.0);
    prevperiod->setDecimals(0);
    prevperiod->setMinimum(0);
    prevperiod->setMaximum(999);
    prevperiod->setValue(0);
    QHBoxLayout *thisl = new QHBoxLayout;
    thisl->addWidget(radioThis);
    thisl->addWidget(thisperiod);
    thisl->addWidget(new QLabel(tr("prior")));
    thisl->addWidget(prevperiod);
    thisl->addStretch();
    mainLayout->addRow(thisl);

    // switched between one or other
    connect(radioSelected, SIGNAL(toggled(bool)), this, SLOT(setDateSettings()));
    connect(radioToday, SIGNAL(toggled(bool)), this, SLOT(setDateSettings()));
    connect(radioCustom, SIGNAL(toggled(bool)), this, SLOT(setDateSettings()));
    connect(radioLast, SIGNAL(toggled(bool)), this, SLOT(setDateSettings()));
    connect(radioFrom, SIGNAL(toggled(bool)), this, SLOT(setDateSettings()));
    connect(radioThis, SIGNAL(toggled(bool)), this, SLOT(setDateSettings()));
    connect(fromDateEdit, SIGNAL(editingFinished()), this, SLOT(setDateSettings()));
    connect(toDateEdit, SIGNAL(editingFinished()), this, SLOT(setDateSettings()));
    connect(startDateEdit, SIGNAL(editingFinished()), this, SLOT(setDateSettings()));
    connect(lastn, SIGNAL(editingFinished()), this, SLOT(setDateSettings()));
    connect(lastnx, SIGNAL(currentIndexChanged(int)), this, SLOT(setDateSettings()));
    connect(thisperiod, SIGNAL(currentIndexChanged(int)), this, SLOT(setDateSettings()));
    connect(prevperiod, SIGNAL(editingFinished()), this, SLOT(setDateSettings()));
}
コード例 #20
0
void VPropertyFormWidget::build()
{
    // Clear the old content, delete old widgets
    d_ptr->EditorWidgets.clear();
    if (layout())
    {
        QLayoutItem *child;
        while (layout()->count() > 0 && (child = layout()->takeAt(0)) != 0)
        {
            if (child->widget())
            {
                delete child->widget();
            }
            delete child;
        }
        delete layout();
    }

    // Create new content
    if (d_ptr->Properties.isEmpty())
    {
        return; //... only if there are properties
    }

    QFormLayout* tmpFormLayout = new QFormLayout(this);
    setLayout(tmpFormLayout);

    for (int i = 0; i < d_ptr->Properties.count(); ++i)
    {
        // Get the current property
        VProperty* tmpProperty = d_ptr->Properties.value(i, nullptr);
        if (!tmpProperty)
        {
            continue;
        }

        if (tmpProperty->getRowCount() > 0)
        {
            if (tmpProperty->propertyType() == Property::Complex)
            {
                buildEditor(tmpProperty, tmpFormLayout, Property::Complex);
                QWidget *group = new QWidget(this);
                tmpFormLayout->addRow(group);

                QFormLayout* subFormLayout = new QFormLayout(group);
                QMargins margins = subFormLayout->contentsMargins();
                margins.setTop(0);
                margins.setLeft(14);
                subFormLayout->setContentsMargins(margins);

                group->setLayout(subFormLayout);
                QList<VProperty*> children = tmpProperty->getChildren();
                for (int j = 0; j < children.size(); ++j)
                {
                    buildEditor(children[j], subFormLayout);
                    connect(children[j], &VProperty::childChanged, tmpProperty, &VProperty::ValueChildChanged,
                            Qt::UniqueConnection);
                    ++i;
                    d_ptr->Properties.insert(i, children[j]);
                }
            }
            else
            {
                // Child properties, the property itself is not being added
                VPropertyFormWidget* tmpNewFormWidget = new VPropertyFormWidget(tmpProperty, this);
                tmpFormLayout->addRow(tmpNewFormWidget);
                d_ptr->EditorWidgets.append(VPropertyFormWidgetPrivate::SEditorWidget(tmpNewFormWidget));
                tmpNewFormWidget->setCommitBehaviour(d_ptr->UpdateEditors);
            }
        }
        else if (tmpProperty->type() == "widget")
        {
            VWidgetProperty* tmpWidgetProperty = static_cast<VWidgetProperty*>(tmpProperty);
            tmpFormLayout->addRow(tmpWidgetProperty->getWidget());
            d_ptr->EditorWidgets.append(VPropertyFormWidgetPrivate::SEditorWidget(tmpWidgetProperty->getWidget()));
        }
        else
        {
            buildEditor(tmpProperty, tmpFormLayout);
        }
    }
}
コード例 #21
0
AttachCoreDialog::AttachCoreDialog(QWidget *parent)
    : QDialog(parent), d(new AttachCoreDialogPrivate)
{
    setWindowTitle(tr("Load Core File"));
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

    d->kitChooser = new DebuggerKitChooser(DebuggerKitChooser::RemoteDebugging, this);
    d->kitChooser->populate();

    d->selectRemoteCoreButton = new QPushButton(tr("Browse..."), this);
    d->remoteCoreFileName = new QLineEdit(this);

    d->forceLocalCheckBox = new QCheckBox(this);
    d->forceLocalLabel = new QLabel(this);
    d->forceLocalLabel->setText(tr("Use local core file:"));
    d->forceLocalLabel->setBuddy(d->forceLocalCheckBox);

    d->localCoreFileName = new PathChooser(this);
    d->localCoreFileName->setExpectedKind(PathChooser::File);
    d->localCoreFileName->setPromptDialogTitle(tr("Select Core File"));

    d->localExecFileName = new PathChooser(this);
    d->localExecFileName->setExpectedKind(PathChooser::File);
    d->localExecFileName->setPromptDialogTitle(tr("Select Executable"));

    d->overrideStartScriptFileName = new PathChooser(this);
    d->overrideStartScriptFileName->setExpectedKind(PathChooser::File);
    d->overrideStartScriptFileName->setPromptDialogTitle(tr("Select Startup Script"));

    d->buttonBox = new QDialogButtonBox(this);
    d->buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
    d->buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
    d->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);

    QHBoxLayout *coreLayout = new QHBoxLayout;
    coreLayout->addWidget(d->localCoreFileName);
    coreLayout->addWidget(d->remoteCoreFileName);
    coreLayout->addWidget(d->selectRemoteCoreButton);

    QFormLayout *formLayout = new QFormLayout;
    formLayout->setContentsMargins(0, 0, 0, 0);
    formLayout->setHorizontalSpacing(6);
    formLayout->setVerticalSpacing(6);
    formLayout->addRow(tr("Kit:"), d->kitChooser);
    formLayout->addRow(tr("&Executable:"), d->localExecFileName);
    formLayout->addRow(d->forceLocalLabel, d->forceLocalCheckBox);
    formLayout->addRow(tr("Core file:"), coreLayout);
    formLayout->addRow(tr("Override &start script:"), d->overrideStartScriptFileName);

    QFrame *line = new QFrame(this);
    line->setFrameShape(QFrame::HLine);
    line->setFrameShadow(QFrame::Sunken);

    formLayout->addRow(d->buttonBox);

    QVBoxLayout *vboxLayout = new QVBoxLayout(this);
    vboxLayout->addLayout(formLayout);
    vboxLayout->addStretch();
    vboxLayout->addWidget(line);
    vboxLayout->addWidget(d->buttonBox);
}
コード例 #22
0
ファイル: vsearcher.cpp プロジェクト: getwindow/vnote
void VSearcher::setupUI()
{
    if (m_uiInitialized) {
        return;
    }

    m_uiInitialized = true;

    // Search button.
    m_searchBtn = new QPushButton(VIconUtils::buttonIcon(":/resources/icons/search.svg"), "", this);
    m_searchBtn->setToolTip(tr("Search"));
    m_searchBtn->setProperty("FlatBtn", true);
    connect(m_searchBtn, &QPushButton::clicked,
            this, &VSearcher::startSearch);

    // Clear button.
    m_clearBtn = new QPushButton(VIconUtils::buttonDangerIcon(":/resources/icons/clear_search.svg"), "", this);
    m_clearBtn->setToolTip(tr("Clear Results"));
    m_clearBtn->setProperty("FlatBtn", true);
    connect(m_clearBtn, &QPushButton::clicked,
            this, [this]() {
                m_results->clearResults();
            });

    // Advanced button.
    m_advBtn = new QPushButton(VIconUtils::buttonIcon(":/resources/icons/search_advanced.svg"),
                               "",
                               this);
    m_advBtn->setToolTip(tr("Advanced Settings"));
    m_advBtn->setProperty("FlatBtn", true);
    m_advBtn->setCheckable(true);
    connect(m_advBtn, &QPushButton::toggled,
            this, [this](bool p_checked) {
                m_advWidget->setVisible(p_checked);
            });

    // Console button.
    m_consoleBtn = new QPushButton(VIconUtils::buttonIcon(":/resources/icons/search_console.svg"),
                                   "",
                                   this);
    m_consoleBtn->setToolTip(tr("Console"));
    m_consoleBtn->setProperty("FlatBtn", true);
    m_consoleBtn->setCheckable(true);
    connect(m_consoleBtn, &QPushButton::toggled,
            this, [this](bool p_checked) {
                m_consoleEdit->setVisible(p_checked);
            });

    m_numLabel = new QLabel(this);

    QHBoxLayout *btnLayout = new QHBoxLayout();
    btnLayout->addWidget(m_searchBtn);
    btnLayout->addWidget(m_clearBtn);
    btnLayout->addWidget(m_advBtn);
    btnLayout->addWidget(m_consoleBtn);
    btnLayout->addStretch();
    btnLayout->addWidget(m_numLabel);
    btnLayout->setContentsMargins(0, 0, 0, 0);

    // Keyword.
    m_keywordCB = VUtils::getComboBox(this);
    m_keywordCB->setEditable(true);
    m_keywordCB->setLineEdit(new VLineEdit(this));
    m_keywordCB->setToolTip(tr("Keywords to search for"));
    m_keywordCB->lineEdit()->setPlaceholderText(tr("Supports space, &&, and ||"));
    m_keywordCB->lineEdit()->setProperty("EmbeddedEdit", true);
    connect(m_keywordCB, &QComboBox::currentTextChanged,
            this, &VSearcher::handleInputChanged);
    connect(m_keywordCB->lineEdit(), &QLineEdit::returnPressed,
            this, &VSearcher::animateSearchClick);
    m_keywordCB->completer()->setCaseSensitivity(Qt::CaseSensitive);

    // Scope.
    m_searchScopeCB = VUtils::getComboBox(this);
    m_searchScopeCB->setToolTip(tr("Scope to search"));
    connect(m_searchScopeCB, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
            this, &VSearcher::handleInputChanged);

    // Object.
    m_searchObjectCB = VUtils::getComboBox(this);
    m_searchObjectCB->setToolTip(tr("Object to search"));
    connect(m_searchObjectCB, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
            this, &VSearcher::handleInputChanged);

    // Target.
    m_searchTargetCB = VUtils::getComboBox(this);
    m_searchTargetCB->setToolTip(tr("Target to search"));
    connect(m_searchTargetCB, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
            this, &VSearcher::handleInputChanged);

    // Pattern.
    m_filePatternCB = VUtils::getComboBox(this);
    m_filePatternCB->setEditable(true);
    m_filePatternCB->setLineEdit(new VLineEdit(this));
    m_filePatternCB->setToolTip(tr("Wildcard pattern to filter the files to be searched"));
    m_filePatternCB->lineEdit()->setProperty("EmbeddedEdit", true);
    m_filePatternCB->completer()->setCaseSensitivity(Qt::CaseSensitive);

    // Engine.
    m_searchEngineCB = VUtils::getComboBox(this);
    m_searchEngineCB->setToolTip(tr("Engine to execute the search"));

    // Case sensitive.
    m_caseSensitiveCB = new QCheckBox(tr("&Case sensitive"), this);

    // Whole word only.
    m_wholeWordOnlyCB = new QCheckBox(tr("&Whole word only"), this);

    // Fuzzy search.
    m_fuzzyCB = new QCheckBox(tr("&Fuzzy search"), this);
    m_fuzzyCB->setToolTip(tr("Not available for content search"));
    connect(m_fuzzyCB, &QCheckBox::stateChanged,
            this, [this](int p_state) {
                bool checked = p_state == Qt::Checked;
                m_wholeWordOnlyCB->setEnabled(!checked);
            });

    // Regular expression.
    m_regularExpressionCB = new QCheckBox(tr("Re&gular expression"), this);
    connect(m_regularExpressionCB, &QCheckBox::stateChanged,
            this, [this](int p_state) {
                bool checked = p_state == Qt::Checked;
                m_wholeWordOnlyCB->setEnabled(!checked);
                m_fuzzyCB->setEnabled(!checked);
            });

    QFormLayout *advLayout = VUtils::getFormLayout();
    advLayout->addRow(tr("File pattern:"), m_filePatternCB);
    advLayout->addRow(tr("Engine:"), m_searchEngineCB);
    advLayout->addRow(m_caseSensitiveCB);
    advLayout->addRow(m_wholeWordOnlyCB);
    advLayout->addRow(m_fuzzyCB);
    advLayout->addRow(m_regularExpressionCB);
    advLayout->setContentsMargins(0, 0, 0, 0);

    m_advWidget = new QWidget(this);
    m_advWidget->setLayout(advLayout);
    m_advWidget->hide();

    // Progress bar.
    m_proBar = new QProgressBar(this);
    m_proBar->setRange(0, 0);

    // Cancel button.
    m_cancelBtn = new QPushButton(VIconUtils::buttonIcon(":/resources/icons/close.svg"),
                                  "",
                                  this);
    m_cancelBtn->setToolTip(tr("Cancel"));
    m_cancelBtn->setProperty("FlatBtn", true);
    connect(m_cancelBtn, &QPushButton::clicked,
            this, [this]() {
                if (m_inSearch) {
                    appendLogLine(tr("Cancelling the search..."));
                    m_askedToStop = true;
                    m_search.stop();
                }
            });

    QHBoxLayout *proLayout = new QHBoxLayout();
    proLayout->addWidget(m_proBar);
    proLayout->addWidget(m_cancelBtn);
    proLayout->setContentsMargins(0, 0, 0, 0);

    // Console.
    m_consoleEdit = new QPlainTextEdit(this);
    m_consoleEdit->setReadOnly(true);
    m_consoleEdit->setLineWrapMode(QPlainTextEdit::WidgetWidth);
    m_consoleEdit->setProperty("LineEdit", true);
    m_consoleEdit->setPlaceholderText(tr("Output logs will be shown here"));
    m_consoleEdit->setMaximumHeight(m_searchScopeCB->height() * 2);
    m_consoleEdit->hide();

    // List.
    m_results = new VSearchResultTree(this);
    m_results->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
    connect(m_results, &VSearchResultTree::countChanged,
            this, [this](int p_count) {
                m_clearBtn->setEnabled(p_count > 0);
                updateNumLabel(p_count);
            });

    QFormLayout *formLayout = VUtils::getFormLayout();
    formLayout->addRow(tr("Keywords:"), m_keywordCB);
    formLayout->addRow(tr("Scope:"), m_searchScopeCB);
    formLayout->addRow(tr("Object:"), m_searchObjectCB);
    formLayout->addRow(tr("Target:"), m_searchTargetCB);
    formLayout->setContentsMargins(0, 0, 0, 0);

    QVBoxLayout *mainLayout = new QVBoxLayout();
    mainLayout->addLayout(btnLayout);
    mainLayout->addLayout(formLayout);
    mainLayout->addWidget(m_advWidget);
    mainLayout->addLayout(proLayout);
    mainLayout->addWidget(m_consoleEdit);
    mainLayout->addWidget(m_results);
    mainLayout->setContentsMargins(3, 0, 3, 0);

    setLayout(mainLayout);
}
コード例 #23
0
void DataViewer_GameObject::_CreatePiece_Transform()
{
	QFormLayout* form = new QFormLayout();
	form->setSpacing( 3 );
	form->setContentsMargins( 0, 0, 3, 0 );


	QLineEdit* xWidget;
	QLineEdit* yWidget;
	QLineEdit* zWidget;

	QWidget* posLocal = _CreateWidget_Vector3();
	xWidget = static_cast<QLineEdit*>( posLocal->layout()->itemAt(1)->widget() );
	yWidget = static_cast<QLineEdit*>( posLocal->layout()->itemAt(3)->widget() );
	zWidget = static_cast<QLineEdit*>( posLocal->layout()->itemAt(5)->widget() );
	QObject::connect( xWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Transform_Local );
	QObject::connect( yWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Transform_Local );
	QObject::connect( zWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Transform_Local );
	form->addRow( "Position Local", posLocal );

	QWidget* posWorld = _CreateWidget_Vector3();
	xWidget = static_cast<QLineEdit*>( posWorld->layout()->itemAt(1)->widget() );
	yWidget = static_cast<QLineEdit*>( posWorld->layout()->itemAt(3)->widget() );
	zWidget = static_cast<QLineEdit*>( posWorld->layout()->itemAt(5)->widget() );
	QObject::connect( xWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Transform_World );
	QObject::connect( yWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Transform_World );
	QObject::connect( zWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Transform_World );
	form->addRow( "Position World", posWorld );

	QWidget* rotLocal = _CreateWidget_Vector3();
	xWidget = static_cast<QLineEdit*>( rotLocal->layout()->itemAt(1)->widget() );
	yWidget = static_cast<QLineEdit*>( rotLocal->layout()->itemAt(3)->widget() );
	zWidget = static_cast<QLineEdit*>( rotLocal->layout()->itemAt(5)->widget() );
	QObject::connect( xWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Transform_Local );
	QObject::connect( yWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Transform_Local );
	QObject::connect( zWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Transform_Local );
	form->addRow( "Rotation Local", rotLocal );

	QWidget* rotWorld = _CreateWidget_Vector3();
	xWidget = static_cast<QLineEdit*>( rotWorld->layout()->itemAt(1)->widget() );
	yWidget = static_cast<QLineEdit*>( rotWorld->layout()->itemAt(3)->widget() );
	zWidget = static_cast<QLineEdit*>( rotWorld->layout()->itemAt(5)->widget() );
	QObject::connect( xWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Transform_World );
	QObject::connect( yWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Transform_World );
	QObject::connect( zWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Transform_World );
	form->addRow( "Rotation World", rotWorld );

	QWidget* scaleLocal = _CreateWidget_Vector3();
	xWidget = static_cast<QLineEdit*>( scaleLocal->layout()->itemAt(1)->widget() );
	yWidget = static_cast<QLineEdit*>( scaleLocal->layout()->itemAt(3)->widget() );
	zWidget = static_cast<QLineEdit*>( scaleLocal->layout()->itemAt(5)->widget() );
	QObject::connect( xWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Transform_Local );
	QObject::connect( yWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Transform_Local );
	QObject::connect( zWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Transform_Local );
	form->addRow( "Scale Local", scaleLocal );

	QWidget* scaleWorld = _CreateWidget_Vector3();
	xWidget = static_cast<QLineEdit*>( scaleWorld->layout()->itemAt(1)->widget() );
	yWidget = static_cast<QLineEdit*>( scaleWorld->layout()->itemAt(3)->widget() );
	zWidget = static_cast<QLineEdit*>( scaleWorld->layout()->itemAt(5)->widget() );
	QObject::connect( xWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Transform_World );
	QObject::connect( yWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Transform_World );
	QObject::connect( zWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Transform_World );
	form->addRow( "Scale World", scaleWorld );


	QHBoxLayout* boxLayout = new QHBoxLayout();
	boxLayout->setAlignment( Qt::AlignLeft );

	QLabel* titleLabel = new QLabel( "Transform" );
	titleLabel->setObjectName( "Style_Title" );
	boxLayout->addWidget( titleLabel );


	QWidget* titleWidget = new QWidget( _qtTree );
	titleWidget->setLayout( boxLayout );

	QWidget* dataWidget = new QWidget( _qtTree );
	dataWidget->setLayout( form );

	_CreatePiece( titleWidget, dataWidget );


	_dataTransform.titleWidget = titleWidget;
	_dataTransform.dataWidget = dataWidget;
	_dataTransform.posLocal = posLocal;
	_dataTransform.posWorld = posWorld;
	_dataTransform.rotLocal = rotLocal;
	_dataTransform.rotWorld = rotWorld;
	_dataTransform.scaleLocal = scaleLocal;
	_dataTransform.scaleWorld = scaleWorld;
}
コード例 #24
0
void DataViewer_GameObject::_CreatePiece_MeshDrawing( MeshDrawing* meshDrawing )
{
	QFormLayout* form = new QFormLayout();
	form->setSpacing( 3 );
	form->setContentsMargins( 0, 0, 3, 0 );


	QLineEdit* textWidget;

	QWidget* material = _CreateWidget_Picking( "Material" );
	textWidget = static_cast<QLineEdit*>( material->layout()->itemAt(0)->widget() );
	QObject::connect( textWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_MeshDrawing_1 );
	form->addRow( "Material", material );

	QWidget* mesh = _CreateWidget_Picking( "Mesh" );
	textWidget = static_cast<QLineEdit*>( mesh->layout()->itemAt(0)->widget() );
	QObject::connect( textWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_MeshDrawing_1 );
	form->addRow( "Mesh", mesh );

	QWidget* castShadows = _CreateWidget_Bool();
	QObject::connect( static_cast<QCheckBox*>(castShadows), &QCheckBox::clicked, 
						this, &DataViewer_GameObject::A_MeshDrawing_2 );
	form->addRow( "Cast Shadows", castShadows );

	QWidget* receiveShadows = _CreateWidget_Bool();
	QObject::connect( static_cast<QCheckBox*>(receiveShadows), &QCheckBox::clicked, 
						this, &DataViewer_GameObject::A_MeshDrawing_2 );
	form->addRow( "Receive Shadows", receiveShadows );


	QCheckBox* titleCheck = new QCheckBox();
	QObject::connect( titleCheck, &QCheckBox::clicked, this, &DataViewer_GameObject::A_MeshDrawing_2 );

	QLabel* titleLabel = new QLabel( "MeshDrawing" );
	titleLabel->setObjectName( "Style_Title" );

	QWidget* emptySpace = new QWidget();
	emptySpace->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );

	QtRemoveButton* removeButton = new QtRemoveButton();
	removeButton->setText( "x" );
	removeButton->setMinimumSize( 20, 18 );
	removeButton->setMaximumSize( 20, 18 );
	removeButton->component = meshDrawing;
	QObject::connect( removeButton, &QPushButton::clicked, removeButton, &QtRemoveButton::A_Onlick );

	QHBoxLayout* boxLayout = new QHBoxLayout();
	boxLayout->setAlignment( Qt::AlignLeft );
	boxLayout->addWidget( titleCheck );
	boxLayout->addWidget( titleLabel );
	boxLayout->addWidget( emptySpace );
	boxLayout->addWidget( removeButton );


	QWidget* titleWidget = new QWidget( _qtTree );
	titleWidget->setLayout( boxLayout );

	QWidget* dataWidget = new QWidget( _qtTree );
	dataWidget->setLayout( form );

	_CreatePiece( titleWidget, dataWidget );


	_dataMeshDrawing.titleWidget = titleWidget;
	_dataMeshDrawing.dataWidget = dataWidget;
	_dataMeshDrawing.enable = titleCheck;
	_dataMeshDrawing.material = material;
	_dataMeshDrawing.mesh = mesh;
	_dataMeshDrawing.castShadows = castShadows;
	_dataMeshDrawing.receiveShadows = receiveShadows;
}
コード例 #25
0
ファイル: settingswindow.cpp プロジェクト: gustawho/dooscape
void SettingsWindow::genSecurity()
{
    /*QLabel *lblPhoto = new QLabel(tr("Your photo"));
    QLineEdit *editPhoto = new QLineEdit;*/

    QLabel *lblUserName = new QLabel(tr("Pseudo"));
    editUserName = new QLineEdit;

    QLabel *lblPass1 = new QLabel(tr("Password"));
    editPass1 = new QLineEdit;
    editPass1->setEchoMode(QLineEdit::Password);

    QLabel *lblPass2 = new QLabel(tr("Retype your Password"));
    lblPass2->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum);
    editPass2 = new QLineEdit;
    editPass2->setEchoMode(QLineEdit::Password);

    QLabel *lblIndice = new QLabel(tr("Indication"));
    editIndice = new QLineEdit;

    QFormLayout *layUser = new QFormLayout;
    layUser->setContentsMargins(10,10,10,10);
    layUser->setSpacing(10);
   /* layUser->addWidget(lblPhoto,0,0);
    layUser->addWidget(editPhoto,0,1);*/

    layUser->addRow(lblUserName,editUserName);
    layUser->addRow(lblPass1,editPass1);
    layUser->addRow(lblPass2,editPass2);
    layUser->addRow(lblIndice,editIndice);

   /* for(int i(0);layUser->count();i++)
        layUser->itemAt(i)->widget()->setAlignment(Qt::AlignHCenter);*/

    /*lblPhoto->setAlignment(Qt::AlignVCenter);
    editPhoto->setAlignment(Qt::AlignVCenter);*/

    QGroupBox *boxUser = new QGroupBox(tr("Account"));
    boxUser->setLayout(layUser);

    // ----------------------------

    checkLockAtStartup = new QCheckBox(tr("At Startup"));
    checkUnlockToClose = new QCheckBox(tr("Closing"));
    checkLockConfig = new QCheckBox(tr("Open Config Window"));
    checkLockLocker = new QCheckBox(tr("To Unlock"));

    QToolButton *btnCheckAll = new QToolButton;
    btnCheckAll->setIcon(QIcon(":/img/menu.png"));
    btnCheckAll->setIconSize(QSize(0,0));
    btnCheckAll->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    btnCheckAll->setText(tr("Select all"));
    btnCheckAll->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum);

    QGridLayout *layAskPass = new QGridLayout;
    layAskPass->setSpacing(10);
    layAskPass->addWidget(checkLockAtStartup);
    layAskPass->addWidget(checkUnlockToClose);
    layAskPass->addWidget(checkLockConfig);
    layAskPass->addWidget(checkLockLocker);
    layAskPass->addWidget(btnCheckAll);

    HideBlock *boxAskPass = new HideBlock(tr("Ask password"));
    boxAskPass->setBlockLayout(layAskPass);

    // --------------------------

    QWidget *spacer = new QWidget;
    spacer->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);

    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->setContentsMargins(10,10,10,10);
    mainLayout->setSpacing(10);
    mainLayout->addWidget(boxUser);
    mainLayout->addWidget(boxAskPass);
    mainLayout->addWidget(spacer);

    tabSecurity = new SettingsPanel;
    tabSecurity->setTitle(tr("Security"));
    tabSecurity->setMainLayout(mainLayout);
}
コード例 #26
0
void DataViewer_GameObject::_CreatePiece_Camera( Camera* camera )
{
	QFormLayout* form = new QFormLayout();
	form->setSpacing( 3 );
	form->setContentsMargins( 0, 0, 3, 0 );


	QLineEdit* xWidget;
	QLineEdit* yWidget;

	QStringList typeNames;
	for (auto& kv : EnumConvertor::s2e_CameraType)
	{
		typeNames << kv.first.ToChar();
	}
	QWidget* type = _CreateWidget_Choice( typeNames );
	QObject::connect( static_cast<QComboBox*>(type), &QComboBox::currentTextChanged, 
						this, &DataViewer_GameObject::A_Camera_1 );
	form->addRow( "Type", type );

	QWidget* aspectRatio = _CreateWidget_Float();
	QObject::connect( static_cast<QLineEdit*>(aspectRatio), &QLineEdit::textChanged, 
						this, &DataViewer_GameObject::A_Camera_1 );
	form->addRow( "Aspect Ratio", aspectRatio );

	QWidget* fovYAngle = _CreateWidget_Float();
	QObject::connect( static_cast<QLineEdit*>(fovYAngle), &QLineEdit::textChanged, 
						this, &DataViewer_GameObject::A_Camera_1 );
	form->addRow( "FovY Angle", fovYAngle );

	QWidget* orthoSize = _CreateWidget_Vector2();
	xWidget = static_cast<QLineEdit*>( orthoSize->layout()->itemAt(1)->widget() );
	yWidget = static_cast<QLineEdit*>( orthoSize->layout()->itemAt(3)->widget() );
	QObject::connect( xWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Camera_1 );
	QObject::connect( yWidget, &QLineEdit::textChanged, this, &DataViewer_GameObject::A_Camera_1 );
	form->addRow( "Ortho Size", orthoSize );

	QWidget* nearClipping = _CreateWidget_Float();
	QObject::connect( static_cast<QLineEdit*>(nearClipping), &QLineEdit::textChanged, 
						this, &DataViewer_GameObject::A_Camera_1 );
	form->addRow( "Near Clipping", nearClipping );

	QWidget* farClipping = _CreateWidget_Float();
	QObject::connect( static_cast<QLineEdit*>(farClipping), &QLineEdit::textChanged, 
						this, &DataViewer_GameObject::A_Camera_1 );
	form->addRow( "Far Clipping", farClipping );


	QCheckBox* titleCheck = new QCheckBox();
	QObject::connect( titleCheck, &QCheckBox::clicked, this, &DataViewer_GameObject::A_Camera_2 );

	QLabel* titleLabel = new QLabel( "Camera" );
	titleLabel->setObjectName( "Style_Title" );

	QWidget* emptySpace = new QWidget();
	emptySpace->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );

	QtRemoveButton* removeButton = new QtRemoveButton();
	removeButton->setText( "x" );
	removeButton->setMinimumSize( 20, 18 );
	removeButton->setMaximumSize( 20, 18 );
	removeButton->component = camera;
	QObject::connect( removeButton, &QPushButton::clicked, removeButton, &QtRemoveButton::A_Onlick );

	QHBoxLayout* boxLayout = new QHBoxLayout();
	boxLayout->setAlignment( Qt::AlignLeft );
	boxLayout->addWidget( titleCheck );
	boxLayout->addWidget( titleLabel );
	boxLayout->addWidget( emptySpace );
	boxLayout->addWidget( removeButton );


	QWidget* titleWidget = new QWidget( _qtTree );
	titleWidget->setLayout( boxLayout );

	QWidget* dataWidget = new QWidget( _qtTree );
	dataWidget->setLayout( form );

	_CreatePiece( titleWidget, dataWidget );


	_dataCamera.titleWidget = titleWidget;
	_dataCamera.dataWidget = dataWidget;
	_dataCamera.enable = titleCheck;
	_dataCamera.type = type;
	_dataCamera.aspectRatio = aspectRatio;
	_dataCamera.fovYAngle = fovYAngle;
	_dataCamera.orthoSize = orthoSize;
	_dataCamera.nearClipping = nearClipping;
	_dataCamera.farClipping = farClipping;
}
コード例 #27
0
QWidget*
PartitionViewStep::createSummaryWidget() const
{
    QWidget* widget = new QWidget;
    QVBoxLayout* mainLayout = new QVBoxLayout;
    widget->setLayout( mainLayout );
    mainLayout->setMargin( 0 );

    ChoicePage::Choice choice = m_choicePage->currentChoice();

    QFormLayout* formLayout = new QFormLayout( widget );
    const int MARGIN = CalamaresUtils::defaultFontHeight() / 2;
    formLayout->setContentsMargins( MARGIN, 0, MARGIN, MARGIN );
    mainLayout->addLayout( formLayout );

    QList< PartitionCoreModule::SummaryInfo > list = m_core->createSummaryInfo();
    if ( list.length() > 1 ) // There are changes on more than one disk
    {
        //NOTE: all of this should only happen when Manual partitioning is active.
        //      Any other choice should result in a list.length() == 1.
        QLabel* modeLabel = new QLabel;
        formLayout->addRow( modeLabel );
        QString modeText;
        switch ( choice )
        {
        case ChoicePage::Alongside:
            modeText = tr( "Install %1 <strong>alongside</strong> another operating system." )
                       .arg( Calamares::Branding::instance()->
                             string( Calamares::Branding::ShortVersionedName ) );
            break;
        case ChoicePage::Erase:
            modeText = tr( "<strong>Erase</strong> disk and install %1." )
                       .arg( Calamares::Branding::instance()->
                             string( Calamares::Branding::ShortVersionedName ) );
            break;
        case ChoicePage::Replace:
            modeText = tr( "<strong>Replace</strong> a partition with %1." )
                       .arg( Calamares::Branding::instance()->
                             string( Calamares::Branding::ShortVersionedName ) );
            break;
        default:
            modeText = tr( "<strong>Manual</strong> partitioning." );
        }
        modeLabel->setText( modeText );
    }
    for ( const auto& info : list )
    {
        QLabel* diskInfoLabel = new QLabel;
        if ( list.length() == 1 ) // this is the only disk preview
        {
            QString modeText;
            switch ( choice )
            {
            case ChoicePage::Alongside:
                modeText = tr( "Install %1 <strong>alongside</strong> another operating system on disk <strong>%2</strong> (%3)." )
                           .arg( Calamares::Branding::instance()->
                                 string( Calamares::Branding::ShortVersionedName ) )
                           .arg( info.deviceNode )
                           .arg( info.deviceName );
                break;
            case ChoicePage::Erase:
                modeText = tr( "<strong>Erase</strong> disk <strong>%2</strong> (%3) and install %1." )
                           .arg( Calamares::Branding::instance()->
                                 string( Calamares::Branding::ShortVersionedName ) )
                           .arg( info.deviceNode )
                           .arg( info.deviceName );
                break;
            case ChoicePage::Replace:
                modeText = tr( "<strong>Replace</strong> a partition on disk <strong>%2</strong> (%3) with %1." )
                           .arg( Calamares::Branding::instance()->
                                 string( Calamares::Branding::ShortVersionedName ) )
                           .arg( info.deviceNode )
                           .arg( info.deviceName );
                break;
            default:
                modeText = tr( "<strong>Manual</strong> partitioning on disk <strong>%1</strong> (%2)." )
                           .arg( info.deviceNode )
                           .arg( info.deviceName );
            }
            diskInfoLabel->setText( modeText );
        }
        else // multiple disk previews!
        {
            diskInfoLabel->setText( tr( "Disk <strong>%1</strong> (%2)" )
                                        .arg( info.deviceNode )
                                        .arg( info.deviceName ) );
        }
        formLayout->addRow( diskInfoLabel );

        PartitionBarsView* preview;
        PartitionLabelsView* previewLabels;
        QVBoxLayout* field;

        preview = new PartitionBarsView;
        previewLabels = new PartitionLabelsView;
        preview->setModel( info.partitionModelBefore );
        previewLabels->setModel( info.partitionModelBefore );
        info.partitionModelBefore->setParent( widget );
        field = new QVBoxLayout;
        CalamaresUtils::unmarginLayout( field );
        field->setSpacing( 6 );
        field->addWidget( preview );
        field->addWidget( previewLabels );
        formLayout->addRow( tr( "Current state:" ), field );

        preview = new PartitionBarsView;
        previewLabels = new PartitionLabelsView;
        preview->setModel( info.partitionModelAfter );
        previewLabels->setModel( info.partitionModelAfter );
        info.partitionModelAfter->setParent( widget );
        field = new QVBoxLayout;
        CalamaresUtils::unmarginLayout( field );
        field->setSpacing( 6 );
        field->addWidget( preview );
        field->addWidget( previewLabels );
        formLayout->addRow( tr( "Your changes:" ), field );
    }
    QStringList jobsLines;
    foreach ( const Calamares::job_ptr& job, jobs() )
    {
        if ( !job->prettyDescription().isEmpty() )
        jobsLines.append( job->prettyDescription() );
    }
    if ( !jobsLines.isEmpty() )
    {
        QLabel* jobsLabel = new QLabel( widget );
        mainLayout->addWidget( jobsLabel );
        jobsLabel->setText( jobsLines.join( "<br/>" ) );
        int m = CalamaresUtils::defaultFontHeight() / 2;
        jobsLabel->setMargin( CalamaresUtils::defaultFontHeight() / 2 );
        QPalette pal;
        pal.setColor( QPalette::Background, pal.background().color().lighter( 108 ) );
        jobsLabel->setAutoFillBackground( true );
        jobsLabel->setPalette( pal );
    }
    return widget;
}