summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/QtViewHistoryWindow.cpp12
-rw-r--r--Swift/QtUI/QtViewHistoryWindow.ui23
2 files changed, 16 insertions, 19 deletions
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 <ChatSnippet>(new MessageSnippet(*htmlString, *htmlString, B2QDATE(time), P2QSTRING(path), true, false, theme, P2QSTRING(id))));
messageLog_->addMessage(boost::shared_ptr <ChatSnippet>(new MessageSnippet(*htmlString, *htmlString, B2QDATE(time), P2QSTRING(path), true, false, theme, P2QSTRING(id))));
messageLog_->addMessage(boost::shared_ptr <ChatSnippet>(new MessageSnippet(*htmlString, *htmlString, B2QDATE(time), P2QSTRING(path), true, false, theme, P2QSTRING(id))));
messageLog_->addMessage(boost::shared_ptr <ChatSnippet>(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 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
- <widget class="QWidget" name="chatView_" native="true"/>
- </item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
+ <layout class="QVBoxLayout" name="chatView_">
+ <property name="leftMargin">
+ <number>0</number>
</property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
+ <property name="rightMargin">
+ <number>0</number>
</property>
- </spacer>
+ </layout>
</item>
<item>
<widget class="QTreeView" name="userHistory_">
<property name="maximumSize">
<size>
- <width>350</width>
+ <width>400</width>
<height>800</height>
</size>
</property>
+ <attribute name="headerDefaultSectionSize">
+ <number>100</number>
+ </attribute>
</widget>
</item>
</layout>