display content in post widgets. Sizes still to fix up

This commit is contained in:
csoler 2020-07-04 15:58:16 +02:00
parent e676f83ab3
commit b453f80cbd
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
5 changed files with 877 additions and 1006 deletions

View file

@ -47,6 +47,9 @@ BoardPostDisplayWidget::BoardPostDisplayWidget(const RsPostedPost& post,QWidget
: QWidget(parent),ui(new Ui::BoardPostDisplayWidget()),mPost(post) : QWidget(parent),ui(new Ui::BoardPostDisplayWidget()),mPost(post)
{ {
ui->setupUi(this); ui->setupUi(this);
setup();
fill();
} }
void BoardPostDisplayWidget::setCommentsSize(int comNb) void BoardPostDisplayWidget::setCommentsSize(int comNb)
@ -99,9 +102,9 @@ void BoardPostDisplayWidget::setReadStatus(bool isNew, bool isUnread)
ui->newLabel->setVisible(isNew); ui->newLabel->setVisible(isNew);
ui->mainFrame->setProperty("new", isNew); // ui->mainFrame->setProperty("new", isNew);
ui->mainFrame->style()->unpolish(ui->mainFrame); // ui->mainFrame->style()->unpolish(ui->mainFrame);
ui->mainFrame->style()->polish( ui->mainFrame); // ui->mainFrame->style()->polish( ui->mainFrame);
} }
void BoardPostDisplayWidget::setComment(const RsGxsComment& cmt) {} void BoardPostDisplayWidget::setComment(const RsGxsComment& cmt) {}
@ -150,8 +153,6 @@ void BoardPostDisplayWidget::setup()
ui->readAndClearButton->hide(); ui->readAndClearButton->hide();
} }
void BoardPostDisplayWidget::fill() void BoardPostDisplayWidget::fill()
{ {
RsReputationLevel overall_reputation = rsReputations->overallReputationLevel(mPost.mMeta.mAuthorId); RsReputationLevel overall_reputation = rsReputations->overallReputationLevel(mPost.mMeta.mAuthorId);
@ -161,7 +162,7 @@ void BoardPostDisplayWidget::fill()
ui->commentButton->setDisabled(true); ui->commentButton->setDisabled(true);
ui->voteUpButton->setDisabled(true); ui->voteUpButton->setDisabled(true);
ui->voteDownButton->setDisabled(true); ui->voteDownButton->setDisabled(true);
ui->picture_frame->hide(); // ui->picture_frame->hide();
ui->fromLabel->setId(mPost.mMeta.mAuthorId); ui->fromLabel->setId(mPost.mMeta.mAuthorId);
ui->titleLabel->setText(tr( "<p><font color=\"#ff0000\"><b>The author of this message (with ID %1) is banned.</b>").arg(QString::fromStdString(mPost.mMeta.mAuthorId.toStdString()))) ; ui->titleLabel->setText(tr( "<p><font color=\"#ff0000\"><b>The author of this message (with ID %1) is banned.</b>").arg(QString::fromStdString(mPost.mMeta.mAuthorId.toStdString()))) ;
QDateTime qtime; QDateTime qtime;
@ -243,13 +244,9 @@ void BoardPostDisplayWidget::fill()
} }
} }
else if (mPost.mImage.mData == NULL) else if (mPost.mImage.mData == NULL)
{ ui->pictureLabel->hide();
ui->picture_frame->hide();
}
else else
{ ui->pictureLabel->show();
ui->picture_frame->show();
}
} }
//QString score = "Hot" + QString::number(post.mHotScore); //QString score = "Hot" + QString::number(post.mHotScore);
@ -263,10 +260,8 @@ void BoardPostDisplayWidget::fill()
// FIX THIS UP LATER. // FIX THIS UP LATER.
ui->notes->setText(RsHtml().formatText(NULL, QString::fromUtf8(mPost.mNotes.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS)); ui->notes->setText(RsHtml().formatText(NULL, QString::fromUtf8(mPost.mNotes.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
QTextDocument doc;
doc.setHtml(ui->notes->text());
if(doc.toPlainText().trimmed().isEmpty()) if( ui->notes->document()==nullptr || ui->notes->document()->toPlainText().trimmed().isEmpty())
ui->notes->hide(); ui->notes->hide();
#ifdef TO_REMOVE #ifdef TO_REMOVE

View file

@ -6,502 +6,383 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>614</width> <width>747</width>
<height>182</height> <height>366</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true"/>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin"> <item>
<number>0</number> <layout class="QVBoxLayout" name="verticalLayout">
</property> <item>
<property name="topMargin"> <widget class="QToolButton" name="voteUpButton">
<number>0</number> <property name="sizePolicy">
</property> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<property name="rightMargin"> <horstretch>0</horstretch>
<number>0</number> <verstretch>0</verstretch>
</property> </sizepolicy>
<property name="bottomMargin"> </property>
<number>0</number> <property name="toolTip">
</property> <string>Vote up</string>
<property name="spacing"> </property>
<number>0</number> <property name="text">
</property> <string/>
<item row="0" column="0"> </property>
<widget class="QFrame" name="mainFrame"> <property name="icon">
<property name="sizePolicy"> <iconset resource="Posted_images.qrc">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <normaloff>:/images/up-arrow.png</normaloff>:/images/up-arrow.png</iconset>
<horstretch>0</horstretch> </property>
<verstretch>0</verstretch> <property name="autoRaise">
</sizepolicy> <bool>true</bool>
</property> </property>
<property name="autoFillBackground"> </widget>
<bool>false</bool> </item>
</property> <item>
<property name="frameShape"> <widget class="StyledLabel" name="scoreLabel">
<enum>QFrame::Box</enum> <property name="font">
</property> <font>
<property name="frameShadow"> <pointsize>9</pointsize>
<enum>QFrame::Sunken</enum> </font>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <property name="text">
<property name="leftMargin"> <string>0</string>
<number>0</number> </property>
</property> <property name="alignment">
<property name="topMargin"> <set>Qt::AlignCenter</set>
<number>0</number> </property>
</property> </widget>
<property name="rightMargin"> </item>
<number>0</number> <item>
</property> <widget class="QToolButton" name="voteDownButton">
<property name="bottomMargin"> <property name="sizePolicy">
<number>2</number> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
</property> <horstretch>0</horstretch>
<property name="horizontalSpacing"> <verstretch>0</verstretch>
<number>0</number> </sizepolicy>
</property> </property>
<property name="verticalSpacing"> <property name="minimumSize">
<number>6</number> <size>
</property> <width>0</width>
<item row="1" column="1"> <height>0</height>
<widget class="StyledLabel" name="titleLabel"> </size>
<property name="sizePolicy"> </property>
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding"> <property name="toolTip">
<horstretch>0</horstretch> <string>Vote down</string>
<verstretch>0</verstretch> </property>
</sizepolicy> <property name="styleSheet">
</property> <string notr="true"/>
<property name="font"> </property>
<font> <property name="text">
<family>Arial</family> <string>\/</string>
<pointsize>10</pointsize> </property>
<weight>75</weight> <property name="icon">
<bold>true</bold> <iconset resource="Posted_images.qrc">
</font> <normaloff>:/images/down-arrow.png</normaloff>:/images/down-arrow.png</iconset>
</property> </property>
<property name="text"> <property name="autoRaise">
<string notr="true">This is a very very very very loooooooooooooooonnnnnnnnnnnnnnnnng title don't you think? Yes it is and should wrap around I hope</string> <bool>true</bool>
</property> </property>
<property name="alignment"> </widget>
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> </item>
</property> </layout>
<property name="wordWrap"> </item>
<bool>true</bool> <item>
</property> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="openExternalLinks"> <item>
<bool>true</bool> <layout class="QHBoxLayout" name="horizontalLayout_2">
</property> <property name="spacing">
<property name="textInteractionFlags"> <number>5</number>
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> </property>
</property> <property name="leftMargin">
</widget> <number>0</number>
</item> </property>
<item row="2" column="1"> <property name="rightMargin">
<widget class="QLabel" name="siteLabel"> <number>6</number>
<property name="sizePolicy"> </property>
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <item>
<horstretch>0</horstretch> <widget class="QLabel" name="fromBoldLabel">
<verstretch>0</verstretch> <property name="sizePolicy">
</sizepolicy> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
</property> <horstretch>0</horstretch>
<property name="text"> <verstretch>0</verstretch>
<string notr="true">site</string> </sizepolicy>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>5</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<item>
<widget class="QLabel" name="fromBoldLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Posted by</string>
</property>
</widget>
</item>
<item>
<widget class="GxsIdLabel" name="fromLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">Signed by</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="dateLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">You eyes only</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="readButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Toggle Message Read Status</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/message-state-unread.png</normaloff>:/images/message-state-unread.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="newLabel">
<property name="text">
<string>New</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>70</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="0" column="0" rowspan="6">
<widget class="QFrame" name="voteFrame">
<property name="minimumSize">
<size>
<width>37</width>
<height>0</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property> </property>
<property name="leftMargin"> <property name="font">
<number>3</number> <font>
<weight>50</weight>
<bold>false</bold>
</font>
</property> </property>
<property name="topMargin"> <property name="text">
<number>3</number> <string>Posted by</string>
</property> </property>
<property name="rightMargin"> </widget>
<number>3</number> </item>
<item>
<widget class="GxsIdLabel" name="fromLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="bottomMargin"> <property name="text">
<number>3</number> <string notr="true">Signed by</string>
</property> </property>
<item> <property name="openExternalLinks">
<widget class="QToolButton" name="voteUpButton"> <bool>true</bool>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Vote up</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="Posted_images.qrc">
<normaloff>:/images/up-arrow.png</normaloff>:/images/up-arrow.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="StyledLabel" name="scoreLabel">
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="voteDownButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Vote down</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>\/</string>
</property>
<property name="icon">
<iconset resource="Posted_images.qrc">
<normaloff>:/images/down-arrow.png</normaloff>:/images/down-arrow.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="5" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QToolButton" name="commentButton">
<property name="text">
<string>Comments</string>
</property>
<property name="icon">
<iconset resource="Posted_images.qrc">
<normaloff>:/images/comments.png</normaloff>:/images/comments.png</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="shareButton">
<property name="text">
<string>Share</string>
</property>
<property name="icon">
<iconset resource="Posted_images.qrc">
<normaloff>:/images/share.png</normaloff>:/images/share.png</iconset>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>308</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="readAndClearButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Set as read and remove item</string>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/correct.png</normaloff>:/icons/png/correct.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clearButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Remove Item</string>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/exit2.png</normaloff>:/icons/png/exit2.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="1">
<widget class="QLabel" name="notes">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QFrame" name="picture_frame">
<layout class="QHBoxLayout" name="horizontalPictureLayout">
<property name="leftMargin">
<number>0</number>
</property> </property>
<property name="topMargin"> </widget>
<number>0</number> </item>
<item>
<widget class="QLabel" name="dateLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="rightMargin"> <property name="text">
<number>0</number> <string notr="true">You eyes only</string>
</property> </property>
<property name="bottomMargin"> <property name="openExternalLinks">
<number>0</number> <bool>true</bool>
</property> </property>
<item> </widget>
<widget class="QLabel" name="pictureLabel"> </item>
<property name="text"> <item>
<string>PictureLabel</string> <widget class="QToolButton" name="readButton">
</property> <property name="maximumSize">
<property name="scaledContents"> <size>
<bool>true</bool> <width>24</width>
</property> <height>16777215</height>
</widget> </size>
</item> </property>
<item> <property name="focusPolicy">
<spacer name="horizontalSpacer"> <enum>Qt::NoFocus</enum>
<property name="orientation"> </property>
<enum>Qt::Horizontal</enum> <property name="toolTip">
</property> <string>Toggle Message Read Status</string>
<property name="sizeHint" stdset="0"> </property>
<size> <property name="icon">
<width>268</width> <iconset resource="../images.qrc">
<height>17</height> <normaloff>:/images/message-state-unread.png</normaloff>:/images/message-state-unread.png</iconset>
</size> </property>
</property> <property name="checkable">
</spacer> <bool>true</bool>
</item> </property>
</layout> <property name="checked">
</widget> <bool>false</bool>
</item> </property>
</layout> <property name="autoRaise">
</widget> <bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="newLabel">
<property name="text">
<string>New</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>70</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="StyledLabel" name="titleLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">This is a very very very very loooooooooooooooonnnnnnnnnnnnnnnnng title don't you think? Yes it is and should wrap around I hope</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="siteLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">site</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="pictureLabel">
<property name="text">
<string>PictureLabel</string>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>268</width>
<height>17</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QTextEdit" name="notes"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QToolButton" name="commentButton">
<property name="text">
<string>Comments</string>
</property>
<property name="icon">
<iconset resource="Posted_images.qrc">
<normaloff>:/images/comments.png</normaloff>:/images/comments.png</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="shareButton">
<property name="text">
<string>Share</string>
</property>
<property name="icon">
<iconset resource="Posted_images.qrc">
<normaloff>:/images/share.png</normaloff>:/images/share.png</iconset>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>308</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="readAndClearButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Set as read and remove item</string>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/correct.png</normaloff>:/icons/png/correct.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clearButton">
<property name="maximumSize">
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Remove Item</string>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/exit2.png</normaloff>:/icons/png/exit2.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item> </item>
</layout> </layout>
</widget> </widget>

View file

@ -43,7 +43,7 @@ class PostedPostDelegate: public QAbstractItemDelegate
Q_OBJECT Q_OBJECT
public: public:
PostedPostDelegate(QObject *parent=0) : QAbstractItemDelegate(parent){} PostedPostDelegate(QObject *parent=0) : QAbstractItemDelegate(parent),mCellWidthPix(100){}
virtual ~PostedPostDelegate(){} virtual ~PostedPostDelegate(){}
void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const override; void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const override;
@ -52,6 +52,11 @@ class PostedPostDelegate: public QAbstractItemDelegate
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override; QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
int cellSize(const QFont& font) const; int cellSize(const QFont& font) const;
void setCellWidth(int pix) { mCellWidthPix = pix; }
private:
int mCellWidthPix;
}; };
class PostedListWidgetWithModel: public GxsMessageFrameWidget class PostedListWidgetWithModel: public GxsMessageFrameWidget
@ -118,6 +123,9 @@ private slots:
void postContextMenu(const QPoint&); void postContextMenu(const QPoint&);
void copyMessageLink(); void copyMessageLink();
public slots:
void handlePostsTreeSizeChange(QSize size);
private: private:
void processSettings(bool load); void processSettings(bool load);
int viewMode(); int viewMode();

File diff suppressed because it is too large Load diff

View file

@ -405,7 +405,7 @@ p, li { white-space: pre-wrap; }
</font> </font>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="tab">
<attribute name="title"> <attribute name="title">