예제 #1
1
ProceduralLevelGenerator::ProceduralLevelGenerator( QWidget* parent, GL2DProceduralLevel* params )
   : QFrame( parent )
   , m_params( params )
   , m_root( params->getParent() )
{
   QVBoxLayout* layout = new QVBoxLayout( this );
   setLayout( layout );

   QToolBar* toolbar = new QToolBar( this );
   {
      layout->addWidget( toolbar );

      QAction* generateLevelAction = toolbar->addAction( QIcon( ":/TamyEditor/Resources/Icons/Editor/play.png" ), "Generate level" );
      connect( generateLevelAction, SIGNAL( triggered() ), this, SLOT( generateScene() ) );
   }
   
   QFrame* statusBar = new QFrame( this );
   {
      layout->addWidget( statusBar );

      QHBoxLayout* statusBarLayout = new QHBoxLayout( statusBar );
      statusBarLayout->setSpacing( 0 );
      statusBarLayout->setMargin( 0 );
      statusBar->setLayout( statusBarLayout );

      QLabel* statusLabel = new QLabel( "Status: ", this );
      statusLabel->setMaximumWidth( 100 );
      statusBarLayout->addWidget( statusLabel );

      m_status = new QLabel( this );
      statusBarLayout->addWidget( m_status );
   }
}
예제 #2
0
void npc_text_view::setView(int id)
{
    setLayout(new QVBoxLayout{});
    std::multimap<int,std::tuple<float,QString,QString>> * l_map = m_dbcache->get_npc_text_resource();
    // loop through all the texts and present with probability
    for(auto it = l_map->lower_bound(id); it != l_map->upper_bound(id); ++it)
    {
        float   p = std::get<0>((*it).second);
        QString t0 = std::get<1>((*it).second);
        QString t1 = std::get<2>((*it).second);
        int a = (t0.length()!=0) + (t1.length()!=0)*2;
        int c = (t0.length()!=0) + (t1.length()!=0);
        QGroupBox * box = new QGroupBox(QString::number(p*100) + QString("%"));
        box->setLayout(new QHBoxLayout{});
        layout()->addWidget(box);
        switch(c)
        {
        case 1: // Present only one of the texts
        {
            QLabel * label = new QLabel{};
            label->setMaximumWidth(400);
            label->setWordWrap(true);
            label->setFrameStyle(QFrame::Panel | QFrame::Sunken);
            box->layout()->addWidget(label);
            if(a==1) // t0 isnt empty
            {
                label->setText(t0);
            }
            if(a==2) // t1 isnt empty
            {
                label->setText(t1);
            }
            label->setAlignment(Qt::AlignCenter);
            break;
        }
        case 2: // Present both of the texts
        {
            QLabel * label0 = new QLabel{t0};
            label0->setMaximumWidth(400);
            label0->setWordWrap(true);
            QLabel * labelOR = new QLabel{" or "};
            labelOR->setMaximumWidth(20);
            QLabel * label1 = new QLabel{t1};
            label1->setMaximumWidth(400);
            label1->setWordWrap(true);
            label0->setFrameStyle(QFrame::Panel | QFrame::Sunken);
            label1->setFrameStyle(QFrame::Panel | QFrame::Sunken);
            box->layout()->addWidget(label0);
            box->layout()->addWidget(labelOR);
            box->layout()->addWidget(label1);
            break;
        }
        default:
            break;
        }
    }
}
예제 #3
0
void SearchControl::initialize()
{
	QHBoxLayout * layoutSearch = new QHBoxLayout();
	QVBoxLayout * layout = new QVBoxLayout();
	QHBoxLayout * layoutTracks = new QHBoxLayout();
	QHBoxLayout * layoutAnnotations = new QHBoxLayout();
	
	QPushButton * clearButton = new QPushButton("Clear");
	QCheckBox * caseCheckBox = new QCheckBox("Match case");
	lineEdit = new QLineEdit();
	labelResultsTracks = new StatusLabel();
	labelResultsAnnotations = new StatusLabel();
	
	QLabel * labelTracks = new QLabel(tr("tracks"));
	QLabel * labelAnnotations = new QLabel(tr("annotations"));
	
	labelResultsAnnotations->setMinimumWidth(100);
	labelResultsAnnotations->setMaximumWidth(100);
	labelAnnotations->setMinimumWidth(100);
	labelAnnotations->setMaximumWidth(100);
	labelResultsTracks->setMinimumWidth(100);
	labelResultsTracks->setMaximumWidth(100);
	labelTracks->setMinimumWidth(100);
	labelTracks->setMaximumWidth(100);
	labelResultsTracks->setMinimumHeight(19);
	labelResultsAnnotations->setMinimumHeight(19);
	
	layoutSearch->addWidget(lineEdit);
	layoutSearch->addWidget(clearButton);
	layout->addLayout(layoutSearch);
	layout->addWidget(caseCheckBox);
	layoutTracks->addWidget(labelResultsTracks);
	layoutTracks->addWidget(labelTracks);
	layoutTracks->setAlignment(Qt::AlignLeft);
	layoutAnnotations->addWidget(labelResultsAnnotations);
	layoutAnnotations->addWidget(labelAnnotations);
	layoutAnnotations->setAlignment(Qt::AlignLeft);
	layout->addLayout(layoutTracks);
	layout->addLayout(layoutAnnotations);
	
	qDeleteAll(children());
	delete this->layout();
	setLayout(layout);
	
	connect(lineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged(const QString &)));
	connect(clearButton, SIGNAL(clicked()), this, SLOT(clear()));
	connect(caseCheckBox, SIGNAL(stateChanged(int)), this, SLOT(matchCaseChaged(int)));
	
	matchCase = false;
	setWindowTitle("Find");
	adjustSize();
}
예제 #4
0
QWidget *PartsEditorViewsWidget::addZoomControlsAndBrowseButton(PartsEditorView *view) {
    QFrame *container1 = new QFrame(this);
    QVBoxLayout *lo1 = new QVBoxLayout(container1);
    lo1->setSpacing(1);
    lo1->setMargin(0);

    QLabel *button = new QLabel(QString("<a href='#'>%1</a>").arg(tr("Load image..")), this);
    button->setObjectName("browseButton");
    button->setMinimumWidth(85);
    button->setMaximumWidth(85);
    button->setFixedHeight(20);
    button->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);

    connect(button, SIGNAL(linkActivated(const QString&)), view, SLOT(loadFile()));
    QHBoxLayout *lo2 = new QHBoxLayout();
    lo2->setSpacing(1);
    lo2->setMargin(0);
    lo2->addWidget(button);
    lo2->addWidget(new ZoomControls(view,container1));

    lo1->addWidget(view);
    lo1->addLayout(lo2);

    return container1;
}
예제 #5
0
void Wizard::setupPage1()
{
    page1 = new QHBox( this );
    page1->setSpacing(8);

    QLabel *info = new QLabel( page1 );
    info->setPalette( yellow );
    info->setText( "Enter your personal\n"
                   "key here.\n\n"
                   "Your personal key\n"
                   "consists of 4 digits" );
    info->setIndent( 8 );
    info->setMaximumWidth( info->sizeHint().width() );

    QVBox *page = new QVBox( page1 );

    QHBox *row1 = new QHBox( page );

    (void)new QLabel( "Key:", row1 );

    key = new QLineEdit( row1 );
    key->setMaxLength( 4 );
    key->setValidator( new QIntValidator( 9999, 0, key ) );

    connect( key, SIGNAL( textChanged( const QString & ) ), this, SLOT( keyChanged( const QString & ) ) );

    addPage( page1, "Personal Key" );

    setNextEnabled( page1, FALSE );
    setHelpEnabled( page1, FALSE );
}
예제 #6
0
EdLevelResourceSound::EdLevelResourceSound (const FilePath &path)
{
    
    EdLevelSoundThumbnail *item = new EdLevelSoundThumbnail(this);
    item->setSound(path);
    item->setMaximumWidth(128);
    item->setMinimumWidth(128);
    item->setMaximumHeight(128);
    item->setMinimumHeight(128);

    QLabel *title = new QLabel(this);
    title->setMaximumWidth(200);
    title->setMinimumWidth(200);
    title->setText(path.file_name().c_str());
    
    QGridLayout *layout = new QGridLayout;
    layout->setContentsMargins(2,2,2,2);
    layout->setHorizontalSpacing(0);
    layout->setVerticalSpacing(0);
    layout->setColumnStretch(1,1);
    layout->addWidget(item,1,0);
    layout->addWidget(title,0,0);

    setLayout(layout);
    
    setMinimumHeight(15+2+128);
    setMinimumWidth(200);
    setMaximumWidth(200);
}
예제 #7
0
LibraryScannerDlg::LibraryScannerDlg(QWidget * parent, Qt::WindowFlags f)
        : QWidget(parent, f),
          m_bCancelled(false) {

    setWindowIcon(QIcon(":/images/ic_mixxx_window.png"));

    QVBoxLayout* pLayout = new QVBoxLayout(this);

    setWindowTitle(tr("Library Scanner"));
    QLabel* pLabel = new QLabel(tr("It's taking Mixxx a minute to scan your music library, please wait..."),this);
    pLayout->addWidget(pLabel);

    QPushButton* pCancel = new QPushButton(tr("Cancel"), this);
    connect(pCancel, SIGNAL(clicked()),
            this, SLOT(slotCancel()));
    pLayout->addWidget(pCancel);

    QLabel* pCurrent = new QLabel(this);
    pCurrent->setMaximumWidth(600);
    pCurrent->setWordWrap(true);
    connect(this, SIGNAL(progress(QString)),
            pCurrent, SLOT(setText(QString)));
    pLayout->addWidget(pCurrent);
    setLayout(pLayout);

    m_timer.start();
}
예제 #8
0
/**
 * Draws neural network layer topology.
 */
void LayerEditWidget::setNeuronImageFrame() {
    QString labelStyle;

    if(inputLayer) {
        labelStyle =
            "background-image: url(:/neuron1w);"
            "background-position: center center;"
            "background-repeat: no-repeat;";
    } else {
        labelStyle =
            "background-image: url(:/neuron3w);"
            "background-position: center center;"
            "background-repeat: no-repeat;";
    }

    for(int i = 0; i < neuronList.count(); i++) {
        ui->neuronImageFrame->layout()->removeWidget(neuronList[i]);
        delete neuronList[i];
    }
    neuronList.clear();

    if(ui->neuronCountSpinBox->value() <= 7) {
        for(int i = 1; i < ui->neuronCountSpinBox->value()+1; i++) {
            QLabel* neuron = new QLabel(ui->neuronImageFrame);
            neuron->setMaximumWidth(36);
            neuron->setMinimumWidth(36);
            neuron->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
            neuron->setStyleSheet(labelStyle);
            neuron->setText(QString::number(i));
            neuronList.append(neuron);
            ui->neuronImageFrame->layout()->addWidget(neuron);
        }
    } else {
        for(int i = 1; i < 8; i++) {
            QLabel* neuron = new QLabel(ui->neuronImageFrame);
            neuron->setMaximumWidth(36);
            neuron->setMinimumWidth(36);
            neuron->setStyleSheet(labelStyle);
            neuron->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
            if(i == 7) neuron->setText(QString::number(ui->neuronCountSpinBox->value()));
            else if(i == 6)	neuron->setText(QString("..."));
            else neuron->setText(QString::number(i));
            neuronList.append(neuron);
            ui->neuronImageFrame->layout()->addWidget(neuron);
        }
    }
}
예제 #9
0
void Wizard::setupPage3()
{
    page3 = new QHBox( this );
    page3->setSpacing(8);

    QLabel *info = new QLabel( page3 );
    info->setPalette( yellow );
    info->setText( "\n"
                   "  Look here to see of  \n"
                   "  the data you entered  \n"
                   "  is correct. To confirm,  \n"
                   "  press the [Finish] button  \n"
                   "  else go back to correct  \n"
                   "  mistakes." );
    info->setIndent(8);
    info->setAlignment( AlignTop|AlignLeft );
    info->setMaximumWidth( info->sizeHint().width() );

    QVBox *page = new QVBox( page3 );

    QHBox *row1 = new QHBox( page );
    QHBox *row2 = new QHBox( page );
    QHBox *row3 = new QHBox( page );
    QHBox *row4 = new QHBox( page );
    QHBox *row5 = new QHBox( page );
    QHBox *row6 = new QHBox( page );

    QLabel *label1 = new QLabel( " Personal Key: ", row1 );
    label1->setAlignment( Qt::AlignVCenter );
    QLabel *label2 = new QLabel( " First Name: ", row2 );
    label2->setAlignment( Qt::AlignVCenter );
    QLabel *label3 = new QLabel( " Last Name: ", row3 );
    label3->setAlignment( Qt::AlignVCenter );
    QLabel *label4 = new QLabel( " Address: ", row4 );
    label4->setAlignment( Qt::AlignVCenter );
    QLabel *label5 = new QLabel( " Phone Number: ", row5 );
    label5->setAlignment( Qt::AlignVCenter );
    QLabel *label6 = new QLabel( " E-Mail: ", row6 );
    label6->setAlignment( Qt::AlignVCenter );

    label1->setMinimumWidth( label1->sizeHint().width() );
    label2->setMinimumWidth( label1->sizeHint().width() );
    label3->setMinimumWidth( label1->sizeHint().width() );
    label4->setMinimumWidth( label1->sizeHint().width() );
    label5->setMinimumWidth( label1->sizeHint().width() );
    label6->setMinimumWidth( label1->sizeHint().width() );

    lKey = new QLabel( row1 );
    lFirstName = new QLabel( row2 );
    lLastName = new QLabel( row3 );
    lAddress = new QLabel( row4 );
    lPhone = new QLabel( row5 );
    lEmail = new QLabel( row6 );

    addPage( page3, "Finish" );

    setFinish( page3, TRUE );
    setHelpEnabled( page3, FALSE );
}
예제 #10
0
void Wizard::setupPage2()
{
    page2 = new QHBox( this );
    page2->setSpacing(8);

    QLabel *info = new QLabel( page2 );
    info->setPalette( yellow );
    info->setText( "\n"
                   "  Enter your personal  \n"
                   "  data here.  \n\n"
                   "  The required fields are  \n"
                   "  First Name, Last Name \n"
                   "  and E-Mail.  \n" );
    info->setIndent(8);
    info->setMaximumWidth( info->sizeHint().width() );

    QVBox *page = new QVBox( page2 );

    QHBox *row1 = new QHBox( page );
    QHBox *row2 = new QHBox( page );
    QHBox *row3 = new QHBox( page );
    QHBox *row4 = new QHBox( page );
    QHBox *row5 = new QHBox( page );

    QLabel *label1 = new QLabel( " First Name: ", row1 );
    label1->setAlignment( Qt::AlignVCenter );
    QLabel *label2 = new QLabel( " Last Name: ", row2 );
    label2->setAlignment( Qt::AlignVCenter );
    QLabel *label3 = new QLabel( " Address: ", row3 );
    label3->setAlignment( Qt::AlignVCenter );
    QLabel *label4 = new QLabel( " Phone Number: ", row4 );
    label4->setAlignment( Qt::AlignVCenter );
    QLabel *label5 = new QLabel( " E-Mail: ", row5 );
    label5->setAlignment( Qt::AlignVCenter );

    label1->setMinimumWidth( label4->sizeHint().width() );
    label2->setMinimumWidth( label4->sizeHint().width() );
    label3->setMinimumWidth( label4->sizeHint().width() );
    label4->setMinimumWidth( label4->sizeHint().width() );
    label5->setMinimumWidth( label4->sizeHint().width() );

    firstName = new QLineEdit( row1 );
    lastName = new QLineEdit( row2 );
    address = new QLineEdit( row3 );
    phone = new QLineEdit( row4 );
    email = new QLineEdit( row5 );

    connect( firstName, SIGNAL( textChanged( const QString & ) ), this, SLOT( dataChanged( const QString & ) ) );
    connect( lastName, SIGNAL( textChanged( const QString & ) ), this, SLOT( dataChanged( const QString & ) ) );
    connect( email, SIGNAL( textChanged( const QString & ) ), this, SLOT( dataChanged( const QString & ) ) );

    addPage( page2, "Personal Data" );

    setHelpEnabled( page2, FALSE );
}
예제 #11
0
void LyricWidget::setLyric(const QLyricList &lyric) {
    if (animWidget) delete animWidget;
    animWidget = new QWidget(this);
    animWidget->raise();
    ui->border->raise();
    QRect geo = this->geometry();
    animWidget->setMinimumWidth(geo.width());
    animWidget->setMaximumWidth(geo.width());
    animWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    QVBoxLayout *vbox = new QVBoxLayout(animWidget);
    vbox->setMargin(0);
    vbox->setSpacing(0);
    vbox->setContentsMargins(0, 0, 0, 0);
    animWidget->setLayout(vbox);

    labels.clear();
    curInd = 0;
    this->lyric = lyric;
    firstShowing = false;

    int widgetWidth = this->geometry().width();
    int accuHeight = 0;
    for (const QLyric& lyr : lyric) {
        QLabel *label = new QLabel(animWidget);
        QFont font("文泉驿微米黑", 11);
        font.setStyleStrategy(QFont::PreferAntialias);
        label->setFont(font);
        label->setText(QString("<font color='grey'>") +
                        lyr.lyric + QString("</font>"));
        label->setMaximumWidth(widgetWidth);
        label->setMaximumWidth(widgetWidth);
        label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
        label->setWordWrap(true);
        labels.append(label);
        QRect fsize = label->fontMetrics().boundingRect(label->text());
        int height = (widgetWidth + fsize.width()) / widgetWidth * fsize.height() + 15;
        heights.append(height);
        label->setMinimumHeight(height);
        label->setMaximumHeight(height);
        accuHeight += height;

        animWidget->layout()->addWidget(label);
    }

    if (heights.size() > 0) {
        animWidget->setGeometry(0, this->geometry().height() / 2 + heights[0],
                                this->geometry().width(), accuHeight);
    }
    animWidget->show();
    ui->border->setText("");
}
예제 #12
0
void SearchView::updateRecentKeywords() {
    // load
    QSettings settings;
    QStringList keywords = settings.value(recentKeywordsKey).toStringList();
    if (keywords == recentKeywords) return;
    recentKeywords = keywords;

    // cleanup
    QLayoutItem *item;
    while ((item = recentKeywordsLayout->takeAt(1)) != 0) {
        item->widget()->close();
        delete item;
    }

    recentKeywordsLabel->setVisible(!keywords.isEmpty());
    The::globalActions()->value("clearRecentKeywords")->setEnabled(!keywords.isEmpty());

    foreach (const QString &keyword, keywords) {
        QString link = keyword;
        QString display = keyword;
        if (keyword.startsWith("http://") || keyword.startsWith("https://")) {
            int separator = keyword.indexOf("|");
            if (separator > 0 && separator + 1 < keyword.length()) {
                link = keyword.left(separator);
                display = keyword.mid(separator+1);
            }
        }
        bool needStatusTip = false;
        if (display.length() > 24) {
            display.truncate(24);
            display.append("...");
            needStatusTip = true;
        }
        QLabel *itemLabel = new QLabel("<a href=\"" + link
                                       + "\" style=\"color:palette(text); text-decoration:none\">"
                                       + display + "</a>", this);
        itemLabel->setAttribute(Qt::WA_DeleteOnClose);
        itemLabel->setProperty("recentItem", true);
        itemLabel->setMaximumWidth(queryEdit->toWidget()->width() + watchButton->width());
        itemLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
        // Make links navigable with the keyboard too
        itemLabel->setTextInteractionFlags(Qt::LinksAccessibleByKeyboard | Qt::LinksAccessibleByMouse);
        if (needStatusTip)
            itemLabel->setStatusTip(link);
        connect(itemLabel, SIGNAL(linkActivated(QString)), this, SLOT(watchKeywords(QString)));
        recentKeywordsLayout->addWidget(itemLabel);
    }
예제 #13
0
void KNotesSummaryWidget::updateView()
{
  mNotes = mCalendar->journals();
  QLabel *label;

  for ( label = mLabels.first(); label; label = mLabels.next() )
    label->deleteLater();
  mLabels.clear();

  KIconLoader loader( "knotes" );

  int counter = 0;
  QPixmap pm = loader.loadIcon( "knotes", KIcon::Small );

  KCal::Journal::List::Iterator it;
  if ( mNotes.count() ) {
    for (it = mNotes.begin(); it != mNotes.end(); ++it) {

      // Fill Note Pixmap Field
      label = new QLabel( this );
      label->setPixmap( pm );
      label->setMaximumWidth( label->minimumSizeHint().width() );
      label->setAlignment( AlignVCenter );
      mLayout->addWidget( label, counter, 0 );
      mLabels.append( label );

      // File Note Summary Field
      QString newtext = (*it)->summary();

      KURLLabel *urlLabel = new KURLLabel( (*it)->uid(), newtext, this );
      urlLabel->installEventFilter( this );
      urlLabel->setTextFormat(RichText);
      urlLabel->setAlignment( urlLabel->alignment() | Qt::WordBreak );
      mLayout->addWidget( urlLabel, counter, 1 );
      mLabels.append( urlLabel );

      if ( !(*it)->description().isEmpty() ) {
        QToolTip::add( urlLabel, (*it)->description().left( 80 ) );
      }

      connect( urlLabel, SIGNAL( leftClickedURL( const QString& ) ),
               this, SLOT( urlClicked( const QString& ) ) );
      counter++;
    }

  } else {
예제 #14
0
EdLevelPropertyVector2Field::EdLevelPropertyVector2Field (EdLevelPropertiesWindow *parent, std::shared_ptr<PlugNode> node, std::shared_ptr<ArchiveData> data)
{
    //setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
    _data = data;
    _node = node;

    buildStatusButtons();

    QLabel *name = new QLabel(this);
    name->setMaximumWidth(130);
    name->setMinimumWidth(130);
    name->setText(MoreStrings::captialize_and_format(_data->title()).c_str());

    _value_x = new EdLevelLineEdit(this);
    _value_y = new EdLevelLineEdit(this);

    _value_x->setObjectName("prop");
    _value_y->setObjectName("prop");

    connect(	_value_x,       SIGNAL(editingFinished()),
                this,           SLOT(doWriteParams())	);
    connect(	_value_y,       SIGNAL(editingFinished()),
                this,           SLOT(doWriteParams())	);

    connect(	this,           SIGNAL(doCommand(QString, bool)),
                parent,         SLOT(onCommand(QString, bool))	);

    QGridLayout *layout = new QGridLayout;
    layout->setContentsMargins(0,0,0,0);
    layout->setHorizontalSpacing(0);
    layout->setVerticalSpacing(0);
    layout->addWidget(keyButton(),0,0);
    layout->addWidget(hasInputButton(),0,1);
    layout->addWidget(hasOutputButton(),0,2);
    layout->addWidget(name,0,3);
    layout->addWidget(_value_x,0,4);
    layout->addWidget(_value_y,0,5);

    setLayout(layout);

    setMinimumHeight(15+2);

    doReadParams();
}
예제 #15
0
void MagnatuneCollectionLocation::showSourceDialog( const Meta::TrackList &tracks, bool removeSources )
{
    KDialog dialog;
    dialog.setCaption( i18n( "Preview Tracks" ) );
    dialog.setButtons( KDialog::Ok | KDialog::Cancel );

    QLabel *label = new QLabel( i18n( "The tracks you are about to copy are Magnatune.com preview streams. For better quality and advert free streams, consider buying an album download. Remember that when buying from Magnatune the artist gets 50%. Also if you buy using Amarok, you support the Amarok project with 10%." ) );

    label->setWordWrap ( true );
    label->setMaximumWidth( 400 );
    
    dialog.setMainWidget( label );

    dialog.exec();

    if ( dialog.result() == QDialog::Rejected )
        abort();

    CollectionLocation::showSourceDialog( tracks, removeSources ); // to get transcoding dialog
}
예제 #16
0
void AxisDetailsWidget::addLed(int row, int column) {
    Led* led = iAnimation.ledAt(Position(row, column));

    if(led == NULL) {
        throw IllegalArgumentException("AnimationDetailsWidget::addLed : NULL led");
    }

    if(!iLedDetails.contains(led->number())) {
        int count = iLedDetails.count();
        qDebug("add new led, %d, %d", row, column);

        QLabel* ledNumberLabel = new QLabel(this);
        ledNumberLabel->setMaximumWidth(LED_LABEL_WIDTH);
        ledNumberLabel->setMinimumWidth(LED_LABEL_WIDTH);

        FrameListWidget* framesListWidget = new FrameListWidget(this, axisData(*led), *this);//, count);
        QToolButton* closeButton = new QToolButton(this);
        closeButton->setObjectName(QString::fromUtf8("detailsClose"));
        closeButton->setIcon(QIcon(":/images/delete.png"));

        iGridLayout->addWidget(closeButton, count, 0);
        iGridLayout->addWidget(ledNumberLabel, count, 1);
        iGridLayout->addWidget(framesListWidget, count, 2);
       // iGridLayout->setColumnStretch(1, 1);
       // iGridLayout->addWidget(new QWidget(), count, 3);
       // iGridLayout->setColumnStretch(3, 2);

        iLedDetails.insert(led->number(), new LedDetails(*this,
                                                         *led,
                                                         *ledNumberLabel,
                                                         *framesListWidget,
                                                         *closeButton));

        iCloseAll->setEnabled(true);
        iScrollAreaWidgetContents->setShowCurrentFrameLine(true);

        doResize();
        layout()->invalidate();
    }
}
예제 #17
0
파일: selectWeapon.cpp 프로젝트: akzfowl/hw
SelWeaponItem::SelWeaponItem(bool allowInfinite, int iconNum, int wNum, QImage image, QImage imagegrey, QWidget* parent) :
    QWidget(parent)
{
    QHBoxLayout* hbLayout = new QHBoxLayout(this);
    hbLayout->setSpacing(1);
    hbLayout->setMargin(1);

    QLabel* lbl = new QLabel(this);
    lbl->setPixmap(QPixmap::fromImage(getAmmoImage(iconNum)));
    lbl->setMaximumWidth(30);
    lbl->setGeometry(0, 0, 30, 30);
    hbLayout->addWidget(lbl);

    item = new WeaponItem(image, imagegrey, this);
    item->setItemsNum(wNum);
    item->setInfinityState(allowInfinite);
    hbLayout->addWidget(item);

    hbLayout->setStretchFactor(lbl, 1);
    hbLayout->setStretchFactor(item, 99);
    hbLayout->setAlignment(lbl, Qt::AlignLeft | Qt::AlignVCenter);
    hbLayout->setAlignment(item, Qt::AlignLeft | Qt::AlignVCenter);
}
예제 #18
0
void RTIMULibDemo::layoutWindow()
{
    QVBoxLayout *vLayout = new QVBoxLayout();
    vLayout->setContentsMargins(3, 3, 3, 3);
    vLayout->setSpacing(3);

    QHBoxLayout *imuLayout = new QHBoxLayout();
    vLayout->addLayout(imuLayout);
    imuLayout->addWidget(new QLabel("IMU type: "));
    m_imuType = new QLabel();
    imuLayout->addWidget(m_imuType);
    imuLayout->setStretch(1, 1);

    vLayout->addSpacing(10);

    QHBoxLayout *biasLayout = new QHBoxLayout();
    vLayout->addLayout(biasLayout);
    biasLayout->addWidget(new QLabel("Gyro bias status: "));
    m_biasStatus = new QLabel();
    biasLayout->addWidget(m_biasStatus);
    biasLayout->setStretch(1, 1);

    vLayout->addSpacing(10);

    vLayout->addWidget(new QLabel("Fusion state (quaternion): "));

    QHBoxLayout *dataLayout = new QHBoxLayout();
    dataLayout->setAlignment(Qt::AlignLeft);
    m_fusionQPoseScalar = getFixedPanel("1");
    m_fusionQPoseX = getFixedPanel("0");
    m_fusionQPoseY = getFixedPanel("0");
    m_fusionQPoseZ = getFixedPanel("0");
    dataLayout->addSpacing(30);
    dataLayout->addWidget(m_fusionQPoseScalar);
    dataLayout->addWidget(m_fusionQPoseX);
    dataLayout->addWidget(m_fusionQPoseY);
    dataLayout->addWidget(m_fusionQPoseZ);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Pose - roll, pitch, yaw (degrees): "));

    m_fusionPoseX = getFixedPanel("0");
    m_fusionPoseY = getFixedPanel("0");
    m_fusionPoseZ = getFixedPanel("0");
    dataLayout = new QHBoxLayout();
    dataLayout->setAlignment(Qt::AlignLeft);
    dataLayout->addSpacing(30);
    dataLayout->addWidget(m_fusionPoseX);
    dataLayout->addWidget(m_fusionPoseY);
    dataLayout->addWidget(m_fusionPoseZ);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Gyros (radians/s): "));

    m_gyroX = getFixedPanel("0");
    m_gyroY = getFixedPanel("0");
    m_gyroZ = getFixedPanel("0");
    dataLayout = new QHBoxLayout();
    dataLayout->setAlignment(Qt::AlignLeft);
    dataLayout->addSpacing(30);
    dataLayout->addWidget(m_gyroX);
    dataLayout->addWidget(m_gyroY);
    dataLayout->addWidget(m_gyroZ);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Accelerometers (g): "));

    m_accelX = getFixedPanel("0");
    m_accelY = getFixedPanel("0");
    m_accelZ = getFixedPanel("0");
    dataLayout = new QHBoxLayout();
    dataLayout->addSpacing(30);
    dataLayout->setAlignment(Qt::AlignLeft);
    dataLayout->addWidget(m_accelX);
    dataLayout->addWidget(m_accelY);
    dataLayout->addWidget(m_accelZ);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Accelerometer magnitude (g): "));

    m_accelMagnitude = getFixedPanel("0");
    dataLayout = new QHBoxLayout();
    dataLayout->addSpacing(30);
    dataLayout->addWidget(m_accelMagnitude);
    dataLayout->setAlignment(Qt::AlignLeft);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Accelerometer residuals (g): "));

    m_accelResidualX = getFixedPanel("0");
    m_accelResidualY = getFixedPanel("0");
    m_accelResidualZ = getFixedPanel("0");
    dataLayout = new QHBoxLayout();
    dataLayout->addSpacing(30);
    dataLayout->setAlignment(Qt::AlignLeft);
    dataLayout->addWidget(m_accelResidualX);
    dataLayout->addWidget(m_accelResidualY);
    dataLayout->addWidget(m_accelResidualZ);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Magnetometers (uT): "));

    m_compassX = getFixedPanel("0");
    m_compassY = getFixedPanel("0");
    m_compassZ = getFixedPanel("0");
    dataLayout = new QHBoxLayout();
    dataLayout->setAlignment(Qt::AlignLeft);
    dataLayout->addSpacing(30);
    dataLayout->addWidget(m_compassX);
    dataLayout->addWidget(m_compassY);
    dataLayout->addWidget(m_compassZ);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Compass magnitude (uT): "));

    m_compassMagnitude = getFixedPanel("0");
    dataLayout = new QHBoxLayout();
    dataLayout->addSpacing(30);
    dataLayout->addWidget(m_compassMagnitude);
    dataLayout->setAlignment(Qt::AlignLeft);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Pressure (hPa), height above sea level (m): "));

    m_pressure = getFixedPanel("0");
    m_height = getFixedPanel("0");
    dataLayout = new QHBoxLayout();
    dataLayout->addSpacing(30);
    dataLayout->addWidget(m_pressure);
    dataLayout->addWidget(m_height);
    dataLayout->setAlignment(Qt::AlignLeft);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Temperature (C): "));

    m_temperature = getFixedPanel("0");
    dataLayout = new QHBoxLayout();
    dataLayout->addSpacing(30);
    dataLayout->addWidget(m_temperature);
    dataLayout->setAlignment(Qt::AlignLeft);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);
    vLayout->addWidget(new QLabel("Humidity (RH): "));

    m_humidity = getFixedPanel("0");
    dataLayout = new QHBoxLayout();
    dataLayout->addSpacing(30);
    dataLayout->addWidget(m_humidity);
    dataLayout->setAlignment(Qt::AlignLeft);
    vLayout->addLayout(dataLayout);

    vLayout->addSpacing(10);

    QHBoxLayout *fusionBox = new QHBoxLayout();
    QLabel *fusionTypeLabel = new QLabel("Fusion algorithm: ");
    fusionBox->addWidget(fusionTypeLabel);
    fusionTypeLabel->setMaximumWidth(150);
    m_fusionType = new QLabel();
    fusionBox->addWidget(m_fusionType);
    vLayout->addLayout(fusionBox);

    vLayout->addSpacing(10);

    vLayout->addWidget(new QLabel("Fusion controls: "));

    m_enableGyro = new QCheckBox("Enable gyros");
    m_enableGyro->setChecked(true);
    vLayout->addWidget(m_enableGyro);

    m_enableAccel = new QCheckBox("Enable accels");
    m_enableAccel->setChecked(true);
    vLayout->addWidget(m_enableAccel);

    m_enableCompass = new QCheckBox("Enable compass");
    m_enableCompass->setChecked(true);
    vLayout->addWidget(m_enableCompass);

    m_enableDebug = new QCheckBox("Enable debug messages");
    m_enableDebug->setChecked(false);
    vLayout->addWidget(m_enableDebug);

    vLayout->addStretch(1);

    centralWidget()->setLayout(vLayout);
    setFixedSize(850, 750);
}
예제 #19
0
questionsSettings::questionsSettings(TlevelCreatorDlg* creator) :
    TabstractLevelPage(creator)
{
	QVBoxLayout *mainLay = new QVBoxLayout;
	mainLay->addStretch();

	int nootFontSize = fontMetrics().boundingRect("A").height() * 2;
	QString nooColor = QString("color: %1").arg(palette().highlight().color().name());
	m_tableWdg = new QWidget(this);
	QHBoxLayout *tabLay = new QHBoxLayout;
	tabLay->addWidget(m_tableWdg);
	QGridLayout *qaLay = new QGridLayout(); // Questions & Answers table
	qaLay->setAlignment(Qt::AlignCenter);
	qaLay->setSpacing(10);
// Labels describing answers types
	QFont f = font();
	f.setBold(true);
	QLabel *newQuestLab = new QLabel(TquestionAsWdg::answerTxt().toUpper(), this);
	newQuestLab->setFont(f);
	qaLay->addWidget(newQuestLab, 0, 2, 0, 4, Qt::AlignHCenter | Qt::AlignTop);
	m_questLab = new QLabel(TnooFont::span("n", nootFontSize * 1.5, nooColor) + "<br><br>" + TquestionAsWdg::questionTxt().toUpper(), this);
	m_questLab->setAlignment(Qt::AlignCenter);
	m_questLab->setFont(f);
	qaLay->addWidget(m_questLab, 1, 0, Qt::AlignBottom | Qt::AlignHCenter);
	m_answLab = new QLabel("  ", this);
	m_answLab->setFont(f);
	qaLay->addWidget(m_answLab, 1, 1, Qt::AlignBottom);
	QLabel *asNoteLab = new QLabel(" <br>" + TquestionAsWdg::asNoteTxt().replace(" ", "<br>"), this);
	asNoteLab->setAlignment(Qt::AlignCenter);
	qaLay->addWidget(asNoteLab, 1, 2, Qt::AlignBottom);
	QLabel *asNameLab = new QLabel(" <br>" + TquestionAsWdg::asNameTxt().replace(" ", "<br>"), this);
	asNameLab->setAlignment(Qt::AlignCenter);
	qaLay->addWidget(asNameLab, 1, 3, Qt::AlignBottom);
	m_asFretLab = new QLabel(" <br>" + TquestionAsWdg::asFretPosTxt().replace(" ", "<br>"), this);
	m_asFretLab->setAlignment(Qt::AlignCenter);
	qaLay->addWidget(m_asFretLab, 1, 4, Qt::AlignBottom);
	m_asSoundLab = new QLabel(" <br>" + TquestionAsWdg::asSoundTxt().replace(" ", "<br>"), this);
	m_asSoundLab->setAlignment(Qt::AlignCenter);
	qaLay->addWidget(m_asSoundLab, 1, 5, Qt::AlignBottom);
// CheckBoxes with types of answers for every kind of question
	asNoteWdg = new TquestionAsWdg(TQAtype::e_asNote, qaLay, 2, this);
	asNameWdg = new TquestionAsWdg(TQAtype::e_asName, qaLay, 3, this);
	asFretPosWdg = new TquestionAsWdg(TQAtype::e_asFretPos, qaLay, 4, this);
	asSoundWdg = new TquestionAsWdg(TQAtype::e_asSound, qaLay, 5, this);
// Labels on the right side of the table with symbols of types - related to questions
	QLabel *scoreNooLab = new QLabel("s?", this);
	QFont nf("nootka", fontMetrics().boundingRect("A").height());
#if defined(Q_OS_MACX)
	nf.setPointSize(fontMetrics().boundingRect("A").height() * 2);
#elif defined (Q_OS_ANDROID)
//   nf.setPointSize(qMax<int>(Tmtr::fingerPixels() / 3, fontMetrics().boundingRect("A").height()));
  nf.setPointSize(Tmtr::fingerPixels() / 3);
#endif
	scoreNooLab->setFont(nf);
	qaLay->addWidget(scoreNooLab, 2, 6, Qt::AlignCenter);
	QLabel *nameNooLab = new QLabel("c?", this);
	nameNooLab->setFont(nf);
	qaLay->addWidget(nameNooLab, 3, 6, Qt::AlignCenter);
	m_guitarNooLab = new QLabel("g?", this);
	m_guitarNooLab->setFont(nf);
	qaLay->addWidget(m_guitarNooLab, 4, 6, Qt::AlignCenter);
	m_soundNooLab = new QLabel("n?", this);
	m_soundNooLab->setFont(nf);
	qaLay->addWidget(m_soundNooLab, 5, 6);
// Labels on the bottom side of the table with symbols of types - related to answers  
	QLabel *qScoreNooLab = new QLabel("s!", this);
	qScoreNooLab->setFont(nf);
	qaLay->addWidget(qScoreNooLab, 6, 2, Qt::AlignCenter);
	QLabel *qNmeNooLab = new QLabel("c!", this);
	qNmeNooLab->setFont(nf);
	qaLay->addWidget(qNmeNooLab, 6, 3, Qt::AlignCenter);
	m_qGuitarNooLab = new QLabel("g!", this);
	m_qGuitarNooLab->setFont(nf);
	qaLay->addWidget(m_qGuitarNooLab, 6, 4, Qt::AlignCenter);
	m_qSoundNooLab = new QLabel("n!", this);
	m_qSoundNooLab->setFont(nf);
	qaLay->addWidget(m_qSoundNooLab, 6, 5);
	
	QLabel *melodyLab = new QLabel(TnooFont::span("m", nootFontSize * 2, nooColor), this);
	melodyLab->setAlignment(Qt::AlignCenter);
  melodyLab->setMaximumWidth(melodyLab->sizeHint().width());
	m_playMelodyChB = new QCheckBox(TexTrans::playMelodyTxt(), this);
		m_playMelodyChB->setStatusTip(tableTip(TexTrans::playDescTxt(), TQAtype::e_asNote, TQAtype::e_asSound, nootFontSize));
	m_writeMelodyChB = new QCheckBox(TexTrans::writeMelodyTxt(), this);
		m_writeMelodyChB->setStatusTip(tableTip(TexTrans::writeDescTxt(), TQAtype::e_asSound, TQAtype::e_asNote, nootFontSize));
// 		QCheckBox *m_repeatMelodyChB = new QCheckBox(tr("repeat melody"), this);
	m_melodyLengthSpin = new QSpinBox(this);
// 		m_melodyLengthSpin->setValue(5);
		m_melodyLengthSpin->setMinimum(1);
		m_melodyLengthSpin->setMaximum(50);
		m_melodyLengthSpin->setStatusTip(tr("Maximum number of notes in a melody. Melody length is random value between 70% and 100% of that number."));
	QLabel *lenghtLab = new QLabel(tr("Melody length"), this);
		lenghtLab->setStatusTip(m_melodyLengthSpin->statusTip());
		
	m_finishOnTonicChB = new QCheckBox(tr("Melody ends on tonic note"), this);
		m_finishOnTonicChB->setStatusTip(tr("Determines the last note of a melody.<br>When set, melody will be finished on tonic note of actual key signature."));
	
	m_tableWdg->setLayout(qaLay);
  m_paintHandler = new TpaintHandler(widget());
  m_paintHandler->setLayout(tabLay);
	m_singleGr = new QGroupBox(tr("single note"), this);
			m_singleGr->setCheckable(true);
      QVBoxLayout *outTabLay = new QVBoxLayout;
      outTabLay->addWidget(m_paintHandler);
      outTabLay->setContentsMargins(0, 0, 0, 0);
			m_singleGr->setLayout(outTabLay);

	auto melLay = new QVBoxLayout;
#if !defined (Q_OS_ANDROID)
		melLay->addWidget(melodyLab, 0, Qt::AlignCenter);
#endif
		melLay->addStretch();
		melLay->addWidget(m_playMelodyChB);
		melLay->addWidget(m_writeMelodyChB);
// 			melLay->addWidget(m_repeatMelodyChB);
		melLay->addStretch();
		auto lenLay= new QHBoxLayout;
			lenLay->addWidget(lenghtLab);
			lenLay->addWidget(m_melodyLengthSpin);
		melLay->addLayout(lenLay);
#if defined (Q_OS_ANDROID)
    melLay->addWidget(getLabelFromStatus(m_melodyLengthSpin, true, true));
#endif
		melLay->addWidget(m_finishOnTonicChB);
#if defined (Q_OS_ANDROID)
    melLay->addWidget(getLabelFromStatus(m_finishOnTonicChB, true, true));
#endif
		melLay->addStretch();
	m_melodiesGr = new QGroupBox(tr("melodies"), this);
			m_melodiesGr->setCheckable(true);
#if defined (Q_OS_ANDROID)
    auto androidMelLay = new QHBoxLayout;
    melodyLab->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
    androidMelLay->addWidget(melodyLab);
    androidMelLay->addLayout(melLay);
    m_melodiesGr->setLayout(androidMelLay);
    QVBoxLayout *grBoxLay = new QVBoxLayout;
#else
    m_melodiesGr->setLayout(melLay);
    auto grBoxLay = new QHBoxLayout;
#endif
		grBoxLay->addStretch();
		grBoxLay->addWidget(m_singleGr);
		grBoxLay->addStretch();
		grBoxLay->addWidget(m_melodiesGr);
		grBoxLay->addStretch();

	mainLay->addLayout(grBoxLay);
	mainLay->addStretch();

// some checkBoxes
#if defined (Q_OS_ANDROID)
  auto chLay = new QVBoxLayout;
#else
	auto chLay = new QGridLayout;
#endif
	octaveRequiredChB = new QCheckBox(tr("require octave"),this);
	octaveRequiredChB->setStatusTip(tr("if checked, selecting of valid octave is required"));
#if defined (Q_OS_ANDROID)
  chLay->addWidget(octaveRequiredChB, 0, Qt::AlignLeft);
  chLay->addWidget(getLabelFromStatus(octaveRequiredChB, true, true));
#else
	chLay->addWidget(octaveRequiredChB, 0, 0, Qt::AlignLeft);
#endif

	styleRequiredChB = new QCheckBox(tr("use different naming styles"),this);
	styleRequiredChB->setStatusTip(tr("if checked, note names are switched between letters and solfege."));
#if defined (Q_OS_ANDROID)
  chLay->addWidget(styleRequiredChB, 0, Qt::AlignLeft);
  chLay->addWidget(getLabelFromStatus(styleRequiredChB, true, true));
#else
	chLay->addWidget(styleRequiredChB, 1, 0, Qt::AlignLeft);
#endif

	showStrNrChB = new QCheckBox(tr("show string number in questions"), this);
	showStrNrChB->setStatusTip(
      tr("Shows on which string an answer has to be given.<br>Be careful, sometimes it is needed and sometimes it makes no sense."));
#if defined (Q_OS_ANDROID)
  chLay->addWidget(showStrNrChB, 0, Qt::AlignLeft);
  chLay->addWidget(getLabelFromStatus(showStrNrChB, true, true));
#else
	chLay->addWidget(showStrNrChB, 0, 1, Qt::AlignLeft);
#endif

  lowPosOnlyChBox = new QCheckBox(tr("notes in the lowest position only"),this);
  lowPosOnlyChBox->setStatusTip(tr("if checked, the lowest position in selected fret range is required,<br>otherwise all possible positions of the note are acceptable.<br>To use this, all strings have to be available!"));
#if defined (Q_OS_ANDROID)
  chLay->addWidget(lowPosOnlyChBox, 0, Qt::AlignLeft);
  chLay->addWidget(getLabelFromStatus(lowPosOnlyChBox, true, true));
#else
  chLay->addWidget(lowPosOnlyChBox, 1, 1, Qt::AlignLeft);
#endif

	mainLay->addLayout(chLay);

	TintonationCombo *intoCombo = new TintonationCombo(this);
	m_intonationCombo = intoCombo->accuracyCombo; // we need only combo box (label is not necessary)
	mainLay->addWidget(intoCombo, 0, Qt::AlignCenter);

#if defined (Q_OS_ANDROID) // add space at the bottom to allow touching lower boxes and combo
  mainLay->addSpacing(Tmtr::fingerPixels() / 2);
  mainLay->setContentsMargins(0, 10, 0, 10);
#endif
	setLayout(mainLay);

  connect(m_singleGr, SIGNAL(clicked()), this, SLOT(singleMultiSlot()));
  connect(m_melodiesGr, SIGNAL(clicked()), this, SLOT(singleMultiSlot()));
  connect(m_playMelodyChB, SIGNAL(clicked()), this, SLOT(melodyQuestionSlot()));
  connect(m_writeMelodyChB, SIGNAL(clicked()), this, SLOT(melodyQuestionSlot()));
  
	connect(asNoteWdg, SIGNAL(answerStateChanged()), this, SLOT(whenParamsChanged()));
	connect(asNameWdg, SIGNAL(answerStateChanged()), this, SLOT(whenParamsChanged()));
	connect(asFretPosWdg, SIGNAL(answerStateChanged()), this, SLOT(whenParamsChanged()));
	connect(asSoundWdg, SIGNAL(answerStateChanged()), this, SLOT(whenParamsChanged()));
	
	connect(octaveRequiredChB , SIGNAL(clicked()), this, SLOT(whenParamsChanged()));
	connect(styleRequiredChB, SIGNAL(clicked()), this, SLOT(whenParamsChanged()));
	connect(showStrNrChB, SIGNAL(clicked()), this, SLOT(whenParamsChanged()));
	connect(lowPosOnlyChBox, SIGNAL(clicked()), this, SLOT(whenParamsChanged()));
	connect(m_intonationCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(whenParamsChanged()));
	connect(m_playMelodyChB, SIGNAL(clicked()), this, SLOT(whenParamsChanged()));
	connect(m_writeMelodyChB, SIGNAL(clicked()), this, SLOT(whenParamsChanged()));
	connect(m_melodyLengthSpin, SIGNAL(valueChanged(int)), this, SLOT(whenParamsChanged()));
	connect(m_paintHandler, &TpaintHandler::paintMe, this, &questionsSettings::paintSlot);
}
예제 #20
0
ObjrefWidget::ObjrefWidget(InterfaceDescriptor_ptr iface,
        QWidget * parent) :
    QWidget(parent), m_model(NULL)
{
    setInterface(iface);

    QGridLayout * mainLayout = new QGridLayout;
    QHBoxLayout * layout = new QHBoxLayout;

    m_selector = new QComboBox;
    QLabel * label = new QLabel("Select source");
    mainLayout->addWidget(label, 0, 0);
    label->setMaximumWidth(150);
    mainLayout->addWidget(m_selector, 0, 1);

    m_stack = new QStackedWidget;
    layout->addWidget(m_stack);

    QPushButton * updateBtn = new QPushButton("Update");
    mainLayout->addWidget(updateBtn, 0, 2);

    updateBtn->setMaximumWidth(90);

    m_status = new qt::Status;
    mainLayout->addWidget(m_status, 0, 3);

    {
        // IOR
        m_selector->addItem("IOR");
        m_ior = new QTextEdit;
        m_ior->setAcceptRichText(false);
        m_stack->addWidget(m_ior);

        // NameService query
        m_selector->addItem("Name service query");
        m_resolve_str = new QTextEdit;
        m_stack->addWidget(m_resolve_str);

        // Well-known objects
        m_selector->addItem("Well-known object");
        QWidget * w = new QWidget;
        QVBoxLayout * l = new QVBoxLayout;
        m_object_selector = new QComboBox;
        l->addWidget(m_object_selector);
        w->setLayout(l);
        m_stack->addWidget(w);
    }
    mainLayout->addLayout(layout, 1, 0, 1, 4);

    setLayout(mainLayout);

    connect(m_selector, SIGNAL(currentIndexChanged(int)),
            m_stack, SLOT(setCurrentIndex(int)));

    connect(m_selector, SIGNAL(currentIndexChanged(int)),
            this, SLOT(valueChanged()));

    connect(m_object_selector, SIGNAL(currentIndexChanged(int)),
            this, SLOT(valueChanged()));

    connect(m_ior, SIGNAL(textChanged()), this, 
            SLOT(valueChanged()));

    connect(m_resolve_str, SIGNAL(textChanged()), this, 
            SLOT(valueChanged()));

    connect(updateBtn, SIGNAL(clicked()), this, 
            SLOT(valueChanged()));

    connect(this, SIGNAL(resolve(Objref_ptr)),
            Application::currentApplication()->nameServiceManager(),
            SLOT(resolve(Objref_ptr)));

    // Default model
    QAbstractItemModel * model = qt::getDefaultInstanceModel();
    if (model)
    {
        setModel(model);
    }

    setMaximumHeight(100);
}
예제 #21
0
파일: about.cpp 프로젝트: muldjord/boris
About::About(QWidget *parent) : QDialog(parent)
{
  setFixedSize(900, 470);
  setWindowIcon(QIcon(":icon.png"));
  setWindowTitle("Boris v" VERSION);

  move(QApplication::desktop()->width() / 2 - 225, QApplication::desktop()->height() / 2 - 250);
  // About tab
  QWidget *aboutWidget = new QWidget;
  QLabel *aboutText = new QLabel(tr("Boris bids you welcome! He is here to keep you company during all seasons of the year. He is a bit of a prankster, so keep an eye out for him!\n\n"
                                    "Functions:\n- You can throw Boris around your desktop by left-clicking him. Don't throw him too much though, or you'll bruise him...\n- Right-clicking Boris brings up a menu where you can select what you want Boris to do. Each activity is added to a queue and performed in the order you select them.\n- Right-click the tray icon to either quit, cause an earthquake, teleport or open this config/about box.\n\nVitality description:\n- The 'Zz' icon signifies Boris' energy level. Tell him to relax to give him more energy.\n- The 'knife and fork' icon shows how hungry Boris is. Tell him to eat to remove his hunger.\n- The 'toilet' icon is an indicator of Boris' need to go to the toilet. Tell him to weewee to make him feel better.\n- The 'speech bubble' icon shows Boris' need for social interaction. Move you mouse over him to interact with him. Boris will also socialize with other Boris clones when he meets them.\n- The 'smiley' icon indicates if Boris is in a good mood. If he's sad, tell him to do something fun.\n- If Boris is getting dirty, tell him to take a shower.\n\nIf your friends / colleagues become envious and would like a Boris of their own, simply ask them to visit http://www.muldjord.com/boris and download it. You can also download the full source code in there if you like. This software is COMPLETELY FREE and OPEN SOURCE (GPLv3)."));
  aboutText->setWordWrap(true);
  aboutText->setMaximumWidth(400);

  QVBoxLayout *aboutLayout = new QVBoxLayout();
  aboutLayout->addWidget(aboutText);
  aboutWidget->setLayout(aboutLayout);

  QScrollArea *aboutScroll = new QScrollArea();
  aboutScroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
  aboutScroll->setWidget(aboutWidget);

  // Author tab
  QWidget *authorWidget = new QWidget;
  QLabel *authorText = new QLabel(tr("Programming: Lars Muldjord\nGraphics: Lars Muldjord\nSound: Lars Muldjord\n\nBoris was programmed using the Qt framework (http://www.qt.io) and C++.\n\nBug reports, suggestions and / or comments can be emailed to me at:\[email protected].\n\nIf your friends / colleagues would like to get their own Boris, tell them to visit:\n\nhttp://www.muldjord.com/boris\n\nIt's FREE and OPEN SOURCE (GPLv3), so there's absolutely no strings attached, just download away. You can also download the full source code in there if you like.\n\nCopyright 2016 Lars Muldjord. This software is distributed under the terms of the GNU General Public License. Be sure to read the license in the 'License' tab or check out the web page http://www.gnu.org/licenses/gpl-3.0.html."));
  authorText->setWordWrap(true);
  authorText->setMaximumWidth(400);

  QVBoxLayout *authorLayout = new QVBoxLayout();
  authorLayout->addWidget(authorText);
  authorWidget->setLayout(authorLayout);

  QScrollArea *authorScroll = new QScrollArea();
  authorScroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
  authorScroll->setWidget(authorWidget);

  // License tab
  // Read COPYING data from file
  QFile file("COPYING.TXT");
  QByteArray gplText;
  if(file.open(QIODevice::ReadOnly)) {
    gplText = file.readAll();
    file.close();
  } else {
    printf("ERROR: Couldn't find COPYING file at the designated location.\n");
    gplText = "ERROR: File not found... This means that someone has been fiddling with the files of this software, and someone might be violating the terms of the GPL. Go to the following location to read the license: http://www.gnu.org/licenses/gpl-3.0.html";
  }

  QWidget *licenseWidget = new QWidget;
  QLabel *licenseText = new QLabel(gplText);
  licenseText->setWordWrap(true);
  licenseText->setMaximumWidth(400);

  QVBoxLayout *licenseLayout = new QVBoxLayout();
  licenseLayout->addWidget(licenseText);
  licenseWidget->setLayout(licenseLayout);

  QScrollArea *licenseScroll = new QScrollArea();
  licenseScroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
  licenseScroll->setWidget(licenseWidget);

  QTabWidget *tabWidget = new QTabWidget;
  tabWidget->addTab(aboutScroll, tr("About"));
  tabWidget->addTab(authorScroll, tr("Author"));
  tabWidget->addTab(licenseScroll, tr("License"));
  
  QPushButton *okButton = new QPushButton(tr("Close and save"));
  connect(okButton, SIGNAL(clicked()), this, SLOT(saveAll()));

  QLabel *sizeLabel = new QLabel(tr("Boris size in pixels (32-256 or 0 for random):"));
  sizeLineEdit = new QLineEdit();
  QIntValidator *sizeValidator = new QIntValidator(32,256);
  sizeLineEdit->setValidator(sizeValidator);
  if(settings->contains("size")) {
    sizeLineEdit->setText(settings->value("size").toString());
  }

  QLabel *clonesLabel = new QLabel(tr("Boris clones (1-100):"));
  clonesLineEdit = new QLineEdit();
  QIntValidator *clonesValidator = new QIntValidator(1,100);
  clonesLineEdit->setValidator(clonesValidator);
  if(settings->contains("clones")) {
    clonesLineEdit->setText(settings->value("clones").toString());
  }

  alwaysWeather = new QCheckBox(tr("Show weather all the time"));
  if(settings->value("weather") == "true") {
    alwaysWeather->setCheckState(Qt::Checked);
  }

  QLabel *weatherLabel = new QLabel(tr("Show weather for city (mouse over for help):"));
  weatherLineEdit = new QLineEdit();
  weatherLineEdit->setToolTip(tr("Try typing in a nearby city. If it doesn't work, go to openweathermap.org and search for a city until you find one that exists.<br/>Then type that in exactly as it is shown on their website."));
  if(settings->contains("weather_city")) {
    weatherLineEdit->setText(settings->value("weather_city").toString());
  }

  QLabel *weatherKeyLabel = new QLabel(tr("OpenWeatherMap key (mouse over for help):"));
  weatherKeyLineEdit = new QLineEdit();
  weatherKeyLineEdit->setToolTip(tr("The weather functionality needs an API key to function. The default one should work.<br/>In case it doesn't, get a new one for free at openweathermap.org/appid"));
  if(settings->contains("weather_key")) {
    weatherKeyLineEdit->setText(settings->value("weather_key").toString());
  }

  showStats = new QCheckBox(tr("Always show vitality stats"));
  if(settings->value("stats") == "true") {
    showStats->setCheckState(Qt::Checked);
  }

  QLabel *independenceLabel = new QLabel(tr("Independence:"));
  independenceSlider = new QSlider(Qt::Horizontal);
  independenceSlider->setMinimum(0);
  independenceSlider->setMaximum(100);
  if(settings->contains("independence")) {
    independenceSlider->setValue(settings->value("independence").toInt());
  }

  enableChatter = new QCheckBox(tr("Enable Boris speech bubbles"));
  if(settings->value("chatter") == "true") {
    enableChatter->setCheckState(Qt::Checked);
  }

  enableSound = new QCheckBox(tr("Enable sound"));
  if(settings->value("sound") == "true") {
    enableSound->setCheckState(Qt::Checked);
  }

  QLabel *volumeLabel = new QLabel(tr("Sound volume:"));
  volumeSlider = new QSlider(Qt::Horizontal);
  volumeSlider->setMinimum(0);
  volumeSlider->setMaximum(100);
  if(settings->contains("volume")) {
    volumeSlider->setValue(settings->value("volume").toInt());
  }
  
  showWelcome = new QCheckBox(tr("Always show this dialog on startup"));
  if(settings->value("show_welcome") == "true") {
    showWelcome->setCheckState(Qt::Checked);
  }

  QVBoxLayout *configLayout = new QVBoxLayout();
  configLayout->addWidget(showWelcome);
  configLayout->addWidget(sizeLabel);
  configLayout->addWidget(sizeLineEdit);
  configLayout->addWidget(clonesLabel);
  configLayout->addWidget(clonesLineEdit);
  configLayout->addWidget(enableChatter);
  configLayout->addWidget(showStats);
  configLayout->addWidget(independenceLabel);
  configLayout->addWidget(independenceSlider);
  configLayout->addWidget(enableSound);
  configLayout->addWidget(volumeLabel);
  configLayout->addWidget(volumeSlider);
  configLayout->addWidget(alwaysWeather);
  configLayout->addWidget(weatherLabel);
  configLayout->addWidget(weatherLineEdit);
  configLayout->addWidget(weatherKeyLabel);
  configLayout->addWidget(weatherKeyLineEdit);
  
  QVBoxLayout *infoLayout = new QVBoxLayout;
  infoLayout->addWidget(tabWidget);
  infoLayout->addWidget(okButton);

  QHBoxLayout *layout = new QHBoxLayout;
  layout->addLayout(configLayout);
  layout->addLayout(infoLayout);
  
  setLayout(layout);
}
예제 #22
0
파일: mainwindow.cpp 프로젝트: Nos-/htw
/**
 * @brief MainWindow::addMedium fügt ein Medium in die Datenbank und ins UI ein
 * @param mType Typ des Mediums
 * @param mName Titel des Mediums
 * @param mID ID des Mediums, falls verfügbar (wenn leer, dann wird eine eigene erstellt)
 * @return ID des eingefügten Mediums
 */
int MainWindow::addMedium(MType mType, QString mName, QString detail, int mID){
    QString mTypeString;
    QString mEntry;
    Medium *medium;
    QString detailType;
    /// Unterscheidung zwischen Medien Typ: erstellt verschieden Klassen und füllt die Zusatzinformationen
    switch (mType){
    case book:
        mTypeString="Buch";
        medium = new Book(mName);
        ((Book*)medium)->setAuthor(detail);
        detailType="Autor: ";
        break;
    case cd:
        mTypeString="CD";
        medium = new CD(mName);
        ((CD*)medium)->setInterpret(detail);
        detailType="Interpret: ";
        break;
    case dvd:
        mTypeString="DVD";
        medium = new DVD(mName);
        ((DVD*)medium)->setDirector(detail);
        detailType="Regisseur: ";
        break;
    default:
        mTypeString="-";
        medium = new Medium(mName);
    }
    if (detail.isEmpty()){
        detail = "-";
        detailType = "";
    }
    /// Medium in Datenbank erfassen (Fehler, falls ID bereits existiert)
    if (mID == -1){
        lendlib->addMediumToList(medium);
    } else {
        if (!lendlib->addMediumToList(medium, mID)){
            otherErr = true;
            errString = "Medium konnte nicht mit vorgegebener ID eingegeben werden.";
            checkError();
        }
    }

    mEntry = QString::number(medium->getID());

    /// UI-Elemente erstellen
    QWidget *newMedium = new QWidget;
    QHBoxLayout *newMediumLayout = new QHBoxLayout(newMedium);
    QPushButton *delB = new QPushButton("Löschen");
    QLabel *type = new QLabel(mTypeString);
    QLabel *title = new QLabel(mName);
    QLabel *lendee = new QLabel("");
    QPushButton *retlendB = new QPushButton("Ausleihen");

    /// UI-Eigenschaften anpassen
    newMedium->setObjectName(mEntry);
    newMedium->setToolTip("Typ: "+mTypeString+"\nTitel: "+mName+"\n"+detailType+detail);
    delB->setObjectName("del"+mEntry);
    delB->setToolTip("Lösche Medium "+mEntry+": "+mName);
    type->setObjectName("type"+mEntry);
    title->setObjectName("title"+mEntry);
    lendee->setObjectName("lendee"+mEntry);
    retlendB->setObjectName("retlend"+mEntry);
    retlendB->setToolTip("Leihe Medium "+mEntry+" aus: "+mName);

    newMedium->layout()->setMargin(0);
    newMedium->setStyleSheet("border-bottom: 1px solid #DEE2CF");
    delB->setStyleSheet("background: #DEE2CF;");
    delB->setMinimumWidth(60);
    delB->setMaximumWidth(60);
    delB->setMinimumHeight(25);
    delB->setMaximumHeight(25);
    connect(delB, SIGNAL (released()), this, SLOT (deleteMediumButton()));
    retlendB->setStyleSheet("background: #DEE2CF;");
    retlendB->setMinimumWidth(100);
    retlendB->setMaximumWidth(100);
    retlendB->setMinimumHeight(25);
    retlendB->setMaximumHeight(25);
    connect(retlendB, SIGNAL (released()), this, SLOT (retlendMediumButton()));
    type->setMinimumWidth(60);
    type->setMaximumWidth(60);
    lendee->setMinimumWidth(100);
    lendee->setMaximumWidth(100);

    newMediumLayout->addWidget(delB);
    newMediumLayout->addWidget(type);
    newMediumLayout->addWidget(title);
    newMediumLayout->addWidget(lendee);
    newMediumLayout->addWidget(retlendB);
    qobject_cast<QVBoxLayout*>(ui->allMediaScroll->layout())->insertWidget(getInsertPosition(mName),newMedium);

    ui->allMediaScroll->layout()->removeItem(ui->mediaSpacer);
    ui->allMediaScroll->layout()->addItem(ui->mediaSpacer);
    return medium->getID();
}
예제 #23
0
MintingView::MintingView(QWidget *parent) :
    QWidget(parent), model(0), mintingView(0)
{
    QHBoxLayout *hlayout = new QHBoxLayout();
    hlayout->setContentsMargins(0,0,0,0);

    QString legendBoxStyle = "background-color: rgb(%1,%2,%3); border: 1px solid black;";

    QLabel *youngColor = new QLabel(" ");
    youngColor->setMaximumHeight(15);
    youngColor->setMaximumWidth(10);
    youngColor->setStyleSheet(legendBoxStyle.arg(COLOR_MINT_YOUNG.red()).arg(COLOR_MINT_YOUNG.green()).arg(COLOR_MINT_YOUNG.blue()));
    QLabel *youngLegend = new QLabel(tr("transaction is too young"));
    youngLegend->setContentsMargins(5,0,15,0);

    QLabel *matureColor = new QLabel(" ");
    matureColor->setMaximumHeight(15);
    matureColor->setMaximumWidth(10);
    matureColor->setStyleSheet(legendBoxStyle.arg(COLOR_MINT_MATURE.red()).arg(COLOR_MINT_MATURE.green()).arg(COLOR_MINT_MATURE.blue()));
    QLabel *matureLegend = new QLabel(tr("transaction is mature"));
    matureLegend->setContentsMargins(5,0,15,0);

    QLabel *oldColor = new QLabel(" ");
    oldColor->setMaximumHeight(15);
    oldColor->setMaximumWidth(10);
    oldColor->setStyleSheet(legendBoxStyle.arg(COLOR_MINT_OLD.red()).arg(COLOR_MINT_OLD.green()).arg(COLOR_MINT_OLD.blue()));
    QLabel *oldLegend = new QLabel(tr("transaction has reached maximum probability"));
    oldLegend->setContentsMargins(5,0,15,0);

    QHBoxLayout *legendLayout = new QHBoxLayout();
    legendLayout->setContentsMargins(10,10,0,0);
    legendLayout->addWidget(youngColor);
    legendLayout->addWidget(youngLegend);
    legendLayout->addWidget(matureColor);
    legendLayout->addWidget(matureLegend);
    legendLayout->addWidget(oldColor);
    legendLayout->addWidget(oldLegend);
    legendLayout->insertStretch(-1);
	
	QLabel *label1 = new QLabel(this);
	label1->setText("Staking Estimations");
	label1->setAlignment(Qt::AlignLeft);
	QFont font( "Arial", 16, QFont::Bold);
	label1->setFont(font);
	label1->setFixedWidth(250);
	
	QLabel *mintingLabel = new QLabel(tr("Check the arrow icon below for more staking information. *BETA*"));

    QLabel *mintingLabel2 = new QLabel(tr(" [Display staking probability within]: "));
    mintingCombo = new QComboBox();
    mintingCombo->addItem(tr("10 min"), Minting10min);
    mintingCombo->addItem(tr("24 hours"), Minting1day);
    mintingCombo->addItem(tr("7 days"), Minting7days);
    mintingCombo->addItem(tr("30 days"), Minting30days);
    mintingCombo->addItem(tr("60 days"), Minting60days);
    mintingCombo->addItem(tr("90 days"), Minting90days);
    mintingCombo->setFixedWidth(120);

    hlayout->insertStretch(0);
    hlayout->addWidget(mintingLabel);
	hlayout->addWidget(mintingLabel2);
    hlayout->addWidget(mintingCombo);

    QVBoxLayout *vlayout = new QVBoxLayout(this);
    vlayout->setContentsMargins(0,0,0,0);
    vlayout->setSpacing(0);

    QTableView *view = new QTableView(this);
    vlayout->addLayout(hlayout);
    vlayout->addWidget(view);
    vlayout->addLayout(legendLayout);

    vlayout->setSpacing(0);
    int width = view->verticalScrollBar()->sizeHint().width();
    // Cover scroll bar width with spacing
#ifdef Q_WS_MAC
    hlayout->addSpacing(width+2);
#else
    hlayout->addSpacing(width);
#endif
    // Always show scroll bar
    view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    view->setTabKeyNavigation(false);
    view->setContextMenuPolicy(Qt::CustomContextMenu);

    mintingView = view;

    connect(mintingCombo, SIGNAL(activated(int)), this, SLOT(chooseMintingInterval(int)));

    // Actions
    QAction *copyTxIDAction = new QAction(tr("Copy transaction ID of input"), this);
    QAction *copyAddressAction = new QAction(tr("Copy address of input"), this);
    QAction *showHideAddressAction = new QAction(tr("Show/hide 'Address' column"), this);
    QAction *showHideTxIDAction = new QAction(tr("Show/hide 'Transaction' column"), this);

    contextMenu = new QMenu();
    contextMenu->addAction(copyAddressAction);
    contextMenu->addAction(copyTxIDAction);
    contextMenu->addAction(showHideAddressAction);
    contextMenu->addAction(showHideTxIDAction);

    connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress()));
    connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID()));
    connect(showHideAddressAction, SIGNAL(triggered()), this, SLOT(showHideAddress()));
    connect(showHideTxIDAction, SIGNAL(triggered()), this, SLOT(showHideTxID()));

    connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));
}
QWidget* ExtensionDialog::CreateWidget( extension_widget_t *p_widget )
{
    QLabel *label = NULL;
    QPushButton *button = NULL;
    QTextBrowser *textArea = NULL;
    QLineEdit *textInput = NULL;
    QCheckBox *checkBox = NULL;
    QComboBox *comboBox = NULL;
    QListWidget *list = NULL;
    SpinningIcon *spinIcon = NULL;
    struct /*extension_widget_t::*/extension_widget_value_t *p_value = NULL;			// sunqueen modify

    assert( p_widget->p_sys_intf == NULL );

    switch( p_widget->type )
    {
        case EXTENSION_WIDGET_LABEL:
            label = new QLabel( qfu( p_widget->psz_text ), this );
            p_widget->p_sys_intf = label;
            label->setTextFormat( Qt::RichText );
            label->setOpenExternalLinks( true );
            return label;

        case EXTENSION_WIDGET_BUTTON:
            button = new QPushButton( qfu( p_widget->psz_text ), this );
            clickMapper->setMapping( button, new WidgetMapper( p_widget ) );
            CONNECT( button, clicked(), clickMapper, map() );
            p_widget->p_sys_intf = button;
            return button;

        case EXTENSION_WIDGET_IMAGE:
            label = new QLabel( this );
            label->setPixmap( QPixmap( qfu( p_widget->psz_text ) ) );
            if( p_widget->i_width > 0 )
                label->setMaximumWidth( p_widget->i_width );
            if( p_widget->i_height > 0 )
                label->setMaximumHeight( p_widget->i_height );
            label->setScaledContents( true );
            p_widget->p_sys_intf = label;
            return label;

        case EXTENSION_WIDGET_HTML:
            textArea = new QTextBrowser( this );
            textArea->setOpenExternalLinks( true );
            textArea->setHtml( qfu( p_widget->psz_text ) );
            p_widget->p_sys_intf = textArea;
            return textArea;

        case EXTENSION_WIDGET_TEXT_FIELD:
            textInput = new QLineEdit( this );
            textInput->setText( qfu( p_widget->psz_text ) );
            textInput->setReadOnly( false );
            textInput->setEchoMode( QLineEdit::Normal );
            inputMapper->setMapping( textInput, new WidgetMapper( p_widget ) );
            /// @note: maybe it would be wiser to use textEdited here?
            CONNECT( textInput, textChanged(const QString &),
                     inputMapper, map() );
            p_widget->p_sys_intf = textInput;
            return textInput;

        case EXTENSION_WIDGET_PASSWORD:
            textInput = new QLineEdit( this );
            textInput->setText( qfu( p_widget->psz_text ) );
            textInput->setReadOnly( false );
            textInput->setEchoMode( QLineEdit::Password );
            inputMapper->setMapping( textInput, new WidgetMapper( p_widget ) );
            /// @note: maybe it would be wiser to use textEdited here?
            CONNECT( textInput, textChanged(const QString &),
                     inputMapper, map() );
            p_widget->p_sys_intf = textInput;
            return textInput;

        case EXTENSION_WIDGET_CHECK_BOX:
            checkBox = new QCheckBox( this );
            checkBox->setText( qfu( p_widget->psz_text ) );
            checkBox->setChecked( p_widget->b_checked );
            clickMapper->setMapping( checkBox, new WidgetMapper( p_widget ) );
            CONNECT( checkBox, stateChanged( int ), clickMapper, map() );
            p_widget->p_sys_intf = checkBox;
            return checkBox;

        case EXTENSION_WIDGET_DROPDOWN:
            comboBox = new QComboBox( this );
            comboBox->setEditable( false );
            for( p_value = p_widget->p_values;
                 p_value != NULL;
                 p_value = p_value->p_next )
            {
                comboBox->addItem( qfu( p_value->psz_text ), p_value->i_id );
            }
            /* Set current item */
            if( p_widget->psz_text )
            {
                int idx = comboBox->findText( qfu( p_widget->psz_text ) );
                if( idx >= 0 )
                    comboBox->setCurrentIndex( idx );
            }
            selectMapper->setMapping( comboBox, new WidgetMapper( p_widget ) );
            CONNECT( comboBox, currentIndexChanged( const QString& ),
                     selectMapper, map() );
            return comboBox;

        case EXTENSION_WIDGET_LIST:
            list = new QListWidget( this );
            list->setSelectionMode( QAbstractItemView::ExtendedSelection );
            for( p_value = p_widget->p_values;
                 p_value != NULL;
                 p_value = p_value->p_next )
            {
                QListWidgetItem *item =
                    new QListWidgetItem( qfu( p_value->psz_text ) );
                item->setData( Qt::UserRole, p_value->i_id );
                list->addItem( item );
            }
            selectMapper->setMapping( list, new WidgetMapper( p_widget ) );
            CONNECT( list, itemSelectionChanged(),
                     selectMapper, map() );
            return list;

        case EXTENSION_WIDGET_SPIN_ICON:
            spinIcon = new SpinningIcon( this );
            spinIcon->play( p_widget->i_spin_loops );
            p_widget->p_sys_intf = spinIcon;
            return spinIcon;

        default:
            msg_Err( p_intf, "Widget type %d unknown", p_widget->type );
            return NULL;
    }
}
예제 #25
0
ProjectionManagement::ProjectionManagement(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::ProjectionManagement)
{
    ui->setupUi(this);
    ui->hintLabel->setText(tr("Please set all parameters below in order to create your projecttion"));

    QVBoxLayout *scrollLayout = new QVBoxLayout();

    //limit the start year and the area
    QGroupBox *yearAndAreaBox = new QGroupBox(tr("select the year and area"));

    QLabel *yearLabel = new QLabel(tr("start year"));
    yearLabel->setMaximumWidth(120);

    QComboBox *yearBox = new QComboBox();
    YearItemModel *yearItems = new YearItemModel(this);
    yearBox->setModel(yearItems);
    this->year = yearBox->itemText(0).toInt();

    QLabel *areaLabel = new QLabel(tr("study area"));
    areaLabel->setMaximumWidth(120);

    QComboBox *areaBox = new QComboBox();
    AreaItemModel *areaItems = new AreaItemModel(this);
    areaBox->setModel(areaItems);
    this->area = areaBox->itemText(0);

    QHBoxLayout *yearAndAreaLayout = new QHBoxLayout();
    yearAndAreaLayout->addWidget(yearLabel);
    yearAndAreaLayout->addWidget(yearBox);
    yearAndAreaLayout->addWidget(areaLabel);
    yearAndAreaLayout->addWidget(areaBox);

    yearAndAreaBox->setLayout(yearAndAreaLayout);

    scrollLayout->addWidget(yearAndAreaBox);

    //select the name and the path
    QGroupBox *nameAndPathBox = new QGroupBox(tr("name and path"));

    QHBoxLayout *nameAndPathLayout = new QHBoxLayout();

    QPushButton *nameAndPathButton = new QPushButton(tr("projection name"));
    nameAndPathLayout->addWidget(nameAndPathButton);

    filePathLabel = new QLabel();
    nameAndPathLayout->addWidget(filePathLabel);
    this->reloadData();

    nameAndPathBox->setLayout(nameAndPathLayout);

    scrollLayout->addWidget(nameAndPathBox);

    //if anything more

    ui->scrollAreaWidgetContents->setLayout(scrollLayout);

    //actionss
    connect(nameAndPathButton, SIGNAL(clicked()), this, SLOT(saveProjection()));
    connect(yearBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(yearChanged(QString)));
    connect(areaBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(areaChanged(QString)));

}
예제 #26
0
PinLabelDialog::PinLabelDialog(const QStringList & labels, bool singleRow, const QString & chipLabel, bool isCore, QWidget *parent)
	: QDialog(parent)
{
	m_isCore = isCore;
	m_labels = labels;
	m_doSaveAs = true;
	this->setWindowTitle(QObject::tr("Pin Label Editor"));

	QVBoxLayout * vLayout = new QVBoxLayout(this);

	QScrollArea * scrollArea = new QScrollArea(this);
	scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

	QFrame * frame = new QFrame(this);
	QHBoxLayout * hLayout = new QHBoxLayout(frame);

	QFrame * labelsFrame = initLabels(labels, singleRow, chipLabel);

	QFrame * textFrame = new QFrame();
	QVBoxLayout * textLayout = new QVBoxLayout(frame);

	QLabel * label = new QLabel("<html><body>" +
								tr("<p><h2>Pin Label Editor</h2></p>") +
								tr("<p>Click on a label next to a pin number to rename that pin.") + " " +
								tr("You can use the tab key to move through the labels in order.</p>") +
								"</body></html>");
	label->setMaximumWidth(150);
	label->setWordWrap(true);

	textLayout->addWidget(label);
	textLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding));
	textFrame->setLayout(textLayout);

	hLayout->addWidget(labelsFrame);
	hLayout->addSpacing(15);
	hLayout->addWidget(textFrame);
	frame->setLayout(hLayout);

	scrollArea->setWidget(frame);	

	QDialogButtonBox * buttonBox = new QDialogButtonBox(QDialogButtonBox::Save | QDialogButtonBox::Cancel);
	
	QPushButton * cancelButton = buttonBox->button(QDialogButtonBox::Cancel);
	cancelButton->setText(tr("Cancel"));
	cancelButton->setDefault(false);
	
	m_saveAsButton = buttonBox->button(QDialogButtonBox::Save);
	m_saveAsButton->setText(tr("Save"));
	m_saveAsButton->setEnabled(false);
	m_saveAsButton->setDefault(false);

	m_undoButton = new QPushButton(tr("Undo"));
	m_undoButton->setEnabled(false);
	m_undoButton->setDefault(false);

	m_redoButton = new QPushButton(tr("Redo"));
	m_redoButton->setEnabled(false);
	m_redoButton->setDefault(false);

    buttonBox->addButton(m_undoButton, QDialogButtonBox::ResetRole);
    buttonBox->addButton(m_redoButton, QDialogButtonBox::ResetRole);

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

	vLayout->addWidget(scrollArea);
	vLayout->addWidget(buttonBox);
	this->setLayout(vLayout);

	connect(buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *)));
	connect(&m_undoStack, SIGNAL(canRedoChanged(bool)), this, SLOT(undoChanged(bool)));
	connect(&m_undoStack, SIGNAL(canUndoChanged(bool)), this, SLOT(undoChanged(bool)));
	connect(&m_undoStack, SIGNAL(cleanChanged(bool)), this, SLOT(undoChanged(bool)));

}
예제 #27
0
파일: main.cpp 프로젝트: jinghuaguo/Logger1
MainWindow::MainWindow(Logger * logger)
 : logger(logger),
   depthImage(640, 480, QImage::Format_RGB888),
   rgbImage(640, 480, QImage::Format_RGB888),
   recording(false),
   lastDrawn(-1)
{
    this->setMaximumSize(1280, 600);
    this->setMinimumSize(1280, 600);

    QVBoxLayout * wrapperLayout = new QVBoxLayout;

    QHBoxLayout * mainLayout = new QHBoxLayout;
    QHBoxLayout * fileLayout = new QHBoxLayout;
    QHBoxLayout * buttonLayout = new QHBoxLayout;

    wrapperLayout->addLayout(mainLayout);

    depthLabel = new QLabel(this);
    depthLabel->setPixmap(QPixmap::fromImage(depthImage));
    mainLayout->addWidget(depthLabel);

    imageLabel = new QLabel(this);
    imageLabel->setPixmap(QPixmap::fromImage(rgbImage));
    mainLayout->addWidget(imageLabel);

    wrapperLayout->addLayout(fileLayout);

    QLabel * logLabel = new QLabel("Log file: ", this);
    logLabel->setMaximumWidth(logLabel->fontMetrics().boundingRect(logLabel->text()).width());
    fileLayout->addWidget(logLabel);

    logFile = new QLabel(this);
    logFile->setTextInteractionFlags(Qt::TextSelectableByMouse);
    logFile->setStyleSheet("border: 1px solid grey");
    fileLayout->addWidget(logFile);

    browseButton = new QPushButton("Browse", this);
    browseButton->setMaximumWidth(browseButton->fontMetrics().boundingRect(browseButton->text()).width() + 10);
    connect(browseButton, SIGNAL(clicked()), this, SLOT(fileBrowse()));
    fileLayout->addWidget(browseButton);

    dateNameButton = new QPushButton("Date filename", this);
    dateNameButton->setMaximumWidth(dateNameButton->fontMetrics().boundingRect(dateNameButton->text()).width() + 10);
    connect(dateNameButton, SIGNAL(clicked()), this, SLOT(dateFilename()));
    fileLayout->addWidget(dateNameButton);

    wrapperLayout->addLayout(buttonLayout);

    startStop = new QPushButton("Record", this);
    connect(startStop, SIGNAL(clicked()), this, SLOT(recordToggle()));
    buttonLayout->addWidget(startStop);

    QPushButton * quitButton = new QPushButton("Quit", this);
    connect(quitButton, SIGNAL(clicked()), this, SLOT(quit()));
    buttonLayout->addWidget(quitButton);

    setLayout(wrapperLayout);

    startStop->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    quitButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

    QFont currentFont = startStop->font();
    currentFont.setPointSize(currentFont.pointSize() + 8);

    startStop->setFont(currentFont);
    quitButton->setFont(currentFont);

    painter = new QPainter(&depthImage);

    timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(timerCallback()));
    timer->start(15);

