Exemplo n.º 1
0
Screenshot::Screenshot( QWidget *parent, Qt::WFlags f)
{
    screenshotLabel = new QLabel;
    screenshotLabel->setSizePolicy(QSizePolicy::Expanding,
                                   QSizePolicy::Expanding);
    screenshotLabel->setAlignment(Qt::AlignCenter);
//    screenshotLabel->setMinimumSize(240, 160);

    createOptionsGroupBox();
    createButtonsLayout();

    mainLayout = new QVBoxLayout;
    mainLayout->addWidget(screenshotLabel);
    mainLayout->addWidget(optionsGroupBox);
#ifndef Q_WS_QWS
    mainLayout->addLayout(buttonsLayout);
#endif
    setLayout(mainLayout);

    shootScreen();
    delaySpinBox->setValue(5);
    hideThisWindowCheckBox->setChecked(true);
    setWindowTitle(tr("Screenshot"));
#ifndef Q_WS_QWS
    resize(300, 200);
#endif
    QtopiaApplication::instance()->registerRunningTask("ReallyFuckingHideThisAndNotKillIt");

}
Exemplo n.º 2
0
Screenshot::Screenshot()
{
        imageLabel = new QLabel;
        imageLabel->setSizePolicy(QSizePolicy::Expanding,
                                   QSizePolicy::Expanding);
        imageLabel->setAlignment(Qt::AlignCenter);

        imageScrollArea = new QScrollArea;
        imageScrollArea->setWidget(imageLabel);
        imageScrollArea->setMinimumSize(320,240);

        createButtonsLayout();

        createGroupBoxesLayout();

        createParameterLayout();

        buttonsLayout->addLayout(GroupBoxesLayoutLayout);

        detectLayout = new QVBoxLayout;
        detectLayout->addLayout(parameterLayout);
        detectLayout->addWidget(imageScrollArea);

        mainLayout = new QHBoxLayout;
        mainLayout->addLayout(buttonsLayout);
        mainLayout->addLayout(detectLayout);
        setLayout(mainLayout);

        zoomSpinBox->setValue(100);
        brightnessSpinBox->setValue(0);
        contrastSpinBox->setValue(100);
        gammaSpinBox->setValue(0);

        rhoSpinBox->setValue(1);
        thetaSpinBox->setValue(180);
        thresholdSpinBox->setValue(50);
        minLineLengthSpinBox->setValue(50);
        maxGapSpinBox->setValue(10);

        setWindowTitle(tr("Line detecting via Hough Transform Demo"));

        lineDetected = false;
        scaleFator = 100;
        dumpFullScreen();
        updatePreview();
}
Exemplo n.º 3
0
Interface::Interface(Session* currentSession)
{
	thisSession = currentSession;
	QVBoxLayout* mainLayoyt;
	setLayout(mainLayoyt = new QVBoxLayout(this));

	peopleButton = new QToolButton(this);
	createPeopleWidget();
	mainLayoyt->addWidget(peopleButton);


	transactionData = new QListWidget(this);
	mainLayoyt->addWidget(transactionData);

	QHBoxLayout *buttonsLayout = new QHBoxLayout();
	createButtonsLayout(buttonsLayout);

	mainLayoyt->addLayout(buttonsLayout);
}
void MotivationInfoWidget::createLayout()
{
	QLabel* motivationQuestionText = new QLabel(tr(HOW_ARE_YOU_MOTIVATED_TEXT));
	QLabel* lowMotivationText = new QLabel(tr(LOWLY_MOTIVATED_TEXT));
	QLabel* highMotivationText = new QLabel(tr(HIGHLY_MOTIVATED_TEXT));

	QHBoxLayout* horizontalLayoutButtons = new QHBoxLayout;
	createButtonsLayout(*horizontalLayoutButtons);

	QHBoxLayout* horizontalLayoutScale = new QHBoxLayout;
	horizontalLayoutScale->addWidget(lowMotivationText);
	horizontalLayoutScale->addStretch();
	horizontalLayoutScale->addWidget(highMotivationText);

	QVBoxLayout* verticalLayout = new QVBoxLayout;
	verticalLayout->addWidget(motivationQuestionText);
	verticalLayout->addLayout(horizontalLayoutButtons);
	verticalLayout->addLayout(horizontalLayoutScale);

	setLayout(verticalLayout);
}
void MultiButtonWidget::createLayout()
{
	m_descriptionLabel = new QLabel();
	m_lowScaleLabel = new QLabel();
	m_highScaleLabel = new QLabel();

	QHBoxLayout* horizontalLayoutButtons = new QHBoxLayout;
	createButtonsLayout(*horizontalLayoutButtons);

	QHBoxLayout* horizontalLayoutScale = new QHBoxLayout;
	horizontalLayoutScale->addWidget(m_lowScaleLabel);
	horizontalLayoutScale->addStretch();
	horizontalLayoutScale->addWidget(m_highScaleLabel);

	QVBoxLayout* mainLayout = new QVBoxLayout;
	mainLayout->addWidget(m_descriptionLabel);
	mainLayout->addLayout(horizontalLayoutButtons);
	mainLayout->addLayout(horizontalLayoutScale);

	setLayout(mainLayout);
}
Exemplo n.º 6
0
//! [0]
Screenshot::Screenshot()
{
    screenshotLabel = new QLabel;
    screenshotLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    screenshotLabel->setAlignment(Qt::AlignCenter);
    screenshotLabel->setMinimumSize(240, 160);

    createOptionsGroupBox();
    createButtonsLayout();

    mainLayout = new QVBoxLayout;
    mainLayout->addWidget(screenshotLabel);
    mainLayout->addWidget(optionsGroupBox);
    mainLayout->addLayout(buttonsLayout);
    setLayout(mainLayout);

    shootScreen();
    delaySpinBox->setValue(5);

    setWindowTitle(tr("Screenshot"));
    resize(300, 200);
}
Exemplo n.º 7
0
/* constructor */
ExerciseFactorize::ExerciseFactorize(QWidget * parent, const char * name):
    ExerciseBase(parent, name)
{
    QPalette pal;
    QColorGroup cg;
#ifdef DEBUG
    kdDebug() << "constructor ExerciseFactorize()" << endl;
#endif

    /* create a new task */
    QApplication::setOverrideCursor(waitCursor); /* show the sand clock */
    createTask();
    QApplication::restoreOverrideCursor(); /* show the normal cursor */

    // the next thing to do on a button click would be to check the entered
    // result
    m_currentState = _CHECK_TASK;

    Form1Layout = new QVBoxLayout( this, 11, 6, "Form1Layout");

    layout9 = new QVBoxLayout( 0, 0, 6, "layout9");

    // The following method fix the problem in
    // bug  #116831, reverse order in RTL desktops.
    // Amit Ramon [email protected]
    layout4 = createFactorsLayout();
    layout9->addLayout(layout4);

    spacer2 = new QSpacerItem( 20, 21, QSizePolicy::Minimum, QSizePolicy::Expanding );
    layout9->addItem( spacer2 );

    layout2 = new QVBoxLayout( 0, 0, 6, "layout2");

    // The following method fix the problem in
    // bug  #116831, reverse order in RTL desktops.
    // Amit Ramon [email protected]
    layout1 = createButtonsLayout();
    layout2->addLayout(layout1);

    m_removeLastFactorButton = new QPushButton( this, "m_removeLastFactorButton" );
    layout2->addWidget( m_removeLastFactorButton );
    layout9->addLayout( layout2 );

    spacer4 = new QSpacerItem( 20, 21, QSizePolicy::Minimum, QSizePolicy::Expanding );
    layout9->addItem( spacer4 );

    layout7 = new QHBoxLayout( 0, 0, 6, "layout7");
    spacer3 = new QSpacerItem( 361, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout7->addItem( spacer3 );

    m_checkButton = new QPushButton( this, "m_checkButton" );
    layout7->addWidget( m_checkButton );
    layout9->addLayout( layout7 );
    Form1Layout->addLayout( layout9 );

    // the current task
    QString tmp_str;
    tmp_str.setNum(m_taskNumber);
    m_taskLabel->setText(tmp_str);

    // now set the color for the task label
    m_taskLabel->setPaletteForegroundColor(SettingsClass::numberColor());

    // the equal sign
    m_equalSignLabel->setText("=");

    // now set the color for the equal sign
    m_equalSignLabel->setPaletteForegroundColor(SettingsClass::operationColor());

    // the wrong/correct label, we hide it
    result_label->setText(i18n("WRONG"));
    result_label->hide();

    // the prime factor buttons
    m_factor2Button->setText( i18n( "2" ) );
    m_factor3Button->setText( i18n( "3" ) );
    m_factor5Button->setText( i18n( "5" ) );
    m_factor7Button->setText( i18n( "7" ) );
    m_factor11Button->setText( i18n( "11" ) );
    m_factor13Button->setText( i18n( "13" ) );
    m_factor17Button->setText( i18n( "17" ) );
    m_factor19Button->setText( i18n( "19" ) );
    QObject::connect(m_factor2Button, SIGNAL(clicked()), this, SLOT(slotFactor2ButtonClicked()));
    QObject::connect(m_factor3Button, SIGNAL(clicked()), this, SLOT(slotFactor3ButtonClicked()));
    QObject::connect(m_factor5Button, SIGNAL(clicked()), this, SLOT(slotFactor5ButtonClicked()));
    QObject::connect(m_factor7Button, SIGNAL(clicked()), this, SLOT(slotFactor7ButtonClicked()));
    QObject::connect(m_factor11Button, SIGNAL(clicked()), this, SLOT(slotFactor11ButtonClicked()));
    QObject::connect(m_factor13Button, SIGNAL(clicked()), this, SLOT(slotFactor13ButtonClicked()));
    QObject::connect(m_factor17Button, SIGNAL(clicked()), this, SLOT(slotFactor17ButtonClicked()));
    QObject::connect(m_factor19Button, SIGNAL(clicked()), this, SLOT(slotFactor19ButtonClicked()));

    // add tooltips to the factor buttons
    QToolTip::add(m_factor2Button, i18n("Add prime factor 2."));
    QToolTip::add(m_factor3Button, i18n("Add prime factor 3."));
    QToolTip::add(m_factor5Button, i18n("Add prime factor 5."));
    QToolTip::add(m_factor7Button, i18n("Add prime factor 7."));
    QToolTip::add(m_factor11Button, i18n("Add prime factor 11."));
    QToolTip::add(m_factor13Button, i18n("Add prime factor 13."));
    QToolTip::add(m_factor17Button, i18n("Add prime factor 17."));
    QToolTip::add(m_factor19Button, i18n("Add prime factor 19."));

    // the remove last factor button
    m_removeLastFactorButton->setText( i18n( "&Remove Last Factor" ) );
    m_removeLastFactorButton->setEnabled(false);
    QObject::connect(m_removeLastFactorButton, SIGNAL(clicked()), this, SLOT(slotRemoveLastFactorButtonClicked()));
    QToolTip::add(m_removeLastFactorButton, i18n("Removes the last entered prime factor."));

    // the check task button
    m_checkButton->setText( i18n( "&Check Task" ) );
    QToolTip::add(m_checkButton, i18n("Click on this button to check your result. The button will not work if you have not entered a result yet."));
    QObject::connect(m_checkButton, SIGNAL(clicked()), this, SLOT(slotCheckButtonClicked()));
    m_checkButton->setDefault(true); // is the default button of the dialog

    // that the user can start choosing the prime factors
    m_factor2Button->setFocus();

    // set the tab order
    setTabOrder(m_factor2Button, m_factor3Button);
    setTabOrder(m_factor3Button, m_factor5Button);
    setTabOrder(m_factor5Button, m_factor7Button);
    setTabOrder(m_factor7Button, m_factor11Button);
    setTabOrder(m_factor13Button, m_factor17Button);
    setTabOrder(m_factor17Button, m_factor19Button);
    setTabOrder(m_factor19Button, m_removeLastFactorButton);

    // add tooltip and qwhatsthis help to the widget
    QToolTip::add(this, i18n("In this exercise you have to factorize a given number."));
    QWhatsThis::add(this, i18n("In this exercise you have to factorize a given number. You have to enter all prime factors of the number. You can add a prime factor by clicking on the corresponding button. The chosen prime factors will be shown in the input field. Do not forget to enter all prime factors, even when a prime factor repeats several times!"));
}