示例#1
0
EditPlayerDialog::EditPlayerDialog(int playerNumber,QWidget *parent) :
        QDialog(parent),
        ui(new Ui::EditPlayerDialog)
{
    ui->setupUi(this);
    this->playerNumber = playerNumber;

    PlaylistPlayer *player = PlaylistPlayer::getObjectWithNumber(playerNumber);
    ui->deviceSelectWidget->selectDevice(player->getType(),player->getDeviceID(),player->getChannel());
    setColor(player->getColor());
    setFontColor(player->getFontColor());

    connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(save()));
    connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(closeDialog()));
    connect(ui->selectColorButton, SIGNAL(clicked()), this, SLOT(selectColor()));
    connect(ui->selectFontColorButton, SIGNAL(clicked()), this, SLOT(selectFontColor()));
}
示例#2
0
    //copy-paste
    connect( ui->actionCopy               , SIGNAL(triggered())              , this                   , SLOT(copy())                 );
    connect( ui->actionCut                , SIGNAL(triggered())              , this                   , SLOT(cut())                  );
    connect( ui->actionPaste              , SIGNAL(triggered())              , this                   , SLOT(paste())                );

    //tools
    connect( ui->actionIndent             , SIGNAL(triggered())              , this                   , SLOT(indent())               );
    connect( ui->actionUnindent           , SIGNAL(triggered())              , this                   , SLOT(unindent())             );
    connect( ui->actionUppercase          , SIGNAL(triggered())              , this                   , SLOT(uppercase())            );
    connect( ui->actionLowercase          , SIGNAL(triggered())              , this                   , SLOT(lowercase())            );
    connect( ui->actionCapitalize         , SIGNAL(triggered())              , this                   , SLOT(capitalize())           );

    //settings
    connect( ui->actionSelect_Font        , SIGNAL(triggered())              , this                   , SLOT(selectFont())           );
    connect( ui->actionSelect_Font_Color  , SIGNAL(triggered())              , this                   , SLOT(selectFontColor())      );
    connect( ui->actionZoom_In            , SIGNAL(triggered())              , this                   , SLOT(zoomIn())               );
    connect( ui->actionZoom_Out           , SIGNAL(triggered())              , this                   , SLOT(zoomOut())              );

}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::changeEvent(QEvent *e)
{
    QMainWindow::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange: