diff --git a/cmainwindow.ui b/cmainwindow.ui index 5529465..d16e368 100644 --- a/cmainwindow.ui +++ b/cmainwindow.ui @@ -35,8 +35,8 @@ 0 0 - 89 - 460 + 147 + 477 @@ -57,7 +57,7 @@ 0 0 - 79 + 147 477 @@ -70,7 +70,7 @@ 0 0 - 79 + 147 477 @@ -83,7 +83,7 @@ 0 0 - 79 + 147 477 diff --git a/cstorybook.cpp b/cstorybook.cpp index 0667a7a..36d0ee5 100644 --- a/cstorybook.cpp +++ b/cstorybook.cpp @@ -8,12 +8,15 @@ #include #include +#include #include #include #include +#include + cStoryBook::cStoryBook(const QString &szProjectPath) : m_szProjectPath(szProjectPath), @@ -358,9 +361,13 @@ bool cStoryBook::fillOutlineList(QTreeView* lpView) lpModel->clear(); - QStringList headerLabels = QStringList() << tr("") << tr(""); + QStringList headerLabels = QStringList() << tr("name") << tr("state"); lpModel->setHorizontalHeaderLabels(headerLabels); + lpView->header()->setStretchLastSection(false); + lpView->header()->setSectionResizeMode(0, QHeaderView::Stretch); + lpView->header()->setSectionResizeMode(1, QHeaderView::Interactive); + fontPart.setBold(true); fontChapter.setItalic(true); @@ -371,10 +378,11 @@ bool cStoryBook::fillOutlineList(QTreeView* lpView) lpItem->setData(QVariant::fromValue(lpPart)); lpItem->setFont(fontPart); lpItem->setBackground(QBrush(background)); + lpItem->setToolTip(lpPart->description()); part.insert(lpPart->id(), lpItem); lpModel->appendRow(lpItem); - qint16 z = lpRootItem->rowCount(); lpView->setFirstColumnSpanned(lpModel->rowCount()-1, lpRootItem->index(), true); + QThread::msleep(50); } for(int x = 0;x < m_chapterList.count();x++) @@ -389,32 +397,39 @@ bool cStoryBook::fillOutlineList(QTreeView* lpView) lpItem->setFont(fontChapter); lpItem->setForeground(QBrush(Qt::darkBlue)); lpItem->setBackground(QBrush(background)); + lpItem->setToolTip(lpChapter->description()); chapter.insert(lpChapter->id(), lpItem); lpRoot->appendRow(lpItem); lpView->setFirstColumnSpanned(lpRoot->rowCount()-1, lpRoot->index(), true); + QThread::msleep(50); } } for(int x = 0;x < m_sceneList.count();x++) { - cScene* lpScene = m_sceneList.at(x); - QStandardItem* lpRoot = chapter.value(lpScene->chapter()->id()); + cScene* lpScene = m_sceneList.at(x); + QStandardItem* lpChapterItem = chapter.value(lpScene->chapter()->id()); - if(lpRoot) + if(lpChapterItem) { QList lpItems; lpItems << new QStandardItem(lpScene->name()); + lpItems << new QStandardItem(lpScene->stateText()); + lpItems[0]->setData(QVariant::fromValue(lpScene)); lpItems[0]->setFont(fontScene); lpItems[0]->setForeground(QBrush(Qt::blue)); + lpItems[0]->setToolTip(lpScene->description()); - lpItems << new QStandardItem(lpScene->stateText()); lpItems[1]->setData(QVariant::fromValue(lpScene)); lpItems[1]->setBackground(QBrush(lpScene->stateColor())); lpItems[1]->setTextAlignment(Qt::AlignCenter); - lpRoot->appendRow(lpItems); + lpItems[1]->setToolTip(lpScene->description()); + + lpChapterItem->appendRow(lpItems); } + QThread::msleep(50); } return(true);