int defaultFirstColHandlePos = defaultSettings.value("FirstColumnHandlePos", 80).toInt();
int defaultSecondColHandlePos = defaultSettings.value("SecondColumnHandlePos", 200).toInt();
int defaultFirstColHandlePos = defaultSettings.value("FirstColumnHandlePos", 80).toInt();
int defaultSecondColHandlePos = defaultSettings.value("SecondColumnHandlePos", 200).toInt();
firstColHandlePos = viewSettings.value("FirstColumnHandlePos", defaultFirstColHandlePos).toInt();
secondColHandlePos = viewSettings.value("SecondColumnHandlePos", defaultSecondColHandlePos).toInt();
firstColHandlePos = viewSettings.value("FirstColumnHandlePos", defaultFirstColHandlePos).toInt();
secondColHandlePos = viewSettings.value("SecondColumnHandlePos", defaultSecondColHandlePos).toInt();
- setSceneRect(sceneRect().adjusted(0, h, 0, 0));
+ updateSceneRect(_sceneRect.adjusted(0, h, 0, 0));
- setSceneRect(sceneRect().adjusted(0, 0, 0, h));
+ updateSceneRect(_sceneRect.adjusted(0, 0, 0, h));
- setSceneRect(sceneRect().adjusted(0, h, 0, 0));
+ updateSceneRect(_sceneRect.adjusted(0, h, 0, 0));
- setSceneRect(sceneRect().adjusted(0, 0, 0, -h));
+ updateSceneRect(_sceneRect.adjusted(0, 0, 0, -h));
- qreal oldHeight = sceneRect().height();
- qreal y = sceneRect().y();
+ // clock_t startT = clock();
+ qreal oldHeight = _sceneRect.height();
+ qreal y = _sceneRect.y();
- setSceneRect(QRectF(0, y, width, height));
+ updateSceneRect(QRectF(0, y, width, height));
viewSettings.setValue("FirstColumnHandlePos", firstColHandlePos);
viewSettings.setValue("SecondColumnHandlePos", secondColHandlePos);
viewSettings.setValue("FirstColumnHandlePos", firstColHandlePos);
viewSettings.setValue("SecondColumnHandlePos", secondColHandlePos);
- firstColHandle->setXLimits(0, secondColumnHandleRect().left());
- secondColHandle->setXLimits(firstColumnHandleRect().right(), width() - minContentsWidth);
+ firstColHandle->setXLimits(0, secondColHandle->sceneLeft());
+ secondColHandle->setXLimits(firstColHandle->sceneRight(), width() - minContentsWidth);
void ChatScene::updateSelection(const QPointF &pos) {
// This is somewhat hacky... we look at the contents item that is at the cursor's y position (ignoring x), since
// it has the full height. From this item, we can then determine the row index and hence the ChatLine.
void ChatScene::updateSelection(const QPointF &pos) {
// This is somewhat hacky... we look at the contents item that is at the cursor's y position (ignoring x), since
// it has the full height. From this item, we can then determine the row index and hence the ChatLine.
else if(pos.x() > firstColHandlePos) curColumn = ChatLineModel::SenderColumn;
else curColumn = ChatLineModel::TimestampColumn;
else if(pos.x() > firstColHandlePos) curColumn = ChatLineModel::SenderColumn;
else curColumn = ChatLineModel::TimestampColumn;
int backlogSize = model()->rowCount();
if(isSingleBufferScene() && backlogSize != 0 && _lastBacklogSize + REQUEST_COUNT <= backlogSize) {
QModelIndex msgIdx = model()->index(0, 0);
int backlogSize = model()->rowCount();
if(isSingleBufferScene() && backlogSize != 0 && _lastBacklogSize + REQUEST_COUNT <= backlogSize) {
QModelIndex msgIdx = model()->index(0, 0);