#ifdef unix
    char * homeDir = getenv("HOME");
    logFolder.append(homeDir);
    logFolder.append("/");
#else
    char * homeDrive = getenv("HOMEDRIVE");
    char * homeDir = getenv("HOMEPATH");
    logFolder.append(homeDrive);
    logFolder.append("\\");
    logFolder.append(homeDir);
    logFolder.append("\\");
#endif

    logFolder.append("Kinect_Logs");

    boost::filesystem::path p(logFolder.c_str());
    boost::filesystem::create_directory(p);

    logFile->setText(QString::fromStdString(getNextFilename()));
}
/****************************************************************************
**
** Copyright (C) 2016
**
** This file is generated by the Magus toolkit
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
****************************************************************************/

#include <QComboBox>
#include <QStringListModel>
#include <QLabel>
#include <QHBoxLayout>
#include <QGroupBox>
#include <QLineEdit>
#include "tb_transformationwidget.h"

namespace Magus
{
    //****************************************************************************/
    TransformationWidget::TransformationWidget(QWidget* parent) : QWidget(parent)
    {
        selectionChanged = false;
        mPrecision = 2;
        mPosition = QVector3D(0, 0, 0);
        mRotation = QVector3D(0, 0, 0);
        mScale = QVector3D(0, 0, 0);
        mTransformation = POSITION;
        QHBoxLayout* transformationLayout = new QHBoxLayout;
        QHBoxLayout* xLayout = new QHBoxLayout;
        QHBoxLayout* yLayout = new QHBoxLayout;
        QHBoxLayout* zLayout = new QHBoxLayout;

        // Combobox
        QStringList list;
        list << QString("Position") << QString("Rotation") << QString("Scale");
        mModel = new QStringListModel(list);
        mTransformationCombobox = new QComboBox(parent);
        mTransformationCombobox->setModel(mModel);
        mTransformationCombobox->setMaxVisibleItems(3);

        // X, Y, Z
        QString s;
        QLabel* xLabel = new QLabel(QString("<b>X</b>"));
        xLabel->setMaximumWidth(24);
        xLabel->setAutoFillBackground(true);
        xLabel->setStyleSheet("QLabel {background-color : rgb(255, 0, 0); margin-left: 0px; margin-right: 0px; spacing: 0px;}");
        QRegExp regularExpression("[+-]?([0-9]+\\.([0-9]+)?|\\.[0-9]+)([eE][+-]?[0-9]+)?"); // floating point
        QRegExpValidator* validator = new QRegExpValidator(regularExpression);
        mXedit = new QLineEdit;
        mXedit->setValidator(validator);
        s = QVariant(mPosition.x()).toString();
        s = s.left(getLeftStringIndex(s));
        mXedit->setText(s);
        mXedit->setStyleSheet("QLineEdit {margin-right: 0px; margin-left: 5px; width: 32px; spacing: 0px;}");

        QLabel* yLabel = new QLabel(QString("<b>Y</b>"));
        yLabel->setMaximumWidth(24);
        yLabel->setAutoFillBackground(true);
        yLabel->setStyleSheet("QLabel {background-color : rgb(0, 255, 0); margin-left: 0px; margin-right: 0px;}");
        mYedit = new QLineEdit;
        mYedit->setValidator(validator);
        s = QVariant(mPosition.y()).toString();
        s = s.left(getLeftStringIndex(s));
        mYedit->setText(s);
        mYedit->setStyleSheet("QLineEdit {margin-right: 0px; margin-left: 0px; width: 32px; spacing: 0px;}");

        QLabel* zLabel = new QLabel(QString("<b>Z</b>"));
        zLabel->setMaximumWidth(24);
        zLabel->setAutoFillBackground(true);
        zLabel->setStyleSheet("QLabel {background-color : rgb(100, 100, 255); margin-left: 0px; margin-right: 0px;}");
        mZedit = new QLineEdit;
        mZedit->setValidator(validator);
        s = QVariant(mPosition.z()).toString();
        s = s.left(getLeftStringIndex(s));
        mZedit->setText(s);
        mZedit->setStyleSheet("QLineEdit {margin-right: 0px; margin-left: 0px; width: 32px; spacing: 0px;}");

        // Layout
        transformationLayout->addWidget(mTransformationCombobox);
        xLayout->addWidget(xLabel, 0, Qt::AlignRight);
        xLayout->addWidget(mXedit, 100, Qt::AlignLeft);
        yLayout->addWidget(yLabel, 0, Qt::AlignRight);
        yLayout->addWidget(mYedit, 0, Qt::AlignLeft);
        zLayout->addWidget(zLabel, 0, Qt::AlignRight);
        zLayout->addWidget(mZedit, 0, Qt::AlignLeft);
        transformationLayout->addLayout(xLayout);
        transformationLayout->addLayout(yLayout);
        transformationLayout->addLayout(zLayout);
        setLayout(transformationLayout);
        connect(mTransformationCombobox, SIGNAL(currentIndexChanged(int)), this, SLOT(handleSelectionChanged(int)));
        connect(mXedit, SIGNAL(textEdited(const QString &)), this, SLOT(handleXchanged(const QString &)));
        connect(mYedit, SIGNAL(textEdited(const QString &)), this, SLOT(handleYchanged(const QString &)));
        connect(mZedit, SIGNAL(textEdited(const QString &)), this, SLOT(handleZchanged(const QString &)));
    }
예제 #29
0
EdLevelPropertyColorField::EdLevelPropertyColorField (EdLevelPropertiesWindow *parent, std::shared_ptr<PlugNode> node, std::shared_ptr<ArchiveData> data)
{
    //setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
    _data = data;
    _node = node;
    
    buildStatusButtons();

    QLabel *name = new QLabel(this);
    name->setMaximumWidth(130);
    name->setMinimumWidth(130);
    name->setText(MoreStrings::captialize_and_format(_data->title()).c_str());
    
    
    QLabel *r = new QLabel(this);
    r->setText("R");

    QLabel *g = new QLabel(this);
    g->setText("G");

    QLabel *b = new QLabel(this);
    b->setText("B");

    QLabel *a = new QLabel(this);
    a->setText("A");


    _r = new QSlider(Qt::Horizontal, this);
    _r->setMinimum(0);
    _r->setMaximum(255);
    _r->setObjectName("prop");

    _r2 = new EdLevelLineEdit(this);
    _r2->setMaximumWidth(60);

    connect(    _r,         SIGNAL(valueChanged(int)), 
                this,       SLOT(doColorChange(int)));
    connect(	_r2,        SIGNAL(editingFinished()),
				this,       SLOT(doWriteParams2())	);


    _g = new QSlider(Qt::Horizontal, this);
    _g->setMinimum(0);
    _g->setMaximum(255);
    _g->setObjectName("prop");

    _g2 = new EdLevelLineEdit(this);
    _g2->setMaximumWidth(60);
    
    connect(    _g,         SIGNAL(valueChanged(int)), 
                this,       SLOT(doColorChange(int)));
    connect(	_g2,        SIGNAL(editingFinished()),
				this,       SLOT(doWriteParams2())	);

    _b = new QSlider(Qt::Horizontal, this);
    _b->setMinimum(0);
    _b->setMaximum(255);
    _b->setObjectName("prop");

    _b2 = new EdLevelLineEdit(this);
    _b2->setMaximumWidth(60);
    
    connect(    _b,         SIGNAL(valueChanged(int)), 
                this,       SLOT(doColorChange(int)));
    connect(	_b2,        SIGNAL(editingFinished()),
				this,       SLOT(doWriteParams2())	);

    _a = new QSlider(Qt::Horizontal, this); 
    _a->setMinimum(0);
    _a->setMaximum(255);
    _a->setObjectName("prop");

    _a2 = new EdLevelLineEdit(this);
    _a2->setMaximumWidth(60);
    
    connect(    _a,         SIGNAL(valueChanged(int)), 
                this,       SLOT(doColorChange(int)));
    connect(	_a2,        SIGNAL(editingFinished()),
				this,       SLOT(doWriteParams2())	);

    _fill = new EdLevelColorSwatch();
    _fill->setMaximumWidth(50);
    _fill->setMinimumWidth(50);
    _fill->setMaximumHeight(40);
    _fill->setMinimumHeight(40);

	connect(	this,           SIGNAL(doCommand(QString, bool)),
				parent,         SLOT(onCommand(QString, bool))	);

    QGridLayout *layout = new QGridLayout;
    layout->setContentsMargins(0,0,0,0);
    layout->setHorizontalSpacing(0);
    layout->setVerticalSpacing(0);
    layout->addWidget(keyButton(),0,0);
    layout->addWidget(hasInputButton(),0,1);
    layout->addWidget(hasOutputButton(),0,2);
    
    layout->addWidget(name,0,3);
    layout->addWidget(_fill,1,3,2,1, Qt::AlignHCenter | Qt::AlignVCenter);
    
    layout->addWidget(r,0,4);
    layout->addWidget(_r,0,5);
    layout->addWidget(_r2,0,6);

    layout->addWidget(g,1,4);
    layout->addWidget(_g,1,5);
    layout->addWidget(_g2,1,6);
    
    layout->addWidget(b,2,4);
    layout->addWidget(_b,2,5);
    layout->addWidget(_b2,2,6);
    
    layout->addWidget(a,3,4);
    layout->addWidget(_a,3,5);
    layout->addWidget(_a2,3,6);

    setLayout(layout);
    
    setMinimumHeight( (15+2) *4);

    doReadParams();
}
예제 #30
0
파일: menu.cpp 프로젝트: grea09/dirige
	void Menu::build()
	{
		debugsub(ENTER);
		
		menuFile_ = new QMenu(this);
		menuFile_->setTitle("&Fichier");
			actionSaveAs_ = new QAction(QIcon(":/images/save-as.png"),"Enregistrer sous ...",menuFile_);
			actionSaveAs_->setIconVisibleInMenu(true);
			actionSaveAs_->setObjectName(QString::fromUtf8("actionSaveAs_"));
			actionSaveAs_->setShortcut(QKeySequence::SaveAs);
			
			actionClose_ = new QAction(QIcon(":/images/color-delete.png"),"Fermer le document",menuFile_);
			actionClose_->setIconVisibleInMenu(true);
			actionClose_->setObjectName(QString::fromUtf8("actionClose_"));
			actionClose_->setShortcut(QKeySequence::Close);
			
			actionQuit_ = new QAction(QIcon(":/images/quit.png"),"Quitter",menuFile_);
			actionQuit_->setIconVisibleInMenu(true);
			actionQuit_->setObjectName(QString::fromUtf8("actionQuit_"));
			actionQuit_->setShortcut(Qt::CTRL + Qt::Key_Q);
			
			menuFile_->addAction(parent_->getToolBarFile()->getActionNew());
			menuFile_->addAction(parent_->getToolBarFile()->getActionOpen());
			menuFile_->addSeparator();
			menuFile_->addAction(parent_->getToolBarFile()->getActionSave());
			menuFile_->addAction(actionSaveAs_);
			menuFile_->addSeparator();
			menuFile_->addAction(actionClose_);
			menuFile_->addAction(actionQuit_);
		
		menuEdit_ = new QMenu(this);
		menuEdit_->setTitle(QString::fromUtf8("Édit&er"));
			menuEdit_->addAction(parent_->getToolBarDraw()->getActionEllipse());
			menuEdit_->addAction(parent_->getToolBarDraw()->getActionRectangle());
			menuEdit_->addAction(parent_->getToolBarDraw()->getActionLine());
			menuEdit_->addAction(parent_->getToolBarDraw()->getActionHandFree());
			menuEdit_->addAction(parent_->getToolBarDraw()->getActionErraser());
			//~ menuEdit_->addSeparator();
			menuEdit_->addAction(parent_->getToolBarDraw()->getActionFill());
			//~ menuEdit_->addAction(parent_->getToolBarDraw()->getActionColor());
			menuEdit_->addSeparator();
			menuEdit_->addAction(parent_->getToolBarDraw()->getActionStart());
			menuEdit_->addAction(parent_->getToolBarDraw()->getActionEnd());
			menuEdit_->addAction(parent_->getToolBarDraw()->getActionRun());
			
		menuView_ = new QMenu(this);
		menuView_->setTitle("&Affichage");
			menuToolBar_ = new QMenu(menuView_);
			menuToolBar_->setTitle(QString::fromUtf8("&Barre d'outils"));
				
				actionGroupToolBar_ = new QActionGroup(menuToolBar_);
				actionGroupToolBar_->setExclusive(false);
				
				actionToolBarFile_ = new QAction(QIcon(":/images/save-as.png"),"Fichier",actionGroupToolBar_);
				actionToolBarFile_->setIconVisibleInMenu(true);
				actionToolBarFile_-> setCheckable(true);
				actionToolBarFile_->setObjectName(QString::fromUtf8("actionToolBarFile_"));
				
				actionToolBarDraw_ = new QAction(QIcon(":/images/handfree.png"),"Dessin",actionGroupToolBar_);
				actionToolBarDraw_->setIconVisibleInMenu(true);
				actionToolBarDraw_-> setCheckable(true);
				actionToolBarDraw_->setObjectName(QString::fromUtf8("actionToolBarDraw_"));
				
				actionToolBarZoom_ = new QAction(QIcon(":/images/zoom-def.png"),"Zoom",actionGroupToolBar_);
				actionToolBarZoom_->setIconVisibleInMenu(true);
				actionToolBarZoom_-> setCheckable(true);
				actionToolBarZoom_->setObjectName(QString::fromUtf8("actionToolBarZoom_"));
				
				actionToolBarRobot_ = new QAction(QIcon(":/images/nxt.svg"),QString::fromUtf8("Paramètres du robot"),actionGroupToolBar_);
				actionToolBarRobot_->setIconVisibleInMenu(true);
				actionToolBarRobot_-> setCheckable(true);
				actionToolBarRobot_->setObjectName(QString::fromUtf8("actionToolBarRobot_"));
				
				actionToolBarColor_ = new QAction(QIcon(":/images/color-edit.png"),"Palette de couleurs",actionGroupToolBar_);
				actionToolBarColor_->setIconVisibleInMenu(true);
				actionToolBarColor_-> setCheckable(true);
				actionToolBarColor_->setObjectName(QString::fromUtf8("actionToolBarColor_"));
				
				actionGroupToolBar_->addAction(actionToolBarFile_);
				actionGroupToolBar_->addAction(actionToolBarDraw_);
				actionGroupToolBar_->addAction(actionToolBarZoom_);
				actionGroupToolBar_->addAction(actionToolBarRobot_);
				actionGroupToolBar_->addAction(actionToolBarColor_);
				
				menuToolBar_->addAction(actionToolBarFile_);
				menuToolBar_->addAction(actionToolBarDraw_);
				menuToolBar_->addAction(actionToolBarZoom_);
				menuToolBar_->addAction(actionToolBarRobot_);
				menuToolBar_->addAction(actionToolBarColor_);
				
			menuView_->addMenu(menuToolBar_);
			menuView_->addAction(parent_->getToolBarZoom()->getActionZoomPlus());
			menuView_->addAction(parent_->getToolBarZoom()->getActionZoomMinus());
			menuView_->addAction(parent_->getToolBarZoom()->getActionZoomDef());
			
			
			
		menuOption_ = new QMenu(this);
		menuOption_->setTitle("&Options");
			actionColor_ = new QAction(QIcon(":/images/color.png"),"Couleur du chemin",menuOption_);
			actionColor_->setIconVisibleInMenu(true);
			actionColor_->setObjectName(QString::fromUtf8("actionColor_"));
			menuOption_->addAction(actionColor_);
		
		menuHelp_ = new QMenu(this);
		menuHelp_->setTitle("Aide");
			actionHelp_ = new QAction(QIcon(":/images/help.png"),"Aide",menuHelp_);
			actionHelp_->setIconVisibleInMenu(true);
			actionHelp_->setObjectName(QString::fromUtf8("actionHelp_"));
			actionHelp_->setShortcut(QKeySequence::HelpContents);
			QMainWindow* helpWindow = new QMainWindow(menuHelp_);
			helpWindow->setWindowTitle("Aide de DiRIGe");
			QScrollArea* scrollHelp = new QScrollArea(helpWindow);
			QLabel* label = new QLabel(QString::fromUtf8("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<HTML>\n<HEAD>\n\t<META HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=utf-8\">\n\t<TITLE></TITLE>\n\t<META NAME=\"GENERATOR\" CONTENT=\"OpenOffice.org 3.1  (Linux)\">\n\t<META NAME=\"AUTHOR\" CONTENT=\"Blon THO\">\n\t<META NAME=\"CREATED\" CONTENT=\"20100323;21130100\">\n\t<META NAME=\"CHANGEDBY\" CONTENT=\"Blon THO\">\n\t<META NAME=\"CHANGED\" CONTENT=\"20100323;22494200\">\n\t<STYLE TYPE=\"text/css\">\n\t<!--\n\t\t@page { margin: 2cm }\n\t\tP { text-indent: 1.2cm; margin-bottom: 0.21cm; text-align: justify; page-break-before: auto }\n\t\tH1 { margin-bottom: 0.21cm; text-align: center }\n\t\tH1.western { font-family: \"Arial\", sans-serif; font-size: 20pt }\n\t\tH1.cjk { font-family: \"MS Mincho\"; font-size: 16pt }\n\t\tH1.ctl { font-family: \"Tahoma\"; font-size: 16pt }\n\t\tH2 { text-indent: 1cm; margin-bottom: 0.21cm; text-align: left }\n\t\tH2.western { font-family: \"Arial\", sans-serif; font-size: 14pt; font-style: italic }\n\t\tH2.cjk { font-family: \"MS Mincho\"; font-size: 14pt; font-style: italic }\n\t\tH2.ctl { font-family: \"Tahoma\"; font-size: 14pt; font-style: italic }\n\t-->\n\t</STYLE>\n</HEAD>\n<BODY LANG=\"fr-FR\" DIR=\"LTR\">\n<P ALIGN=CENTER STYLE=\"text-indent: 0cm; margin-top: 0.42cm; page-break-after: avoid\">\n<FONT FACE=\"Arial, sans-serif\"><FONT SIZE=5><B>DiRIGe</B></FONT></FONT></P>\n<H1 CLASS=\"western\">Mode d'emploi</H1>\n<P>DiRIGe est une application libre et gratuite. Elle permet de\ntrouver le chemin le plus court entre deux points pour un robot dans\nun environnement donné. Cet environnement pourra être dessiné avec\ncette application, ou modifié à partir d'un fichier image (BMP)\nexistant. Le logiciel offre à l'utilisateur plusieurs options de\ndessin comme le choix de la forme à dessiner et de sa couleur.\nEnsuite, il est possible de définir les paramètres du robot pour\nque l'algorithme puisse trouver le chemin le plus court que le robot\naura à parcourir.</P>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm\"><I>Conseil\n: il est recommandé d'enregistrer constamment l'image éditée car\nil n'existe pas de fonction «&nbsp;Retour en arrière&nbsp;» !</I></P>\n<H2 CLASS=\"western\">Vue générale à l'ouverture</H2>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm; page-break-before: auto\"></P>\n<H2 CLASS=\"western\">Espace sur lequel l'utilisateur pourra éditer\nl'environnement</H2>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm; page-break-before: auto\"></P>\n<H2 CLASS=\"western\">Vue générale des options de fichiers</H2>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm; page-break-before: auto\"></P>\n<H2 CLASS=\"western\">Vue générale des options de dessin disponibles</H2>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm; page-break-before: auto\"></P>\n<H2 CLASS=\"western\">Vue générale des options de couleurs.</H2>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm; page-break-before: auto\"></P>\n<H2 CLASS=\"western\">Vue générale des paramètres attribuables au\nrobot.</H2>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm; page-break-before: auto\"></P>\n<H2 CLASS=\"western\">Barre d'outils</H2>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm; page-break-before: auto\"></P>\n<H1 CLASS=\"western\">Options de fichier</H1>\n<H2 CLASS=\"western\"> Une nouvelle carte</H2>\n<P>Cette option permettra à l'utilisateur d'ouvrir un nouvel\nenvironnement vierge (blanc).</P>\n<P>Il sera demandé à l'utilisateur d'enregistrer l'environnement\ncourant ou non. Si l'utilisateur souhaite enregistrer son image avant\nd'ouvrir un nouvel environnement, une fenêtre s'ouvrira pour lui\ndemander de choisir l'emplacement du fichier. \n</P>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm; page-break-before: auto\"></P>\n<P>Ensuite l'application demandera à l'utilisateur d'entrer la\ntaille du nouvel environnement.</P>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm; page-break-before: auto\"></P>\n<H2 CLASS=\"western\"> Ouvrir une carte</H2>\n<P>Cette option permet à l'utilisateur d'ouvrir un environnement à\npartir d'un fichier image BMP existant.</P>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm\"><I>Remarque\n: les couleurs existantes sur l'image chargée devront être définies\nmanuellement par l'utilisateur (se référer à la section «&nbsp;Options\nde couleurs&nbsp;»).</I></P>\n<P>Il sera demandé à l'utilisateur d'enregistrer l'environnement\ncourant ou non. Si l'utilisateur souhaite enregistrer son image avant\nd'ouvrir un nouvel environnement, une fenêtre s'ouvrira pour lui\ndemander de choisir l'emplacement du fichier.</P>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm; page-break-before: auto\"></P>\n<P>Ensuite l'application demandera à l'utilisateur de spécifier\nl'emplacement du fichier image BMP à ouvrir.</P>\n<H2 CLASS=\"western\"> Enregistre la carte</H2>\n<P>Cette option permet à l'utilisateur d'enregistrer l'environnement\nsur lequel il est en train de travailler en un fichier image BMP.</P>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm\"><I>Remarque\n: aucun paramètre du robot défini ni les couleurs choisies ne\nseront enregistrés.</I></P>\n<H1 CLASS=\"western\">Options de dessin</H1>\n<H2 CLASS=\"western\">Dessiner avec le curseur</H2>\n<P>Cette option permet à l'utilisateur de dessiner librement sur\nl'espace de travail. Lorsqu'il cliquera sur le bouton gauche de la\nsouris sur l'environnement, un point à l'emplacement du curseur sera\ndessiné. Si le bouton gauche de la souris n'est pas relâché,\nl'application continuera de dessiner derrière le curseur. \n</P>\n<H2 CLASS=\"western\">Taille du stylo</H2>\n<P>Cette «&nbsp;spinbox&nbsp;» (zone de sélection numérique)\npermet à l'utilisateur de modifier la taille de dessin du stylo en\npixel. Plus la taille est petite, plus les points dessinés seront\npetits.</P>\n<H2 CLASS=\"western\">Tracer une ellipse</H2>\n<P>Cette option permet de dessiner une ellipse. Dès que le clic\ngauche de la souris est enclenché sur l'environnement, l'emplacement\ndu curseur sera choisi comme centre de l'ellipse. Ensuite, sans\nrelâcher le bouton gauche de la souris, en bougeant le curseur\nl'utilisateur va définir la taille de l'ellipse. Une première\napproche de l'ellipse qui sera dessinée est faite avec des\npointillés. Lorsque le bouton gauche sera relâché, l'ellipse sera\ndessinée sur la carte.</P>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm\"><I>Remarque\n: la taille du stylo est prise en compte pour le contour de\nl'ellipse.</I></P>\n<H2 CLASS=\"western\">Tracer un rectangle</H2>\n<P>Cette option permet de dessiner un rectangle. Dès que le clic\ngauche de la souris est enclenché sur l'environnement, l'emplacement\ndu curseur sera choisi comme un premier sommet du rectangle. Ensuite,\nsans relâcher le bouton gauche de la souris, en bougeant le curseur\nl'utilisateur va définir la taille du rectangle. Une première\napproche du rectangle qui sera dessiné est faite avec des\npointillés. Lorsque le bouton gauche sera relâché, le rectangle\nsera dessiné sur la carte.</P>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm\"><I>Remarque\n: la taille du stylo est prise en compte pour le contour du\nrectangle.</I></P>\n<H2 CLASS=\"western\">Tracer une ligne</H2>\n<P>Cette option permet de dessiner une ligne. Dès que le clic gauche\nde la souris est enclenché sur l'environnement, l'emplacement du\ncurseur sera choisi comme un premier sommet de la ligne. Ensuite,\nsans relâcher le bouton gauche de la souris, en bougeant le curseur\nl'utilisateur va définir l'autre sommet de la ligne. Une première\napproche de la ligne qui sera dessinée est faite avec des\npointillés. Lorsque le bouton gauche sera relâché, la ligne sera\ndessinée sur la carte.</P>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm\"><I>Remarque\n: la taille du stylo est prise en compte pour la ligne.</I></P>\n<H2 CLASS=\"western\"> Effacer avec le curseur</H2>\n<P>Cette option permet d'effacer une zone de l'environnement. Cette\nzone est représentée par un carré  et définie en fonction de la\ntaille du stylo. Un carré en pointillés sous le curseur indiquera\nla zone dans laquelle le contenu de la carte sera effacé. Lorsque\nl'utilisateur clique sur le bouton gauche de la souris, la zone\nsituée dans le carré en pointillés sera effacée.</P>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm\"><I>Remarque\n: dans une zone noire, les pointillés ne pourront pas être\nvisibles.</I></P>\n<H2 CLASS=\"western\"> Zoom arrière</H2>\n<P>Cette option permet de faire un zoom arrière de 50% sur\nl'environnement.</P>\n<H2 CLASS=\"western\"> Rétablir l'échelle</H2>\n<P>Cette option permet de mettre le zoom à 100% c'est à dire à\nl'échelle réelle de la carte.</P>\n<H2 CLASS=\"western\"> Zoom avant</H2>\n<P>Cette option permet de faire un zoom avant de 50% sur\nl'environnement.</P>\n<H2 CLASS=\"western\"> Taille du zoom</H2>\n<P>Cette «&nbsp;spinbox&nbsp;» (zone de sélection numérique)\npermet à l'utilisateur de modifier la taille du zoom sur\nl'environnement. Plus la valeur sera petite, plus le zoom sera\nreculé.</P>\n<H2 CLASS=\"western\"> Remplir les prochaines formes</H2>\n<P>Cette option permet de déterminer si l'ellipse ou le rectangle\nque l'utilisateur va dessiner sera rempli ou non.</P>\n<H2 CLASS=\"western\"> Placer le point de départ</H2>\n<P>Cette option permet à l'utilisateur de placer le point de départ\ndu robot sur l'environnement. Il lui suffira ensuite de cliquer sur\nle bouton gauche de la souris à l'emplacement choisi dans\nl'environnement pour définir la position du point de départ.</P>\n<H2 CLASS=\"western\">Placer le point d'arrivée</H2>\n<P>Cette option permet à l'utilisateur de placer le point d'arrivée\ndu robot à atteindre sur l'environnement. Il lui suffira ensuite de\ncliquer sur le bouton gauche de la souris à l'emplacement choisi\ndans l'environnement pour définir la position du point d'arrivée.</P>\n<H1 CLASS=\"western\">Options de couleur</H1>\n<H2 CLASS=\"western\">Ajouter une nouvelle couleur</H2>\n<P>Cette option permet d'ajouter une couleur de dessin. Lorsque\nl'utilisateur enclenchera cette option, une nouvelle fenêtre\napparaîtra pour lui demander de choisir une couleur.</P>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm; page-break-before: auto\"></P>\n<P>Lorsque l'utilisateur confirmera son choix (appui sur le bouton\nOK), une nouvelle boîte de couleur apparaîtra.</P>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm; page-break-before: auto\"></P>\n<H2 CLASS=\"western\"> Supprimer toutes les couleurs</H2>\n<P>Cette option permet de supprimer toutes les couleurs définies par\nl'utilisateur. Une confirmation lui sera demandée avant d'effectuer\nla suppression.</P>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm; page-break-before: auto\"></P>\n<H2 CLASS=\"western\">Choix de la couleur</H2>\n<P>Lorsque l'utilisateur cliquera sur cette case de couleur, le stylo\nprendra cette couleur pour les prochaines formes dessinées.</P>\n<H2 CLASS=\"western\">Passante</H2>\n<P>Cette option détermine le comportement que le robot aura sur les\nformes de cette couleur dans l'environnement. Si l'option est cochée,\nle robot pourra franchir cette couleur, sinon il ne pourra pas.</P>\n<H2 CLASS=\"western\">Valeur d'obstacle de la couleur</H2>\n<P>Cette spinbox (zone de sélection numérique) permet de définir\nsi le robot sera accéléré (inférieure à 100%), ralenti\n(supérieure à 100%) ou sans modification (égale à 100%). Cette\nvaleur pourra aussi être définie avec la barre de sélection en\nchangeant la position du curseur sur la barre.</P>\n<H2 CLASS=\"western\">Modifier la couleur</H2>\n<P>Cette option permet à l'utilisateur de modifier la couleur\nchoisie en lui demandant de la choisir à nouveau dans la nouvelle\nfenêtre.</P>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm\"><I>Remarque\n: les formes dessinées avec la couleur précédente ne changeront\npas de couleur.</I></P>\n<H2 CLASS=\"western\">Suppression de la couleur</H2>\n<P>Cette option permet de supprimer la couleur en question.</P>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm\"><I>Remarque\n: les formes dessinées avec la couleur ne seront pas effacées.</I></P>\n<H1 CLASS=\"western\">Paramètres attribuables du robot</H1>\n<H2 CLASS=\"western\">Taille du robot</H2>\n<P>Cette spinbox (zone de sélection numérique) permet de définir\nla taille du robot en pixel. Cela aura un impact sur le chemin à\nemprunter si le robot est trop grand pour passer par de petits\nchemins. Cette valeur pourra aussi être définie avec la barre de\nsélection en changeant la position du curseur sur la barre.</P>\n<H2 CLASS=\"western\">Angle initial du robot</H2>\n<P>Cette spinbox (zone de sélection numérique) permet de définir\nl'angle initial du robot en degré. Cela aura un impact sur le chemin\nà emprunter dès le départ. Cette valeur pourra aussi être définie\navec  la <FONT COLOR=\"#800000\">???????????????? </FONT><FONT COLOR=\"#000000\">en</FONT>\nla tournant.</P>\n<H2 CLASS=\"western\">Coût de demi-tour</H2>\n<P>Cette spinbox (zone de sélection numérique) permet de définir\nle coût que le robot prendra pour faire un tour sur lui-même. Cela\naura un impact sur le chemin à emprunter si trop de virages sont\nnécessaires. Cette valeur pourra aussi être définie avec la barre\nde sélection en changeant la position du curseur sur la barre.</P>\n<P ALIGN=LEFT STYLE=\"text-indent: 0cm; margin-bottom: 0cm; page-break-before: auto\">\n<BR>\n</P>\n<P>Barre d'outils : faire pour chaque option encore ou alors les\nincorporer dans chaque option concernée vue précédemment ?</P>\n</BODY>\n</HTML>"),scrollHelp);
			label->setMaximumWidth(512);
			label->setWordWrap(true);
			scrollHelp->setWidget(label);
			helpWindow->setCentralWidget(scrollHelp);
			helpWindow->setWindowIcon(QIcon(":/images/dirige.png"));
			
			connect(actionHelp_,SIGNAL(triggered()),helpWindow,SLOT(show()));
			
			actionAboutDirige_ = new QAction(QIcon(":/images/dirige.svg"),QString::fromUtf8("À propos de DiRIGe"),menuHelp_);
			actionAboutDirige_->setIconVisibleInMenu(true);
			actionAboutDirige_->setObjectName(QString::fromUtf8("actionAboutDirige_"));
			
			
			
			menuHelp_->addAction(actionHelp_);
			menuHelp_->addAction(actionAboutDirige_);
		
		this->addMenu(menuFile_);
		this->addMenu(menuEdit_);
		this->addMenu(menuView_);
		this->addMenu(menuOption_);
		this->addMenu(menuHelp_);
		
		
		debugsub(EXIT_SUCCESS);
	}