Re: [Interest] Build a Photos(Mac) copy with Qt Widgets

2016-01-20 Thread Hualet Wang
Hi Mironchik, your example is very helpful. It seems that QListView is just
what I want. I'll take a deeper loop at it. Thank you.

2016-01-20 23:36 GMT+08:00 Igor Mironchik :

> Just to clarification.
>
> Don't forget to setWrapping( true ) on QListView. With such settings list
> view will be displayed as table. And you can play with scroll bars...
>
> On 20.01.2016 17:52, Hualet Wang wrote:
>
>> Really ? That’s quite good enough for me if it’s true. Thank you for you
>> suggestion, I’ll check
>> it out. :D
>>
>> 在 2016年1月20日,下午10:48,Igor Mironchik  写道:
>>>
>>> Hi,
>>>
>>> On 20.01.2016 17:09, Hualet Wang wrote:
>>>
 And one more, what about QTableWidget with icons? And why you decided
> that QTableView will not do the trick?
>
 Because I’m not sure if QTableView is capable of re-layouting the items
 after I delete one or more cells from it. And that’s the whole point of my
 question.

>>> Even more: you can use QListView with flow QListView::LeftToRight with
>>> resizeMode QListView::Adjust and proper delegate... And you are happy.
>>> Items will relayout automatically... And will be placed in the table...
>>>
>>> And QtMWidgets is for touch-devices...
>
 I’m not targeting touch devices. The application will run on Linux.

>>>
>


-- 
-- Hualet
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Build a Photos(Mac) copy with Qt Widgets

2016-01-20 Thread Hualet Wang
Really ? That’s quite good enough for me if it’s true. Thank you for you 
suggestion, I’ll check 
it out. :D

> 在 2016年1月20日,下午10:48,Igor Mironchik  写道:
> 
> Hi,
> 
> On 20.01.2016 17:09, Hualet Wang wrote:
>>> And one more, what about QTableWidget with icons? And why you decided that 
>>> QTableView will not do the trick?
>> Because I’m not sure if QTableView is capable of re-layouting the items 
>> after I delete one or more cells from it. And that’s the whole point of my 
>> question.
> 
> Even more: you can use QListView with flow QListView::LeftToRight with 
> resizeMode QListView::Adjust and proper delegate... And you are happy. Items 
> will relayout automatically... And will be placed in the table...
> 
>> 
>>> And QtMWidgets is for touch-devices...
>> I’m not targeting touch devices. The application will run on Linux.
> 

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Build a Photos(Mac) copy with Qt Widgets

2016-01-20 Thread Igor Mironchik

Just to clarification.

Don't forget to setWrapping( true ) on QListView. With such settings 
list view will be displayed as table. And you can play with scroll bars...


On 20.01.2016 17:52, Hualet Wang wrote:

Really ? That’s quite good enough for me if it’s true. Thank you for you 
suggestion, I’ll check
it out. :D


在 2016年1月20日,下午10:48,Igor Mironchik  写道:

Hi,

On 20.01.2016 17:09, Hualet Wang wrote:

And one more, what about QTableWidget with icons? And why you decided that 
QTableView will not do the trick?

Because I’m not sure if QTableView is capable of re-layouting the items after I 
delete one or more cells from it. And that’s the whole point of my question.

Even more: you can use QListView with flow QListView::LeftToRight with 
resizeMode QListView::Adjust and proper delegate... And you are happy. Items 
will relayout automatically... And will be placed in the table...


And QtMWidgets is for touch-devices...

I’m not targeting touch devices. The application will run on Linux.


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Build a Photos(Mac) copy with Qt Widgets

2016-01-20 Thread Igor Mironchik

Look at this example:


#include 
#include 
#include 
#include 
#include 


class Delegate
:public QStyledItemDelegate
{
public:
Delegate()
{
}

void paint( QPainter * painter, const QStyleOptionViewItem & option,
const QModelIndex & index ) const
{
painter->drawText( option.rect, index.data().toString() );
}

QSize sizeHint( const QStyleOptionViewItem &,
const QModelIndex &) const
{
return QSize( 50, 50 );
}
};


int main( int argc, char ** argv )
{
QApplication app( argc, argv );

QListView view;
view.setFlow( QListView::LeftToRight );
view.setResizeMode( QListView::Adjust );
view.setWrapping( true );

Delegate delegate;
view.setItemDelegate(  );


QStringListModel model;
QStringList items;

for( int i = 0; i < 100; ++i )
items.append( QString::number( i ) );

model.setStringList( items );

view.setModel(  );

view.show();

return app.exec();
}


On 20.01.2016 17:52, Hualet Wang wrote:

Really ? That’s quite good enough for me if it’s true. Thank you for you 
suggestion, I’ll check
it out. :D


在 2016年1月20日,下午10:48,Igor Mironchik  写道:

Hi,

On 20.01.2016 17:09, Hualet Wang wrote:

And one more, what about QTableWidget with icons? And why you decided that 
QTableView will not do the trick?

Because I’m not sure if QTableView is capable of re-layouting the items after I 
delete one or more cells from it. And that’s the whole point of my question.

Even more: you can use QListView with flow QListView::LeftToRight with 
resizeMode QListView::Adjust and proper delegate... And you are happy. Items 
will relayout automatically... And will be placed in the table...


And QtMWidgets is for touch-devices...

I’m not targeting touch devices. The application will run on Linux.


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Build a Photos(Mac) copy with Qt Widgets

