Example #1
0
Fenetre::Fenetre()
    :QWidget()
{
    this->setFixedSize(450, 250);
    QLabel* fond = new QLabel(this);
    fond->resize(500, 500);
    fond->move(0, -30);
    fond->setPixmap(QPixmap("fond.png"));
    Table * m_case;
    m_case = new Table(this);
    m_case -> move(30, 70);

    Bouton *p_bouton;
    p_bouton = new Bouton("<", this);
    p_bouton->setGeometry(30, 40, 30, 20);

    Bouton *n_bouton;
    n_bouton = new Bouton(">", this);
    n_bouton->setGeometry(205, 40, 30, 20);

    Bouton *about;
    about = new Bouton("About Us", this);
    about->setGeometry(315, 40, 60, 20);

    Clock *clock;
    clock = new Clock(150, this);
    clock->move(270, 75);

    QObject::connect(p_bouton, SIGNAL(clicked()), m_case, SLOT(moisPrecedent()));
    QObject::connect(n_bouton, SIGNAL(clicked()), m_case, SLOT(moisSuivant()));

    QObject::connect(about, SIGNAL(clicked()), m_case, SLOT(aboutUs()));
}
Example #2
0
void KylinMenu::initConnect()
{
    connect(help_action, SIGNAL(triggered()), this, SLOT(forumHelp()));
//    connect(features_action, SIGNAL(triggered()), p_mainwindow, SLOT(newFeatures()));
    connect(feedback_action, SIGNAL(triggered()), this, SLOT(questionFeedback()));
//    connect(setting_action, SIGNAL(triggered()), p_mainwindow, SLOT(setupConfigure()));
    connect(about_action, SIGNAL(triggered()), p_mainwindow, SLOT(aboutUs()));
}
Example #3
0
void KobeMenu::initConnect()
{
    connect(help_action, SIGNAL(clicked()), this, SLOT(forumHelp()));
    connect(help_action, SIGNAL(clicked()), p_mainwindow, SLOT(newFeatures()));
    connect(help_action, SIGNAL(clicked()), p_mainwindow, SLOT(questionFeedback()));
    connect(help_action, SIGNAL(clicked()), p_mainwindow, SLOT(setupConfigure()));
    connect(help_action, SIGNAL(clicked()), p_mainwindow, SLOT(aboutUs()));
}
Example #4
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    setWindowFlags(Qt::FramelessWindowHint);
    setAttribute(Qt::WA_TranslucentBackground);

    ui->horizontalSlider->setRange(0, 0);
    ui->tableWidget->hide();
    ui->tableWidget->hideColumn(2);
    volume=80;

    createContextMenu();
    createSystemTrayIcon();

    playList=new QMediaPlaylist;
    playList->setPlaybackMode(QMediaPlaylist::Loop);
    player=new QMediaPlayer;
    player->setPlaylist(playList);
    player->setVolume(volume);

    connect(ui->horizontalSlider, SIGNAL(sliderMoved(int)), this, SLOT(setPosition(int)));
    connect(ui->tableWidget, SIGNAL(cellClicked(int,int)), this, SLOT(playTo(int, int)));

    connect(player, SIGNAL(positionChanged(qint64)), this, SLOT(positionChanged(qint64)));
    connect(player, SIGNAL(durationChanged(qint64)), this, SLOT(durationChanged(qint64)));
    connect(playList, SIGNAL(currentIndexChanged(int)), this, SLOT(updateSongList(int)));

    connect(ui->action_SongList, SIGNAL(triggered()), this, SLOT(showOrHideSongList()));
    connect(ui->action_Import, SIGNAL(triggered()), this, SLOT(importSongs()));
    connect(ui->action_Last, SIGNAL(triggered()), this, SLOT(playLast()));
    connect(ui->action_Play, SIGNAL(triggered()), this, SLOT(playOrPause()));
    connect(ui->action_Stop, SIGNAL(triggered()), player, SLOT(stop()));
    connect(ui->action_Next, SIGNAL(triggered()), this, SLOT(playNext()));
    connect(ui->action_SoundPlus, SIGNAL(triggered()), this, SLOT(plusSound()));
    connect(ui->action_SoundReduce, SIGNAL(triggered()), this, SLOT(reduceSound()));
    connect(ui->action_Mode1, SIGNAL(triggered()), this, SLOT(setPlaybackMode1()));
    connect(ui->action_Mode2, SIGNAL(triggered()), this, SLOT(setPlaybackMode2()));
    connect(ui->action_Mode3, SIGNAL(triggered()), this, SLOT(setPlaybackMode3()));
    connect(ui->action_Mode4, SIGNAL(triggered()), this, SLOT(setPlaybackMode4()));
    connect(ui->action_Support, SIGNAL(triggered()), this, SLOT(support()));
    connect(ui->action_About, SIGNAL(triggered()), this, SLOT(aboutUs()));
    connect(ui->action_Quit, SIGNAL(triggered()), this, SLOT(close()));

    connect(ui->toolButton_Last, SIGNAL(clicked()), this, SLOT(playLast()));
    connect(ui->toolButton_Play, SIGNAL(clicked()), this, SLOT(playOrPause()));
    connect(ui->toolButton_Stop, SIGNAL(clicked()), player, SLOT(stop()));
    connect(ui->toolButton_Next, SIGNAL(clicked()), this, SLOT(playNext()));
}
Example #5
0
widget::widget(QWidget *parent) :
    QWidget(parent,Qt::FramelessWindowHint),
    ui(new Ui::widget)
{
    ui->setupUi(this);
    setFixedSize(506,364);
    isSound = true;
    ui->hSlider_SongProgress->setRange(0,0);
 //   mList = new musicList(this);
//    mList->setFixedSize(300,320);
  //  mList->ui->tableWidget->setColumnWidth(0,300);
 //   mList->ui->tableWidget->setColumnWidth(1,150);
    ui->tableWidget->setAcceptDrops(true);
    ui->tableWidget->setColumnWidth(0,30);
    ui->tableWidget->setColumnWidth(1,150);


 //   connect(mList->ui->tableWidget,SIGNAL(cellDoubleClicked(int,int)),SLOT(tableWidget_cellDoubleClicked(int,int)));
    connect(ui->tableWidget,SIGNAL(cellDoubleClicked(int,int)),SLOT(tableWidget_cellDoubleClicked(int,int)));
    //  mList->show();
 //   connect(mList,SIGNAL(listClose()),ui->toolButton_List,SLOT(toggle()));
//  connect(ui->toolButton_open,SIGNAL(triggered),this,SLOT(on_toolButton_open_clicked()));
//  connect(ui->toolButton_Sound, SIGNAL(triggered),this,SLOT(on_toolButton_List_clicked()));

    text = new QTextEdit(this);
    text->hide();//用于查找下句歌词以计算时间间隔
    ui->textEdit->setVisible(false);//文本编辑框不可见,(解析歌词)
    this->setAcceptDrops(true);
//    this->setFixedSize(300,150);

    readSettings();//读取上次关闭窗口时窗口的位置

    QPalette palette = ui->label_lrc->palette();//设置窗体内歌词颜色
    palette.setColor(QPalette::WindowText,Qt::darkBlue);
    ui->label_lrc->setPalette(palette);
    lrc = new lrcWindow(0);//桌面歌词

    createPlayMode();
    createOpenFileMenu();
    createContextMenu();
    createSystemTrayIcon();

    volume = 50;

    playList=new QMediaPlaylist;
    playList->setPlaybackMode(QMediaPlaylist::Loop);
    player=new QMediaPlayer;
    player->setPlaylist(playList);
    player->setVolume(volume);



    ui->hSlider_Volume->setValue(volume);
    connect(ui->hSlider_SongProgress, SIGNAL(sliderMoved(int)), this, SLOT(setPosition(int)));
    connect(ui->hSlider_Volume, SIGNAL(sliderMoved(int)), this, SLOT(setSound(int)));

    connect(ui->action_SingleLoopMode, SIGNAL(triggered()), this, SLOT(setSingleLoopMode()));
    connect(ui->action_SequentialMode, SIGNAL(triggered()), this, SLOT(setSequentialMode()));
    connect(ui->action_LoopMode, SIGNAL(triggered()), this, SLOT(setLoopMode()));
    connect(ui->action_RandomMode, SIGNAL(triggered()), this, SLOT(setRandomMode()));
    connect(ui->action_About, SIGNAL(triggered()), this, SLOT(aboutUs()));
    connect(ui->action_Quit, SIGNAL(triggered()), this, SLOT(close()));
    connect(ui->action_AddFiles,SIGNAL(triggered()), this, SLOT(setAddFiles()));
    connect(ui->action_AddFileFolder, SIGNAL(triggered()), this, SLOT(setAddFileFolder()));

    connect(ui->toolButton_close,SIGNAL(clicked()),this, SLOT(close()));
    connect(ui->toolButton_min,SIGNAL(clicked()),this,SLOT(showMinimized()));

    connect(player, SIGNAL(positionChanged(qint64)), this, SLOT(positionChanged(qint64)));
    connect(player, SIGNAL(durationChanged(qint64)), this, SLOT(durationChanged(qint64)));
    connect(playList, SIGNAL(currentIndexChanged(int)), this, SLOT(updateSongList(int)));
// connect(player,SIGNAL(tick(qint64)),this,SLOT(showTime(qint64)));//时间显示与歌词的更新

    timer = new QTimer(this);//定时器,若0.1秒不显示歌词,则显示“Music ...”
    timer->start(100);
    lrcID = startTimer(100);
    connect(timer,SIGNAL(timeout()),SLOT(Timeout()));

//    iconpause = new QIcon(":/images/btn_plause0.png");
//    iconplay = new QIcon(":/images/btn_play0.png");

//    ui->toolButton_playpause->setIcon(*iconplay);
    ui->toolButton_playpause->setToolTip(tr("播放"));

    ui->toolButton_playpause->setStyleSheet("QToolButton{border-image:url(:/images/btn_play0.png);}"
                                            "QToolButton:hover{border-image:url(:/images/btn_play1.png);}");
    ui->toolButton_stop->setStyleSheet("QToolButton{border-image:url(:/images/btn_stop0.png);}"
                                       "QToolButton:hover{border-image:url(:/images/btn_stop1.png);}");
    ui->toolButton_previous->setStyleSheet("QToolButton{border-image:url(:/images/btn_pre0.png);}"
                                           "QToolButton:hover{border-image:url(:/images/btn_pre1.png);}");
    ui->toolButton_next->setStyleSheet("QToolButton{border-image:url(:/images/btn_next0.png);}"
                                       "QToolButton:hover{border-image:url(:/images/btn_next1.png);}");
    ui->toolButton_open->setStyleSheet("QToolButton{border-image:url(:/images/btn_openFile0.png);}"
                                       "QToolButton:hover{border-image:url(:/images/btn_openFile1.png);}");
    ui->toolButton_Sound->setStyleSheet("QToolButton{border-image:url(:/images/btn_sound0.png);}"
                                       "QToolButton:hover{border-image:url(:/images/btn_sound1.png);}");
    ui->toolButton_playMode->setStyleSheet("QToolButton{border-image:url(:/images/seqtional.PNG);}"
                                           "QToolButton:hover{border-image:url(:/images/seqtional1.png);}");
    ui->toolButton_close->setStyleSheet("QToolButton:hover{border-image:url(:/images/close.png);}");
    ui->toolButton_min->setStyleSheet("QToolButton:hover{border-image:url(:/images/min.png);}");
    ui->toolButton_mintray->setStyleSheet("QToolButton:hover{border-image:url(:/images/mintray.png);}");
    ui->toolButton_toolstyle->setStyleSheet("QToolButton:hover{border-image:url(:/images/toolstyle.png);}");
    ui->toolButton_main->setStyleSheet("QToolButton:hover{border-image:url(:/images/main.png);}");
    ui->toolButton_showfront->setStyleSheet("QToolButton:hover{border-image:url(:/images/showfront.png);}");
    ui->toolButton_p->setStyleSheet("QToolButton:hover{border-image:url(:/images/putup.png);}");
    ui->toolButton_s->setStyleSheet("QToolButton:hover{border-image:url(:/images/spin.png);}");

    ui->toolButton_lrcD->setStyleSheet("QToolButton:hover{background:rgb(0,255,255,100)}");
    ui->label_Title->setStyleSheet("QLabel:hover{color: rgb(85, 255, 255);}");
    QPalette p = this->palette();
    p.setColor(QPalette::WindowText,QColor(0,255,255));
    ui->label_palyname->setPalette(p);
    p.setColor(QPalette::WindowText,QColor(255,190,0));
    ui->label_lrc->setPalette(p);

  //  mList->installEventFilter(this);
  //  mList->ui->tableWidget->installEventFilter(this);//事件过滤器
    ui->tableWidget->installEventFilter(this);
//    connect(audioOutput,SIGNAL(mutedChanged(bool)),sound,SLOT(setChecked(bool)));
    connect(this,SIGNAL(mySignal()),this,SLOT(close()),Qt::QueuedConnection);

    init(playList);
//    mList->show();
 //   addToPlayList();
}
int ClientInterface::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: sendMessage(); break;
        case 1: chat((*reinterpret_cast< CLID(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2])),(*reinterpret_cast< QString(*)>(_a[3])),(*reinterpret_cast< ENUM_TYPE(*)>(_a[4]))); break;
        case 2: changeServerInformations((*reinterpret_cast< ServerInformations(*)>(_a[1]))); break;
        case 3: changeClientID((*reinterpret_cast< CLID(*)>(_a[1]))); break;
        case 4: changeClientNickname((*reinterpret_cast< CLID(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 5: showError((*reinterpret_cast< ENUM_TYPE(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 6: changeGameMaster((*reinterpret_cast< CLID(*)>(_a[1]))); break;
        case 7: clientVoted((*reinterpret_cast< CLID(*)>(_a[1])),(*reinterpret_cast< CLID(*)>(_a[2]))); break;
        case 8: connectionEtablished(); break;
        case 9: connectionLost(); break;
        case 10: diceRolled((*reinterpret_cast< CLID(*)>(_a[1])),(*reinterpret_cast< quint16(*)>(_a[2])),(*reinterpret_cast< quint16(*)>(_a[3]))); break;
        case 11: sanctionned((*reinterpret_cast< CLID(*)>(_a[1])),(*reinterpret_cast< ENUM_TYPE(*)>(_a[2])),(*reinterpret_cast< QString(*)>(_a[3]))); break;
        case 12: rollDice(); break;
        case 13: rollSpecialDice(); break;
        case 14: serverName((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 15: motdChanged((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 16: gameLaunched(); break;
        case 17: setTitle(); break;
        case 18: playSound((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 19: updatePlayerList(); break;
        case 20: clientJoined((*reinterpret_cast< CLID(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 21: clientLeft((*reinterpret_cast< CLID(*)>(_a[1]))); break;
        case 22: updateGMLabel(); break;
        case 23: updateGMPanel(); break;
        case 24: { bool _r = addLanguage();
            if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; }  break;
        case 25: { bool _r = addLanguage((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2])));
            if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; }  break;
        case 26: languageListMenu((*reinterpret_cast< const QPoint(*)>(_a[1]))); break;
        case 27: { bool _r = removeLanguage((*reinterpret_cast< const QString(*)>(_a[1])));
            if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; }  break;
        case 28: removeLanguageMenu(); break;
        case 29: importLanguageList(); break;
        case 30: sendLanguageList(); break;
        case 31: { CLID _r = CLIDFromString((*reinterpret_cast< const QString(*)>(_a[1])));
            if (_a[0]) *reinterpret_cast< CLID*>(_a[0]) = _r; }  break;
        case 32: switchConnectionState(); break;
        case 33: openSettings(); break;
        case 34: openSoundsGUI(); break;
        case 35: aboutUs(); break;
        case 36: aboutServer(); break;
        case 37: openMapEditor(); break;
        case 38: clearMapEditor(); break;
        case 39: mapFlare(); break;
        case 40: resetData(); break;
        case 41: setCSS((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 42: setCSS(); break;
        case 43: setInterface((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 44: setInterface(); break;
        case 45: playerListMenu((*reinterpret_cast< const QPoint(*)>(_a[1]))); break;
        case 46: actionKick(); break;
        case 47: actionBan(); break;
        case 48: actionVoteGM(); break;
        case 49: actionChangeGM(); break;
        case 50: refresh(); break;
        case 51: textChanged(); break;
        case 52: narrationChanged((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 53: syncSoundLibs((*reinterpret_cast< QList<SoundLibInformations>(*)>(_a[1]))); break;
        case 54: syncLanguagesList((*reinterpret_cast< QList<QPair<QString,QString> >(*)>(_a[1]))); break;
        case 55: syncDictionariesList((*reinterpret_cast< QStringList(*)>(_a[1]))); break;
        case 56: requestScriptDownload((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 57: sendScriptToServer((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 58: deleteScript((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 59: renameScript((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 60: makeEntity((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 61: deleteEntity((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 62: injectCode((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 63: scriptToGMMsg((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 64: scriptToOwnerMsg((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 65: scriptActionMsg((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 66: scriptToPlayerMsg((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 67: scriptMsg((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 68: scriptError((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 69: sendMapToServer((*reinterpret_cast< const MapInformations*const(*)>(_a[1])),(*reinterpret_cast< const QMap<QString,RSID>(*)>(_a[2]))); break;
        case 70: addDictionnary(); break;
        case 71: saveGame(); break;
        case 72: loadGame(); break;
        case 73: VOIPRemoveClient(); break;
        case 74: VOIPAddClient(); break;
        case 75: VOIPClientVolume(); break;
        case 76: dataPerSecond((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        default: ;
        }
        _id -= 77;
    }
    return _id;
}