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);
}
}
@ -89,11 +89,9 @@ void PhotoDialog::requestComments()
}
void PhotoDialog::createComment()
{
if(mCommentDialog)
{
RsPhotoComment comment;
QString commentString = mCommentDialog->getComment();
QString commentString = ui->lineEdit->text();
comment.mComment = commentString.toStdString();
@ -103,10 +101,7 @@ void PhotoDialog::createComment()
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,22 +6,18 @@
<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>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QGroupBox" name="albumGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Minimum">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
@ -52,10 +48,40 @@
</layout>
</widget>
</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>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<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="MinimumExpanding" vsizetype="Preferred">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -63,7 +89,7 @@
<property name="minimumSize">
<size>
<width>50</width>
<height>200</height>
<height>0</height>
</size>
</property>
<property name="title">
@ -153,64 +179,16 @@
</layout>
</widget>
</item>
</layout>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit"/>
</item>
</layout>
</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>
<item row="2" column="2">
<widget class="QToolButton" name="toolButton_AddComment">
<property name="text">
<string>Add Comment</string>
<string>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>
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>496</width>
<height>69</height>
</rect>
</property>
</widget>
</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>