From 4c7bc4e22039f5b6c98eea584ec7103bfe04c155 Mon Sep 17 00:00:00 2001 From: Vlad Voicu Date: Tue, 31 May 2011 22:30:55 +0300 Subject: Added dummy messages that work diff --git a/Swift/QtUI/QtViewHistoryWindow.cpp b/Swift/QtUI/QtViewHistoryWindow.cpp index b862971..e81eabd 100644 --- a/Swift/QtUI/QtViewHistoryWindow.cpp +++ b/Swift/QtUI/QtViewHistoryWindow.cpp @@ -26,12 +26,12 @@ namespace Swift { QtViewHistoryWindow::QtViewHistoryWindow() { ui.setupUi(this); - QStandardItemModel *dummyModel = new QStandardItemModel(1, 1); + QStandardItemModel *dummyModel = new QStandardItemModel(2, 2); QStandardItem *item = new QStandardItem(QString("test row, test column")); + QStandardItem *item2 = new QStandardItem(QString("test row2, test column2")); dummyModel->setItem(0, 0, item); - QTreeView *userHistory = new QTreeView(); - userHistory->setModel(dummyModel); - ui.userHistory_ = userHistory; + dummyModel->setItem(0, 1, item2); + ui.userHistory_->setModel(dummyModel); addDummyMessage(); connect(ui.periodPickerBefore_, SIGNAL(valueChanged(int)), this, SLOT(handleBeforeSliderValueChanged(int))); connect(ui.periodPickerAfter_, SIGNAL(valueChanged(int)), this, SLOT(handleAfterSliderValueChanged(int))); @@ -42,14 +42,14 @@ void QtViewHistoryWindow::addDummyMessage() { QtChatTheme *theme = new QtChatTheme(""); // Where should I get the theme path from? QString *htmlString = new QString("test"); boost::posix_time::ptime time = boost::posix_time::microsec_clock::universal_time(); - QtChatView* messageLog_ = new QtChatView(theme, 0); + QtChatView* messageLog_ = new QtChatView(theme, NULL); std::string id = "test"; std::string path = ""; messageLog_->addMessage(boost::shared_ptr (new MessageSnippet(*htmlString, *htmlString, B2QDATE(time), P2QSTRING(path), true, false, theme, P2QSTRING(id)))); messageLog_->addMessage(boost::shared_ptr (new MessageSnippet(*htmlString, *htmlString, B2QDATE(time), P2QSTRING(path), true, false, theme, P2QSTRING(id)))); messageLog_->addMessage(boost::shared_ptr (new MessageSnippet(*htmlString, *htmlString, B2QDATE(time), P2QSTRING(path), true, false, theme, P2QSTRING(id)))); messageLog_->addMessage(boost::shared_ptr (new MessageSnippet(*htmlString, *htmlString, B2QDATE(time), P2QSTRING(path), true, false, theme, P2QSTRING(id)))); - ui.chatView_ = messageLog_; + ui.chatView_->addWidget(messageLog_); } void QtViewHistoryWindow::show() { diff --git a/Swift/QtUI/QtViewHistoryWindow.ui b/Swift/QtUI/QtViewHistoryWindow.ui index 736776f..e90d03f 100644 --- a/Swift/QtUI/QtViewHistoryWindow.ui +++ b/Swift/QtUI/QtViewHistoryWindow.ui @@ -17,29 +17,26 @@ - - - - - - Qt::Horizontal + + + 0 - - - 40 - 20 - + + 0 - + - 350 + 400 800 + + 100 + -- cgit v0.10.2-6-g49f6