I'm using QtRuby + Mysql2 in a project, and i'm trying to retrieve all the data I need to populate the form.
First, a query is made. Then, each value is taken and used to fill each related widget.
client = Mysql2::Client.new(:host => "localhost", :username => "root", :password => "", :database => "school")
res= client.query("SELECT * FROM activ WHERE act_name = '#{@cActiv.currentText()}' ")
res.each do |row|
@tName.setText(row['act_name'].to_s)
@tType.setText(row['act_type'].to_s)
@strDate= row['act_date'].to_s
@year=@strDate[0,4].to_i
@month=@strDate[5,2].to_i
@day=@strDate[7,2].to_i
@date= Qt::Date.new(@year, @month, @day)
@deDate.setDate(@date)
end
The Problem is that I've got an error when trying to set the date to the DateEdit, even when the QDate object was created with no error.
Any thoughts?