QFormLayout* RenderSettingsWindow::create_form_layout()
{
    QFormLayout* layout = new QFormLayout();
    layout->setLabelAlignment(Qt::AlignRight);
    layout->setSpacing(10);
    return layout;
}
dmz::V8Value
dmz::JsModuleUiV8QtBasic::_form_layout_spacing (const v8::Arguments &Args) {

   v8::HandleScope scope;
   V8Value result = v8::Undefined ();

   JsModuleUiV8QtBasic *self = _to_self (Args);
   if (self) {

      QFormLayout *form = self->v8_to_qobject<QFormLayout> (Args.This ());
      if (form) {

         if (Args.Length () == 0) {

            result = v8::Number::New (form->spacing ());
         }
         else if (Args.Length () == 1) {

            form->setSpacing (v8_to_int32 (Args[0]));
         }
      }
   }

   return scope.Close (result);
}
Example #3
0
VisualContextDecoration::VisualContextDecoration(const QString& commandLine, VisualContext* parent, VisualContext* context)
  : QFrame(parent),
    button(new QPushButton(Icons::getInstance().ICON_GRAY, "", this)),
    header(new QLabel(commandLine)),
    visualContext(context),
    parentContext(parent)
{
  setAutoFillBackground(true);
  QPalette p = palette();
  p.setColor(QPalette::Background, p.color(QPalette::AlternateBase));
  setPalette(p);
  QFormLayout* layout = new QFormLayout();
  layout->setSpacing(3);
  header->setFrameStyle(QFrame::Box);
  layout->addRow(button, header);
  button->setMaximumWidth(25);
  button->setFlat(true);
  button->setCheckable(true);
  button->setChecked(true);
  layout->addRow(visualContext);
  setLayout(layout);

  connect(visualContext, SIGNAL(statusChanged(bool)), this, SLOT(updateStatus(bool)));
  connect(visualContext, SIGNAL(sCanceled()), this, SLOT(canceled()));
}
Example #4
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);
}
Example #5
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));
    }
void QmitkMultiLabelSegmentationPreferencePage::CreateQtControl(QWidget* parent)
{
  m_Initializing = true;
  berry::IPreferencesService* prefService
    = berry::Platform::GetPreferencesService();

  m_SegmentationPreferencesNode = prefService->GetSystemPreferences()->Node("/org.mitk.views.multilabelsegmentation");

  m_MainControl = new QWidget(parent);

  QVBoxLayout* displayOptionsLayout = new QVBoxLayout;
  m_RadioOutline = new QRadioButton( "Draw as outline", m_MainControl);
  displayOptionsLayout->addWidget( m_RadioOutline );
  m_RadioOverlay = new QRadioButton( "Draw as transparent overlay", m_MainControl);
  displayOptionsLayout->addWidget( m_RadioOverlay );

  QFormLayout *formLayout = new QFormLayout;
  formLayout->setHorizontalSpacing(8);
  formLayout->setVerticalSpacing(24);
  formLayout->addRow( "2D display", displayOptionsLayout );

  m_VolumeRenderingCheckBox = new QCheckBox( "Show as volume rendering", m_MainControl );
  formLayout->addRow( "3D display", m_VolumeRenderingCheckBox );
  connect( m_VolumeRenderingCheckBox, SIGNAL(stateChanged(int)), this, SLOT(OnVolumeRenderingCheckboxChecked(int)) );

  QFormLayout* surfaceLayout = new QFormLayout;
  surfaceLayout->setSpacing(8);

  m_SmoothingSpinBox = new QDoubleSpinBox(m_MainControl);
  m_SmoothingSpinBox->setMinimum(0.0);
  m_SmoothingSpinBox->setSingleStep(0.5);
  m_SmoothingSpinBox->setValue(0.1);
  m_SmoothingSpinBox->setToolTip("The Smoothing value is used as Sigma for a gaussian blur.");
  surfaceLayout->addRow("Smoothing value (mm)", m_SmoothingSpinBox);

  m_DecimationSpinBox = new QDoubleSpinBox(m_MainControl);
  m_DecimationSpinBox->setMinimum(0.0);
  m_DecimationSpinBox->setMaximum(0.99);
  m_DecimationSpinBox->setSingleStep(0.1);
  m_DecimationSpinBox->setValue(0.5);
  m_DecimationSpinBox->setToolTip("Valid range is [0, 1). High values increase decimation, especially when very close to 1. A value of 0 disables decimation.");
  surfaceLayout->addRow("Decimation rate", m_DecimationSpinBox);

  m_SelectionModeCheckBox = new QCheckBox("Enable auto-selection mode", m_MainControl);
  m_SelectionModeCheckBox->setToolTip("If checked the segmentation plugin ensures that only one segmentation and the according greyvalue image are visible at one time.");
  formLayout->addRow("Data node selection mode",m_SelectionModeCheckBox);

  formLayout->addRow("Smoothed surface creation", surfaceLayout);

  m_MainControl->setLayout(formLayout);
  this->Update();
  m_Initializing = false;
}
Example #7
0
void AlarmView::init()
{
    /* Create stuff! */
    QFormLayout *mainL = new QFormLayout();
    mainL->setSpacing(2);
    mainL->setMargin(2);

    mAlarmList = new QWrapListView();
    mAlarmList->setSelectionMode(QListView::SingleSelection);
    mAlarmList->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    //mAlarmList->setUniformItemSizes(true);
    mAlarmList->setAlternatingRowColors(true);
    mAlarmList->setItemDelegate(new TwoLevelDelegate(mAlarmList));
    mAlarmList->setResizeMode(QListView::Adjust);
    mAlarmList->setLayoutMode(QListView::Batched);
    QSizePolicy expando(QSizePolicy::Expanding, QSizePolicy::Expanding);
    expando.setVerticalStretch(1);
    mAlarmList->setSizePolicy(expando);

    mainL->addRow(mAlarmList);

    mSnoozeButton = new QPushButton(tr("Snooze"));
    mainL->addRow(mSnoozeButton);

    mSnoozeChoices = new QComboBox();

    mSnoozeChoices->clear();
    mSnoozeChoices->addItem(tr("5 minutes"));
    mSnoozeChoices->addItem(tr("10 minutes"));
    mSnoozeChoices->addItem(tr("15 minutes"));
    mSnoozeChoices->addItem(tr("30 minutes"));
    mSnoozeChoices->addItem(tr("1 hour"));
    mSnoozeChoices->addItem(tr("1 day"));
    mSnoozeChoices->addItem(tr("1 week"));
    mSnoozeChoices->addItem(tr("1 month"));

    mainL->addRow(tr("Snooze delay:"), mSnoozeChoices);
    setLayout(mainL);

    mStandardModel = new QStandardItemModel(this);
    mAlarmList->setModel(mStandardModel);
    connect(mAlarmList->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
            this, SLOT(currentAlarmChanged(QModelIndex)));
    connect(mAlarmList, SIGNAL(activated(QModelIndex)), this, SLOT(alarmSelected(QModelIndex)));

    connect(mSnoozeButton, SIGNAL(clicked()), this, SLOT(snoozeClicked()));
}
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();
}
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 {
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;
}
Example #11
0
DocDetailsPage::DocDetailsPage( QWidget *parent )
  :mCustomerLabel( 0 )
{
  QVBoxLayout *vbox = new QVBoxLayout;
  parent->setLayout( vbox );

  vbox->setSpacing( KDialog::spacingHint() );
  vbox->setMargin( KDialog::marginHint() );

  QLabel *help = new QLabel;
  help->setTextFormat( Qt::RichText );
  help->setText( i18n( "Select a document type and a date. A comment on the whiteboard "
                       "helps to classify the document." ) );
  vbox->addWidget( help );

  mCustomerLabel = new QLabel;
  mCustomerLabel->setFrameStyle( QFrame::Box + QFrame::Sunken );
  mCustomerLabel->setTextFormat( Qt::RichText );
  mCustomerLabel->setMargin( KDialog::marginHint() );
  mCustomerLabel->setText( i18n( "Customer: Not yet selected!" ) );
  vbox->addWidget( mCustomerLabel );

  QFormLayout *grid = new QFormLayout;
  grid->setSpacing( KDialog::marginHint() );
  vbox->addLayout( grid );

//   QLabel *l = new QLabel( i18n( "Some Document Details: " ), vbox );
//  l->setMargin( KDialog::marginHint() );

  mTypeCombo = new KComboBox;
  mTypeCombo->insertItems( 0, DocType::allLocalised() );
  mTypeCombo->setCurrentIndex( mTypeCombo->findText( DefaultProvider::self()->docType() ));
  grid->addRow( i18n("Document &Type:"), mTypeCombo );

  mDateEdit = new KDateWidget;
  mDateEdit->setDate( QDate::currentDate() );
  grid->addRow( i18n( "Document Date: " ), mDateEdit );

  mWhiteboardEdit = new KTextEdit;
  grid->addRow( i18n( "Whiteboard Content:" ), mWhiteboardEdit );

  vbox->addStretch( 1 );


}
Example #12
0
void ConfigureDlg::layoutWindow()
{
    QSettings settings;

    setModal(true);

    QVBoxLayout *centralLayout = new QVBoxLayout(this);
    centralLayout->setSpacing(20);
    centralLayout->setContentsMargins(11, 11, 11, 11);

    QFormLayout *formLayout = new QFormLayout();
    formLayout->setSpacing(16);
    formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);

    settings.beginGroup(RTMQTTCLIENT_PARAMS_GROUP);
    m_brokerAddress = new QLineEdit();
    m_brokerAddress->setText(settings.value(RTMQTTCLIENT_PARAMS_BROKERADDRESS).toString());
    m_brokerAddress->setToolTip("The MQTT broker address (e.g. tcp://localhost:1883");
    m_brokerAddress->setMinimumWidth(200);
    formLayout->addRow(tr("MQTT broker address:"), m_brokerAddress);

    m_clientID = new QLineEdit();
    m_clientID->setText(settings.value(RTMQTTCLIENT_PARAMS_CLIENTID).toString());
    m_clientID->setToolTip("The client ID is used to sign on to the NQTT broker");
    m_clientID->setMinimumWidth(200);
    formLayout->addRow(tr("MQTT client ID:"), m_clientID);

    m_clientSecret = new QLineEdit();
    m_clientSecret->setText(settings.value(RTMQTTCLIENT_PARAMS_CLIENTSECRET).toString());
    m_clientSecret->setToolTip("The client secret may be used to sign on to the NQTT broker");
    m_clientSecret->setMinimumWidth(200);
    m_clientSecret->setEchoMode(QLineEdit::Password);
    formLayout->addRow(tr("MQTT client secret:"), m_clientSecret);

    settings.endGroup();

    centralLayout->addLayout(formLayout);

    m_buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
    m_buttons->setCenterButtons(true);

    centralLayout->addWidget(m_buttons);
}
Example #13
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();
}
FilterOptionsDialog::FilterOptionsDialog(QWidget *parent, int FilterType)
                   : KDialog(parent)
{
    setCaption(i18n("Filter Options"));
    setModal(true);
    showButtonSeparator(true);
    setButtons(Ok | Cancel);
    setDefaultButton(Ok);
    QWidget* box       = new QWidget(this);
    QFormLayout *layout = new QFormLayout(box);
    layout->setSpacing(spacingHint());
    layout->setMargin(0);
    setMainWidget(box);

    if (FilterType == 0)
    { // Add noise
        m_noiseType = new KComboBox(false, box);
        m_noiseType->addItem(i18nc("image noise type", "Uniform"));
        m_noiseType->addItem(i18nc("image noise type", "Gaussian"));
        m_noiseType->addItem(i18nc("image noise type", "Multiplicative"));
        m_noiseType->addItem(i18nc("image noise type", "Impulse"));
        m_noiseType->addItem(i18nc("image noise type", "Laplacian"));
        m_noiseType->addItem(i18nc("image noise type", "Poisson"));
        m_noiseType->setWhatsThis(i18n("Select here the algorithm method which will used "
                                       "to add random noise to the images."));
        layout->addRow(i18n("Noise algorithm:"), m_noiseType);
    }
    else if (FilterType == 2)
    { // Blur
        m_blurRadius = new KIntNumInput(3, box);
        initInput(m_blurRadius, 0, 20, i18n("px"));
        m_blurRadius->setWhatsThis(i18n("Select here the blur radius of the Gaussian, "
                                        "not counting the center pixel. For reasonable results, the "
                                        "radius should be larger than deviation. If you use a radius of 0 "
                                        "the blur operation selects a suitable radius."));
        layout->addRow(i18n("Radius:"), m_blurRadius);

        m_blurDeviation = new KIntNumInput(1, box);
        initInput(m_blurDeviation, 0, 20, i18n("px"));
        m_blurDeviation->setWhatsThis(i18n("Select here the standard deviation of the blur Gaussian."));
        layout->addRow(i18n("Deviation:"), m_blurDeviation);
    }
    else if (FilterType == 5)
    { // Median
        m_medianRadius = new KIntNumInput(3, box);
        initInput(m_medianRadius, 0, 20, i18n("px"));
        m_medianRadius->setWhatsThis(i18n("Select here the median radius of the pixel neighborhood. "
                                          "The algorithm applies a digital filter that improves the quality "
                                          "of noisy images. Each pixel is replaced by the median in a "
                                          "set of neighboring pixels as defined by the radius."));
        layout->addRow(i18n("Radius:"), m_medianRadius);
    }
    else if (FilterType == 6)
    { // Noise reduction
        m_noiseRadius = new KIntNumInput(3, box);
        initInput(m_noiseRadius, 0, 20, i18n("px"));
        m_noiseRadius->setWhatsThis(i18n("Select here the noise reduction radius value. "
                                         "The algorithm smooths the contours of an image while still "
                                         "preserving edge information. The algorithm works by replacing "
                                         "each pixel with its neighbor closest in value. A neighbor is "
                                         "defined by the radius. If you use a radius of 0 the algorithm "
                                         "selects a suitable radius."));
        layout->addRow(i18n("Radius:"), m_noiseRadius);
    }
    else if (FilterType == 7)
    { // Sharpen
        m_sharpenRadius = new KIntNumInput(3, box);
        initInput(m_sharpenRadius, 0, 20, i18n("px"));
        m_sharpenRadius->setWhatsThis(i18n("Select here the radius of the sharpen Gaussian, "
                                           "not counting the center pixel. For reasonable "
                                           "results, the radius should be larger than deviation. "
                                           "If you use a radius of 0 the sharpen operation selects a "
                                           "suitable radius."));
        layout->addRow(i18n("Radius:"), m_sharpenRadius);

        m_sharpenDeviation = new KIntNumInput(1, box);
        initInput(m_sharpenDeviation, 0, 20, i18n("px"));
        m_sharpenDeviation->setWhatsThis(i18n("Select here the sharpen deviation value of the "
                                              "Laplacian."));
        layout->addRow(i18n("Deviation:"), m_sharpenDeviation);
    }
    else if (FilterType == 8)
    { // Unsharp
        m_unsharpenRadius = new KIntNumInput(3, box);
        initInput(m_unsharpenRadius, 0, 20, i18n("px"));
        m_unsharpenRadius->setWhatsThis(i18n("Select here the radius of the unsharpen Gaussian, "
                                             "not counting the center pixel. The algorithm "
                                             "convolve the image with a Gaussian operator of the given "
                                             "radius and standard deviation. For reasonable results, "
                                             "radius should be larger than sigma. If you use a radius of 0 "
                                             "the algorithm selects a suitable radius."));
        layout->addRow(i18n("Radius:"), m_unsharpenRadius);

        m_unsharpenDeviation = new KIntNumInput(1, box);
        initInput(m_unsharpenDeviation, 0, 20, i18n("px"));
        m_unsharpenDeviation->setWhatsThis(i18n("Select here the unsharpen deviation value of the "
                                                "Gaussian."));
        layout->addRow(i18n("Deviation:"), m_unsharpenDeviation);

        m_unsharpenPercent = new KIntNumInput(100, box);
        initInput(m_unsharpenPercent, 1, 200, i18n("%"));
        m_unsharpenPercent->setWhatsThis(i18n("Select here the percentage difference between original "
                                              "and blurred image which should be added to original."));
        layout->addRow(i18n("Amount:"), m_unsharpenPercent);

        m_unsharpenThreshold = new KIntNumInput(5, box);
        initInput(m_unsharpenThreshold, 1, 100, i18n("%"));
        m_unsharpenThreshold->setWhatsThis(i18n("Select here the unsharpen threshold value, "
                                                "as a percentage of the maximum color component value, "
                                                "needed to apply the difference amount."));
        layout->addRow(i18n("Threshold:"), m_unsharpenThreshold);
    }
}
Example #15
0
void ConfigureDlg::layoutWindow()
{
    QSettings settings;

    setModal(true);

    QVBoxLayout *centralLayout = new QVBoxLayout(this);
    centralLayout->setSpacing(20);
    centralLayout->setContentsMargins(11, 11, 11, 11);

    QFormLayout *formLayout = new QFormLayout();
    formLayout->setSpacing(16);
    formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);

    m_brokerAddress = new QLineEdit();
    m_brokerAddress->setText(settings.value(RTAUTOMATION_PARAMS_BROKERADDRESS).toString());
    m_brokerAddress->setToolTip("The MQTT broker address (e.g. tcp://localhost:1883");
    m_brokerAddress->setMinimumWidth(200);
    formLayout->addRow(tr("MQTT broker address:"), m_brokerAddress);

    m_clientID = new QLineEdit();
    m_clientID->setText(settings.value(RTAUTOMATION_PARAMS_CLIENTID).toString());
    m_clientID->setToolTip("The client ID is used to sign on to the NQTT broker");
    m_clientID->setMinimumWidth(200);
    formLayout->addRow(tr("MQTT client ID:"), m_clientID);

    m_clientSecret = new QLineEdit();
    m_clientSecret->setText(settings.value(RTAUTOMATION_PARAMS_CLIENTSECRET).toString());
    m_clientSecret->setToolTip("The client secret may be used to sign on to the NQTT broker");
    m_clientSecret->setMinimumWidth(200);
    m_clientSecret->setEchoMode(QLineEdit::Password);
    formLayout->addRow(tr("MQTT client secret:"), m_clientSecret);

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

    m_automationServerID = new QLineEdit();
    m_automationServerID->setText(settings.value(RTAUTOMATION_PARAMS_SERVERID).toString());
    m_automationServerID->setToolTip("The device ID of the automation server");
    m_automationServerID->setMinimumWidth(200);
    formLayout->addRow(tr("Automation server ID:"), m_automationServerID);

    settings.beginGroup(RTAUTOMATION_PARAMS_TOPICGROUP);

    m_statusTopic = new QLineEdit();
    m_statusTopic->setText(settings.value(RTAUTOMATION_PARAMS_STATUSTOPIC).toString());
    m_statusTopic->setToolTip("The topic to suscribe for status updates (e.g. status)");
    m_statusTopic->setMinimumWidth(200);
    formLayout->addRow(tr("Status topic (sub):"), m_statusTopic);

    m_controlTopic = new QLineEdit();
    m_controlTopic->setText(settings.value(RTAUTOMATION_PARAMS_CONTROLTOPIC).toString());
    m_controlTopic->setToolTip("The topic to publish for control operations (e.g. control)");
    m_controlTopic->setMinimumWidth(200);
    formLayout->addRow(tr("Control topic (pub):"), m_controlTopic);

    settings.endGroup();

    centralLayout->addLayout(formLayout);

    m_buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
    m_buttons->setCenterButtons(true);

    centralLayout->addWidget(m_buttons);
}
Example #16
0
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()));
}
SVNCommitDialog::SVNCommitDialog(QWidget *parent, const QString &workingDir,
                                 const QStringList &files, bool folderOnly,
                                 int sceneIconAdded)
    : Dialog(TApp::instance()->getMainWindow(), true, false)
    , m_commitSceneContentsCheckBox(0)
    , m_workingDir(workingDir)
    , m_files(files)
    , m_folderOnly(folderOnly)
    , m_targetTempFile(0)
    , m_selectionCheckBox(0)
    , m_selectionLabel(0)
    , m_sceneIconAdded(sceneIconAdded)
    , m_folderAdded(0) {
  setModal(false);
  setAttribute(Qt::WA_DeleteOnClose, true);
  setWindowTitle(tr("Version Control: Put changes"));

  if (m_folderOnly)
    setMinimumSize(320, 320);
  else
    setMinimumSize(300, 180);

  QWidget *container = new QWidget;

  QVBoxLayout *mainLayout = new QVBoxLayout;
  mainLayout->setAlignment(Qt::AlignHCenter);
  mainLayout->setMargin(0);

  m_treeWidget = new QTreeWidget;
  m_treeWidget->header()->hide();
  m_treeWidget->hide();

  if (m_folderOnly) {
    m_treeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
    m_treeWidget->setIconSize(QSize(21, 17));
  }
  m_treeWidget->setStyleSheet("QTreeWidget { border: 1px solid gray; }");

  if (m_folderOnly) {
    mainLayout->addWidget(m_treeWidget);

    QHBoxLayout *belowTreeLayout = new QHBoxLayout;
    belowTreeLayout->setMargin(0);

    m_selectionCheckBox = new QCheckBox(tr("Select / Deselect All"), 0);
    connect(m_selectionCheckBox, SIGNAL(clicked(bool)), this,
            SLOT(onSelectionCheckBoxClicked(bool)));

    m_selectionLabel = new QLabel;
    m_selectionLabel->setText(tr("0 Selected / 0 Total"));

    m_selectionCheckBox->hide();
    m_selectionLabel->hide();

    belowTreeLayout->addWidget(m_selectionCheckBox);
    belowTreeLayout->addStretch();
    belowTreeLayout->addWidget(m_selectionLabel);

    mainLayout->addLayout(belowTreeLayout);
  }

  QHBoxLayout *hLayout = new QHBoxLayout;

  m_waitingLabel      = new QLabel;
  QMovie *waitingMove = new QMovie(":Resources/waiting.gif");
  waitingMove->setParent(this);

  m_waitingLabel->setMovie(waitingMove);
  waitingMove->setCacheMode(QMovie::CacheAll);
  waitingMove->start();

  m_textLabel = new QLabel;
  m_textLabel->setText(tr("Getting repository status..."));

  hLayout->addStretch();
  hLayout->addWidget(m_waitingLabel);
  hLayout->addWidget(m_textLabel);
  hLayout->addStretch();

  mainLayout->addLayout(hLayout);

  if (!m_folderOnly)
    mainLayout->addWidget(m_treeWidget);
  else
    mainLayout->addSpacing(10);

  QFormLayout *formLayout = new QFormLayout;
  formLayout->setLabelAlignment(Qt::AlignRight);
  formLayout->setFormAlignment(Qt::AlignHCenter | Qt::AlignTop);
  formLayout->setSpacing(10);
  formLayout->setMargin(0);

  m_commentTextEdit = new QPlainTextEdit;
  m_commentTextEdit->setMaximumHeight(50);
  m_commentTextEdit->hide();

  m_commentLabel = new QLabel(tr("Comment:"));
  m_commentLabel->setFixedWidth(55);
  m_commentLabel->hide();

  formLayout->addRow(m_commentLabel, m_commentTextEdit);

  if (!m_folderOnly) {
    m_commitSceneContentsCheckBox = new QCheckBox(this);
    connect(m_commitSceneContentsCheckBox, SIGNAL(toggled(bool)), this,
            SLOT(onCommiSceneContentsToggled(bool)));
    m_commitSceneContentsCheckBox->setChecked(false);
    m_commitSceneContentsCheckBox->hide();
    m_commitSceneContentsCheckBox->setText(tr("Put Scene Contents"));
    formLayout->addRow("", m_commitSceneContentsCheckBox);
  }
Example #18
0
SmugNewAlbum::SmugNewAlbum(QWidget* parent)
            : KDialog(parent)
{
    QString header(i18n("SmugMug New Album"));
    setWindowTitle(header);
    setButtons(Ok|Cancel);
    setDefaultButton(Cancel);
    setModal(false);

    QWidget *mainWidget = new QWidget(this);
    setMainWidget(mainWidget);
    mainWidget->setMinimumSize(400, 400);

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

    QGroupBox* albumBox = new QGroupBox(i18n("Album"), mainWidget);
    albumBox->setWhatsThis(
        i18n("These are basic settings for the new SmugMug album."));

    m_titleEdt          = new KLineEdit;
    m_titleEdt->setWhatsThis(
        i18n("Title of the album that will be created (required)."));

    m_categCoB          = new KComboBox;
    m_categCoB->setEditable(false);
    m_categCoB->setWhatsThis(
        i18n("Category of the album that will be created (required)."));

    m_subCategCoB       = new KComboBox;
    m_subCategCoB->setEditable(false);
    m_subCategCoB->setWhatsThis(
        i18n("Subcategory of the album that will be created (optional)."));

    m_descEdt           = new KTextEdit;
    m_descEdt->setWhatsThis(
        i18n("Description of the album that will be created (optional)."));

    m_templateCoB      = new KComboBox;
    m_templateCoB->setEditable(false);
    m_templateCoB->setWhatsThis(
        i18n("Album template for the new album (optional)."));

    QFormLayout* albumBoxLayout = new QFormLayout;
    albumBoxLayout->addRow(i18nc("new smug album dialog", "Title:"), m_titleEdt);
    albumBoxLayout->addRow(i18nc("new smug album dialog", "Category:"), m_categCoB);
    albumBoxLayout->addRow(i18nc("new smug album dialog", "Subcategory:"), m_subCategCoB);
    albumBoxLayout->addRow(i18nc("new smug album dialog", "Description:"), m_descEdt);
    albumBoxLayout->addRow(i18nc("new smug album dialog", "Template:"), m_templateCoB);
    albumBoxLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
    albumBoxLayout->setSpacing(KDialog::spacingHint());
    albumBoxLayout->setMargin(KDialog::spacingHint());
    albumBox->setLayout(albumBoxLayout);

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

    m_privBox = new QGroupBox(i18n("Security && Privacy"), mainWidget);
    m_privBox->setWhatsThis(
        i18n("These are security and privacy settings for the new SmugMug album."));

    m_publicRBtn        = new QRadioButton(i18nc("smug album privacy", "Public"));
    m_publicRBtn->setChecked(true);
    m_publicRBtn->setWhatsThis(
        i18n("Public album is listed on your public SmugMug page."));
    m_unlistedRBtn      = new QRadioButton(i18nc("smug album privacy", "Unlisted"));
    m_unlistedRBtn->setWhatsThis(
        i18n("Unlisted album is only accessible via URL."));

    QHBoxLayout* radioLayout = new QHBoxLayout;
    radioLayout->addWidget(m_publicRBtn);
    radioLayout->addWidget(m_unlistedRBtn);

    m_passwdEdt         = new KLineEdit;
    m_passwdEdt->setWhatsThis(
        i18n("Require password to access the album (optional)."));

    m_hintEdt           = new KLineEdit;
    m_hintEdt->setWhatsThis(
        i18n("Password hint to present to users in the password prompt (optional)."));

    QFormLayout* privBoxLayout = new QFormLayout;
    privBoxLayout->addRow(i18n("Privacy:"), radioLayout);
    privBoxLayout->addRow(i18n("Password:"******"Password Hint:"), m_hintEdt);
    privBoxLayout->setSpacing(KDialog::spacingHint());
    privBoxLayout->setMargin(KDialog::spacingHint());
    m_privBox->setLayout(privBoxLayout);

    // ------------------------------------------------------------------------
    QVBoxLayout* mainLayout = new QVBoxLayout(mainWidget);
    mainLayout->addWidget(albumBox);
    mainLayout->addWidget(m_privBox);
    mainLayout->setSpacing(KDialog::spacingHint());
    mainLayout->setMargin(0);
    mainWidget->setLayout(mainLayout);

    // ------------------------------------------------------------------------
}
Example #19
0
//
// Constructor
//
HistogramWindow::HistogramWindow(Context *context, bool rangemode) : GcChartWindow(context), context(context), stale(true), source(NULL), active(false), bactive(false), rangemode(rangemode), useCustom(false), useToToday(false), precision(99)
{
    QWidget *c = new QWidget;
    c->setContentsMargins(0,0,0,0);
    QFormLayout *cl = new QFormLayout(c);
    cl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    cl->setSpacing(5);
    setControls(c);

    //
    // reveal controls widget
    //

    // reveal controls
    rWidth = new QLabel(tr("Bin Width"));
    rBinEdit = new QLineEdit();
    rBinEdit->setFixedWidth(40);
    rBinSlider = new QSlider(Qt::Horizontal);
    rBinSlider->setTickPosition(QSlider::TicksBelow);
    rBinSlider->setTickInterval(10);
    rBinSlider->setMinimum(1);
    rBinSlider->setMaximum(100);
    rShade = new QCheckBox(tr("Shade zones"));
    rZones = new QCheckBox(tr("Show in zones"));

    // layout reveal controls
    QHBoxLayout *r = new QHBoxLayout;
    r->setContentsMargins(0,0,0,0);
    r->addStretch();
    r->addWidget(rWidth);
    r->addWidget(rBinEdit);
    r->addWidget(rBinSlider);
    QVBoxLayout *v = new QVBoxLayout;
    v->addWidget(rShade);
    v->addWidget(rZones);
    r->addSpacing(20);
    r->addLayout(v);
    r->addStretch();
    setRevealLayout(r);

    // plot
    QVBoxLayout *vlayout = new QVBoxLayout;
    vlayout->setSpacing(10);
    powerHist = new PowerHist(context);
    vlayout->addWidget(powerHist);

    setChartLayout(vlayout);

#ifdef GC_HAVE_LUCENE
    // search filter box
    isfiltered = false;
    searchBox = new SearchFilterBox(this, context);
    connect(searchBox, SIGNAL(searchClear()), this, SLOT(clearFilter()));
    connect(searchBox, SIGNAL(searchResults(QStringList)), this, SLOT(setFilter(QStringList)));
    if (!rangemode) searchBox->hide();
    else {
        cl->addRow(new QLabel(tr("Filter")), searchBox);
        cl->addWidget(new QLabel(""));
    }
#endif

    // date selection
    dateSetting = new DateSettingsEdit(this);

    if (rangemode) {

        cl->addRow(new QLabel(tr("Date Range")), dateSetting);
        cl->addWidget(new QLabel("")); // spacing

        // default to data series!
        data = new QRadioButton(tr("Ride Data Samples"));
        metric = new QRadioButton(tr("Ride Metrics"));
        data->setChecked(true);
        metric->setChecked(false);
        QHBoxLayout *radios = new QHBoxLayout;
        radios->addWidget(data);
        radios->addWidget(metric);
        cl->addRow(new QLabel(tr("Plot")), radios);

        connect(data, SIGNAL(toggled(bool)), this, SLOT(dataToggled(bool)));
        connect(metric, SIGNAL(toggled(bool)), this, SLOT(metricToggled(bool)));
    }

    // data series
    seriesCombo = new QComboBox();
    addSeries();
    if (rangemode) comboLabel = new QLabel("");
    else comboLabel = new QLabel(tr("Data Series"));
    cl->addRow(comboLabel, seriesCombo);

    if (rangemode) {

        // TOTAL METRIC
        totalMetricTree = new QTreeWidget;
#ifdef Q_OS_MAC
        totalMetricTree->setAttribute(Qt::WA_MacShowFocusRect, 0);
#endif
        totalMetricTree->setColumnCount(2);
        totalMetricTree->setColumnHidden(1, true);
        totalMetricTree->setSelectionMode(QAbstractItemView::SingleSelection);
        totalMetricTree->header()->hide();
        //totalMetricTree->setFrameStyle(QFrame::NoFrame);
        //totalMetricTree->setAlternatingRowColors (true);
        totalMetricTree->setIndentation(5);
        totalMetricTree->setContextMenuPolicy(Qt::CustomContextMenu);

        // ALL METRIC
        distMetricTree = new QTreeWidget;
#ifdef Q_OS_MAC
        distMetricTree->setAttribute(Qt::WA_MacShowFocusRect, 0);
#endif
        distMetricTree->setColumnCount(2);
        distMetricTree->setColumnHidden(1, true);
        distMetricTree->setSelectionMode(QAbstractItemView::SingleSelection);
        distMetricTree->header()->hide();
        //distMetricTree->setFrameStyle(QFrame::NoFrame);
        distMetricTree->setIndentation(5);
        distMetricTree->setContextMenuPolicy(Qt::CustomContextMenu);

        // add them all
        const RideMetricFactory &factory = RideMetricFactory::instance();
        for (int i = 0; i < factory.metricCount(); ++i) {

            const RideMetric *m = factory.rideMetric(factory.metricName(i));

            QTextEdit processHTML(m->name()); // process html encoding of(TM)
            QString processed = processHTML.toPlainText();

            QTreeWidgetItem *add;
            add = new QTreeWidgetItem(distMetricTree->invisibleRootItem());
            add->setText(0, processed);
            add->setText(1, m->symbol());

            // we only want totalising metrics
            if (m->type() != RideMetric::Total) continue;

            add = new QTreeWidgetItem(totalMetricTree->invisibleRootItem());
            add->setText(0, processed);
            add->setText(1, m->symbol());
        }

        QHBoxLayout *labels = new QHBoxLayout;

        metricLabel1 = new QLabel(tr("Total (x-axis)"));
        labels->addWidget(metricLabel1);
        metricLabel1->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);

        metricLabel2 = new QLabel(tr("Distribution (y-axis)"));
        metricLabel2->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
        labels->addWidget(metricLabel2);

        cl->addRow((blankLabel1=new QLabel("")), labels);
        QHBoxLayout *trees = new QHBoxLayout;
        trees->addWidget(totalMetricTree);
        trees->addWidget(distMetricTree);
        cl->addRow((blankLabel2 = new QLabel("")), trees);

        colorButton = new ColorButton(this, "Color", QColor(Qt::blue));
        colorLabel = new QLabel(tr("Color"));
        connect(colorButton, SIGNAL(colorChosen(QColor)), this, SLOT(updateChart()));
        cl->addRow(colorLabel, colorButton);

        // by default select number of rides by duration
        // which are the metrics workout_time and ride_count
        selectTotal("ride_count");
        selectMetric("workout_time");
    }

    showSumY = new QComboBox();
    showSumY->addItem(tr("Absolute Time"));
    showSumY->addItem(tr("Percentage Time"));

    showLabel = new QLabel(tr("Show"));
    cl->addRow(showLabel, showSumY);

    showLnY = new QCheckBox;
    showLnY->setText(tr("Log Y"));
    cl->addRow(blankLabel3 = new QLabel(""), showLnY);

    showZeroes = new QCheckBox;
    showZeroes->setText(tr("With zeros"));
    cl->addRow(blankLabel4 = new QLabel(""), showZeroes);

    shadeZones = new QCheckBox;
    shadeZones->setText(tr("Shade zones"));
    cl->addRow(blankLabel5 = new QLabel(""), shadeZones);

    showInZones = new QCheckBox;
    showInZones->setText(tr("Show in zones"));
    cl->addRow(blankLabel6 = new QLabel(""), showInZones);

    // bin width
    QHBoxLayout *binWidthLayout = new QHBoxLayout;
    QLabel *binWidthLabel = new QLabel(tr("Bin width"), this);
    binWidthLineEdit = new QLineEdit(this);
    binWidthLineEdit->setFixedWidth(40);

    binWidthLayout->addWidget(binWidthLineEdit);
    binWidthSlider = new QSlider(Qt::Horizontal);
    binWidthSlider->setTickPosition(QSlider::TicksBelow);
    binWidthSlider->setTickInterval(1);
    binWidthSlider->setMinimum(1);
    binWidthSlider->setMaximum(100);
    binWidthLayout->addWidget(binWidthSlider);
    cl->addRow(binWidthLabel, binWidthLayout);

    // sort out default values
    setBinEditors();
    showLnY->setChecked(powerHist->islnY());
    showZeroes->setChecked(powerHist->withZeros());
    shadeZones->setChecked(powerHist->shade);
    binWidthSlider->setValue(powerHist->binWidth());
    rBinSlider->setValue(powerHist->binWidth());
    rShade->setChecked(powerHist->shade);

    // fixup series selected by default
    seriesChanged();

    // hide/show according to default mode
    switchMode(); // does nothing if not in rangemode

    // set the defaults etc
    updateChart();

    // the bin slider/input update each other
    // only the input box triggers an update to the chart
    connect(binWidthSlider, SIGNAL(valueChanged(int)), this, SLOT(setBinWidthFromSlider()));
    connect(binWidthLineEdit, SIGNAL(editingFinished()), this, SLOT(setBinWidthFromLineEdit()));
    connect(rBinSlider, SIGNAL(valueChanged(int)), this, SLOT(setrBinWidthFromSlider()));
    connect(rBinEdit, SIGNAL(editingFinished()), this, SLOT(setrBinWidthFromLineEdit()));
    connect(rZones, SIGNAL(stateChanged(int)), this, SLOT(setZoned(int)));
    connect(rShade, SIGNAL(stateChanged(int)), this, SLOT(setShade(int)));

    // when season changes we need to retrieve data from the cache then update the chart
    if (rangemode) {
        connect(this, SIGNAL(dateRangeChanged(DateRange)), this, SLOT(dateRangeChanged(DateRange)));
        connect(dateSetting, SIGNAL(useCustomRange(DateRange)), this, SLOT(useCustomRange(DateRange)));
        connect(dateSetting, SIGNAL(useThruToday()), this, SLOT(useThruToday()));
        connect(dateSetting, SIGNAL(useStandardRange()), this, SLOT(useStandardRange()));
        connect(distMetricTree, SIGNAL(itemSelectionChanged()), this, SLOT(treeSelectionChanged()));
        connect(totalMetricTree, SIGNAL(itemSelectionChanged()), this, SLOT(treeSelectionChanged()));

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

    } else {
        dateSetting->hide();
        connect(this, SIGNAL(rideItemChanged(RideItem*)), this, SLOT(rideSelected()));
        connect(context, SIGNAL(intervalSelected()), this, SLOT(intervalSelected()));
    }

    // if any of the controls change we pass the chart everything
    connect(showLnY, SIGNAL(stateChanged(int)), this, SLOT(updateChart()));
    connect(showZeroes, SIGNAL(stateChanged(int)), this, SLOT(updateChart()));
    connect(seriesCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(seriesChanged()));
    connect(showInZones, SIGNAL(stateChanged(int)), this, SLOT(setZoned(int)));
    connect(showInZones, SIGNAL(stateChanged(int)), this, SLOT(updateChart()));
    connect(shadeZones, SIGNAL(stateChanged(int)), this, SLOT(setShade(int)));
    connect(shadeZones, SIGNAL(stateChanged(int)), this, SLOT(updateChart()));
    connect(showSumY, SIGNAL(currentIndexChanged(int)), this, SLOT(updateChart()));

    connect(context->athlete, SIGNAL(zonesChanged()), this, SLOT(zonesChanged()));
    connect(context, SIGNAL(configChanged()), powerHist, SLOT(configChanged()));

    connect(context, SIGNAL(rideAdded(RideItem*)), this, SLOT(rideAddorRemove(RideItem*)));
    connect(context, SIGNAL(rideDeleted(RideItem*)), this, SLOT(rideAddorRemove(RideItem*)));
    connect(context, SIGNAL(filterChanged()), this, SLOT(forceReplot()));
    connect(context, SIGNAL(homeFilterChanged()), this, SLOT(forceReplot()));
}
Example #20
0
void
GUIWidget::createGUI ()
{
  _timer = new QTimer(this);
  connect(_timer, SIGNAL(timeout()), this, SLOT(updateGUI()));

  QVBoxLayout *vbox = new QVBoxLayout;
  vbox->setSpacing(2);
  vbox->setMargin(5);
  setLayout(vbox);
  
  QFormLayout *form = new QFormLayout;
  form->setSpacing(2);
  form->setMargin(0);
  vbox->addLayout(form);
  
  // templates
  _templates = new QComboBox;
  form->addRow (tr("Templates"), _templates);
  
  // range
  DateRange dr;
  _range = new QComboBox;
  _range->addItems(dr.list());
  _range->setCurrentIndex(5);
  form->addRow (tr("Range"), _range);
  
  // symbol file
  _symbolButton = new FileButton(0);
  connect(_symbolButton, SIGNAL(signalSelectionChanged(QStringList)), this, SLOT(buttonStatus()));
  _symbolButton->setFiles(QStringList() << "/tmp/yahoo_symbols");
  form->addRow (tr("Symbol File"), _symbolButton);
  
  // log
  QGroupBox *gbox = new QGroupBox;
  gbox->setTitle(tr("Log"));
  vbox->addWidget(gbox);

  QVBoxLayout *tvbox = new QVBoxLayout;
  gbox->setLayout(tvbox);
  
  _log = new QTextEdit;
  _log->setReadOnly(TRUE);
  tvbox->addWidget(_log);

  // buttonbox
  QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Help);
  vbox->addWidget(bb);

  // ok button
  _okButton = bb->addButton(QDialogButtonBox::Ok);
  _okButton->setText(tr("&OK"));
  connect(_okButton, SIGNAL(clicked()), this, SLOT(downloadHistory()));

  // cancel button
  _cancelButton = bb->addButton(QDialogButtonBox::Cancel);
  _cancelButton->setText(tr("&Cancel"));
  _cancelButton->setDefault(TRUE);
  _cancelButton->setFocus();
  _cancelButton->setEnabled(FALSE);

  // help button
  QPushButton *b = bb->button(QDialogButtonBox::Help);
  b->setText(tr("&Help"));
  connect(b, SIGNAL(clicked()), this, SIGNAL(signalHelp()));
}
Example #21
0
ToolInstance::ToolInstance(QString filename, ToolInformation information, mcrl2::gui::qt::PersistentFileDialog* fileDialog, QWidget *parent) :
  QWidget(parent),
  m_filename(filename),
  m_info(information),
  m_fileDialog(fileDialog)
{
  m_ui.setupUi(this);

  connect(this, SIGNAL(colorChanged(QColor)), this, SLOT(onColorChanged(QColor)));

  connect(&m_process, SIGNAL(stateChanged(QProcess::ProcessState)), this, SLOT(onStateChange(QProcess::ProcessState)));
  connect(&m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(onStandardOutput()));
  connect(&m_process, SIGNAL(readyReadStandardError()), this, SLOT(onStandardError()));
  connect(m_ui.btnRun, SIGNAL(clicked()), this, SLOT(onRun()));
  connect(m_ui.btnAbort, SIGNAL(clicked()), this, SLOT(onAbort()));
  connect(m_ui.btnSave, SIGNAL(clicked()), this, SLOT(onSave()));
  connect(m_ui.btnClear, SIGNAL(clicked()), m_ui.edtOutput, SLOT(clear()));

  QFileInfo fileInfo(filename);

  m_process.setWorkingDirectory(fileInfo.absoluteDir().absolutePath());
  m_ui.lblDirectoryValue->setText(fileInfo.absoluteDir().absolutePath());
  m_ui.lblFileValue->setText(fileInfo.fileName());

  if (m_info.hasOutput())
  {
    QDir dir = fileInfo.absoluteDir();
    QString newfile = fileInfo.baseName().append(".%1").arg(m_info.output);
    int filenr = 0;
    while(dir.exists(newfile))
    {
      filenr++;
      newfile = fileInfo.baseName().append("_%1.%2").arg(filenr).arg(m_info.output);
    }
    m_pckFileOut = new FilePicker(m_fileDialog, m_ui.pckFileOut);
    m_ui.pckFileOut->layout()->addWidget(m_pckFileOut);
    m_pckFileOut->setText(newfile);
  }
  else
  {
    m_pckFileOut = NULL;
    m_ui.lblFileOut->setVisible(false);
    m_ui.pckFileOut->setVisible(false);
  }

  if (m_info.hasSecondInput())
  {
    m_pckFileIn = new FilePicker(m_fileDialog, m_ui.pckFileIn, false);
    m_ui.pckFileIn->layout()->addWidget(m_pckFileIn);
  }
  else
  {
    m_pckFileIn = NULL;
    m_ui.lblFileIn->setVisible(false);
    m_ui.pckFileIn->setVisible(false);
  }

  QFormLayout *formLayout = new QFormLayout();
  formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
  for (int i = 0; i < m_info.options.count(); i++)
  {
    ToolOption option = m_info.options.at(i);
    QWidget *nameOpt = NULL;
    QCheckBox* cbOpt = NULL;
    QVBoxLayout *lytOpt = new QVBoxLayout();

    if (option.argument.type == EnumArgument)
    {
      nameOpt = new QLabel("<b>"+option.nameLong+": </b>");
    }
    else
    {
      cbOpt = new QCheckBox(option.nameLong + ": ", this);
      cbOpt->setChecked(option.standard);
      QFont font(cbOpt->font());
      font.setBold(true);
      cbOpt->setFont(font);
      nameOpt = cbOpt;
    }

    formLayout->addRow(nameOpt, lytOpt);

    QLabel *lblOpt = new QLabel(option.description, this);
    lblOpt->setAlignment(Qt::AlignJustify | Qt::AlignTop);
    lblOpt->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
    lblOpt->setWordWrap(true);
    lytOpt->addWidget(lblOpt);

    if (!option.hasArgument())
    {
      m_optionValues.append(new OptionValue(option, cbOpt));
    }
    else
    {
      switch (option.argument.type)
      {
        case StringArgument:
        case LevelArgument:
        case IntegerArgument:
        case RealArgument:
        case BooleanArgument:
          {
            QHBoxLayout *lytArg = new QHBoxLayout();
            lytArg->setSpacing(6);

            QWidget *edtArg = NULL;

            switch (option.argument.type)
            {
              case LevelArgument:
                {
                  QLineEdit *edtLdt = new QLineEdit("verbose", this);
                  m_optionValues.append(new OptionValue(option, cbOpt, edtLdt));
                  edtArg = edtLdt;
                }
                break;
              case IntegerArgument:
                {
                  QSpinBox *edtSpb = new QSpinBox(this);
                  edtSpb->setRange(std::numeric_limits<int>::min(), std::numeric_limits<int>::max());
                  if (option.argument.optional)
                  {
                    QCheckBox *cbOptional = new QCheckBox(this);
                    lytArg->addWidget(cbOptional);
                    m_optionValues.append(new OptionValue(option, cbOpt, edtSpb, cbOptional));
                  }
                  else
                  {
                    m_optionValues.append(new OptionValue(option, cbOpt, edtSpb));
                  }
                  edtArg = edtSpb;
                }
                break;
              case RealArgument:
                {
                  QDoubleSpinBox *edtSpb = new QDoubleSpinBox(this);
                  edtSpb->setRange(std::numeric_limits<double>::min(), std::numeric_limits<double>::max());
                  if (option.argument.optional)
                  {
                    QCheckBox *cbOptional = new QCheckBox(this);
                    lytArg->addWidget(cbOptional);
                    m_optionValues.append(new OptionValue(option, cbOpt, edtSpb, cbOptional));
                  }
                  else
                  {
                    m_optionValues.append(new OptionValue(option, cbOpt, edtSpb));
                  }
                  edtArg = edtSpb;
                }
                break;
              case BooleanArgument:
                {
                  QCheckBox *edtChb = new QCheckBox("Yes", this);
                  m_optionValues.append(new OptionValue(option, cbOpt, edtChb));
                  edtArg = edtChb;
                }
                break;
              case StringArgument:
              default:
                {
                  QLineEdit *edtLdt = new QLineEdit(this);
                  m_optionValues.append(new OptionValue(option, cbOpt, edtLdt));
                  edtArg = edtLdt;
                }
                break;
            }
            edtArg->setMinimumWidth(300);

            lytArg->addWidget(edtArg);

            if (!option.argument.optional && option.argument.type != BooleanArgument)
            {
              QLabel *lblReq = new QLabel("*", this);
              lytArg->addWidget(lblReq);
            }

            QSpacerItem *spacer = new QSpacerItem(100, 20, QSizePolicy::Expanding);
            lytArg->addItem(spacer);
            lytOpt->addLayout(lytArg);
          }
          break;
        case FileArgument:
          {
            QHBoxLayout *lytArg = new QHBoxLayout();
            lytArg->setSpacing(6);

            FilePicker *edtArg = new FilePicker(m_fileDialog, this, false);
            lytArg->addWidget(edtArg);
            m_optionValues.append(new OptionValue(option, cbOpt, edtArg));

            if (!option.argument.optional)
            {
              QLabel *lblReq = new QLabel("*", this);
              lytArg->addWidget(lblReq);
            }

            QSpacerItem *spacer = new QSpacerItem(100, 20, QSizePolicy::Expanding);
            lytArg->addItem(spacer);
            lytOpt->addLayout(lytArg);
          }
          break;
        case EnumArgument:
          {
            QFormLayout *lytValues = new QFormLayout();
            lytValues->setSpacing(6);

            QButtonGroup *grpValues = new QButtonGroup(this);

            for (int j = 0; j < option.argument.values.count(); j++)
            {
              ToolValue val = option.argument.values.at(j);
              QRadioButton *rbVal = new QRadioButton(val.nameLong, this);
              rbVal->setChecked(val.standard);
              grpValues->addButton(rbVal);

              QLabel *lblVal = new QLabel(val.description, this);
              lblVal->setWordWrap(true);

              lytValues->addRow(rbVal, lblVal);
            }
            m_optionValues.append(new OptionValue(option, cbOpt, grpValues));

            lytOpt->addLayout(lytValues);
          }
          break;
        default:
          break;
      }
    }
  }
  m_ui.scrollWidget->setLayout(formLayout);
}
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;
}
void RTAutomationManager::layoutWindow()
{
    QSettings settings;

    QWidget *centralWidget = new QWidget(this);
    QVBoxLayout *vLayout = new QVBoxLayout(centralWidget);

    QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    sizePolicy.setHorizontalStretch(0);
    sizePolicy.setVerticalStretch(0);

    QFormLayout *formLayout = new QFormLayout();
    formLayout->setSpacing(16);
    formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
    vLayout->addLayout(formLayout);

    m_brokerAddress = new QLineEdit();
    m_brokerAddress->setText(settings.value(RTAUTOMATION_PARAMS_BROKERADDRESS).toString());
    m_brokerAddress->setToolTip("The MQTT broker address (e.g. tcp://localhost:1883");
    m_brokerAddress->setMinimumWidth(200);
    formLayout->addRow(tr("MQTT broker address:"), m_brokerAddress);

    m_clientID = new QLineEdit();
    m_clientID->setText(settings.value(RTAUTOMATION_PARAMS_CLIENTID).toString());
    m_clientID->setToolTip("The client ID is used to sign on to the NQTT broker");
    m_clientID->setMinimumWidth(200);
    formLayout->addRow(tr("MQTT client ID:"), m_clientID);

    m_clientSecret = new QLineEdit();
    m_clientSecret->setText(settings.value(RTAUTOMATION_PARAMS_CLIENTSECRET).toString());
    m_clientSecret->setToolTip("The client secret may be used to sign on to the NQTT broker");
    m_clientSecret->setMinimumWidth(200);
    m_clientSecret->setEchoMode(QLineEdit::Password);
    formLayout->addRow(tr("MQTT client secret:"), m_clientSecret);

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

    m_automationServerID = new QLineEdit();
    m_automationServerID->setText(settings.value(RTAUTOMATION_PARAMS_SERVERID).toString());
    m_automationServerID->setToolTip("The device ID of the automation server");
    m_automationServerID->setMinimumWidth(200);
    formLayout->addRow(tr("Automation server ID:"), m_automationServerID);

    settings.beginGroup(RTAUTOMATION_PARAMS_TOPICGROUP);

    m_managementCommandTopic = new QLineEdit();
    m_managementCommandTopic->setText(settings.value(RTAUTOMATION_PARAMS_MANAGEMENTCOMMANDTOPIC).toString());
    m_managementCommandTopic->setToolTip("The topic to publish for command messages (e.g. managementCommand)");
    m_managementCommandTopic->setMinimumWidth(200);
    formLayout->addRow(tr("Management command topic (pub):"), m_managementCommandTopic);

    m_managementResponseTopic = new QLineEdit();
    m_managementResponseTopic->setText(settings.value(RTAUTOMATION_PARAMS_MANAGEMENTRESPONSETOPIC).toString());
    m_managementResponseTopic->setToolTip("The topic to subscribe to for response operations (e.g. managementResponse)");
    m_managementResponseTopic->setMinimumWidth(200);
    formLayout->addRow(tr("Management response topic (sub):"), m_managementResponseTopic);

    settings.endGroup();

    QHBoxLayout *buttonLayout = new QHBoxLayout();

    m_connect = new QPushButton("Connect");
    buttonLayout->addWidget(m_connect);
    connect(m_connect, SIGNAL(clicked(bool)), this, SLOT(onConnect()));
    m_disconnect = new QPushButton("Disconnect");
    buttonLayout->addWidget(m_disconnect);
    m_disconnect->setEnabled(false);
    connect(m_disconnect, SIGNAL(clicked(bool)), this, SLOT(onDisconnect()));

    vLayout->addLayout(buttonLayout);

    vLayout->addStretch();

    setCentralWidget(centralWidget);
}
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;
}
Example #25
0
void
GUIWidget::createGUI ()
{
  QVBoxLayout *vbox = new QVBoxLayout;
  vbox->setSpacing(2);
  vbox->setMargin(5);
  setLayout(vbox);
  
  QFormLayout *form = new QFormLayout;
  form->setSpacing(2);
  form->setMargin(0);
  vbox->addLayout(form);
  
  // csv file
  _csvButton = new FileButton(0);
  connect(_csvButton, SIGNAL(signalSelectionChanged(QStringList)), this, SLOT(buttonStatus()));
//  _csvButton->setFiles(QStringList() << "/tmp/yahoo.csv");
  form->addRow (tr("CSV File"), _csvButton);

  // format
  _format = new QLineEdit;
  form->addRow (tr("Format"), _format);
  
  // date format
  _dateFormat = new QLineEdit;
  form->addRow (tr("Date Format"), _dateFormat);
  
  // delimiter
  Delimiter d;
  _delimiter = new QComboBox;
  _delimiter->addItems(d.list());
  _delimiter->setCurrentIndex(Delimiter::_SEMICOLON);
  form->addRow (tr("Delimiter"), _delimiter);
  
  // type
  Quote q;
  _type = new QComboBox;
  _type->addItems(q.list());
  _type->setCurrentIndex(Quote::_STOCK);
  form->addRow (tr("Quote Type"), _type);
  
  // exchange
  _exchange = new QLineEdit;
  form->addRow (tr("Exchange Override"), _exchange);
  
  // filename as symbol
  _filename = new QCheckBox;
  form->addRow (tr("Use Filename As Symbol"), _filename);

  // log
  _log = new QTextEdit;
  _log->setReadOnly(TRUE);
  vbox->addWidget(_log);

  // buttonbox
  QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Help);
  vbox->addWidget(bb);

  // ok button
  _okButton = bb->addButton(QDialogButtonBox::Ok);
  _okButton->setText(tr("&OK"));
  connect(_okButton, SIGNAL(clicked()), this, SLOT(importThread()));

  // cancel button
  _cancelButton = bb->addButton(QDialogButtonBox::Cancel);
  _cancelButton->setText(tr("&Cancel"));
  _cancelButton->setDefault(TRUE);
  _cancelButton->setFocus();
  _cancelButton->setEnabled(TRUE);

  // help button
  QPushButton *b = bb->button(QDialogButtonBox::Help);
  b->setText(tr("&Help"));
  connect(b, SIGNAL(clicked()), this, SIGNAL(signalHelp()));
}
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;
}
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;
}
Example #28
0
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);
}