[Interest] qdateedit

2015-10-01 Thread Rene Decartes
hello,

i am using qt5.5 and having problems with same. there are two difficulties:
a) while qDate has a "... range of valid dates is from January 2nd, 4713 BCE, 
to sometime in the year 11 million CE.", qDateEdit setMinimumDate documentation 
say "minimum date must be at least the first day in year 100, otherwise 
setMinimumDate() has no effect." is there a way around this contradiction?

b) when the calendar popup comes up, changing the month via the drop-down has 
no effect. on the other hand, using the "arrow" keys to either side of the 
month will change the month.

this is the code that i am using...

#dfine MINDATE QDate( -99 , 1 , 1 )

eventDateEdit = new QDateEdit( this ) ;
eventLabel = new QLabel( tr( ":" ) ) ;
eventLabel->setBuddy( eventDateEdit ) ;
eventDateEdit->setCalendarPopup( true ) ;
eventDateEdit->setDate( today ) ;
eventDateEdit->setMinimumDate( MINDATE ) ;
eventDateEdit->setDisplayFormat( "  d" ) ;


-- 
rene

There are 10 kinds of people. Those who understand binary code, and those who 
do not.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] qdateedit

2015-10-01 Thread Rene Decartes
thiago,

thanks for your quick response.

being different classes, i understand that. what i am missing is it seems 
intuitive that is qdate is a natural fit for qdateedit data. and from that, i 
would presume that qdateedit would be able to display any valid qdate. it would 
seem i am mistaken. this begs the question as how to enter a date into qdate in 
a convenient way as it would be in qdateedit?

On Thu, 01 Oct 2015 13:13:59 -0700
Thiago Macieira <thiago.macie...@intel.com> wrote:

> On Thursday 01 October 2015 14:56:15 Rene Decartes wrote:
> > hello,
> > 
> > i am using qt5.5 and having problems with same. there are two difficulties:
> > a) while qDate has a "... range of valid dates is from January 2nd, 4713
> > BCE, to sometime in the year 11 million CE.", qDateEdit setMinimumDate
> > documentation say "minimum date must be at least the first day in year 100,
> > otherwise setMinimumDate() has no effect." is there a way around this
> > contradiction?
> 
> There's no contradiction. QDate and QDateEdit are different classes. QDate's 
> range is bigger than QDateEdit's.
> 
> -- 
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
> 


-- 
rd

There are 10 kinds of people. Those who understand binary code, and those who 
do not.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QLineEdit and QTableWidget

2015-07-07 Thread Rene Decartes
tony, alex

i don't think a grid layout would work as i want to have a list (loosely 
worded) of items and a tablewidget seems to be the logical choice.

the goal is to display attributes from a database table which has three 
attributes, key, number, name. i would like to put the number and name from the 
database in a tablewidget based on a sql select by key. my thought is to have a 
lineedit for each entry. each lineedit would in turn would be placed in a 
tablewidgetitem. the tablewidget would have a single column. there would be a 
final empty tablewidgetitem as the last row in the tablewidget to allow for 
adding an additional name to the database table. after a new name is entered in 
the last item, a signal would cause another empty item/row to be created. the 
salient point is that the last item should use sqltablemodel, tableview and 
completer to allow the user to select a name from a list of names (and numbers) 
in a separate database table. all tablewidgetitems should use the same 
model/view/completer scheme.

the model/view/completer code in the prior post is how i would implement the 
model/view/completer for a lineedit in each tablewidgetitem.

my question is should i be using a custom itemdelegate and custom 
tablewidgetitem as used in the qt spreadsheet example. would the lineedit be 
coded in the custom tablewidgetitem?
-- 
thanks
allen

There are 10 kinds of people. Those who understand binary code, and those who 
do not.

On Tue, 7 Jul 2015 13:45:36 +0200
Alejandro Exojo s...@badopi.org wrote:

 El Tuesday 07 July 2015, Rene Decartes escribió:
  but it is turning out to be convoluted (for me!) am i approaching this
  correctly?
 
 I'm not fully sure I undestand what you want, but, could it be that what you 
 want is a grid layout instead?
 
 -- 
 Alex (a.k.a. suy) | GPG ID 0x0B8B0BC2
 http://barnacity.net/ | http://disperso.net

