コード例 #1
0
int FilterableGroupDataModel::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    typedef bb::cascades::GroupDataModel QMocSuperClass;
    _id = QMocSuperClass::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 3)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 3;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QString*>(_v) = filterText(); break;
        case 1: *reinterpret_cast< QString*>(_v) = filterAttribute(); break;
        }
        _id -= 2;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setFilterText(*reinterpret_cast< QString*>(_v)); break;
        case 1: setFilterAttribute(*reinterpret_cast< QString*>(_v)); break;
        }
        _id -= 2;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 2;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
コード例 #2
0
/** Constructor */
GxsChannelPostsWidget::GxsChannelPostsWidget(const RsGxsGroupId &channelId, QWidget *parent) :
    GxsMessageFramePostWidget(rsGxsChannels, parent),
    ui(new Ui::GxsChannelPostsWidget)
{
    /* Invoke the Qt Designer generated object setup routine */
    ui->setupUi(this);


    /* Setup UI helper */

    mStateHelper->addWidget(mTokenTypeAllPosts, ui->progressBar, UISTATE_LOADING_VISIBLE);
    mStateHelper->addWidget(mTokenTypeAllPosts, ui->loadingLabel, UISTATE_LOADING_VISIBLE);
    mStateHelper->addWidget(mTokenTypeAllPosts, ui->filterLineEdit);

    mStateHelper->addWidget(mTokenTypePosts, ui->loadingLabel, UISTATE_LOADING_VISIBLE);

    mStateHelper->addLoadPlaceholder(mTokenTypeGroupData, ui->nameLabel);

    mStateHelper->addWidget(mTokenTypeGroupData, ui->postButton);
    mStateHelper->addWidget(mTokenTypeGroupData, ui->logoLabel);
    mStateHelper->addWidget(mTokenTypeGroupData, ui->subscribeToolButton);

    /* Connect signals */
    connect(ui->postButton, SIGNAL(clicked()), this, SLOT(createMsg()));
    connect(ui->subscribeToolButton, SIGNAL(subscribe(bool)), this, SLOT(subscribeGroup(bool)));
    connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));

    /* add filter actions */
    ui->filterLineEdit->addFilter(QIcon(), tr("Title"), FILTER_TITLE, tr("Search Title"));
    ui->filterLineEdit->addFilter(QIcon(), tr("Message"), FILTER_MSG, tr("Search Message"));
    ui->filterLineEdit->addFilter(QIcon(), tr("Filename"), FILTER_FILE_NAME, tr("Search Filename"));
    connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), ui->feedWidget, SLOT(setFilterText(QString)));
    connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), ui->fileWidget, SLOT(setFilterText(QString)));
    connect(ui->filterLineEdit, SIGNAL(filterChanged(int)), this, SLOT(filterChanged(int)));

    /* Initialize view button */
    //setViewMode(VIEW_MODE_FEEDS); see processSettings
    ui->infoWidget->hide();

    QSignalMapper *signalMapper = new QSignalMapper(this);
    connect(ui->feedToolButton, SIGNAL(clicked()), signalMapper, SLOT(map()));
    connect(ui->fileToolButton, SIGNAL(clicked()), signalMapper, SLOT(map()));
    signalMapper->setMapping(ui->feedToolButton, VIEW_MODE_FEEDS);
    signalMapper->setMapping(ui->fileToolButton, VIEW_MODE_FILES);
    connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(setViewMode(int)));

    /*************** Setup Left Hand Side (List of Channels) ****************/

    ui->loadingLabel->hide();
    ui->progressBar->hide();

    ui->nameLabel->setMinimumWidth(20);

    /* Initialize feed widget */
    ui->feedWidget->setSortRole(ROLE_PUBLISH, Qt::DescendingOrder);
    ui->feedWidget->setFilterCallback(filterItem);

    /* load settings */
    processSettings(true);

    /* Initialize subscribe button */
    QIcon icon;
    icon.addPixmap(QPixmap(":/images/redled.png"), QIcon::Normal, QIcon::On);
    icon.addPixmap(QPixmap(":/images/start.png"), QIcon::Normal, QIcon::Off);
    mAutoDownloadAction = new QAction(icon, "", this);
    mAutoDownloadAction->setCheckable(true);
    connect(mAutoDownloadAction, SIGNAL(triggered()), this, SLOT(toggleAutoDownload()));

    ui->subscribeToolButton->addSubscribedAction(mAutoDownloadAction);

    /* Initialize GUI */
    setAutoDownload(false);
    settingsChanged();
    setGroupId(channelId);
}