예제 #1
0
Window::Window(QWidget *parent)
    : QWidget(parent),
    m_iconSize(64, 64)
{
    m_ui.setupUi(this);
    QButtonGroup *buttonGroup = findChild<QButtonGroup *>();     // ### workaround for uic in 4.4
    m_ui.easingCurvePicker->setIconSize(m_iconSize);
    m_ui.easingCurvePicker->setMinimumHeight(m_iconSize.height() + 50);
    buttonGroup->setId(m_ui.lineRadio, 0);
    buttonGroup->setId(m_ui.circleRadio, 1);

    QEasingCurve dummy;
    m_ui.periodSpinBox->setValue(dummy.period());
    m_ui.amplitudeSpinBox->setValue(dummy.amplitude());
    m_ui.overshootSpinBox->setValue(dummy.overshoot());

    connect(m_ui.easingCurvePicker, SIGNAL(currentRowChanged(int)), this, SLOT(curveChanged(int)));
    connect(buttonGroup, SIGNAL(buttonClicked(int)), this, SLOT(pathChanged(int)));
    connect(m_ui.periodSpinBox, SIGNAL(valueChanged(double)), this, SLOT(periodChanged(double)));
    connect(m_ui.amplitudeSpinBox, SIGNAL(valueChanged(double)), this, SLOT(amplitudeChanged(double)));
    connect(m_ui.overshootSpinBox, SIGNAL(valueChanged(double)), this, SLOT(overshootChanged(double)));
    createCurveIcons();

    QPixmap pix(QLatin1String(":/images/qt-logo.png"));
    m_item = new PixmapItem(pix);
    m_scene.addItem(m_item);
    m_ui.graphicsView->setScene(&m_scene);

    m_anim = new Animation(m_item, "pos");
    m_anim->setEasingCurve(QEasingCurve::OutBounce);
    m_ui.easingCurvePicker->setCurrentRow(int(QEasingCurve::OutBounce));

    startAnimation();
}
예제 #2
0
SettingsWidget::SettingsWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::SettingsWidget)
{
    ui->setupUi(this);
#ifdef Q_OS_WIN
    this->ui->buttonAssociate->show();
#else
    this->ui->buttonAssociate->hide();
#endif
    this->appsColumnModel = new QStandardItemModel;
    this->backupsColumnModel = new QStandardItemModel;
    this->computerColumnModel = new QStandardItemModel;
    this->phoneColumnModel = new QStandardItemModel;

    this->setLayout(this->ui->gridLayout_7);
    this->ui->pageSettingsGeneral->setLayout(this->ui->layoutGeneralSettings);
    this->ui->pageSettingsFile->setLayout(this->ui->layoutFileSettings);
    this->ui->pageSettingsApp->setLayout(this->ui->layoutSettingsApps);
    this->ui->groupComputer->setLayout(this->ui->gridComputer);
    this->ui->groupPhone->setLayout(this->ui->gridPhone);
    ui->groupBoxBoth->setLayout(ui->gridBoth);
    ui->pageSettingsShell->setLayout(ui->shellGridLayout);
    ui->pageSettingsAnimations->setLayout(ui->layoutAnimationsSettings);
    this->currentIndex=0;

    connect(this->ui->buttonSaveSettings, SIGNAL(clicked()), this, SLOT(saveSettings()));
    connect(this->ui->buttonFontApp, SIGNAL(clicked()), this, SLOT(chooseFontApp()));
    connect(this->ui->buttonFontTables, SIGNAL(clicked()), this, SLOT(chooseFontTables()));
    connect(this->ui->buttonFontShell, SIGNAL(clicked()), this, SLOT(chooseFontShell()));
    connect(this->ui->buttonDefaults, SIGNAL(clicked()), this, SLOT(setSettingsToDefaults()));
    connect(this->ui->radioComputerPath, SIGNAL(toggled(bool)), this, SLOT(settingsSlotChanged()));
    connect(this->ui->radioPhonePath, SIGNAL(toggled(bool)), this, SLOT(settingsSlotChanged()));
    connect(this->ui->checkAppName, SIGNAL(toggled(bool)), this, SLOT(settingsSlotChanged()));
    connect(this, SIGNAL(settingsChanged()), this, SLOT(getSettings()));
    connect(this, SIGNAL(settingsChanged()), this, SLOT(changeFont()));
    connect(this->ui->listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(changePage(int)));
    connect(&this->animation.animation, SIGNAL(finished()), this, SLOT(animationFinished()));
    connect(this->ui->buttonDetectSdExt, SIGNAL(clicked()), this, SLOT(detectSdExtFolder()));

    ui->listWidgetCurvePicker->setIconSize(QSize(64,64));

    createCurveIcons();

    connect(ui->listWidgetCurvePicker, SIGNAL(currentRowChanged(int)), this, SLOT(curveChanged(int)));

    this->getSettings();
    this->changeFont();
}
예제 #3
0
파일: main.cpp 프로젝트: wpbest/copperspice
int main(int argc, char **argv)
{
    QApplication app(argc, argv);
    createCurveIcons();
    return app.exit();
}