Exemplo n.º 1
0
int ToolBar::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QToolBar::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: order(); break;
        case 1: randomize(); break;
        case 2: addSpinBox(); break;
        case 3: removeSpinBox(); break;
        case 4: changeMovable((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 5: allowLeft((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 6: allowRight((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 7: allowTop((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 8: allowBottom((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 9: placeLeft((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 10: placeRight((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 11: placeTop((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 12: placeBottom((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 13: updateMenu(); break;
        case 14: insertToolBarBreak(); break;
        default: ;
        }
        _id -= 15;
    }
    return _id;
}
Exemplo n.º 2
0
 MainWindow::MainWindow()
 {
     //serv = new Server(*this);

     setWindowTitle("Music Player");

     menuFile = menuBar()->addMenu(tr("&File"));
     actionPlay = new QAction(QIcon(":images/play.png"),"Play", this);
     connect(actionPlay, SIGNAL(triggered()), this, SLOT(play()));
     menuFile->addAction(actionPlay);
     actionPause = new QAction(QIcon(":images/pause.png"),"Pause", this);
     connect(actionPause, SIGNAL(triggered()), this, SLOT(pause()));
     menuFile->addAction(actionPause);
     actionStop = new QAction(QIcon(":images/stop.png"),"Stop", this);
     connect(actionStop, SIGNAL(triggered()), this, SLOT(stop()));
     menuFile->addAction(actionStop);

     tbar = addToolBar(tr("Control Bar"));

     buttonPlay = new QToolButton;
     buttonPlay->setIcon(QIcon(":images/play.png"));
     connect(buttonPlay, SIGNAL(clicked()), this, SLOT(play()));
     buttonPause = new QToolButton;
     buttonPause->setIcon(QIcon(":images/pause.png"));
     connect(buttonPause, SIGNAL(clicked()), this, SLOT(pause()));
     buttonStop = new QToolButton;
     buttonStop->setIcon(QIcon(":images/stop.png"));
     connect(buttonStop, SIGNAL(clicked()), this, SLOT(stop()));
     buttonPrevious = new QToolButton;
     buttonPrevious->setIcon(QIcon(":images/prev.png"));
     connect(buttonPrevious, SIGNAL(clicked()), this, SLOT(previous()));
     buttonNext = new QToolButton;
     buttonNext->setIcon(QIcon(":images/next.png"));
     connect(buttonNext, SIGNAL(clicked()), this, SLOT(next()));
     buttonShuffle = new QToolButton;
     buttonShuffle->setIcon(QIcon(":images/shuffle.png"));
     connect(buttonShuffle, SIGNAL(clicked()), this, SLOT(shuffle()));
     buttonShuffleOff = new QToolButton;
     buttonShuffleOff->setIcon(QIcon(":images/shuffleoff.png"));
     connect(buttonShuffleOff, SIGNAL(clicked()), this, SLOT(shuffleOff()));
     buttonClearPl = new QToolButton;
     buttonClearPl->setIcon(QIcon(":images/clearpl.png"));
     connect(buttonClearPl, SIGNAL(clicked()), this, SLOT(clearPl()));
     QToolButton *addDir = new QToolButton;
     addDir->setIcon(QIcon(":images/addfolder.png"));
     connect(addDir, SIGNAL(clicked()), this, SLOT(addDir()));
     QToolButton *addFile = new QToolButton;
     addFile->setIcon(QIcon(":images/addfiles.png"));
     connect(addFile, SIGNAL(clicked()), this, SLOT(addFile()));
     QToolButton *runServer = new QToolButton;
     runServer->setIcon(QIcon(":images/server.png"));
     connect(runServer, SIGNAL(clicked()), this, SLOT(runServer()));

     progressSlider = new QSlider(Qt::Horizontal, this);
     volumeSlider = new QSlider(Qt::Horizontal, this);
     volumeLabel = new QLabel(this);
     durationLabel = new QLabel(this);
     nowPlayingLabel = new QLabel(this);
     volumeLabel->setText("Volume");
     tbar->addWidget(buttonPlay);
     tbar->addSeparator();
     tbar->addWidget(buttonPause);
     tbar->addSeparator();
     tbar->addWidget(buttonStop);
     tbar->addSeparator();
     tbar->addWidget(buttonPrevious);
     tbar->addSeparator();
     tbar->addWidget(buttonNext);
     tbar->addSeparator();
     tbar->addWidget(buttonShuffle);
     tbar->addSeparator();
     tbar->addWidget(buttonShuffleOff);
     tbar->addSeparator();
     tbar->addWidget(buttonClearPl);
     tbar->addSeparator();
     tbar->addWidget(addFile);
     tbar->addSeparator();
     tbar->addWidget(addDir);
     tbar->addSeparator();
     tbar->addWidget(runServer);
     tbar->addSeparator();
     tbar->addWidget(volumeLabel);
     tbar->addWidget(volumeSlider);
     tbar->addSeparator();
     barProgress = addToolBar(tr("Progress Bar"));
     barProgress->addWidget(progressSlider);
     barProgress->addSeparator();
     barProgress->addWidget(durationLabel);
     insertToolBarBreak(barProgress);
     statusBar()->addWidget(nowPlayingLabel);
     player = new QMediaPlayer;
     playlist = new QMediaPlaylist(player);
     playlist->setCurrentIndex(0);
     playlist->setPlaybackMode(QMediaPlaylist::Loop);
     tableWidget = new QListWidget(this);
     setCentralWidget(tableWidget);
     player->setPlaylist(playlist);
     player->setVolume(100);
     volumeSlider->setTickPosition(QSlider::TicksRight);
     volumeSlider->setValue(100);
     connect(volumeSlider, SIGNAL(valueChanged(int)), player, SLOT(setVolume(int)));
     connect(player,SIGNAL(positionChanged(qint64)), this, SLOT(positionChanged(qint64)));
     connect(player,SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), this, SLOT(setDuration()));
     connect(player,SIGNAL(positionChanged(qint64)), this, SLOT(setDuration()));
     connect(progressSlider,SIGNAL(sliderMoved(int)), this, SLOT(setPosition(int)));
     connect(playlist, SIGNAL(currentMediaChanged(QMediaContent)), this, SLOT(checkAv()));
     connect(tableWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(objectClicked(QListWidgetItem*)));
     checkPlItems();

 }
IqHelpViewerMainWindow::IqHelpViewerMainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::IqHelpViewerMainWindow),
    m_urlLineEdit(new QLineEdit(this)),
    m_findStringLineEdit(new QLineEdit(this)),
    m_findLabel(new QLabel(this)),
    m_scaleLabel(new QLabel(this)),
    m_scaleComboBox(new QComboBox(this)),
    m_latLocaleButton(new QRadioButton(this)),
    m_rusLocaleButton(new QRadioButton(this)),
    m_currentView(NULL),
    m_mainWidget(new QWidget()),
    m_currentHistoryIndex(0),
    m_backOrForward(false)
{   
    ui->setupUi(this);

    QHBoxLayout *layout = new QHBoxLayout();
    m_mainWidget->setLayout(layout);
    setCentralWidget(m_mainWidget);

    connect(ui->actionHome, &QAction::triggered, this, &IqHelpViewerMainWindow::showHomePage);
    ui->navigationToolBar->addAction(ui->actionHome);

    connect(ui->actionBack, &QAction::triggered, this, &IqHelpViewerMainWindow::back);
    ui->navigationToolBar->addAction(ui->actionBack);

    connect(ui->actionForward, &QAction::triggered, this, &IqHelpViewerMainWindow::forward);
    ui->navigationToolBar->addAction(ui->actionForward);

    ui->navigationToolBar->addAction(ui->actionRefresh);

    m_urlLineEdit->setReadOnly(true);
    ui->navigationToolBar->addWidget(m_urlLineEdit);

    m_scaleLabel->setText(tr("Scale: "));
    ui->toolsToolBar->addWidget(m_scaleLabel);

    QSettings settings;
    if (!settings.contains("scaleFactors"))
    {
        QStringList scaleFactors;
        scaleFactors << "200" << "150" << "125" << "100" << "75" << "50" << "25";
        settings.setValue("scaleFactors", scaleFactors);
    }
    m_scaleComboBox->setEditable(true);
    m_scaleComboBox->setMinimumWidth(50);
    QStringList scaleFactors = settings.value("scaleFactors").toStringList();
    m_scaleComboBox->addItems(scaleFactors);
    m_scaleComboBox->setEditText("100");
    connect(m_scaleComboBox, &QComboBox::editTextChanged, this, &IqHelpViewerMainWindow::setZoomFactor);
    ui->toolsToolBar->addWidget(m_scaleComboBox);

    connect(ui->actionZoomIn, &QAction::triggered, this, &IqHelpViewerMainWindow::zoomIn);
    ui->toolsToolBar->addAction(ui->actionZoomOut);

    connect(ui->actionZoomOut, &QAction::triggered, this, &IqHelpViewerMainWindow::zoomOut);
    ui->toolsToolBar->addAction(ui->actionZoomIn);

    ui->toolsToolBar->addSeparator();
    m_findLabel->setText(tr("Find: "));
    ui->toolsToolBar->addWidget(m_findLabel);
    m_findStringLineEdit->setMaximumWidth(150);

    connect(m_findStringLineEdit, &QLineEdit::textChanged, this, &IqHelpViewerMainWindow::rusificateFindString);
    connect(m_findStringLineEdit, &QLineEdit::textChanged, this, &IqHelpViewerMainWindow::findText);
    connect(m_findStringLineEdit, &QLineEdit::returnPressed, this, &IqHelpViewerMainWindow::findText);
    ui->toolsToolBar->addWidget(m_findStringLineEdit);

    connect(ui->actionFindNext, &QAction::triggered, this, &IqHelpViewerMainWindow::findText);
    ui->toolsToolBar->addAction(ui->actionFindNext);
    
    m_latLocaleButton->setText(tr("lat"));
    m_latLocaleButton->setChecked(true);
    connect(m_latLocaleButton, &QAbstractButton::clicked, this, &IqHelpViewerMainWindow::rusificateFindString);
    ui->toolsToolBar->addWidget(m_latLocaleButton);

    m_rusLocaleButton->setText(tr("rus"));
    connect(m_rusLocaleButton, &QAbstractButton::clicked, this, &IqHelpViewerMainWindow::rusificateFindString);
    ui->toolsToolBar->addWidget(m_rusLocaleButton);

    insertToolBarBreak(ui->toolsToolBar);

    connect(ui->actionAboutQt, &QAction::triggered, this, &IqHelpViewerMainWindow::showAboutQt);
    ui->helpToolBar->addAction(ui->actionAboutQt);

    connect(ui->actionAbout, &QAction::triggered, this, &IqHelpViewerMainWindow::showAbout);
    ui->helpToolBar->addAction(ui->actionAbout);
		
		ui->helpToolBar->hide();

    //WEB view
    IqWebHelpView *webView = new IqWebHelpView(this);
    m_mainWidget->layout()->addWidget(webView->widget());
    m_helpViewWidgets << webView;

    checkBackForwardEnabled();

    //Content view
    connect(ui->contentTreeWidget, &IqContentWidget::linkClicked, this, &IqHelpViewerMainWindow::showPage);
    ui->contentTreeWidget->header()->hide();
    if (!settings.contains("contentUrl")) {
        settings.setValue("contentUrl", "http://localhost/content.xml");
    }
    ui->contentTreeWidget->loadContent(settings.value("contentUrl").toString());

    showHomePage();
}
Exemplo n.º 4
0
PlaylistTab::PlaylistTab(QWidget *parent)
    : QMainWindow(parent)
{
    _playlistWidget = new PlaylistDisplayWidget(this);
    _playlistWidget->playMode();
    setCentralWidget(_playlistWidget);

    _toolbarTop = new QToolBar(this);
    _toolbarTop->setMovable(false);
    _toolbarTop->setFloatable(false);
    _toolbarTop->setIconSize(QSize(16, 16));
    _toolbarTop->setMinimumHeight(24);
    _toolbarTop->setMaximumHeight(24);
    addToolBar(Qt::TopToolBarArea, _toolbarTop);

    _toolbarBottomSearch = new QToolBar(this);
    _toolbarBottomSearch->setMovable(false);
    _toolbarBottomSearch->setFloatable(false);
    _toolbarBottomSearch->setProperty("topBorder", true);
    _toolbarBottomSearch->setMinimumHeight(24);
    _toolbarBottomSearch->setMaximumHeight(24);
    addToolBar(Qt::BottomToolBarArea, _toolbarBottomSearch);
    insertToolBarBreak(_toolbarBottomSearch);

    _toolbarBottomType = new QToolBar(this);
    _toolbarBottomType->setMovable(false);
    _toolbarBottomType->setFloatable(false);
    _toolbarBottomType->setProperty("topBorder", true);
    _toolbarBottomType->setMinimumHeight(24);
    _toolbarBottomType->setMaximumHeight(24);
    addToolBar(Qt::BottomToolBarArea, _toolbarBottomType);
    insertToolBarBreak(_toolbarBottomType);

    _labelPlaylist = new QLabel(this);
    _labelPlaylist->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    _labelPlaylist->setAlignment(Qt::AlignCenter);
    _toolbarTop->addWidget(_labelPlaylist);

    _selectType = new QComboBox(this);
    _selectType->addItem(tr("All"));
    _selectType->addItem(tr("TV"));
    _selectType->addItems(Channel::types());
    _selectType->setProperty("inverse", true);
    _toolbarTop->addWidget(_selectType);

    _selectCategory = new QComboBox(this);
    _selectCategory->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    _selectLanguage = new QComboBox(this);
    _selectLanguage->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    _selectLanguage->setProperty("hideborder", true);
    _toolbarBottomType->addWidget(_selectCategory);
    _toolbarBottomType->addWidget(_selectLanguage);

    _search = new FancyLineEdit(this);
    _search->setButtonPixmap(FancyLineEdit::Left, QIcon::fromTheme("edit-find").pixmap(16));
    _search->setButtonPixmap(FancyLineEdit::Right, QIcon::fromTheme("edit-clear").pixmap(16));
    _search->setButtonVisible(FancyLineEdit::Left, true);
    _search->setButtonVisible(FancyLineEdit::Right, true);
    _search->setAutoHideButton(FancyLineEdit::Right, true);
    _toolbarBottomSearch->addWidget(_search);

    connect(_selectType, SIGNAL(currentIndexChanged(QString)), this, SLOT(processFilters()));
    connect(_selectCategory, SIGNAL(currentIndexChanged(QString)), this, SLOT(processFilters()));
    connect(_selectLanguage, SIGNAL(currentIndexChanged(QString)), this, SLOT(processFilters()));
    connect(_search, SIGNAL(textChanged(QString)), this, SLOT(processFilters()));
    connect(_search, SIGNAL(rightButtonClicked()), _search, SLOT(clear()));
}