Пример #1
0
NavigatorView::NavigatorView(QObject* parent) :
        AbstractView(parent),
        m_blockSelectionChangedSignal(false),
        m_widget(new NavigatorWidget(this)),
        m_treeModel(new NavigatorTreeModel(this))
{
    Internal::NavigatorContext *navigatorContext = new Internal::NavigatorContext(m_widget.data());
    Core::ICore::addContextObject(navigatorContext);

    m_widget->setTreeModel(m_treeModel.data());

    connect(treeWidget()->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(changeSelection(QItemSelection,QItemSelection)));

    connect(m_widget.data(), SIGNAL(leftButtonClicked()), this, SLOT(leftButtonClicked()));
    connect(m_widget.data(), SIGNAL(rightButtonClicked()), this, SLOT(rightButtonClicked()));
    connect(m_widget.data(), SIGNAL(downButtonClicked()), this, SLOT(downButtonClicked()));
    connect(m_widget.data(), SIGNAL(upButtonClicked()), this, SLOT(upButtonClicked()));

    treeWidget()->setIndentation(treeWidget()->indentation() * 0.5);

    NameItemDelegate *idDelegate = new NameItemDelegate(this,
                                                        m_treeModel.data());
    IconCheckboxItemDelegate *showDelegate =
            new IconCheckboxItemDelegate(this,
                                         Utils::ThemeHelper::themedIconPixmap(QLatin1String(":/navigator/icon/eye_open.png")),
                                         Utils::ThemeHelper::themedIconPixmap(QLatin1String(":/navigator/icon/eye_closed.png")),
                                         m_treeModel.data());

    IconCheckboxItemDelegate *exportDelegate =
            new IconCheckboxItemDelegate(this,
                                         Utils::ThemeHelper::themedIconPixmap(QLatin1String(":/navigator/icon/export_checked.png")),
                                         Utils::ThemeHelper::themedIconPixmap(QLatin1String(":/navigator/icon/export_unchecked.png")),
                                         m_treeModel.data());

#ifdef _LOCK_ITEMS_
    IconCheckboxItemDelegate *lockDelegate = new IconCheckboxItemDelegate(this,":/qmldesigner/images/lock.png",
                                                          ":/qmldesigner/images/hole.png",m_treeModel.data());
#endif


    treeWidget()->setItemDelegateForColumn(0,idDelegate);
#ifdef _LOCK_ITEMS_
    treeWidget()->setItemDelegateForColumn(1,lockDelegate);
    treeWidget()->setItemDelegateForColumn(2,showDelegate);
#else
    treeWidget()->setItemDelegateForColumn(1,exportDelegate);
    treeWidget()->setItemDelegateForColumn(2,showDelegate);
#endif

}
Пример #2
0
NavigatorView::NavigatorView(QObject* parent) :
        AbstractView(parent),
        m_blockSelectionChangedSignal(false),
        m_widget(new NavigatorWidget(this)),
        m_treeModel(new NavigatorTreeModel(this))
{
    Internal::NavigatorContext *navigatorContext = new Internal::NavigatorContext(m_widget.data());
    Core::ICore::addContextObject(navigatorContext);

    m_widget->setTreeModel(m_treeModel.data());

    connect(treeWidget()->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(changeSelection(QItemSelection,QItemSelection)));

    connect(m_widget.data(), SIGNAL(leftButtonClicked()), this, SLOT(leftButtonClicked()));
    connect(m_widget.data(), SIGNAL(rightButtonClicked()), this, SLOT(rightButtonClicked()));
    connect(m_widget.data(), SIGNAL(downButtonClicked()), this, SLOT(downButtonClicked()));
    connect(m_widget.data(), SIGNAL(upButtonClicked()), this, SLOT(upButtonClicked()));

    treeWidget()->setIndentation(treeWidget()->indentation() * 0.5);

    NameItemDelegate *idDelegate = new NameItemDelegate(this,
                                                        m_treeModel.data());
    IconCheckboxItemDelegate *showDelegate =
            new IconCheckboxItemDelegate(this,
                                         Utils::Icons::EYE_OPEN_TOOLBAR.pixmap(),
                                         Utils::Icons::EYE_CLOSED_TOOLBAR.pixmap(),
                                         m_treeModel.data());

    IconCheckboxItemDelegate *exportDelegate =
            new IconCheckboxItemDelegate(this,
                                         Icons::EXPORT_CHECKED.pixmap(),
                                         Icons::EXPORT_UNCHECKED.pixmap(),
                                         m_treeModel.data());

#ifdef _LOCK_ITEMS_
    IconCheckboxItemDelegate *lockDelegate = new IconCheckboxItemDelegate(this,":/qmldesigner/images/lock.png",
                                                          ":/qmldesigner/images/hole.png",m_treeModel.data());
#endif


    treeWidget()->setItemDelegateForColumn(0,idDelegate);
#ifdef _LOCK_ITEMS_
    treeWidget()->setItemDelegateForColumn(1,lockDelegate);
    treeWidget()->setItemDelegateForColumn(2,showDelegate);
#else
    treeWidget()->setItemDelegateForColumn(1,exportDelegate);
    treeWidget()->setItemDelegateForColumn(2,showDelegate);
#endif

}
Пример #3
0
bool QIconView::qt_emit( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: selectionChanged(); break;
    case 1: selectionChanged((QIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 2: currentChanged((QIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 3: clicked((QIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 4: clicked((QIconViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2))); break;
    case 5: pressed((QIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 6: pressed((QIconViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2))); break;
    case 7: doubleClicked((QIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 8: returnPressed((QIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 9: rightButtonClicked((QIconViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2))); break;
    case 10: rightButtonPressed((QIconViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2))); break;
    case 11: mouseButtonPressed((int)static_QUType_int.get(_o+1),(QIconViewItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3))); break;
    case 12: mouseButtonClicked((int)static_QUType_int.get(_o+1),(QIconViewItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3))); break;
    case 13: contextMenuRequested((QIconViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2))); break;
    case 14: dropped((QDropEvent*)static_QUType_ptr.get(_o+1),(const QValueList<QIconDragItem>&)*((const QValueList<QIconDragItem>*)static_QUType_ptr.get(_o+2))); break;
    case 15: moved(); break;
    case 16: onItem((QIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 17: onViewport(); break;
    case 18: itemRenamed((QIconViewItem*)static_QUType_ptr.get(_o+1),(const QString&)static_QUType_QString.get(_o+2)); break;
    case 19: itemRenamed((QIconViewItem*)static_QUType_ptr.get(_o+1)); break;
    default:
	return QScrollView::qt_emit(_id,_o);
    }
    return TRUE;
}
Пример #4
0
KstCurveDifferentiateI::KstCurveDifferentiateI(QWidget* parent,
                                           const char* name,
                                           bool modal,
                                           WFlags fl)
: KstCurveDifferentiate(parent, name, modal, fl) {

  availableListBox->clear();
  selectedListBox->clear();
  availableListBox->insertItem(i18n("Line Color"));  
  availableListBox->insertItem(i18n("Point Style"));  
  availableListBox->insertItem(i18n("Line Style"));
  availableListBox->insertItem(i18n("Line Width"));
  
  connect(Cancel_2, SIGNAL(clicked()), this, SLOT(close()));
  connect(OK_2, SIGNAL(clicked()), this, SLOT(apply()));
  
  // more connections to emulate kactionselector behaviour
  connect(leftButton, SIGNAL(clicked()), this, SLOT(leftButtonClicked()));
  connect(rightButton, SIGNAL(clicked()), this, SLOT(rightButtonClicked()));
  connect(upButton, SIGNAL(clicked()), this, SLOT(upButtonClicked()));
  connect(downButton, SIGNAL(clicked()), this, SLOT(downButtonClicked()));
  connect(availableListBox, SIGNAL(highlighted(int)), this, SLOT(updateButtons()));
  connect(selectedListBox, SIGNAL(highlighted(int)), this, SLOT(updateButtons()));
  
  maxLineWidth->setMaxValue(KSTLINEWIDTH_MAX);
  maxLineWidth->setMinValue(1);
  
  _radioButtonRepeatPlot->setChecked(true);
  _radioButtonApplyAllWindows->setChecked(true);
  
  loadProperties();
  setOptions();
  updateCurveDifferentiate();
}
Пример #5
0
QList<QToolButton *> NavigatorWidget::createToolBarWidgets()
{
    QList<QToolButton *> buttons;

    buttons << new QToolButton();
    buttons.last()->setIcon(QIcon(":/navigator/icon/arrowleft.png"));
    buttons.last()->setToolTip(tr("Become first sibling of parent (CTRL + Left)"));
    buttons.last()->setShortcut(QKeySequence(Qt::Key_Left | Qt::CTRL));
    connect(buttons.last(), SIGNAL(clicked()), this, SIGNAL(leftButtonClicked()));
    buttons << new QToolButton();
    buttons.last()->setIcon(QIcon(":/navigator/icon/arrowright.png"));
    buttons.last()->setToolTip(tr("Become child of first sibling (CTRL + Right)"));
    buttons.last()->setShortcut(QKeySequence(Qt::Key_Right | Qt::CTRL));
    connect(buttons.last(), SIGNAL(clicked()), this, SIGNAL(rightButtonClicked()));

    buttons << new QToolButton();
    buttons.last()->setIcon(QIcon(":/navigator/icon/arrowdown.png"));
    buttons.last()->setToolTip(tr("Move down (CTRL + Down)"));
    buttons.last()->setShortcut(QKeySequence(Qt::Key_Down | Qt::CTRL));
    connect(buttons.last(), SIGNAL(clicked()), this, SIGNAL(downButtonClicked()));

    buttons << new QToolButton();
    buttons.last()->setIcon(QIcon(":/navigator/icon/arrowup.png"));
    buttons.last()->setToolTip(tr("Move up (CTRL + Up)"));
    buttons.last()->setShortcut(QKeySequence(Qt::Key_Up | Qt::CTRL));
    connect(buttons.last(), SIGNAL(clicked()), this, SIGNAL(upButtonClicked()));

    return buttons;
}
Пример #6
0
KstMonochromeDialogI::KstMonochromeDialogI(QWidget* parent,
                                           const char* name,
                                           bool modal,
                                           WFlags fl)
: KstMonochromeDialog(parent, name, modal, fl) {

  availableListBox->clear();
  selectedListBox->clear();
  availableListBox->insertItem(i18n("Point Style"));  
  availableListBox->insertItem(i18n("Line Style"));
  availableListBox->insertItem(i18n("Line Width"));
  
  connect(_Cancel, SIGNAL(clicked()), this, SLOT(accept()));
  connect(enhanceReadability, SIGNAL(clicked()), this, SLOT(updateButtons()));
  
  // more connections to emulate kactionselector behaviour
  connect(leftButton, SIGNAL(clicked()), this, SLOT(leftButtonClicked()));
  connect(rightButton, SIGNAL(clicked()), this, SLOT(rightButtonClicked()));
  connect(upButton, SIGNAL(clicked()), this, SLOT(upButtonClicked()));
  connect(downButton, SIGNAL(clicked()), this, SLOT(downButtonClicked()));
  connect(availableListBox, SIGNAL(highlighted(int)), this, SLOT(updateButtons()));
  connect(selectedListBox, SIGNAL(highlighted(int)), this, SLOT(updateButtons()));
  
  maxLineWidth->setMaxValue(KSTLINESTYLE_MAXTYPE);
  maxLineWidth->setMinValue(1);
  updateMonochromeDialog();
}
Пример #7
0
void GraphicsDImgView::mousePressEvent(QMouseEvent* e)
{
    QGraphicsView::mousePressEvent(e);

    d->mousePressPos    = QPoint();
    d->movingInProgress = false;

    if (!acceptsMouseClick(e))
    {
        return;
    }

    if (e->button() == Qt::LeftButton)
    {
        emit leftButtonClicked();
    }

    if (e->button() == Qt::LeftButton || e->button() == Qt::MidButton)
    {
        d->mousePressPos = e->pos();

        if (!qApp->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick) || e->button() == Qt::MidButton)
        {
            startPanning(e->pos());
        }

        return;
    }

    if (e->button() == Qt::RightButton)
    {
        emit rightButtonClicked();
    }
}
Пример #8
0
QList<QToolButton *> NavigatorWidget::createToolBarWidgets()
{
    QList<QToolButton *> buttons;

    buttons.append(new QToolButton());
    buttons.last()->setIcon(Icons::ARROW_LEFT.icon());
    buttons.last()->setToolTip(tr("Become last sibling of parent (CTRL + Left)."));
    buttons.last()->setShortcut(QKeySequence(Qt::Key_Left | Qt::CTRL));
    connect(buttons.last(), SIGNAL(clicked()), this, SIGNAL(leftButtonClicked()));

    buttons.append(new QToolButton());
    buttons.last()->setIcon(Icons::ARROW_RIGHT.icon());
    buttons.last()->setToolTip(tr("Become child of last sibling (CTRL + Right)."));
    buttons.last()->setShortcut(QKeySequence(Qt::Key_Right | Qt::CTRL));
    connect(buttons.last(), SIGNAL(clicked()), this, SIGNAL(rightButtonClicked()));

    buttons.append(new QToolButton());
    buttons.last()->setIcon(Icons::ARROW_DOWN.icon());
    buttons.last()->setToolTip(tr("Move down (CTRL + Down)."));
    buttons.last()->setShortcut(QKeySequence(Qt::Key_Down | Qt::CTRL));
    connect(buttons.last(), SIGNAL(clicked()), this, SIGNAL(downButtonClicked()));

    buttons.append(new QToolButton());
    buttons.last()->setIcon(Icons::ARROW_UP.icon());
    buttons.last()->setToolTip(tr("Move up (CTRL + Up)."));
    buttons.last()->setShortcut(QKeySequence(Qt::Key_Up | Qt::CTRL));
    connect(buttons.last(), SIGNAL(clicked()), this, SIGNAL(upButtonClicked()));

    return buttons;
}
Пример #9
0
///// createPopupMenu /////////////////////////////////////////////////////////
QPopupMenu* StatusText::createPopupMenu(const QPoint&)
/// This function is overridden to disable the construction of a default popup
/// menu, but instead emit the signal rightButtonClicked so a popup can be
/// shown by the another class (XbraboView in this case).
{
  emit rightButtonClicked();
  return 0;
}
Пример #10
0
bool TexecutorSupply::eventFilter(QObject* obj, QEvent* event) {
  if (event->type() == QEvent::MouseButtonPress) {
    QMouseEvent *me = static_cast<QMouseEvent *>(event);
    if (me->button() == Qt::RightButton) {
        emit rightButtonClicked();
        return true;
    }
  }
  return QObject::eventFilter(obj, event);
}
Пример #11
0
bool AttachDialog::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: contextMenuActivated((int)static_QUType_int.get(_o+1)); break;
    case 1: rightButtonClicked((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2)),(int)static_QUType_int.get(_o+3)); break;
    default:
	return AppDialog::qt_invoke( _id, _o );
    }
    return TRUE;
}
Пример #12
0
bool RouterKeygen::eventFilter(QObject *obj, QEvent *event) {
    // you may handle multiple objects checking "obj" parameter
    if (event->type() == QEvent::ContextMenu) {
        QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
        if (obj == ui->passwordsList) {
            rightButtonClicked(obj, mouseEvent->globalPos());
            return true;
        }
    }
    return QObject::eventFilter(obj, event);
}
Пример #13
0
NavigatorView::NavigatorView(QObject* parent) :
    QmlModelView(parent),
    m_blockSelectionChangedSignal(false),
    m_widget(new NavigatorWidget(this)),
    m_treeModel(new NavigatorTreeModel(this))
{
    m_widget->setTreeModel(m_treeModel.data());

    connect(treeWidget()->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(changeSelection(QItemSelection,QItemSelection)));

    connect(m_widget.data(), SIGNAL(leftButtonClicked()), this, SLOT(leftButtonClicked()));
    connect(m_widget.data(), SIGNAL(rightButtonClicked()), this, SLOT(rightButtonClicked()));
    connect(m_widget.data(), SIGNAL(downButtonClicked()), this, SLOT(downButtonClicked()));
    connect(m_widget.data(), SIGNAL(upButtonClicked()), this, SLOT(upButtonClicked()));

    treeWidget()->setIndentation(treeWidget()->indentation() * 0.5);

    NameItemDelegate *idDelegate = new NameItemDelegate(this,m_treeModel.data());
    IconCheckboxItemDelegate *showDelegate = new IconCheckboxItemDelegate(this,":/qmldesigner/images/eye_open.png",
            ":/qmldesigner/images/placeholder.png",m_treeModel.data());

#ifdef _LOCK_ITEMS_
    IconCheckboxItemDelegate *lockDelegate = new IconCheckboxItemDelegate(this,":/qmldesigner/images/lock.png",
            ":/qmldesigner/images/hole.png",m_treeModel.data());
#endif


    treeWidget()->setItemDelegateForColumn(0,idDelegate);
#ifdef _LOCK_ITEMS_
    treeWidget()->setItemDelegateForColumn(1,lockDelegate);
    treeWidget()->setItemDelegateForColumn(2,showDelegate);
#else
    treeWidget()->setItemDelegateForColumn(1,showDelegate);
#endif

}
Пример #14
0
void FancyLineEdit::iconClicked() {
    IconButton *button = qobject_cast<IconButton *>(sender());
    int index = -1;
    for (int i = 0; i < 2; ++i)
        if (d->m_iconbutton[i] == button)
            index = i;
    if (index == -1)
        return;
    if (d->m_menu[index]) {
        execMenuAtWidget(d->m_menu[index], button);
    } else {
        emit buttonClicked((Side)index);
        if (index == Left)
            emit leftButtonClicked();
        else if (index == Right)
            emit rightButtonClicked();
    }
}
FilterLineEdit::FilterLineEdit(QWidget *parent) :
   FancyLineEdit(parent),
   m_lastFilterText(text())
{
    // KDE has custom icons for this. Notice that icon namings are counter intuitive.
    // If these icons are not available we use the freedesktop standard name before
    // falling back to a bundled resource.
    QIcon icon = QIcon::fromTheme(layoutDirection() == Qt::LeftToRight ?
                     QLatin1String("edit-clear-locationbar-rtl") :
                     QLatin1String("edit-clear-locationbar-ltr"),
                     QIcon::fromTheme(QLatin1String("edit-clear"), QIcon(QLatin1String(":/core/images/editclear.png"))));

    setButtonPixmap(Right, icon.pixmap(16));
    setButtonVisible(Right, true);
    setPlaceholderText(tr("Filter"));
    setButtonToolTip(Right, tr("Clear text"));
    setAutoHideButton(Right, true);
    connect(this, SIGNAL(rightButtonClicked()), this, SLOT(clear()));
    connect(this, SIGNAL(textChanged(QString)), this, SLOT(slotTextChanged()));
}
Пример #16
0
void KVocTrainTable::menuTriggerTimeout()
{
  delayTimer->stop();
  if (triggerSect == -1)
    return;

  int mt = triggerSect;
  triggerSect = -1;

  QHeader *header = horizontalHeader();
  int x = leftMargin();
  for (int i = 0; i < mt; ++i)
    x += header->sectionSize(i);
  QPoint mpos = mapToGlobal(QPoint(x, topMargin()));

  if (mt != KV_COL_MARK)
    emit rightButtonClicked(mt, mpos.x(), mpos.y());

  QMouseEvent me(QEvent::MouseButtonRelease, QPoint(0, 0), QMouseEvent::LeftButton, QMouseEvent::LeftButton);
  QApplication::sendEvent(header, &me);
}
Пример #17
0
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void SearchLineEdit::iconClicked()
{
  IconButton* button = qobject_cast<IconButton*>(sender());
  int index = -1;
  for (int i = 0; i < 2; ++i)
    if (d->m_IconButtons[i] == button)
    { index = i; }
  if (index == -1)
  { return; }
  if (d->m_ButtonMenus[index])
  {
    execMenuAtWidget(d->m_ButtonMenus[index], button);
  }
  else
  {
    emit buttonClicked((Side)index);
    if (index == Left)
    { emit leftButtonClicked(); }
    else if (index == Right)
    { emit rightButtonClicked(); }
  }
}
Пример #18
0
RecorderNewDialog::RecorderNewDialog(bool quick,
                                     TimersModel *timers,
                                     PlaylistModel *playlist,
                                     QWidget *parent)
    : QDialog(parent),
      ui(new Ui::RecorderNewDialog),
      _currentChannel(0),
      _currentTimer(0)
{
    setWindowModality(Qt::WindowModal);

    ui->setupUi(this);

    _model = timers;
    ui->playlistWidget->setPlaylistModel(playlist);

    if (quick)
        ui->buttonTimer->hide();
    else
        ui->buttonRecord->hide();

    ui->search->setButtonPixmap(FancyLineEdit::Left, QIcon::fromTheme("edit-find").pixmap(16));
    ui->search->setButtonPixmap(FancyLineEdit::Right, QIcon::fromTheme("edit-clear").pixmap(16));
    ui->search->setButtonVisible(FancyLineEdit::Left, true);
    ui->search->setButtonVisible(FancyLineEdit::Right, true);
    ui->search->setAutoHideButton(FancyLineEdit::Right, true);

    connect(ui->buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
    connect(ui->buttonTimer, SIGNAL(clicked()), this, SLOT(processNewTimer()));
    connect(ui->buttonRecord, SIGNAL(clicked()), this, SLOT(processQuickRecord()));
    connect(ui->editName, SIGNAL(textChanged(QString)), this, SLOT(validate()));
    connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(processFilters()));
    connect(ui->search, SIGNAL(rightButtonClicked()), ui->search, SLOT(clear()));

    connect(ui->playlistWidget, SIGNAL(itemSelected(Channel *)), this, SLOT(playlist(Channel *)));
}
int Q3IconView::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = Q3ScrollView::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: selectionChanged(); break;
        case 1: selectionChanged((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break;
        case 2: currentChanged((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break;
        case 3: clicked((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break;
        case 4: clicked((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break;
        case 5: pressed((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break;
        case 6: pressed((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break;
        case 7: doubleClicked((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break;
        case 8: returnPressed((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break;
        case 9: rightButtonClicked((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break;
        case 10: rightButtonPressed((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break;
        case 11: mouseButtonPressed((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< Q3IconViewItem*(*)>(_a[2])),(*reinterpret_cast< const QPoint(*)>(_a[3]))); break;
        case 12: mouseButtonClicked((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< Q3IconViewItem*(*)>(_a[2])),(*reinterpret_cast< const QPoint(*)>(_a[3]))); break;
        case 13: contextMenuRequested((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break;
        case 14: dropped((*reinterpret_cast< QDropEvent*(*)>(_a[1])),(*reinterpret_cast< const Q3ValueList<Q3IconDragItem>(*)>(_a[2]))); break;
        case 15: moved(); break;
        case 16: onItem((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break;
        case 17: onViewport(); break;
        case 18: itemRenamed((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2]))); break;
        case 19: itemRenamed((*reinterpret_cast< Q3IconViewItem*(*)>(_a[1]))); break;
        case 20: arrangeItemsInGrid((*reinterpret_cast< const QSize(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break;
        case 21: arrangeItemsInGrid((*reinterpret_cast< const QSize(*)>(_a[1]))); break;
        case 22: arrangeItemsInGrid((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 23: arrangeItemsInGrid(); break;
        case 24: setContentsPos((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 25: updateContents(); break;
        case 26: doAutoScroll(); break;
        case 27: adjustItems(); break;
        case 28: slotUpdate(); break;
        case 29: movedContents((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        }
        _id -= 30;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = sorting(); break;
        case 1: *reinterpret_cast< bool*>(_v) = sortDirection(); break;
        case 2: *reinterpret_cast< SelectionMode*>(_v) = selectionMode(); break;
        case 3: *reinterpret_cast< int*>(_v) = gridX(); break;
        case 4: *reinterpret_cast< int*>(_v) = gridY(); break;
        case 5: *reinterpret_cast< int*>(_v) = spacing(); break;
        case 6: *reinterpret_cast< ItemTextPos*>(_v) = itemTextPos(); break;
        case 7: *reinterpret_cast< QBrush*>(_v) = itemTextBackground(); break;
        case 8: *reinterpret_cast< Arrangement*>(_v) = arrangement(); break;
        case 9: *reinterpret_cast< ResizeMode*>(_v) = resizeMode(); break;
        case 10: *reinterpret_cast< int*>(_v) = maxItemWidth(); break;
        case 11: *reinterpret_cast< int*>(_v) = maxItemTextLength(); break;
        case 12: *reinterpret_cast< bool*>(_v) = autoArrange(); break;
        case 13: *reinterpret_cast< bool*>(_v) = itemsMovable(); break;
        case 14: *reinterpret_cast< bool*>(_v) = wordWrapIconText(); break;
        case 15: *reinterpret_cast< bool*>(_v) = showToolTips(); break;
        case 16: *reinterpret_cast< uint*>(_v) = count(); break;
        }
        _id -= 17;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 2: setSelectionMode(*reinterpret_cast< SelectionMode*>(_v)); break;
        case 3: setGridX(*reinterpret_cast< int*>(_v)); break;
        case 4: setGridY(*reinterpret_cast< int*>(_v)); break;
        case 5: setSpacing(*reinterpret_cast< int*>(_v)); break;
        case 6: setItemTextPos(*reinterpret_cast< ItemTextPos*>(_v)); break;
        case 7: setItemTextBackground(*reinterpret_cast< QBrush*>(_v)); break;
        case 8: setArrangement(*reinterpret_cast< Arrangement*>(_v)); break;
        case 9: setResizeMode(*reinterpret_cast< ResizeMode*>(_v)); break;
        case 10: setMaxItemWidth(*reinterpret_cast< int*>(_v)); break;
        case 11: setMaxItemTextLength(*reinterpret_cast< int*>(_v)); break;
        case 12: setAutoArrange(*reinterpret_cast< bool*>(_v)); break;
        case 13: setItemsMovable(*reinterpret_cast< bool*>(_v)); break;
        case 14: setWordWrapIconText(*reinterpret_cast< bool*>(_v)); break;
        case 15: setShowToolTips(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 17;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 17;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 17;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 17;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 17;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 17;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 17;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Пример #20
0
/** Default constructor */
MainWindow::MainWindow() : QWidget()
{
	/** constructor() that has in input file for scores */
	ifstream fin;
	fin.open("scores.txt");
	if(fin.fail())
	{
		cout << "Could not find the scores file" << endl;
	}
	else
	{
	  string temp;
	  int temp2;
	  getline(fin,temp,'|');
	  fin >> temp2;
		while(fin.good())
		{
			scorenames.push_back(temp);
			scores.push_back(temp2);
			getline(fin,temp,'|');
			fin >> temp2;
		}
	}
	  
	/** Set the Pixmaps */
	ez=new QPixmap("ezreal.png");
		*ez=ez->scaled(75,75,Qt::KeepAspectRatioByExpanding);
	melee=new QPixmap("meleeminion.png");
		*melee=melee->scaled(50,50,Qt::KeepAspectRatioByExpanding);
	caster=new QPixmap("casterminion.png");
		*caster=caster->scaled(45,45,Qt::KeepAspectRatioByExpanding);
	siege=new QPixmap("siegeminion.png");
		*siege=siege->scaled(65,65,Qt::KeepAspectRatioByExpanding);
	basic=new QPixmap("basicattack.gif");
		*basic=basic->scaled(10,10,Qt::KeepAspectRatioByExpanding);
	mystic=new QPixmap("basicattack.gif");
		*mystic=mystic->scaled(30,30,Qt::KeepAspectRatioByExpanding);
	trueshot=new QPixmap("trueshot.png");
		*trueshot=trueshot->scaled(75,75,Qt::KeepAspectRatioByExpanding);
	heal=new QPixmap("heal.png");
		*heal=heal->scaled(50,50,Qt::KeepAspectRatioByExpanding);
	clarity=new QPixmap("clarity.png");
		*clarity=clarity->scaled(50,50,Qt::KeepAspectRatioByExpanding);
	ignite=new QPixmap("ignite.png");
		*ignite=ignite->scaled(50,50,Qt::KeepAspectRatioByExpanding);
	energy=new QPixmap("energybolt.gif");
		*energy=energy->scaled(50,50,Qt::KeepAspectRatioByExpanding);
	cannon=new QPixmap("cannonshot.png");
		*cannon=cannon->scaled(55,55,Qt::KeepAspectRatioByExpanding);
	/** color is the default color set for spacers and background of widgets*/
	color.setRgb(240,240,240,255);
	/** MainWidget which holds everything */
	mainwidget= new QWidget;
	mainwidget->setFixedSize(1200,800);
	/** Main Layout for MainWindow */
	mainLayout = new QVBoxLayout;
	mainwidget->setLayout(mainLayout);
	  /** TITLE above row1*/
	  row0 = new QHBoxLayout;
	  	/** IconObject used to display QPixmap */
	    	hold_spacer0 = new IconObject;
	  	/** Used to hold a space */
	  	spacer0 = new QPixmap(100,64);
	  	spacer0->fill(color);
	  	/** IconObject used to display QPixmap */
	    	hold_title = new IconObject;
	    	/** Ability display icon */
	  	title = new QPixmap("title.png");
	  	/** IconObject used to display QPixmap */
	    	hold_spacer01 = new IconObject;
	  	/** Used to hold a space */
	  	spacer01 = new QPixmap(100,64);
	  	spacer01->fill(color);
	  	// set pixmaps
	  	hold_spacer0->setPixmap(*spacer0);
	  	hold_title->setPixmap(title->scaled(700,40,Qt::KeepAspectRatioByExpanding));
	  	hold_spacer0->setPixmap(*spacer01);
	  	//add to layout row0
	  	row0->addWidget(hold_spacer0);
	  	row0->addWidget(hold_title);
	  	row0->addWidget(hold_spacer01);
	  	mainLayout->addLayout(row0);
	  /** Horizontal box for row 1*/
	  row1= new QHBoxLayout;
	  	/** Button which initiates/restarts game*/
		start= new QPushButton("Start");
		/** Button which pauses/continues game*/
		pause = new QPushButton("Pause");
		/** quits the game*/
		quit = new QPushButton("Quit");
		/** Score display*/
		name = new QTextEdit("Name");
		name->setMaximumHeight(30);
		name->setMaximumWidth(200);
		/** level display*/
		level = new QLabel("LEVEL: 00");
		/** score display*/
		score = new QLabel("SCORE: 00");
	    row1->addWidget(start);
	    row1->addWidget(pause);
	    row1->addWidget(quit);
	    row1->addWidget(name);
	    row1->addWidget(level);
	    row1->addWidget(score);
	    mainLayout->addLayout(row1);
	  /** Horizontal box for row 2*/
	  row2 = new QHBoxLayout;
	  	/** Scene which holds monsters, player and powerups*/
	  	scene = new QGraphicsScene;
	  	/** View which holds gameplay*/
	  	view = new GameWindow(scene);
	    row2->addWidget(view);
	    mainLayout->addLayout(row2);
	  /** Horizontal box for row 3*/
	  row3 = new QHBoxLayout;
	    //left
	    	/** IconObject used to display QPixmap */
	    	hold_basicattackicon = new IconObject;
	    	/** Ability display icon */
	  	basicattackicon = new QPixmap("basicattack.gif");
	  	/** IconObject used to display QPixmap */
	    	hold_mysticshoticon = new IconObject;
	  	/** Ability display icon */
	  	mysticshoticon = new QPixmap("basicattack.gif");
	  	//mysticshoticon->scaledToHeight(64,Qt::FastTransformation);
	  	/** IconObject used to display QPixmap */
	    	hold_trueshoticon = new IconObject;
	  	/** Ability display icon */
	  	trueshoticon = new QPixmap("trueshot.png");
	  	/** IconObject used to display QPixmap */
	    	hold_spacer1 = new IconObject;
	  	/** Used to hold a space */
	  	spacer1 = new QPixmap(400,64);
	  	spacer1->fill(color);
	    //midleft
	    	/** IconObject used to display QPixmap */
	    	hold_heart = new IconObject;
	    	/** Heart Icon */
	    	heart = new QPixmap("heart.gif");
	    	/** Health display */
	    	health = new QLabel("200");
	    	health->setMaximumHeight(25);
	    	/** IconObject used to display QPixmap */
	    	hold_spacer2 = new IconObject;
	    	/** Used to hold a space */
	  	spacer2 = new QPixmap(64,64);
	  	spacer2->fill(color);
	    //midright
	    	/** IconObject used to display QPixmap */
	    	hold_potion = new IconObject;
	    	/** Mana Icon */
	    	potion = new QPixmap("mana.gif");
	    	/** Mana display */
	    	mana= new QLabel("50");
	    	mana->setMaximumHeight(25);
	    	
	    /*Add the Pixmaps to the IconObjects*/
	    hold_basicattackicon->setPixmap(basicattackicon->scaledToHeight(10));
	    hold_mysticshoticon->setPixmap(mysticshoticon->scaledToHeight(20));
	    hold_trueshoticon->setPixmap(trueshoticon->scaled(40,60,Qt::KeepAspectRatioByExpanding));
	    hold_spacer1->setPixmap(*spacer1);
	    hold_heart->setPixmap(*heart);
	    hold_spacer2->setPixmap(*spacer2);
	    hold_potion->setPixmap(*potion);
	    /* Add IconObjects to row3 */
	    row3->addWidget(hold_basicattackicon);
	    row3->addWidget(hold_mysticshoticon);
	    row3->addWidget(hold_trueshoticon);
	    row3->addWidget(hold_spacer1);
	    row3->addWidget(hold_heart);
	    row3->addWidget(health);
	    row3->addWidget(hold_spacer2);
	    row3->addWidget(hold_potion);
	    row3->addWidget(mana);
	    /* Add layout to main widget*/
	    mainLayout->addLayout(row3);
	    
	// set player
	  //objects.push_back(
	//set bool variables
	trueshotfiring = false;
	inGame = false;
	gamePaused = false;
	playerAlive = false;
	up = false;
	down = false;
	left = false;
	right = false;
	grabbedignite=false;
	lostgame=false;
	//set counters
	/** Level identifies which level the game is at */
	levelff=1;
	/** Leftclickcounter determines how many times left click is pressed */
	leftclickcounter=0;
	/** Leftclickholdcounter determines how long left click is pressed */
	leftclickholdcounter=0;
	/** Spawn counter for a meleeminoin */
	spawnmelee=0;
	/** Spawn counter for a Siegeminion*/
	spawnsiege=0;	
	/** Spawn counter for a Casterminion*/
	spawncaster=0;
	/** Ez can not be hurt immediately at next clock 
	  *giving the player time to move out of the way*/
	ezhurt=0;
	/** Points scored*/
	points=0;
	/** Icon spawning at 200*/
	iconspawn=0;
	
	// set timer
	timer = new QTimer(this);// timer->start(val) later on in show()
	//connections
	connect(start,SIGNAL(clicked()),this,SLOT(clickedStart()));
	connect(pause,SIGNAL(clicked()),this,SLOT(clickedPause()));
	connect(view,SIGNAL(leftButtonClicked()),this,SLOT(leftClick()));
	connect(view,SIGNAL(rightButtonClicked()),this,SLOT(rightClick()));
	connect(view,SIGNAL(leftButtonHoldStart()),this,SLOT(leftHoldstart()));
	connect(view,SIGNAL(leftButtonHoldCancel()),this,SLOT(leftHoldcancel()));
	connect(view,SIGNAL(uparrow()),this,SLOT(moveup()));
	connect(view,SIGNAL(downarrow()),this,SLOT(movedown()));
	connect(view,SIGNAL(leftarrow()),this,SLOT(moveleft()));
	connect(view,SIGNAL(rightarrow()),this,SLOT(moveright()));
	connect(timer,SIGNAL(timeout()),this,SLOT(handleTimer()));
	connect(quit,SIGNAL(clicked()),this,SLOT(clickedQuit()));
}
Пример #21
0
/**
  * Constructor for MainWindow. It will initialize the entire board and create the necessary starting elements for the game
  */
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    //Global variables
    hasFinished = false; //Has the game finished?
    cellsRevealed = 0; //Number of current cells revealed
    flagsFlagged = 0; //Number of flags that have been flagged
    minesFlagged = 0; //Number of mines that have been flagged
    hasStarted = false; //If the game has started yet
    currentTime = 0; //The current time in seconds

    ui->setupUi(this);

    //Layout designs
    ui->mineContainer->setSpacing(0); //Forces the board cells to be spaced next to each other

    //Timer for the number of seconds that has passed by
    timer = new QTimer();

    //The display of the number of flags that have been put up (Mines left to solve)
    ui->lcdFlagCount->setDigitCount(2);
    ui->lcdFlagCount->display ( NUMBER_OF_MINES - flagsFlagged );

    //Initialize statuses
    // 0 = Empty, 1 = flagged, 2 = ?
    for ( int i = 0; i < 10; i++)
    {
        for ( int j = 0; j < 10; j++)
            mineStatus[i][j] = 0;
    }

    //Connect the UI elements
    connect(ui->actionHelp, SIGNAL(triggered()), this, SLOT(handleHelpButton()));
    connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(handleAboutButton()));
    connect(ui->action_Reset, SIGNAL(triggered()), this, SLOT(reset()));
    connect(ui->smileyFace, SIGNAL(clicked()), this, SLOT(handleSmileyFace()));
    connect(ui->actionTop_Ten, SIGNAL(triggered()), this, SLOT(handleTopTen()));
    connect(timer, SIGNAL(timeout()), this, SLOT(updateTimer()));

    //Now handle the actual game.. enough of this extra feature stuff. Now for the real deal!
    game = new Minesweeper();

    //We will need to map the click to an object's coordinates
    signalMapper = new QSignalMapper(this);
    signalMapper2 = new QSignalMapper(this);

    //Generate all the buttons for the game
    for( int i = 0; i < 10; i++)
    {
        for( int j = 0; j < 10; j++ )
        {
            MineSweeperButton* button = new MineSweeperButton("");

            //Button Styling
            button->setAttribute(Qt::WA_LayoutUsesWidgetRect); //Forces Mac OS X styled minesweeper to look like linux/windows
            button->setMaximumHeight(30);
            button->setMaximumWidth(30);
            button->setIcon (QIcon(QString(":/images/not_flat_button.png")));
            button->setIconSize (QSize(30,30));

            //Actually add the button to the container
            ui->mineContainer->addWidget(button, i, j);
            QString coordinates = QString::number(i)+","+QString::number(j); //Coordinate of the button
            //Map the coordinates to a particular MineSweeperButton
            signalMapper->setMapping(button, coordinates);
            signalMapper2->setMapping(button, coordinates);

            //Connections for the buttons
            connect(button, SIGNAL(clicked()), signalMapper, SLOT(map()));
            connect(button, SIGNAL(rightButtonClicked()), signalMapper2, SLOT(map()));
            connect(button, SIGNAL(pressed()), this, SLOT(handleButtonPressed()));
            connect(button, SIGNAL(released()), this, SLOT(handleButtonReleased()));
        }
    }

    //Connect the signal mapper to this class so that we can handle its clicks
    connect(signalMapper, SIGNAL(mapped(QString)), this, SLOT(revealCell(QString))); //Left click
    connect(signalMapper2, SIGNAL(mapped(QString)), this, SLOT(hasRightClicked(QString))); //Right click
}
Пример #22
0
FindDocWidget::FindDocWidget(LiteApi::IApplication *app, QWidget *parent) :
    QWidget(parent), m_liteApp(app)
{
    m_findEdit = new SearchEdit;
    m_findEdit->setPlaceholderText(tr("Search"));

    m_chaseWidget = new ChaseWidget;
    m_chaseWidget->setMinimumSize(QSize(16,16));
    m_chaseWidget->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);

    QToolButton *findBtn = new QToolButton;
    findBtn->setPopupMode(QToolButton::InstantPopup);
    findBtn->setText(tr("Find"));

    QHBoxLayout *findLayout = new QHBoxLayout;
    findLayout->setMargin(2);
    findLayout->addWidget(m_findEdit);
    findLayout->addWidget(findBtn);
    findLayout->addWidget(m_chaseWidget);

    m_browser = m_liteApp->htmlWidgetManager()->createByName(this,"QTextBrowser");
    QStringList paths;
    paths << m_liteApp->resourcePath()+"/packages/go/godoc";
    m_browser->setSearchPaths(paths);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->setMargin(1);
    mainLayout->setSpacing(1);
    mainLayout->addLayout(findLayout);
    mainLayout->addWidget(m_browser->widget());

    QAction *findAll = new QAction(tr("Find All"),this);
    QAction *findConst = new QAction(tr("Find const"),this);
    findConst->setData("const");
    QAction *findFunc = new QAction(tr("Find func"),this);
    findFunc->setData("func");
    QAction *findInterface = new QAction(tr("Find interface"),this);
    findInterface->setData("interface");
    QAction *findPkg = new QAction(tr("Find pkg"),this);
    findPkg->setData("pkg");
    QAction *findStruct = new QAction(tr("Find struct"),this);
    findStruct->setData("struct");
    QAction *findType = new QAction(tr("Find type"),this);
    findType->setData("type");
    QAction *findVar = new QAction(tr("Find var"),this);
    findVar->setData("var");
    m_useRegexpCheckAct = new QAction(tr("Use Regexp"),this);
    m_useRegexpCheckAct->setCheckable(true);
    m_matchCaseCheckAct = new QAction(tr("Match Case"),this);
    m_matchCaseCheckAct->setCheckable(true);
    m_matchWordCheckAct = new QAction(tr("Match Word"),this);
    m_matchWordCheckAct->setCheckable(true);

    m_useRegexpCheckAct->setChecked(m_liteApp->settings()->value(GODOCFIND_USEREGEXP,false).toBool());
    m_matchCaseCheckAct->setChecked(m_liteApp->settings()->value(GODOCFIND_MATCHCASE,true).toBool());
    m_matchWordCheckAct->setChecked(m_liteApp->settings()->value(GODOCFIND_MATCHWORD,false).toBool());

    QMenu *menu = new QMenu(findBtn);
    menu->addActions(QList<QAction*>()
                     << findAll
                     //<< findPkg
                     );
    menu->addSeparator();
    menu->addActions(QList<QAction*>()
                     << findInterface
                     << findStruct
                     << findType
                     << findFunc
                     << findConst
                     << findVar
                     );
    menu->addSeparator();
    menu->addAction(m_matchWordCheckAct);
    menu->addAction(m_matchCaseCheckAct);
    menu->addAction(m_useRegexpCheckAct);
    findBtn->setMenu(menu);

    QAction *helpAct = new QAction(tr("Help"),this);
    menu->addSeparator();
    menu->addAction(helpAct);
    connect(helpAct,SIGNAL(triggered()),this,SLOT(showHelp()));

    this->setLayout(mainLayout);    


    connect(findAll,SIGNAL(triggered()),this,SLOT(findDoc()));
    connect(findConst,SIGNAL(triggered()),this,SLOT(findDoc()));
    connect(findFunc,SIGNAL(triggered()),this,SLOT(findDoc()));
    connect(findInterface,SIGNAL(triggered()),this,SLOT(findDoc()));
    connect(findPkg,SIGNAL(triggered()),this,SLOT(findDoc()));
    connect(findStruct,SIGNAL(triggered()),this,SLOT(findDoc()));
    connect(findType,SIGNAL(triggered()),this,SLOT(findDoc()));
    connect(findVar,SIGNAL(triggered()),this,SLOT(findDoc()));

    m_process = new ProcessEx(this);
    connect(m_process,SIGNAL(stateChanged(QProcess::ProcessState)),this,SLOT(stateChanged(QProcess::ProcessState)));
    connect(m_process,SIGNAL(extOutput(QByteArray,bool)),this,SLOT(extOutput(QByteArray,bool)));
    connect(m_process,SIGNAL(extFinish(bool,int,QString)),this,SLOT(extFinish(bool,int,QString)));
    connect(m_findEdit,SIGNAL(returnPressed()),findAll,SIGNAL(triggered()));
    connect(m_findEdit,SIGNAL(rightButtonClicked()),this,SLOT(abortFind()));
    connect(m_browser,SIGNAL(linkClicked(QUrl)),this,SLOT(openUrl(QUrl)));


    QString path = m_liteApp->resourcePath()+"/packages/go/godoc/finddoc.html";
    QFile file(path);
    if (file.open(QIODevice::ReadOnly)) {
        m_templateData = file.readAll();
        file.close();
    }

    //QFont font = m_browser->widget()->font();
    //font.setPointSize(12);
    //m_browser->widget()->setFont(font);

    showHelp();
}
Пример #23
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()));
}
Пример #24
0
FindApiWidget::FindApiWidget(LiteApi::IApplication *app, QWidget *parent) :
    QWidget(parent), m_liteApp(app)
{
    m_findEdit = new FindApiEdit;
    m_findEdit->setPlaceholderText(tr("Search"));

    m_chaseWidget = new ChaseWidget;
    m_chaseWidget->setMinimumSize(QSize(16,16));
    m_chaseWidget->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);

    m_listView = new QListView;
    m_model = new QStandardItemModel(this);
    m_listView->setModel(m_model);
    m_listView->setEditTriggers(QListView::NoEditTriggers);

    QToolButton *findBtn = new QToolButton;
    findBtn->setPopupMode(QToolButton::MenuButtonPopup);
    findBtn->setText(tr("Find"));

    QHBoxLayout *findLayout = new QHBoxLayout;
    findLayout->setMargin(2);
    findLayout->addWidget(m_findEdit);
    findLayout->addWidget(findBtn);
    findLayout->addWidget(m_chaseWidget);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->setMargin(1);
    mainLayout->setSpacing(1);
    mainLayout->addLayout(findLayout);
    mainLayout->addWidget(m_listView);

    this->setLayout(mainLayout);

    m_findThread = new FindApiThread(this);
    m_findThread->setFileName(m_liteApp->storagePath()+"/golangapi.txt");
    connect(m_findThread,SIGNAL(findApiOut(QString,QString,QStringList)),this,SLOT(findApiOut(QString,QString,QStringList)));
    connect(m_findThread,SIGNAL(finished()),this,SLOT(findApiFinished()));
    //connect(m_findThread,SIGNAL(terminated()),this,SLOT(findApiTerminated()));
    //connect(findBtn,SIGNAL(clicked()),this,SLOT(findApi()));
    connect(m_findEdit,SIGNAL(returnPressed()),this,SLOT(findApi()));
    connect(m_findEdit,SIGNAL(rightButtonClicked()),m_findThread,SLOT(terminate()));
    connect(m_listView,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(doubleClickedApi(QModelIndex)));

    m_rebuildThread = new ProcessEx(this);

    m_findAct = new QAction("Search",this);
    m_caseCheckAct = new QAction("Match case",this);
    m_caseCheckAct->setCheckable(true);
    m_rebuildAct = new QAction(tr("Rebuild database"),this);

    QMenu *menu = new QMenu(tr("Find"),findBtn);
    menu->addAction(m_caseCheckAct);
    menu->addSeparator();
    menu->addAction(m_rebuildAct);
    findBtn->setMenu(menu);
    findBtn->setDefaultAction(m_findAct);

    connect(m_findAct,SIGNAL(triggered()),this,SLOT(findApi()));
    connect(m_rebuildAct,SIGNAL(triggered()),this,SLOT(rebuildApiData()));

    m_caseCheckAct->setChecked(m_liteApp->settings()->value("goapisearch/match_case",true).toBool());
}
Пример #25
0
void KMListView::slotRightButtonClicked(TQListViewItem *item, const TQPoint& p, int)
{
	emit rightButtonClicked(item && item->depth() == 2 ? item->text(0) : TQString::null, p);
}
int Q3ListBox::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = Q3ScrollView::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: highlighted((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 1: selected((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 2: highlighted((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 3: selected((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 4: highlighted((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1]))); break;
        case 5: selected((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1]))); break;
        case 6: selectionChanged(); break;
        case 7: selectionChanged((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1]))); break;
        case 8: currentChanged((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1]))); break;
        case 9: clicked((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1]))); break;
        case 10: clicked((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break;
        case 11: pressed((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1]))); break;
        case 12: pressed((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break;
        case 13: doubleClicked((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1]))); break;
        case 14: returnPressed((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1]))); break;
        case 15: rightButtonClicked((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break;
        case 16: rightButtonPressed((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break;
        case 17: mouseButtonPressed((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< Q3ListBoxItem*(*)>(_a[2])),(*reinterpret_cast< const QPoint(*)>(_a[3]))); break;
        case 18: mouseButtonClicked((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< Q3ListBoxItem*(*)>(_a[2])),(*reinterpret_cast< const QPoint(*)>(_a[3]))); break;
        case 19: contextMenuRequested((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1])),(*reinterpret_cast< const QPoint(*)>(_a[2]))); break;
        case 20: onItem((*reinterpret_cast< Q3ListBoxItem*(*)>(_a[1]))); break;
        case 21: onViewport(); break;
        case 22: clear(); break;
        case 23: ensureCurrentVisible(); break;
        case 24: clearSelection(); break;
        case 25: selectAll((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 26: invertSelection(); break;
        case 27: clearInputString(); break;
        case 28: refreshSlot(); break;
        case 29: doAutoScroll(); break;
        case 30: adjustItems(); break;
        }
        _id -= 31;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< uint*>(_v) = count(); break;
        case 1: *reinterpret_cast< int*>(_v) = numItemsVisible(); break;
        case 2: *reinterpret_cast< int*>(_v) = currentItem(); break;
        case 3: *reinterpret_cast< QString*>(_v) = currentText(); break;
        case 4: *reinterpret_cast< int*>(_v) = topItem(); break;
        case 5: *reinterpret_cast< SelectionMode*>(_v) = selectionMode(); break;
        case 6: *reinterpret_cast< bool*>(_v) = isMultiSelection(); break;
        case 7: *reinterpret_cast< LayoutMode*>(_v) = columnMode(); break;
        case 8: *reinterpret_cast< LayoutMode*>(_v) = rowMode(); break;
        case 9: *reinterpret_cast< int*>(_v) = numColumns(); break;
        case 10: *reinterpret_cast< int*>(_v) = numRows(); break;
        case 11: *reinterpret_cast< bool*>(_v) = variableWidth(); break;
        case 12: *reinterpret_cast< bool*>(_v) = variableHeight(); break;
        }
        _id -= 13;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 2: setCurrentItem(*reinterpret_cast< int*>(_v)); break;
        case 4: setTopItem(*reinterpret_cast< int*>(_v)); break;
        case 5: setSelectionMode(*reinterpret_cast< SelectionMode*>(_v)); break;
        case 6: setMultiSelection(*reinterpret_cast< bool*>(_v)); break;
        case 7: setColumnMode(*reinterpret_cast< LayoutMode*>(_v)); break;
        case 8: setRowMode(*reinterpret_cast< LayoutMode*>(_v)); break;
        case 11: setVariableWidth(*reinterpret_cast< bool*>(_v)); break;
        case 12: setVariableHeight(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 13;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 13;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 13;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 13;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 13;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 13;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 13;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}