Ejemplo n.º 1
0
int MusicPlayer::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: updateTime((*reinterpret_cast< qint64(*)>(_a[1]))); break;
        case 1: playOrpause(); break;
        case 2: openFile(); break;
        case 3: setMod(); break;
        case 4: previousSong(); break;
        case 5: nextSong(); break;
        case 6: whatiLike(); break;
        case 7: showLrc(); break;
        case 8: setPlayer(); break;
        case 9: showPlayList(); break;
        case 10: metaStateChanged((*reinterpret_cast< Phonon::State(*)>(_a[1])),(*reinterpret_cast< Phonon::State(*)>(_a[2]))); break;
        case 11: tableWidgetClicked((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 12: aboutToFinish(); break;
        case 13: clearSources(); break;
        case 14: saveAndQuit(); break;
        case 15: trayIconActivated((*reinterpret_cast< QSystemTrayIcon::ActivationReason(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 16;
    }
    return _id;
}
Ejemplo n.º 2
0
int loadScreen () {
    App.setMouseCursorVisible(false);

    sf::Texture logoImage;
    logoImage.loadFromFile("Graphics/Logo.png");

    sf::Sprite Logo;
    Logo.setTexture(logoImage);

    int screenColour = 1;
    sf::Clock opacityTimer;

    bool increasing = true;

    while (App.isOpen()) {
        while (App.pollEvent(Event)) {
            if (Event.type == Event.Closed) {
                saveAndQuit();
                }

            if (Event.type == Event.KeyPressed){
                return 0;
                }

            if (Event.type == Event.MouseButtonPressed){
                return 0;
                }

            if (Event.type == Event.MouseMoved){
                cursor.setPosition(sf::Mouse::getPosition(App).x, sf::Mouse::getPosition(App).y);
                }
            }

        if (increasing && opacityTimer.getElapsedTime().asSeconds() > 0.01) {
            opacityTimer.restart();
            screenColour += 1;
            } else if (!increasing && opacityTimer.getElapsedTime().asSeconds() > 0.01) {
                opacityTimer.restart();
                screenColour -= 1;
                }


        if (screenColour >= 255) increasing = false;
        if (screenColour <= 0) return 0;

        Logo.setColor(sf::Color(255, 255, 255, screenColour));

        App.clear(sf::Color(screenColour, screenColour, screenColour));
        App.draw(Logo);
        App.draw(cursor);
        App.display();
        Framerate = framerateTimer.restart().asSeconds();
        }
    return 0;
    }
Ejemplo n.º 3
0
Tag_modif::Tag_modif(NM::Note *n, QWidget *parent) :
    note(n),
    QDialog(parent),
    ui(new Ui::Tag_modif)
{
    ui->setupUi(this);
    ui->label_name->setText(n->getTitle());
    create_listTags();

    connect(ui->button_addTag, SIGNAL(pressed()), this, SLOT(create_tag()));
    connect(ui->save_button, SIGNAL(pressed()), this, SLOT(saveAndQuit()));
    connect(ui->save_button, SIGNAL(pressed()), MainWindow::getInstance(), SLOT(createListTags()));
}
Ejemplo n.º 4
0
medSaveModifiedDialog::medSaveModifiedDialog(QWidget *parent) : QDialog(parent), d (new medSaveModifiedDialogPrivate)
{
    QLabel *label = new QLabel(this);
    label->setText(tr("The following datasets have been created. Do you want to save them ?"));

    d->saveQuitButton = new QPushButton(tr("Save and Quit"),this);
    d->cancelButton = new QPushButton(tr("Cancel"),this);
    d->quitButton = new QPushButton(tr("Quit without saving"),this);

    d->treeWidget = new QTreeWidget(this);
    d->treeWidget->setColumnCount(6);
    
    d->quitRequested = false;

    QStringList headers;
    headers << tr("Select") <<tr("Thumbnail") << tr("Name") << tr("Study") << tr("Series") << tr("File");

    d->treeWidget->setHeaderLabels(headers);

    QHBoxLayout *hlayout = new QHBoxLayout;
    hlayout->addWidget(d->saveQuitButton);
    hlayout->addWidget(d->cancelButton);
    hlayout->addWidget(d->quitButton);

    QVBoxLayout *layout = new QVBoxLayout(this);
    layout->addWidget(label);
    layout->addWidget(d->treeWidget);
    layout->addLayout(hlayout);

    //TODO a little bit ugly the way medSaveModifiedDialogCheckListItem are parented no ?
    foreach(medDatabaseNonPersistentItem *item, medDatabaseNonPersistentController::instance()->items())
    {
        if ((item->studyName() != "") && (item->seriesName() != ""))
            new medSaveModifiedDialogCheckListItem(d->treeWidget->invisibleRootItem(), item->index(), item->name(), item->studyName(), item->seriesName(), item->file(), item->thumb());
    }
    
    d->treeWidget->resizeColumnToContents(0);

    connect (d->saveQuitButton, SIGNAL(clicked()), this, SLOT(saveAndQuit()));
    connect (d->cancelButton,SIGNAL(clicked()), this, SLOT(reject()));
    connect (d->quitButton,SIGNAL(clicked()), this, SLOT(accept()));

    connect (medDataManager::instance(), SIGNAL(dataImported(medDataIndex,QUuid)),this, SLOT(updateCounter()));

    setModal(true);
}
Ejemplo n.º 5
0
void GameScreen::gameIsWon()
{
    ball->object->stop();
    paddle->object->stop();
    time->stop();

    gameWonLbl = new QLabel(this);
    gameWonLbl->setPixmap(*gameWonIcon);
    gameWonLbl->setGeometry(50, 60, 401, 351);
    gameWonLbl->show();

    mainMenuBtn = new QPushButton(this);
    mainMenuBtn->setGeometry(75, 370, 75, 23);
    mainMenuBtn->setText("Main Menu");
    mainMenuBtn->show();
    connect(mainMenuBtn, SIGNAL(clicked()), this, SLOT(quitToMenu()));

    saveAndQuitBtn = new QPushButton(this);
    saveAndQuitBtn->setGeometry(165, 370, 81, 23);
    saveAndQuitBtn->setText("Save and Quit");
    saveAndQuitBtn->show();
    connect(saveAndQuitBtn, SIGNAL(clicked()), this, SLOT(saveAndQuit()));

    restartBtn = new QPushButton(this);
    restartBtn->setGeometry(261, 370, 75, 23);
    restartBtn->setText("Replay");
    restartBtn->show();
    connect(restartBtn, SIGNAL(clicked()), this, SLOT(restartLevel()));

    nextLvlBtn = new QPushButton(this);
    nextLvlBtn->setGeometry(355, 370, 75, 23);
    nextLvlBtn->setText("Next Level >");
    nextLvlBtn->show();
    connect(nextLvlBtn, SIGNAL(clicked()), this, SLOT(nextLevel()));

}