2016-01-20 Thread Igor Mironchik

Hi,

sorry for noise, forgot to write to the list...


#include 
#include 
#include 
#include 
#include 


class Delegate
:public QStyledItemDelegate
{
public:
Delegate()
{
}

void paint( QPainter * painter, const QStyleOptionViewItem & option,
const QModelIndex & index ) const
{
painter->drawText( option.rect, index.data().toString() );
}

QSize sizeHint( const QStyleOptionViewItem &,
const QModelIndex &) const
{
return QSize( 50, 50 );
}
};


int main( int argc, char ** argv )
{
QApplication app( argc, argv );

QListView view;
view.setFlow( QListView::LeftToRight );
view.setResizeMode( QListView::Adjust );
view.setWrapping( true );

Delegate delegate;
view.setItemDelegate(  );


QStringListModel model;
QStringList items;

for( int i = 0; i < 100; ++i )
items.append( QString::number( i ) );

model.setStringList( items );

view.setModel(  );

view.show();

return app.exec();
}


On 20.01.2016 17:52, Hualet Wang wrote:

Really ? That’s quite good enough for me if it’s true. Thank you for you 
suggestion, I’ll check
it out. :D


在 2016年1月20日,下午10:48,Igor Mironchik  写道:

Hi,

On 20.01.2016 17:09, Hualet Wang wrote:

And one more, what about QTableWidget with icons? And why you decided that 
QTableView will not do the trick?

Because I’m not sure if QTableView is capable of re-layouting the items after I 
delete one or more cells from it. And that’s the whole point of my question.

Even more: you can use QListView with flow QListView::LeftToRight with 
resizeMode QListView::Adjust and proper delegate... And you are happy. Items 
will relayout automatically... And will be placed in the table...


And QtMWidgets is for touch-devices...

I’m not targeting touch devices. The application will run on Linux.


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Build a Photos(Mac) copy with Qt Widgets

2016-01-20 Thread Igor Mironchik



On 20.01.2016 17:09, Hualet Wang wrote:
And one more, what about QTableWidget with icons? And why you decided 
that QTableView will not do the trick?
Because I’m not sure if QTableView is capable of re-layouting the 
items after I delete one or more cells from it. And that’s the whole 
point of my question.


It's doing this. You can write simple app to check it.




And QtMWidgets is for touch-devices...

I’m not targeting touch devices. The application will run on Linux.


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Build a Photos(Mac) copy with Qt Widgets

2016-01-20 Thread Igor Mironchik

Hi,

On 20.01.2016 17:09, Hualet Wang wrote:
And one more, what about QTableWidget with icons? And why you decided 
that QTableView will not do the trick?
Because I’m not sure if QTableView is capable of re-layouting the 
items after I delete one or more cells from it. And that’s the whole 
point of my question.


Even more: you can use QListView with flow QListView::LeftToRight with 
resizeMode QListView::Adjust and proper delegate... And you are happy. 
Items will relayout automatically... And will be placed in the table...





And QtMWidgets is for touch-devices...

I’m not targeting touch devices. The application will run on Linux.


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Build a Photos(Mac) copy with Qt Widgets

2016-01-20 Thread Hualet Wang
> And one more, what about QTableWidget with icons? And why you decided 
> that QTableView will not do the trick?

Because I’m not sure if QTableView is capable of re-layouting the items after I 
delete one or more cells from it. And that’s the whole point of my question.

> And QtMWidgets is for touch-devices...
I’m not targeting touch devices. The application will run on Linux.___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Build a Photos(Mac) copy with Qt Widgets

2016-01-19 Thread Hualet Wang
Hi friends.

I’m trying to build a Photos like application with Qt Widgets. The main view 
should be able to display the photos, delete items on demand. I’m not sure if 
QTableView is sufficient to accomplish the task. Any ideas or any suggested 
project that I can refer to ?
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Build a Photos(Mac) copy with Qt Widgets

2016-01-19 Thread Igor Mironchik

Hello,

On 19.01.2016 17:47, Hualet Wang wrote:

Hi friends.

I’m trying to build a Photos like application with Qt Widgets. The main view 
should be able to display the photos, delete items on demand. I’m not sure if 
QTableView is sufficient to accomplish the task. Any ideas or any suggested 
project that I can refer to ?


You can do this with QtMWidgets, specifically with AbstractListView.

For example look at this screen-shot:

https://imironchik.blogspot.com/2015/01/qtmwidgetsabstractlistview.html

QtMWidgets you can find here:

https://github.com/igormironchik/qtmwidgets

As I understood you need some kind of table, at this time table is not 
implemented in QtMWidgets, but you can do stuff with list where row will 
display more than one image.


If you are interested I can implement AbstractTableView like 
AbstractListView, I don't think that will take much time from me...

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Build a Photos(Mac) copy with Qt Widgets

2016-01-19 Thread Igor Mironchik



On 19.01.2016 17:47, Hualet Wang wrote:

Hi friends.

I’m trying to build a Photos like application with Qt Widgets. The main view 
should be able to display the photos, delete items on demand. I’m not sure if 
QTableView is sufficient to accomplish the task. Any ideas or any suggested 
project that I can refer to ?


And one more, what about QTableWidget with icons? And why you decided 
that QTableView will not do the trick? I don't have Mac, so I don't know 
what are you talking about exactly...


And QtMWidgets is for touch-devices...


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest