little layout changes, to not stretch the labels

display the comments on right side of the PhotoDialog

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5661 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2012-10-10 15:53:59 +00:00
parent b5cadf357b
commit 87856b2c9e
5 changed files with 205 additions and 204 deletions

View File

@ -91,6 +91,19 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>

View File

@ -6,14 +6,17 @@
<rect>
<x>0</x>
<y>0</y>
<width>411</width>
<height>84</height>
<width>392</width>
<height>63</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QFrame" name="expandFrame">
<property name="sizePolicy">

View File

@ -13,7 +13,7 @@ PhotoDialog::PhotoDialog(RsPhotoV2 *rs_photo, const RsPhotoPhoto &photo, QWidget
{
ui->setupUi(this);
setAttribute ( Qt::WA_DeleteOnClose, true );
connect(ui->toolButton_AddComment, SIGNAL(clicked()), this, SLOT(addComment()));
connect(ui->toolButton_AddComment, SIGNAL(clicked()), this, SLOT(createComment()));
setUp();
}
@ -31,7 +31,7 @@ void PhotoDialog::setUp()
ui->label_Photo->setPixmap(qtn);
ui->lineEdit_Title->setText(QString::fromStdString(mPhotoDetails.mMeta.mMsgName));
ui->scrollAreaWidgetContents->setLayout(new QVBoxLayout());
//ui->scrollAreaWidgetContents->setLayout(new QVBoxLayout());
requestComments();
}
@ -49,12 +49,12 @@ void PhotoDialog::addComment()
void PhotoDialog::clearComments()
{
QLayout* l = ui->scrollAreaWidgetContents->layout();
//QLayout* l = ui->scrollAreaWidgetContents->layout();
QSetIterator<PhotoCommentItem*> sit(mComments);
while(sit.hasNext())
{
PhotoCommentItem* item = sit.next();
l->removeWidget(item);
ui->verticalLayout->removeWidget(item);
item->setParent(NULL);
delete item;
}
@ -65,11 +65,11 @@ void PhotoDialog::clearComments()
void PhotoDialog::resetComments()
{
QSetIterator<PhotoCommentItem*> sit(mComments);
QLayout* l = ui->scrollAreaWidgetContents->layout();
//QLayout* l = ui->scrollAreaWidgetContents->layout();
while(sit.hasNext())
{
PhotoCommentItem* item = sit.next();
l->addWidget(item);
ui->verticalLayout->insertWidget(0,item);
}
}
@ -90,10 +90,8 @@ void PhotoDialog::requestComments()
void PhotoDialog::createComment()
{
if(mCommentDialog)
{
RsPhotoComment comment;
QString commentString = mCommentDialog->getComment();
QString commentString = ui->lineEdit->text();
comment.mComment = commentString.toStdString();
@ -102,11 +100,8 @@ void PhotoDialog::createComment()
comment.mMeta.mParentId = mPhotoDetails.mMeta.mOrigMsgId;
mRsPhoto->submitComment(token, comment);
mPhotoQueue->queueRequest(token, TOKENREQ_MSGINFO, RS_TOKREQ_ANSTYPE_ACK, 0);
mCommentDialog->close();
delete mCommentDialog;
mCommentDialog = NULL;
}
ui->lineEdit->clear();
}

View File

@ -6,196 +6,56 @@
<rect>
<x>0</x>
<y>0</y>
<width>516</width>
<height>460</height>
<width>615</width>
<height>566</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QGroupBox" name="albumGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Photo</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_Photo">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>300</height>
</size>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>200</height>
</size>
</property>
<property name="title">
<string>Summary</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_Title">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Caption</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_Caption">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Where:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_Where">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEdit_When">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Photo Title:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>When</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QGroupBox" name="albumGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Photo</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_Photo">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>300</height>
</size>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButton_AddComment">
<property name="text">
<string>Add Comment</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<item row="0" column="1" rowspan="2" colspan="2">
<widget class="QScrollArea" name="scrollArea">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
@ -204,13 +64,131 @@
<rect>
<x>0</x>
<y>0</y>
<width>496</width>
<height>69</height>
<width>325</width>
<height>18</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout"/>
</widget>
</widget>
</item>
<item row="1" column="0" rowspan="2">
<widget class="QGroupBox" name="groupBox_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>Summary</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_Title">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Caption</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_Caption">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Where:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_Where">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEdit_When">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Photo Title:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>When</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit"/>
</item>
<item row="2" column="2">
<widget class="QToolButton" name="toolButton_AddComment">
<property name="text">
<string>Comment</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>253</width>
<height>222</height>
<height>233</height>
</rect>
</property>
<property name="windowTitle">
@ -79,8 +79,7 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_PhotoGrapher">
</widget>
<widget class="QLineEdit" name="lineEdit_PhotoGrapher"/>
</item>
</layout>
</item>
@ -88,6 +87,19 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>