On Wed, 8 Jul 2015 01:03:52 +1000
Tony Rietwyk t...@rightsoft.com.au wrote:

 Hi allen, 
 
  what i really want is to be able to
  attach multiple persons rather a single one with each item in the (say,
  household) widget. so i thought to use a single column table widget and
  follow the spreadsheet example to create the table, delegate and item
  widgets putting the above line edit each item widget.
 
 I'm confused by your last line.  Do you want separate line edits to appear
 on each row (create each and use view.setItemWidget), or just the current
 row (delegate should be doing this already?), or hovering over the previous
 to current row? 
 
 But the start of your requirement sounds more like a combo box that
 automatically adds items.  So instead of the delegate creating an edit box
 on the current string item, it creates a combo box instead and the item's
 value is a string list of people? 
 
 Hope that helps, 
 
 Tony
 
 
  -Original Message-
  From: interest-bounces+tony=rightsoft.com...@qt-project.org
  [mailto:interest-bounces+tony=rightsoft.com...@qt-project.org] On Behalf
  Of Rene Decartes
  Sent: Tuesday, 7 July 2015 12:41 PM
  To: interest@qt-project.org
  Subject: [Interest] QLineEdit and QTableWidget
  
  hello,
  
  i rather green at using qt. jumping right in, i had a qlineedit on a
 widget that is
  basically coded as:
  
  People::createPersonEdit()
  {
  personEdit = new QLineEdit ;
  personLabel = new QLabel( tr( Person: ) ) ;
  personLabel-setBuddy( personEdit ) ;
  
  personModel = new QSqlQueryModel( this ) ;
  personModel-setQuery( SELECT number , name FROM someTable
  WHERE number  -1 ORDER BY name ) ;
  
  personCompleter = new QCompleter( this ) ;
  personCompleter-setModel( personModel ) ;
  
  personView = new QTableView ;
  personCompleter-setPopup( personView ) ;
  
  int width = personView-columnWidth( 0  ) ;
  width += personView-columnWidth( 1  ) ;
  
  personView-setColumnHidden( 0 , true ) ;
  personView-setColumnWidth( 1 , width ) ;
  
  personEdit-setCompleter( personCompleter ) ;
  
  connect( personEdit , SIGNAL( editingFinished() ) ,
   this , SLOT( personValidate() ) ) ; } what i really want is
 to be able to
  attach multiple persons rather a single one with each item in the (say,
  household) widget. so i thought to use a single column table widget and
  follow the spreadsheet example to create the table, delegate and item
  widgets putting the above line edit each item widget.
  
  but it is turning out to be convoluted (for me!) am i approaching this
 correctly?
  
  --
  allen
  
  There are 10 kinds of people. Those who do understand binary code, and
  those who do not.
  ___
  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
-- 
rd

There are 10 kinds of people. Those who

[Interest] QLineEdit and QTableWidget

2015-07-06 Thread Rene Decartes
hello,

i rather green at using qt. jumping right in, i had a qlineedit on a widget 
that is basically coded as:

People::createPersonEdit()
{
personEdit = new QLineEdit ;
personLabel = new QLabel( tr( Person: ) ) ;
personLabel-setBuddy( personEdit ) ;

personModel = new QSqlQueryModel( this ) ;
personModel-setQuery( SELECT number , name FROM someTable WHERE number  
-1 ORDER BY name ) ;

personCompleter = new QCompleter( this ) ;
personCompleter-setModel( personModel ) ;

personView = new QTableView ;
personCompleter-setPopup( personView ) ;

int width = personView-columnWidth( 0  ) ;
width += personView-columnWidth( 1  ) ;

personView-setColumnHidden( 0 , true ) ;
personView-setColumnWidth( 1 , width ) ;

personEdit-setCompleter( personCompleter ) ;

connect( personEdit , SIGNAL( editingFinished() ) ,
 this , SLOT( personValidate() ) ) ;
}
what i really want is to be able to attach multiple persons rather a single one 
with each item in the (say, household) widget. so i thought to use a single 
column table widget and follow the spreadsheet example to create the table, 
delegate and item widgets putting the above line edit each item widget. 

but it is turning out to be convoluted (for me!) am i approaching this 
correctly?

-- 
allen

There are 10 kinds of people. Those who do understand binary code, and those 
who do not.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest