Example #1
0
/**
 * Fills layer edit layout with layer edit widgets.
 */
void TopologyWidget::makeView(){
	Q_ASSERT(model != NULL);

	//input layer

	LayerEditWidget* inputLayer = new LayerEditWidget(ui->layerScrollAreaContent);
    inputLayer->setLayerName(tr("[0] input layer: "));
	inputLayer->setAsInputLayer(true);
	inputLayer->setRemoveButtonDisabled(true);
	inputLayer->setNeuronCount(model->inputCount());

	QFrame* line = new QFrame(ui->layerScrollAreaContent);
	line->setObjectName(QString::fromUtf8("line"));
	line->setMaximumHeight(2);
	line->setFrameShape(QFrame::HLine);
	line->setFrameShadow(QFrame::Sunken);

	connect(inputLayer, SIGNAL(widgetPressed(LayerEditWidget*)), this, SLOT(widgetPressed(LayerEditWidget*)));
	connect(inputLayer, SIGNAL(removePressed(LayerEditWidget*)), this, SLOT(removeLayer(LayerEditWidget*)));
	connect(inputLayer, SIGNAL(duplicatePressed(LayerEditWidget*)), this, SLOT(duplicateLayer(LayerEditWidget*)));
	connect(inputLayer, SIGNAL(countChanged(LayerEditWidget*,int)), this, SLOT(countChanged(LayerEditWidget*, int)));

	layerEditList.append(inputLayer);
	layerLineList.append(line);
	layerEditLayout->insertWidget(0, line);
	layerEditLayout->insertWidget(0, inputLayer);

	//output layer and inner layers

	for(int i = 0; i <  model->layerCount(); i++){
		LayerEditWidget* layer = new LayerEditWidget(ui->layerScrollAreaContent);

		if(i < model->layerCount()-1)
            layer->setLayerName("[" + QString::number(i+1) + tr("] inner layer: "));
		else
            layer->setLayerName("[" + QString::number(i+1) + tr("] output layer: "));

		if(model->layerCount() <= 1) layer->setRemoveButtonDisabled(true);
		layer->setNeuronCount(model->neuronCount(i));

		QFrame* line = new QFrame(ui->layerScrollAreaContent);
		line->setObjectName(QString::fromUtf8("line"));
		line->setMaximumHeight(2);
		line->setFrameShape(QFrame::HLine);
		line->setFrameShadow(QFrame::Sunken);

		connect(layer, SIGNAL(widgetPressed(LayerEditWidget*)), this, SLOT(widgetPressed(LayerEditWidget*)));
		connect(layer, SIGNAL(removePressed(LayerEditWidget*)), this, SLOT(removeLayer(LayerEditWidget*)));
		connect(layer, SIGNAL(duplicatePressed(LayerEditWidget*)), this, SLOT(duplicateLayer(LayerEditWidget*)));
		connect(layer, SIGNAL(countChanged(LayerEditWidget*,int)), this, SLOT(countChanged(LayerEditWidget*, int)));

		layerEditList.append(layer);
		layerLineList.append(line);
		layerEditLayout->insertWidget(0, line);
		layerEditLayout->insertWidget(0, layer);
	}
}
Example #2
0
void XyzWindow::CreateXYZView()
{
	QFrame *XyFrame;
	QFrame *XzFrame;
	QFrame *ZyFrame;
	QWidget *centralWidget;
	
	centralWidget = new QWidget(this);
	QPalette palette;
	palette.setColor(QPalette::Background , QColor(/*200,200,200*/167, 210, 200));
	centralWidget->setAutoFillBackground(true);
	centralWidget->setPalette(palette);
	
	XzFrame = new QFrame(centralWidget);
	XzFrame->setGeometry(QRect(mXorigin1,mYorigin1 , mx+2*FRAM_BORDER , mz+2*FRAM_BORDER));
	XzFrame->setFrameShape(QFrame::StyledPanel);
	XzFrame->setFrameShadow(QFrame::Raised);
	ZyFrame = new QFrame(centralWidget);
	ZyFrame->setGeometry(QRect(mXorigin2 , mYorigin2 , mz+2*FRAM_BORDER ,my+2*FRAM_BORDER));
	ZyFrame->setFrameShape(QFrame::StyledPanel);
	ZyFrame->setFrameShadow(QFrame::Raised);
	XyFrame = new QFrame(centralWidget);
	XyFrame->setGeometry(QRect(mXorigin1 , mYorigin2 , mx+2*FRAM_BORDER  ,my+2*FRAM_BORDER));
	XyFrame->setFrameShape(QFrame::StyledPanel);
	XyFrame->setFrameShadow(QFrame::Raised);
	
	
	palette.setColor(QPalette::Background , QColor(255,0,0));
	XzFrame->setAutoFillBackground(true);
	XzFrame->setPalette(palette);
	ZyFrame->setAutoFillBackground(true);
	ZyFrame->setPalette(palette);
	XyFrame->setAutoFillBackground(true);
	XyFrame->setPalette(palette);
	setCentralWidget(centralWidget);
	
	QGLFormat glFormat;
	glFormat.setRgba(true);
	glFormat.setDoubleBuffer(true);
	glFormat.setDepth(true);
	mXY_GLw = new XyzGL(glFormat , XY_VIEW , XyFrame , this);
	mXY_GLw->setGeometry(FRAM_BORDER , FRAM_BORDER,mx,my);
	mXY_GLw->setAttribute(Qt::WA_DeleteOnClose);
	
	mXZ_GLw = new XyzGL(glFormat , XZ_VIEW , XzFrame , this);
	mXZ_GLw->setGeometry(FRAM_BORDER , FRAM_BORDER , mx ,mz);
	mXZ_GLw->setAttribute(Qt::WA_DeleteOnClose);
	
	mYZ_GLw = new XyzGL(glFormat , ZY_VIEW , ZyFrame , this);
	mYZ_GLw->setGeometry(FRAM_BORDER , FRAM_BORDER ,mz ,my);
	mYZ_GLw->setAttribute(Qt::WA_DeleteOnClose);
}
Example #3
0
StoryBoard::StoryBoard(QWidget *parent)
    : TimeLineWidget(parent)
    , m_videoWidth(640)
    , m_videoHeight(360)
    , m_selectedThumb(0)
    , m_dragItem(0)
{
    connect(m_mainWindow,SIGNAL(storyBoardChanged()),SLOT(updateSnapshots()));

    QFrame * box = new QFrame();
    box->setFrameShadow( QFrame::Raised );
    box->setFrameShape( QFrame::Panel );
    QHBoxLayout * layout = new QHBoxLayout(box);
    layout->setMargin(0);
    layout->setSpacing(0);

    QPushButton * b = new QPushButton("<");
    b->setFlat(true);
    b->setMaximumSize(QSize(16,16));
    layout->addWidget(b);
    b = new QPushButton("x");
    b->setFlat(true);
    b->setMaximumSize(QSize(16,16));
    layout->addWidget(b);
    b = new QPushButton(">");
    b->setFlat(true);
    b->setMaximumSize(QSize(16,16));
    layout->addWidget(b);
}
Example #4
0
void playlistItemText::createPropertiesWidget()
{
  // Absolutely always only call this once// 
  assert (propertiesWidget == NULL);
  
  // Create a new widget and populate it with controls
  propertiesWidget = new QWidget;
  if (propertiesWidget->objectName().isEmpty())
    propertiesWidget->setObjectName(QStringLiteral("playlistItemText"));

  // On the top level everything is layout vertically
  QVBoxLayout *vAllLaout = new QVBoxLayout(propertiesWidget);

  QFrame *line = new QFrame(propertiesWidget);
  line->setObjectName(QStringLiteral("line"));
  line->setFrameShape(QFrame::HLine);
  line->setFrameShadow(QFrame::Sunken);

  // First add the parents controls (duration) then the text spcific controls (font, text...)
  vAllLaout->addLayout( createStaticTimeController(propertiesWidget) );
  vAllLaout->addWidget( line );
  vAllLaout->addLayout( createTextController(propertiesWidget) );

  // Insert a stretch at the bottom of the vertical global layout so that everything
  // gets 'pushed' to the top
  vAllLaout->insertStretch(3, 1);

  // Set the layout and add widget
  propertiesWidget->setLayout( vAllLaout );
}
/** Create a variant editor for a parameter
 * @brief SensorTransformationConfig::createSensorWidget
 * @param parent
 * @param param
 * @param paramIndex
 * @return a widget containing the editor and a description label
 */
QWidget *SensorTransformationConfig::createSensorWidget(QWidget *parent, const TransformationBaseClass::ParameterDescription &param, int paramIndex)
{
    QFrame * frame = new QFrame(parent);
    frame->setFrameShape(QFrame::StyledPanel);
    frame->setFrameShadow(QFrame::Plain);
    frame->setFrameStyle(1);
    QHBoxLayout *layout = new QHBoxLayout(frame);
    frame->setLayout(layout);
    QLabel *name = new QLabel(param.name + " : ", frame);
    QLabel *description = new QLabel(param.description, frame);
    description->setWordWrap(true);

    QVector<QVariant> trParams;
    if(m_transformationList[m_currentIndex]){
        trParams = m_transformationList[m_currentIndex]->getParameters();
    }

    QWidget *editor;
    if(param.typeAndDefault.type() == QVariant::String){
        QPlainTextEdit *editor2 = new QPlainTextEdit(param.typeAndDefault.toString(), frame);
        connect(editor2, SIGNAL(textChanged()), this, SLOT(on_textEditorChange()));
        editor = editor2;
    }else if(param.typeAndDefault.type() == QVariant::Double){
        QDoubleSpinBox *editor2 = new QDoubleSpinBox(frame);
        editor2->setMaximum(9999999999);
        editor2->setMinimum(-9999999999);
        editor2->setValue(trParams[paramIndex].toDouble());
        connect(editor2, SIGNAL(valueChanged(double)), this, SLOT(on_doubleEditorChange(double)));
        editor = editor2;
    }else if(param.typeAndDefault.type() == QVariant::Int){
Example #6
0
QFrame* Utilities::getHeadingLine()
{
  QFrame *pHeadingLine = new QFrame();
  pHeadingLine->setFrameShape(QFrame::HLine);
  pHeadingLine->setFrameShadow(QFrame::Sunken);
  return pHeadingLine;
}
Example #7
0
    QueryWidget::QueryWidget(MongoShell *shell, QWidget *parent) :
        QWidget(parent),
        _shell(shell),
        _viewer(NULL),
        _isTextChanged(false)
    {
        AppRegistry::instance().bus()->subscribe(this, DocumentListLoadedEvent::Type, shell);
        AppRegistry::instance().bus()->subscribe(this, ScriptExecutedEvent::Type, shell);
        AppRegistry::instance().bus()->subscribe(this, AutocompleteResponse::Type, shell);

        _scriptWidget = new ScriptWidget(_shell);
        VERIFY(connect(_scriptWidget,SIGNAL(textChanged()),this,SLOT(textChange())));

        _viewer = new OutputWidget();
        _outputLabel = new QLabel(this);
        _outputLabel->setContentsMargins(0, 5, 0, 0);
        _outputLabel->setVisible(false);

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

        QVBoxLayout *layout = new QVBoxLayout;
        layout->setSpacing(0);
        layout->setContentsMargins(0, 0, 0, 0);
        layout->addWidget(_scriptWidget, 0, Qt::AlignTop);
        layout->addWidget(line);
        layout->addWidget(_outputLabel, 0, Qt::AlignTop);
        layout->addWidget(_viewer, 1);
        setLayout(layout);
    }
Example #8
0
KompareListViewFrame::KompareListViewFrame( bool isSource,
                                            ViewSettings* settings,
                                            KompareSplitter* parent,
                                            const char* name ):
	QFrame ( parent ),
	m_view ( isSource, settings, this, name ),
	m_label ( isSource?"Source":"Dest", this ),
	m_layout ( this )
{
	setSizePolicy ( QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored) );
	m_label.setSizePolicy ( QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed) );
	QFrame *bottomLine = new QFrame(this);
	bottomLine->setFrameShape(QFrame::HLine);
	bottomLine->setFrameShadow ( QFrame::Plain );
	bottomLine->setSizePolicy ( QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed) );
	bottomLine->setFixedHeight(1);
	m_label.setMargin(3);
	m_layout.setSpacing(0);
	m_layout.setMargin(0);
	m_layout.addWidget(&m_label);
	m_layout.addWidget(bottomLine);
	m_layout.addWidget(&m_view);

	connect( &m_view, SIGNAL(differenceClicked(const Diff2::Difference*)),
	         parent, SLOT(slotDifferenceClicked(const Diff2::Difference*)) );

	connect( parent, SIGNAL(scrollViewsToId(int)), &m_view, SLOT(scrollToId(int)) );
	connect( parent, SIGNAL(setXOffset(int)), &m_view, SLOT(setXOffset(int)) );
	connect( &m_view, SIGNAL(resized()), parent, SLOT(slotUpdateScrollBars()) );
}
Example #9
0
File: qt4.cpp Project: m8a/uim
void QConfirmDialog::setupWidgets( const QString&msg )
{
    QVBoxLayout *vLayout = new QVBoxLayout( this );
    vLayout->setSpacing( 6 );
    vLayout->setMargin( 6 );
    QLabel *msgLabel = new QLabel( msg, this );
    QFrame *sep = new QFrame( this );
    sep->setFrameShape( QFrame::HLine );
    sep->setFrameShadow( QFrame::Sunken );
    vLayout->addWidget( msgLabel );
    vLayout->addWidget( sep );

    QHBoxLayout *buttonHLayout = new QHBoxLayout;
    vLayout->addLayout( buttonHLayout );
    QCheckBox *checkBox = new QCheckBox( _("Show this dialog on startup"), this );
    QSettings settings;
    bool isWarnDotUim = settings.value( m_confname, true ).toBool();
    checkBox->setChecked( isWarnDotUim );
    QPushButton *ok = new QPushButton( _("OK"), this );
    ok->setDefault(true);
    buttonHLayout->addWidget( checkBox );
    buttonHLayout->addStretch();    
    buttonHLayout->addWidget( ok );

    connect( ok, SIGNAL(clicked()),
                      this, SLOT(accept()) );
    connect( checkBox, SIGNAL(toggled(bool)),
                      this, SLOT(showOnStart(bool)) );
}
Example #10
0
void MainWindow::showInformation()
{
    information->addWidget( new QLabel( tr( "<b>Image loaded:</b>" ) ) );
    information->addWidget( new QLabel( tr( "<b>Height:</b> %1" ).arg( image->getHeight() ) ) );
    information->addWidget( new QLabel( tr( "<b>Width:</b> %1" ).arg( image->getWidth() ) ) );
    information->addWidget( new QLabel( tr( "<b>Bits per sample:</b> %1" ).arg( image->getBitDepth() ) ) );
    information->addWidget( new QLabel( tr( "<b>Color type:</b> 0b%1" ).arg( QString::number( image->getColorType(), 2 ) ) ) );
    information->addWidget( new QLabel( tr( "<b>Compression method:</b> %1" ).arg( image->getCompressionMethod() ) ) );
    information->addWidget( new QLabel( tr( "<b>Filter method:</b> %1" ).arg( image->getFilterMethod() ) ) );
    information->addWidget( new QLabel( tr( "<b>Interlace method:</b> %1" ).arg( image->getInterlaceMethod() ) ) );
    information->addWidget( new QLabel( tr( "<b>Number of chuncks:</b> %1" ).arg( image->getNumberOfChuncks()+2 ) ) );

    for( quint16 i = 0; i < image->getNumberOfChuncks(); i++ ) {
        QFrame* line = new QFrame( this );
        line->setFrameShape( QFrame::HLine );
        line->setFrameShadow( QFrame::Sunken );
        information->addWidget( line );

        information->addWidget( new QLabel( tr( "<b>Chunck</b> #%1" ).arg(i+1) ) );

        QString type = tr( "<b>Type:</b> \"%1\"" ).arg( *image->getChunckInfo( PngImage::ChunckType, i ) );
        information->addWidget( new QLabel( type ) );

        QString length = tr( "<b>Length:</b> %1b" ).arg( *image->getChunckInfo( PngImage::ChunckLength, i ) );
        information->addWidget( new QLabel( length ) );

        QString crc = tr( "<b>Crc:</b> 0x%1" ).arg( *image->getChunckInfo( PngImage::ChunckCrc, i ) );
        information->addWidget( new QLabel( crc ) );
    }
}
Example #11
0
void NoiseReductionWindow::createProjectorGroup()
{
    if(m_pFiffInfo)
    {
        if(ui->m_groupBox_projections->layout() != 0)
            this->remove(ui->m_groupBox_projections->layout());

        m_qListProjCheckBox.clear();

        // Projection Selection
        QGridLayout *topLayout = new QGridLayout;

        if(!m_pFiffInfo->projs.isEmpty())
        {
            bool bAllActivated = true;

            qint32 i=0;

            for(i; i < m_pFiffInfo->projs.size(); ++i)
            {
                QCheckBox* checkBox = new QCheckBox(m_pFiffInfo->projs[i].desc);
                checkBox->setChecked(m_pFiffInfo->projs[i].active);

                if(m_pFiffInfo->projs[i].active == false)
                    bAllActivated = false;

                m_qListProjCheckBox.append(checkBox);

                connect(checkBox, static_cast<void (QCheckBox::*)(bool)>(&QCheckBox::clicked),
                        this, &NoiseReductionWindow::checkProjStatusChanged);

                topLayout->addWidget(checkBox, i, 0); //+2 because we already added two widgets before the first projector check box

    //            if(i>m_pFiffInfo->projs.size()/2)
    //                topLayout->addWidget(checkBox, i-rowCount, 1); //+2 because we already added two widgets before the first projector check box
    //            else {
    //                topLayout->addWidget(checkBox, i, 0); //+2 because we already added two widgets before the first projector check box
    //                rowCount++;
    //            }
            }

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

            topLayout->addWidget(line, i+1, 0);

            m_enableDisableProjectors = new QCheckBox("Enable all");
            m_enableDisableProjectors->setChecked(bAllActivated);
            topLayout->addWidget(m_enableDisableProjectors, i+2, 0);
            connect(m_enableDisableProjectors, static_cast<void (QCheckBox::*)(bool)>(&QCheckBox::clicked),
                this, &NoiseReductionWindow::enableDisableAllProj);

            emit projSelectionChanged();
        }

        delete ui->m_groupBox_projections->layout();
        ui->m_groupBox_projections->setLayout(topLayout);
    }
}
DataDialogWidget::DataDialogWidget(IDataForms *ADataForms, const IDataForm &AForm, QWidget *AParent) : QDialog(AParent)
{
    REPORT_VIEW;
    setAttribute(Qt::WA_DeleteOnClose,true);

    FFormWidget = NULL;
    FAllowInvalid = false;
    FDataForms = ADataForms;

    QToolBar *toolBar = new QToolBar(this);
    FToolBarChanger = new ToolBarChanger(toolBar);

    FFormHolder = new QWidget(this);
    FFormHolder->setLayout(new QVBoxLayout());
    FFormHolder->layout()->setMargin(0);

    QFrame *hline = new QFrame(this);
    hline->setFrameShape(QFrame::HLine);
    hline->setFrameShadow(QFrame::Raised);

    FDialogButtons = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel,Qt::Horizontal,this);
    connect(FDialogButtons,SIGNAL(clicked(QAbstractButton *)),SLOT(onDialogButtonClicked(QAbstractButton *)));

    QVBoxLayout *dialogLayout = new QVBoxLayout(this);
    dialogLayout->setMargin(5);
    dialogLayout->setMenuBar(toolBar);
    dialogLayout->addWidget(FFormHolder);
    dialogLayout->addWidget(hline);
    dialogLayout->addWidget(FDialogButtons);

    setForm(AForm);
}
Example #13
0
OtherHandler::OtherHandler()
    : QVBox()
{
    QHBox* box = new QHBox(this);
    QLabel* lbl = new QLabel(box);
    lbl->setText(tr("<qt><b>Received:</b></qt>"));
    m_na = new QLabel(box);

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

    m_view = new QTextView(this);

    box = new QHBox(this);
    QPushButton *but = new QPushButton(box);
    but->setText(tr("Accept") );
    connect(but, SIGNAL(clicked() ),
            this, SLOT(accept()) );

    but = new QPushButton(box);
    but->setText(tr("Deny") );
    connect(but, SIGNAL(clicked() ),
            this, SLOT(deny() ) );

    raise();
    showMaximized();
}
Example #14
0
void SoapySDRInputGui::createGlobalGainControl()
{
    m_gainSliderGUI = new IntervalSliderGUI(this);
    int min, max;
    m_sampleSource->getGlobalGainRange(min, max);
    m_gainSliderGUI->setInterval(min, max);
    m_gainSliderGUI->setLabel(QString("Global gain"));
    m_gainSliderGUI->setUnits(QString(""));

    QVBoxLayout *layout = (QVBoxLayout *) ui->scrollAreaWidgetContents->layout();

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

    if (m_sampleSource->isAGCSupported())
    {
        m_autoGain = new QCheckBox(this);
        m_autoGain->setText(QString("AGC"));
        m_autoGain->setStyleSheet("QCheckBox::indicator::unchecked {background: rgb(79,79,79);} QCheckBox::indicator::checked {background: rgb(255, 157, 38);}");
        layout->addWidget(m_autoGain);

        connect(m_autoGain, SIGNAL(toggled(bool)), this, SLOT(autoGainChanged(bool)));
    }
Line_separator::Line_separator( const QString& label, 
				QWidget* parent, const char* name ) 
  : QWidget( parent ) {

  if (name)
    setObjectName(name);
  
  QHBoxLayout* layout = new QHBoxLayout( this );
  setLayout(layout);
  
  QLabel* separator_label = new QLabel( label, this );
  QFont font;
  font.setBold( true );
  separator_label->setFont( font );

  QSizePolicy label_policy( QSizePolicy::Fixed, QSizePolicy::Fixed );
  separator_label->setSizePolicy( label_policy );
  
  QFrame* line = new QFrame( this);
  line->setFrameShape( QFrame::Box );
  line->setFrameShadow( QFrame::Raised );
  QSizePolicy line_policy( QSizePolicy::Expanding, QSizePolicy::Fixed );
  line->setSizePolicy( line_policy );
  
  layout->addWidget( separator_label );
  layout->addWidget( line );
  
}
Example #16
0
URLWatcherPlugin::URLWatcherPlugin()
{
	viewer_ = new QWidget();
	QVBoxLayout *vboxLayout;
	QFrame *frame;
	QLabel *label;
	vboxLayout = new QVBoxLayout(viewer_);
	vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
	frame = new QFrame(viewer_);
	frame->setObjectName(QString::fromUtf8("frame"));
	frame->setFrameShape(QFrame::StyledPanel);
	frame->setFrameShadow(QFrame::Raised);
	viewerText_ = new QTextEdit(frame);
	viewerText_->setObjectName(QString::fromUtf8("text"));
	viewerText_->setReadOnly(true);

	

	label = new QLabel(viewer_);
	label->setObjectName(QString::fromUtf8("label"));
	label->setText("URLs");
	vboxLayout->addWidget(label);
	vboxLayout->addWidget(viewerText_);
	viewer_->show();
}
Example #17
0
void SyncStatusWidget::init()
{
    //horizontal line
    QFrame *line = new QFrame(this);
    line->setFrameShape(QFrame::HLine);
    line->setFrameShadow(QFrame::Sunken);

    m_syncServiceLabel = new QLabel(tr("Cloud:"), this);
    m_syncStatusLabel = new QLabel(tr("undefined"), this);

    m_syncStatusLayout = new QHBoxLayout; //becomes child of m_mainLayout
    m_syncStatusLayout->addWidget(m_syncServiceLabel);
    m_syncStatusLayout->addWidget(m_syncStatusLabel);

    m_syncOperation = new QLabel(tr(""), this);

    m_progressBar = new QProgressBar(this);
    m_progressBar->setRange(0, 0);
    m_progressBar->hide();

    m_mainLayout = new QVBoxLayout(this);
    m_mainLayout->addWidget(line);
    m_mainLayout->addLayout(m_syncStatusLayout);
    m_mainLayout->addWidget(m_syncOperation);
    m_mainLayout->addWidget(m_progressBar);
    setLayout(m_mainLayout);
}
Example #18
0
void CRangeChooserDialog::initView() {
    m_rangeList = new QListWidget(this);
    m_rangeListLabel = new QLabel(this);
    m_rangeListLabel->setBuddy(m_rangeList);

    m_newRangeButton = new QPushButton(this);
    m_deleteRangeButton = new QPushButton(this);

    m_nameEdit = new QLineEdit(this);
    m_nameEditLabel = new QLabel(this);
    m_nameEditLabel->setBuddy(m_nameEdit);

    m_rangeEdit = new QTextEdit(this);
    m_rangeEditLabel = new QLabel(this);
    m_rangeEditLabel->setBuddy(m_rangeEdit);

    m_resultList = new QListWidget(this);
    m_resultListLabel = new QLabel(this);
    m_resultListLabel->setBuddy(m_resultList);

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

    m_buttonBox = new QDialogButtonBox(this);
    m_buttonBox->setOrientation(Qt::Horizontal);
    m_buttonBox->setStandardButtons(QDialogButtonBox::Ok
                                    | QDialogButtonBox::Cancel
                                    | QDialogButtonBox::RestoreDefaults);
    message::prepareDialogBox(m_buttonBox);

    QHBoxLayout *rangeButtonsLayout = new QHBoxLayout();
    rangeButtonsLayout->addWidget(m_newRangeButton);
    rangeButtonsLayout->addWidget(m_deleteRangeButton);

    QVBoxLayout* rangeListLayout = new QVBoxLayout;
    rangeListLayout->addWidget(m_rangeListLabel);
    rangeListLayout->addWidget(m_rangeList);
    rangeListLayout->addLayout(rangeButtonsLayout);

    QHBoxLayout* nameEditLayout = new QHBoxLayout();
    nameEditLayout->addWidget(m_nameEditLabel);
    nameEditLayout->addWidget(m_nameEdit);

    QVBoxLayout* rangeEditLayout = new QVBoxLayout();
    rangeEditLayout->addLayout(nameEditLayout);
    rangeEditLayout->addWidget(m_rangeEditLabel);
    rangeEditLayout->addWidget(m_rangeEdit);
    rangeEditLayout->addWidget(m_resultListLabel);
    rangeEditLayout->addWidget(m_resultList);

    QHBoxLayout *topLayout = new QHBoxLayout;
    topLayout->addLayout(rangeListLayout);
    topLayout->addLayout(rangeEditLayout);

    QVBoxLayout *vboxLayout = new QVBoxLayout(this);
    vboxLayout->addLayout(topLayout);
    vboxLayout->addWidget(hSeparatorLine);
    vboxLayout->addWidget(m_buttonBox);
}
TransparencyDialog::TransparencyDialog( QWidget * parent, ViewerRendererWidget * vrw )
  : QDialog( parent )
  , m_renderer( vrw )
{
  DP_ASSERT( m_renderer );

  setWindowTitle( "Transparency Settings" );
  setWindowFlags( windowFlags() & ~Qt::WindowContextHelpButtonHint );

  m_restoreTransparencyMode = m_renderer->getTransparencyMode();
  QRadioButton * noneButton = new QRadioButton( "None" );
  noneButton->setChecked( m_restoreTransparencyMode == dp::sg::renderer::rix::gl::TransparencyMode::NONE );
  QRadioButton * sortedBlendedButton = new QRadioButton( "Sorted Blended" );
  sortedBlendedButton->setChecked( m_restoreTransparencyMode == dp::sg::renderer::rix::gl::TransparencyMode::SORTED_BLENDED );
  QRadioButton * orderIndependentClosestListButton = new QRadioButton( "Order Independent Closest List" );
  orderIndependentClosestListButton->setChecked( m_restoreTransparencyMode == dp::sg::renderer::rix::gl::TransparencyMode::ORDER_INDEPENDENT_CLOSEST_LIST );
  QRadioButton * orderIndependentAllButton = new QRadioButton( "Order Independent All" );
  orderIndependentAllButton->setChecked( m_restoreTransparencyMode == dp::sg::renderer::rix::gl::TransparencyMode::ORDER_INDEPENDENT_ALL );

  QButtonGroup * buttonGroup = new QButtonGroup();
  buttonGroup->addButton( noneButton, static_cast<int>(dp::sg::renderer::rix::gl::TransparencyMode::NONE) );
  buttonGroup->addButton( sortedBlendedButton, static_cast<int>(dp::sg::renderer::rix::gl::TransparencyMode::SORTED_BLENDED) );
  buttonGroup->addButton( orderIndependentClosestListButton, static_cast<int>(dp::sg::renderer::rix::gl::TransparencyMode::ORDER_INDEPENDENT_CLOSEST_LIST) );
  buttonGroup->addButton( orderIndependentAllButton, static_cast<int>(dp::sg::renderer::rix::gl::TransparencyMode::ORDER_INDEPENDENT_ALL) );
  connect( buttonGroup, SIGNAL(buttonClicked(int)), this, SLOT(buttonClicked(int)) );

  m_restoreLayers = m_renderer->getOITDepth();
  m_layersBox = new QSpinBox();
  m_layersBox->setMinimum( 1 );
  m_layersBox->setValue( m_restoreLayers );
  m_layersBox->setEnabled( ( m_restoreTransparencyMode == dp::sg::renderer::rix::gl::TransparencyMode::ORDER_INDEPENDENT_CLOSEST_ARRAY )
                        || ( m_restoreTransparencyMode == dp::sg::renderer::rix::gl::TransparencyMode::ORDER_INDEPENDENT_CLOSEST_LIST ) );
  connect( m_layersBox, SIGNAL(valueChanged(int)), this, SLOT(layersChanged(int)) );
  QFormLayout * layersLayout = new QFormLayout;
  layersLayout->addRow( "Transparency Layers", m_layersBox );

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

  QDialogButtonBox * dbb = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
  dbb->button( QDialogButtonBox::Ok )->setDefault ( true );
  connect( dbb, SIGNAL(accepted()), this, SLOT(accept()) );
  connect( dbb, SIGNAL(rejected()), this, SLOT(reject()) );

  QVBoxLayout * vLayout = new QVBoxLayout();
  vLayout->addWidget( noneButton );
  vLayout->addWidget( sortedBlendedButton );
  vLayout->addWidget( orderIndependentClosestListButton );
  vLayout->addLayout( layersLayout );
  vLayout->addWidget( orderIndependentAllButton );
  vLayout->addWidget( separatorLine );
  vLayout->addWidget( dbb );

  setLayout( vLayout );
  adjustSize();
  setMinimumSize( size() );
  setMaximumSize( size() );
}
QWidget * MainWindow::newHorizLine(QWidget *parent)
{
    QFrame *frame = new QFrame(parent);
    frame->setFrameShape(QFrame::HLine);
    frame->setFrameShadow(QFrame::Sunken);
    frame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
    return frame;
}
Example #21
0
    CreateUserDialog::CreateUserDialog(const QString &serverName,
        const QString &database, const MongoUser &user,
        QWidget *parent) : QDialog(parent),
        _user(user)
    {
        VERIFY(user.version() < MongoUser::minimumSupportedVersion);
        setWindowTitle("Add User");
        setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); // Remove help button (?)
        setMinimumWidth(400);

        Indicator *serverIndicator = new Indicator(GuiRegistry::instance().serverIcon(), serverName);
        Indicator *databaseIndicator = new Indicator(GuiRegistry::instance().databaseIcon(), database);

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

        _userNameLabel= new QLabel("Name:");
        _userNameEdit = new QLineEdit();
        _userNameEdit->setText(QtUtils::toQString(user.name()));
        _userPassLabel= new QLabel("Password:");
        _userPassEdit = new QLineEdit();
        _userPassEdit->setEchoMode(QLineEdit::Password);
        _readOnlyCheckBox = new QCheckBox("Read Only");
        _readOnlyCheckBox->setChecked(user.readOnly());

        QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
        buttonBox->setOrientation(Qt::Horizontal);
        buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Save);
        VERIFY(connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())));
        VERIFY(connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())));

        QHBoxLayout *hlayout = new QHBoxLayout();
        hlayout->addStretch(1);
        hlayout->addWidget(buttonBox);

        QHBoxLayout *vlayout = new QHBoxLayout();
        vlayout->addWidget(serverIndicator, 0, Qt::AlignLeft);
        vlayout->addWidget(databaseIndicator, 0, Qt::AlignLeft);
        vlayout->addStretch(1);

        QGridLayout *namelayout = new QGridLayout();
        namelayout->setContentsMargins(0, 7, 0, 7);
        namelayout->addWidget(_userNameLabel, 0, 0);
        namelayout->addWidget(_userNameEdit, 0, 1);
        namelayout->addWidget(_userPassLabel, 1, 0);
        namelayout->addWidget(_userPassEdit, 1, 1);
        namelayout->addWidget(_readOnlyCheckBox, 2, 1);

        QVBoxLayout *layout = new QVBoxLayout();
        layout->addLayout(vlayout);
        layout->addWidget(hline);
        layout->addLayout(namelayout);
        layout->addLayout(hlayout);
        setLayout(layout);

        _userNameEdit->setFocus();
    }
Example #22
0
FunctionTextEditor::FunctionTextEditor(const QString &server, const QString &database,
                                       const MongoFunction &function, QWidget *parent) :
    QDialog(parent),
    _function(function)
{
    setMinimumWidth(700);
    setMinimumHeight(550);

    Indicator *databaseIndicator = new Indicator(GuiRegistry::instance().databaseIcon(), database);
    Indicator *serverIndicator = new Indicator(GuiRegistry::instance().serverIcon(), server);

    QPushButton *cancel = new QPushButton("Cancel");
    connect(cancel, SIGNAL(clicked()), this, SLOT(close()));

    QPushButton *save = new QPushButton("Save");
    save->setIcon(qApp->style()->standardIcon(QStyle::SP_ArrowRight));
    connect(save, SIGNAL(clicked()), this, SLOT(accept()));

    _nameEdit = new QLineEdit(function.name());

    _queryText = new RoboScintilla;
    _textFont = chooseTextFont();
    _configureQueryText();
    _queryText->setText(_function.code());

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

    QHBoxLayout *hlayout = new QHBoxLayout();
    hlayout->setContentsMargins(2, 0, 5, 1);
    hlayout->setSpacing(0);
    hlayout->addWidget(serverIndicator, 0, Qt::AlignLeft);
    hlayout->addWidget(databaseIndicator, 0, Qt::AlignLeft);
    hlayout->addStretch(1);

    QHBoxLayout *bottomlayout = new QHBoxLayout();
    bottomlayout->addStretch(1);

#if defined(Q_OS_MAC)
    save->setDefault(true);
    bottomlayout->addWidget(cancel, 0, Qt::AlignRight);
    bottomlayout->addWidget(save, 0, Qt::AlignRight);
#else
    bottomlayout->addWidget(save, 0, Qt::AlignRight);
    bottomlayout->addWidget(cancel, 0, Qt::AlignRight);
#endif

    QVBoxLayout *layout = new QVBoxLayout();
    layout->addLayout(hlayout);
    layout->addWidget(hline);
    layout->addWidget(new QLabel("Name:"));
    layout->addWidget(_nameEdit);
    layout->addWidget(new QLabel("Code:"));
    layout->addWidget(_queryText);
    layout->addLayout(bottomlayout);
    setLayout(layout);
}
Example #23
0
QFrame* AddLineSeparator(QWidget* parent)
{
    QFrame* line = new QFrame(parent);
    line->setObjectName(QString::fromUtf8("line"));
    line->setFrameShape(QFrame::HLine);
    line->setFrameShadow(QFrame::Sunken);
    line->setFixedHeight(10);
    return line;
}
void
MultiplayerDialog::addLine( QLayout* _layout )
{
	QFrame* line = new QFrame();
	line->setFrameShape( QFrame::HLine );
	line->setFrameShadow( QFrame::Sunken );
	_layout->addWidget( line );

} // MultiplayerDialog::addLine
Example #25
0
bool TaskWidget::addHLineToGrid(QGridLayout* grid, unsigned int row, unsigned int maxcol)
{
  QFrame * line = new QFrame(this, "line");
  line->setFrameShape(QFrame::HLine);
  line->setFrameShadow(QFrame::Sunken);
  grid->addMultiCellWidget(line, row, row, 0, maxcol);

  return true;
}
QFrame * createLine()
{
	QFrame * line = new QFrame();
    line->setObjectName(QString::fromUtf8("line"));
    //line->setGeometry(QRect(320, 150, 118, 3));
    line->setFrameShape(QFrame::HLine);
    line->setFrameShadow(QFrame::Sunken);

	return line;
}
Example #27
0
File: qt4.cpp Project: m8a/uim
void UimPrefDialog::createMainWidgets()
{
    QVBoxLayout *mainVLayout = new QVBoxLayout( this );
    mainVLayout->setMargin( 6 );

    QSplitter *mainSplitter = new QSplitter( this );

    /* ListView */
    m_groupListView = new QTreeWidget( mainSplitter );
    m_groupListView->setRootIsDecorated( false );
    m_groupListView->setHeaderLabel( _("Group") );
    m_groupListView->setSelectionMode( QAbstractItemView::SingleSelection );
    connect( m_groupListView, SIGNAL(itemSelectionChanged()),
                      this, SLOT(slotItemSelectionChanged()) );

    /* Contents Frame */
    m_rightSideWidget = new QScrollArea( mainSplitter );
    m_rightSideWidget->setWidgetResizable( true );
    m_groupWidgetStack = new QStackedWidget;

    /* Buttons */
    QWidget *buttonHWidget = new QWidget( this );
    buttonHWidget->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed);
    QHBoxLayout *buttonHLayout = new QHBoxLayout( buttonHWidget );
    buttonHLayout->setMargin( 6 );
    buttonHLayout->setSpacing( 6 );
    QPushButton *defaultButton = new QPushButton( _("Defaults"), buttonHWidget );
    connect( defaultButton, SIGNAL(clicked()),
                      this, SLOT(slotSetDefault()) );
    QPushButton *okButton = new QPushButton( _("OK"), buttonHWidget );
    connect( okButton, SIGNAL(clicked()),
                      this, SLOT(slotOK()) );
    m_applyButton = new QPushButton( _("Apply"), buttonHWidget );
    m_applyButton->setEnabled( false );
    connect( m_applyButton, SIGNAL(clicked()),
                      this, SLOT(slotApply()) );
    QPushButton *cancelButton = new QPushButton( _("Cancel"), buttonHWidget );
    connect( cancelButton, SIGNAL(clicked()),
                      this, SLOT(slotCancel()) );
    buttonHLayout->addWidget( defaultButton );
    buttonHLayout->addStretch();
    buttonHLayout->addWidget( okButton );
    buttonHLayout->addWidget( m_applyButton );
    buttonHLayout->addWidget( cancelButton );

    QFrame *separator = new QFrame( this );
    separator->setFrameShape( QFrame::HLine );
    separator->setFrameShadow( QFrame::Sunken );
    mainVLayout->setMargin( 0 );
    mainVLayout->addWidget( mainSplitter );
    mainVLayout->addWidget( separator );
    mainVLayout->addWidget( buttonHWidget );

    mainSplitter->setStretchFactor( 1, 1 );
}
Example #28
0
CreateUserDialog::CreateUserDialog(const QString &serverName,
                                   const QString &database, const MongoUser &user,
                                   QWidget *parent) : QDialog(parent),
    _user(user)
{
    setWindowTitle("Add User");
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); // Remove help button (?)
    setMinimumWidth(400);

    Indicator *serverIndicator = new Indicator(GuiRegistry::instance().serverIcon(), serverName);
    Indicator *databaseIndicator = new Indicator(GuiRegistry::instance().databaseIcon(), database);

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

    _userNameLabel= new QLabel("Name:");
    _userNameEdit = new QLineEdit();
    _userNameEdit->setText(user.name());
    _userPassLabel= new QLabel("Password:");
    _userPassEdit = new QLineEdit();
    _readOnlyCheckBox = new QCheckBox("Read Only");
    _readOnlyCheckBox->setChecked(user.readOnly());

    QPushButton *cancelButton = new QPushButton("&Cancel");
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(close()));

    QPushButton *_okButton = new QPushButton("&Create");
    connect(_okButton, SIGNAL(clicked()), this, SLOT(accept()));

    QHBoxLayout *hlayout = new QHBoxLayout();
    hlayout->addStretch(1);
    hlayout->addWidget(_okButton, 0, Qt::AlignRight);
    hlayout->addWidget(cancelButton, 0, Qt::AlignRight);

    QHBoxLayout *vlayout = new QHBoxLayout();
    vlayout->addWidget(serverIndicator, 0, Qt::AlignLeft);
    vlayout->addWidget(databaseIndicator, 0, Qt::AlignLeft);
    vlayout->addStretch(1);

    QGridLayout *namelayout = new QGridLayout();
    namelayout->setContentsMargins(0, 7, 0, 7);
    namelayout->addWidget(_userNameLabel, 0, 0);
    namelayout->addWidget(_userNameEdit,  0, 1);
    namelayout->addWidget(_userPassLabel, 1, 0);
    namelayout->addWidget(_userPassEdit,  1, 1);
    namelayout->addWidget(_readOnlyCheckBox,  2, 1);

    QVBoxLayout *layout = new QVBoxLayout();
    layout->addLayout(vlayout);
    layout->addWidget(hline);
    layout->addLayout(namelayout);
    layout->addLayout(hlayout);
    setLayout(layout);
}
Example #29
0
CreateDatabaseDialog::CreateDatabaseDialog(const QString &serverName, const QString &database,
                                           const QString &collection, QWidget *parent) :
    QDialog(parent)
{
    setWindowTitle("Create Database");
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); // Remove help button (?)
    setMinimumWidth(300);

    Indicator *serverIndicator = new Indicator(GuiRegistry::instance().serverIcon(), serverName);

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

    _inputEdit = new QLineEdit();
    _inputLabel= new QLabel("Database Name:");

    QPushButton *cancelButton = new QPushButton("&Cancel");
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(close()));

    _okButton = new QPushButton("&Create");
    connect(_okButton, SIGNAL(clicked()), this, SLOT(accept()));

    QHBoxLayout *hlayout = new QHBoxLayout();
    hlayout->addStretch(1);

#if defined(Q_OS_MAC)
    _okButton->setDefault(true);
    hlayout->addWidget(cancelButton, 0, Qt::AlignRight);
    hlayout->addWidget(_okButton, 0, Qt::AlignRight);
#else
    hlayout->addWidget(_okButton, 0, Qt::AlignRight);
    hlayout->addWidget(cancelButton, 0, Qt::AlignRight);
#endif

    QHBoxLayout *vlayout = new QHBoxLayout();
    if (!serverName.isEmpty())
        vlayout->addWidget(serverIndicator, 0, Qt::AlignLeft);
    if (!database.isEmpty())
        vlayout->addWidget(createDatabaseIndicator(database), 0, Qt::AlignLeft);
    if (!collection.isEmpty())
        vlayout->addWidget(createCollectionIndicator(collection), 0, Qt::AlignLeft);

    QVBoxLayout *namelayout = new QVBoxLayout();
    namelayout->setContentsMargins(0, 7, 0, 7);
    namelayout->addWidget(_inputLabel);
    namelayout->addWidget(_inputEdit);

    QVBoxLayout *layout = new QVBoxLayout();
    layout->addLayout(vlayout);
    layout->addWidget(hline);
    layout->addLayout(namelayout);
    layout->addLayout(hlayout);
    setLayout(layout);
}
Example #30
0
//BEGIN class PinMapEditor
PinMapEditor::PinMapEditor( PinMapping * pinMapping, MicroInfo * picInfo, QWidget * parent, const char * name )
	: //KDialog( parent, name, true, i18n("Pin Map Editor"), Ok|Apply|Cancel, KDialog::Ok, true )
	  KDialog( parent ) //, name, true, i18n("Pin Map Editor"), Ok|Apply|Cancel, KDialog::Ok, true )
{
    setName(name);
    setModal(true);
    setCaption(i18n("Pin Map Editor"));
    setButtons(KDialog::Ok | KDialog::Apply | KDialog::Cancel);
    setDefaultButton(KDialog::Ok);
    showButtonSeparator(true);

	m_pPinMapping = pinMapping;
	
	m_pPinMapDocument = new PinMapDocument();
	
	Q3Accel * accel = new Q3Accel( this );
	accel->connectItem( accel->insertItem( Qt::Key_Delete ),
						m_pPinMapDocument,
						SLOT(deleteSelection()) );
	
	accel->connectItem( accel->insertItem( KStandardShortcut::selectAll().primary() ),
						m_pPinMapDocument,
						SLOT(selectAll()) );
	
	accel->connectItem( accel->insertItem( KStandardShortcut::undo().primary() ),
						m_pPinMapDocument,
						SLOT(undo()) );
	
	accel->connectItem( accel->insertItem( KStandardShortcut::redo().primary() ),
						m_pPinMapDocument,
						SLOT(redo()) );
	
	
	QFrame * f = new QFrame(this);
	f->setMinimumWidth( 480 );
	f->setMinimumHeight( 480 );
	
	f->setFrameShape( QFrame::Box );
	f->setFrameShadow( QFrame::Plain );
	QVBoxLayout * fLayout = new QVBoxLayout( f, 1, 0, "fLayout" );

	ViewContainer * vc = new ViewContainer( 0, f );
	fLayout->addWidget( vc );
	
	m_pPinMapView = static_cast<PinMapView*>(m_pPinMapDocument->createView( vc, 0 ));
	
	//qApp->processEvents(); // 2015.07.07 - do not process events, if it is not urgently needed; might generate crashes?
	
	m_pPinMapDocument->init( *m_pPinMapping, picInfo );
	
    showButtonSeparator( false );
	// enableButtonSeparator( false );

	setMainWidget(f);
}