예제 #1
0
ChatWindow* QtChatWindowFactory::createChatWindow(const JID &contact,UIEventStream* eventStream) {
    if (!theme_) {
        theme_ = new QtChatTheme(themePath_);
        if (theme_->getIncomingContent().isEmpty()) {
            delete theme_;
            theme_ = new QtChatTheme(":/themes/Default/"); /* Use the inbuilt theme */
        }
    }

    QtChatWindow* chatWindow = new QtChatWindow(P2QSTRING(contact.toString()), theme_, eventStream, settings_, emoticons_);
    connect(chatWindow, SIGNAL(splitterMoved()), this, SLOT(handleSplitterMoved()));
    connect(this, SIGNAL(changeSplitterState(QByteArray)), chatWindow, SLOT(handleChangeSplitterState(QByteArray)));

    QVariant splitterState = qtOnlySettings_->getQSettings()->value(SPLITTER_STATE);
    if(splitterState.isValid()) {
        chatWindow->handleChangeSplitterState(splitterState.toByteArray());
    }

    if (tabs_) {
        tabs_->addTab(chatWindow);
    } else {
        QVariant chatGeometryVariant = qtOnlySettings_->getQSettings()->value(CHAT_TABS_GEOMETRY);
        if (chatGeometryVariant.isValid()) {
            chatWindow->restoreGeometry(chatGeometryVariant.toByteArray());
        }
        connect(chatWindow, SIGNAL(geometryChanged()), this, SLOT(handleWindowGeometryChanged()));
    }
    return chatWindow;
}
void SingleCellSimulationViewGraphPanelsWidget::removeGraphPanel()
{
    if (count() == 1)
        // There is only one graph panel left, so...

        return;

    // Remove the current graph panel

    for (int i = 0, iMax = count(); i < iMax; ++i) {
        SingleCellSimulationViewGraphPanelWidget *graphPanel = qobject_cast<SingleCellSimulationViewGraphPanelWidget *>(widget(i));

        if (graphPanel->isActive()) {
            // We are dealing with the currently active graph panel, so remove
            // it

            graphPanel->hide();

            delete graphPanel;

            // Activate the next graph panel or the last one available, if any

            if (i < count())
                // There is a next graph panel, so activate it

                qobject_cast<SingleCellSimulationViewGraphPanelWidget *>(widget(i))->setActive(true);
            else
                // We were dealing with the last graph panel, so just activate
                // the new last graph panel

                qobject_cast<SingleCellSimulationViewGraphPanelWidget *>(widget(count()-1))->setActive(true);

            // We are all done, so...

            break;
        }
    }

    // Keep track of our new sizes

    splitterMoved();

    // Let people know that we have removed a graph panel

    emit grapPanelRemoved();

    // Let people know whether graph panels can be removed

    emit removeGraphPanelsEnabled(count() > 1);
}
SingleCellSimulationViewGraphPanelWidget * SingleCellSimulationViewGraphPanelsWidget::addGraphPanel()
{
    // Keep track of the graph panels' original size

    QList<int> origSizes = sizes();

    // Create a new graph panel

    SingleCellSimulationViewGraphPanelWidget *res = new SingleCellSimulationViewGraphPanelWidget(this);

    // Add the graph panel to ourselves

    addWidget(res);

    // Resize the graph panels, thus making sure that their size is what it
    // should be (see issue #58)

    double scalingFactor = double(count()-1)/count();

    for (int i = 0, iMax = origSizes.count(); i < iMax; ++i)
        origSizes[i] *= scalingFactor;

    setSizes(origSizes << height()/count());

    // Create a connection to keep track of whenever the graph panel gets
    // activated

    connect(res, SIGNAL(activated(SingleCellSimulationViewGraphPanelWidget *)),
            this, SLOT(graphPanelActivated(SingleCellSimulationViewGraphPanelWidget *)));

    // Activate the graph panel

    res->setActive(true);

    // Keep track of our new sizes

    splitterMoved();

    // Let people know that we have added a graph panel

    emit grapPanelAdded(res);

    // Let people know whether graph panels can be removed

    emit removeGraphPanelsEnabled(count() > 1);

    // Return our newly created graph panel

    return res;
}
예제 #4
0
파일: qsplitter.cpp 프로젝트: Fale/qtmoko
/*!
    Moves the left or top edge of the splitter handle at \a index as
    close as possible to position \a pos, which is the distance from the
    left or top edge of the widget.

    For right-to-left languages such as Arabic and Hebrew, the layout
    of horizontal splitters is reversed. \a pos is then the distance
    from the right edge of the widget.

    \sa splitterMoved(), closestLegalPosition(), getRange()
*/
void QSplitter::moveSplitter(int pos, int index)
{
    Q_D(QSplitter);
    QSplitterLayoutStruct *s = d->list.at(index);
    int farMin;
    int min;
    int max;
    int farMax;

#ifdef QSPLITTER_DEBUG
    int debugp = pos;
#endif

    pos = d->adjustPos(pos, index, &farMin, &min, &max, &farMax);
    int oldP = d->pick(s->rect.topLeft());
#ifdef QSPLITTER_DEBUG
    qDebug() << "QSplitter::moveSplitter" << debugp << index << "adjusted" << pos << "oldP" << oldP;
#endif

    QVarLengthArray<int, 32> poss(d->list.count());
    QVarLengthArray<int, 32> ws(d->list.count());
    bool upLeft;

    d->doMove(false, pos, index, +1, (d->collapsible(s) && (pos > max)), poss.data(), ws.data());
    d->doMove(true, pos, index - 1, +1, (d->collapsible(index - 1) && (pos < min)), poss.data(), ws.data());
    upLeft = (pos < oldP);

    int wid, delta, count = d->list.count();
    if (upLeft) {
        wid = 0;
        delta = 1;
    } else {
        wid = count - 1;
        delta = -1;
    }
    for (; wid >= 0 && wid < count; wid += delta) {
        QSplitterLayoutStruct *sls = d->list.at( wid );
        if (!sls->widget->isHidden())
            d->setGeo(sls, poss[wid], ws[wid], true);
    }
    d->storeSizes();

    emit splitterMoved(pos, index);
}
예제 #5
0
int dUserWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: searchWidgetUpdate(); break;
        case 1: closed(); break;
        case 2: minimized(); break;
        case 3: show(); break;
        case 4: viewBarToggled(*reinterpret_cast< bool*>(_a[1])); break;
        case 5: viewIconToggled(*reinterpret_cast< bool*>(_a[1])); break;
        case 6: viewListToggled(*reinterpret_cast< bool*>(_a[1])); break;
        case 7: viewTableToggled(*reinterpret_cast< bool*>(_a[1])); break;
        case 8: refreshTriggered(*reinterpret_cast< bool*>(_a[1])); break;
        case 9: refreshTriggered(); break;
        case 10: refreshInfoTriggered(*reinterpret_cast< bool*>(_a[1])); break;
        case 11: refreshInfoTriggered(); break;
        case 12: userInfoTriggered(*reinterpret_cast< bool*>(_a[1])); break;
        case 13: userInfoTriggered(); break;
        case 14: sendBeepTriggered(*reinterpret_cast< bool*>(_a[1])); break;
        case 15: sendBeepTriggered(); break;
        case 16: sendMessageTriggered(*reinterpret_cast< bool*>(_a[1])); break;
        case 17: sendMessageTriggered(); break;
        case 18: sendMassTriggered(*reinterpret_cast< bool*>(_a[1])); break;
        case 19: sendMassTriggered(); break;
        case 20: sendPersonalMassTriggered(*reinterpret_cast< bool*>(_a[1])); break;
        case 21: sendPersonalMassTriggered(); break;
        case 22: customContextMenuRequested(*reinterpret_cast< QPoint*>(_a[1])); break;
        case 23: searchTextChanged(*reinterpret_cast< QString*>(_a[1])); break;
        case 24: countUserChange(*reinterpret_cast< int*>(_a[1])); break;
        case 25: splitterMoved(*reinterpret_cast< int*>(_a[1]),*reinterpret_cast< int*>(_a[2])); break;
        case 26: tableHeaderResize(*reinterpret_cast< int*>(_a[1]),*reinterpret_cast< int*>(_a[2]),*reinterpret_cast< int*>(_a[3])); break;
        case 27: itemDoubleClicked(*reinterpret_cast< QModelIndex*>(_a[1])); break;
        }
        _id -= 28;
    }
    return _id;
}
예제 #6
0
int dMessageEditor::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: clickedSendButton(); break;
        case 1: splitterMoved(*(int*)_a[1],*(int*)_a[2]); break;
        case 2: textBold(); break;
        case 3: textUnderline(); break;
        case 4: textItalic(); break;
        case 5: textAlign(*(QAction**)_a[1]); break;
        case 6: textFamily(*(QString*)_a[1]); break;
        case 7: textSize(*(QString*)_a[1]); break;
        case 8: textColor(); break;
        case 9: saveMessage(); break;
        }
        _id -= 10;
    }
    return _id;
}
예제 #7
0
void CellmlAnnotationViewMetadataDetailsWidget::emitSplitterMoved()
{
    // Let people know that our splitter has been moved

    emit splitterMoved(mSplitter->sizes());
}
void CellmlAnnotationViewWidget::emitSplitterMoved()
{
    // Let people know that our splitter has been moved

    emit splitterMoved(sizes());
}
예제 #9
0
void
GcSplitter::subSplitterMoved(int pos, int index)
{
   saveSettings();
   emit splitterMoved(pos, index);
}
예제 #10
0
void QtChatWindow::handleSplitterMoved(int, int) {
	emit splitterMoved();
}