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> </item>
</layout> </layout>
</item> </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> </layout>
</widget> </widget>
</item> </item>

View File

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

View File

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

View File

@ -6,196 +6,56 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>516</width> <width>615</width>
<height>460</height> <height>566</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Dialog</string> <string>Dialog</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QGridLayout" name="gridLayout_2">
<item> <item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4"> <widget class="QGroupBox" name="albumGroup">
<item> <property name="sizePolicy">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<item> <horstretch>0</horstretch>
<widget class="QGroupBox" name="albumGroup"> <verstretch>1</verstretch>
<property name="sizePolicy"> </sizepolicy>
<sizepolicy hsizetype="Maximum" vsizetype="Minimum"> </property>
<horstretch>0</horstretch> <property name="title">
<verstretch>1</verstretch> <string>Photo</string>
</sizepolicy> </property>
</property> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="title"> <item>
<string>Photo</string> <widget class="QLabel" name="label_Photo">
</property> <property name="sizePolicy">
<layout class="QVBoxLayout" name="verticalLayout_2"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<item> <horstretch>0</horstretch>
<widget class="QLabel" name="label_Photo"> <verstretch>0</verstretch>
<property name="sizePolicy"> </sizepolicy>
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> </property>
<horstretch>0</horstretch> <property name="minimumSize">
<verstretch>0</verstretch> <size>
</sizepolicy> <width>200</width>
</property> <height>300</height>
<property name="minimumSize"> </size>
<size> </property>
<width>200</width> <property name="text">
<height>300</height> <string>TextLabel</string>
</size> </property>
</property> </widget>
<property name="text"> </item>
<string>TextLabel</string> </layout>
</property> </widget>
</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>
</item> </item>
<item> <item row="0" column="1" rowspan="2" colspan="2">
<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>
<widget class="QScrollArea" name="scrollArea"> <widget class="QScrollArea" name="scrollArea">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -204,13 +64,131 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>496</width> <width>325</width>
<height>69</height> <height>18</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout"/>
</widget> </widget>
</widget> </widget>
</item> </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> </layout>
</widget> </widget>
<resources/> <resources/>

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>253</width> <width>253</width>
<height>222</height> <height>233</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -79,8 +79,7 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="lineEdit_PhotoGrapher"> <widget class="QLineEdit" name="lineEdit_PhotoGrapher"/>
</widget>
</item> </item>
</layout> </layout>
</item> </item>
@ -88,6 +87,19 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</item> </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> </layout>
</widget> </widget>
</item> </item>