Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, August 2006
Issue when I save to a file rows and columns

Pages: Prev | 1 | 2 | 3 | Next

Message 16 in thread

I sent you both a email with my source code, did you got it?

Thanks.

Andreas Pakulat wrote:
> On 14.08.06 15:41:41, Rek2 wrote:
> 
>>usually when I do the my testing  I put data on each cell usually in my case cell 1, 2, 3.
>>when I get to the cell in row 1 column 3 (that last one I enter data) I save then, so I have that cell selected.
>>in this situation I always miss that cell information/data, but in the other hand if I move with my mouse the selection to another place.. a empty cell for example
>>then I save to file, in this case this last cell *does* get saved.  so whatever cell I have selected before I save data to file, wont get saved.
> 
> 
> Can't reproduce this here with Qt4.1.4 and the attached small example. I
> always get all lines saved to the file. BTW: There's another problem
> with the code you posted, you don't close the file, right before the
> file2.close() call you do a return true so the function is left at that
> point. The only reason you see any data at all in the file is that the
> file2 object is local to the function and get's destroyed when leaving
> it.
> 
> 
>>I don't think this is ok, I may need to add some piece of code to check for this or it may be a bug,
> 
> 
> If you can reduce your program to a complete minimal example that
> reproduces your problem you can post it here so we can take a look and
> tell you wethe it's a bug.
> 
> 
>>Thanks guys, if this is not a bug were can I look force the selection out of the last cell so it gets saved?
> 
> 
> Your code, it works perfectly here.
> 
> 
>>or any work around. and if is a bug what should I do to report this?
> 
> 
> bugs (at) trolltech (dot) com is the right adress for bugreports.
> 
> Andreas
> 

--
 [ signature omitted ] 

Message 17 in thread

On 15.08.06 19:10:47, rek2 wrote:
> I sent you both a email with my source code, did you got it?

Nope, might have been caught by the spam scanner... You can also just
put your source up on pastebin (http://rafb.net/paste/) and post the
link here, that way everybody can see it and help you.

Andreas

-- 
 [ signature omitted ] 

Message 18 in thread

:-(  my idea was to sent you the whole code in case is something in
other funtions.
let me try again.. expect something from rek2@xxxxxxxxxxxxxxxxxx

Thanks.

Andreas Pakulat wrote:
> On 15.08.06 19:10:47, rek2 wrote:
> 
>>I sent you both a email with my source code, did you got it?
> 
> 
> Nope, might have been caught by the spam scanner... You can also just
> put your source up on pastebin (http://rafb.net/paste/) and post the
> link here, that way everybody can see it and help you.
> 
> Andreas
> 

--
 [ signature omitted ] 

Message 19 in thread

did you got it this time? :-/

rek2 wrote:
> :-(  my idea was to sent you the whole code in case is something in
> other funtions.
> let me try again.. expect something from rek2@xxxxxxxxxxxxxxxxxx
> 
> Thanks.
> 
> Andreas Pakulat wrote:
> 
>>On 15.08.06 19:10:47, rek2 wrote:
>>
>>
>>>I sent you both a email with my source code, did you got it?
>>
>>
>>Nope, might have been caught by the spam scanner... You can also just
>>put your source up on pastebin (http://rafb.net/paste/) and post the
>>link here, that way everybody can see it and help you.
>>
>>Andreas
>>

--
 [ signature omitted ] 

Message 20 in thread

On 18.08.06 15:39:30, rek2 wrote:
> did you got it this time? :-/

No, nothing from rek2 in my inbox or spam filter. 

As I said it's probably much easier when you put the relevant class up
on pastebin (i.e. the populating and the saving code). I wouldn't look
through your whole project anyway, due to time constraints.

Andreas

-- 
 [ signature omitted ] 

Message 21 in thread

Hi Andreas, ok here it is.. but I have only put the main window and the
class funtion were it saves my labels and my cells(cells were I have the
issue)

http://rafb.net/paste/results/ryhevp81.html

if you need more infomation let me know please so I put more info on it.
the main class is in .h but dont know if you need this.

thanks.





Andreas Pakulat wrote:
> On 18.08.06 15:39:30, rek2 wrote:
> 
>>did you got it this time? :-/
> 
> 
> No, nothing from rek2 in my inbox or spam filter. 
> 
> As I said it's probably much easier when you put the relevant class up
> on pastebin (i.e. the populating and the saving code). I wouldn't look
> through your whole project anyway, due to time constraints.
> 
> Andreas
> 

--
 [ signature omitted ] 

Message 22 in thread

Hi Andreas, ok here it is.. but I have only put the main window and the
class funtion were it saves my labels and my cells(cells were I have the
issue)

http://rafb.net/paste/results/ryhevp81.html

if you need more infomation let me know please so I put more info on it.
the main class is in .h but dont know if you need this.

thanks.





Andreas Pakulat wrote:
> On 18.08.06 15:39:30, rek2 wrote:
> 
>>did you got it this time? :-/
> 
> 
> No, nothing from rek2 in my inbox or spam filter. 
> 
> As I said it's probably much easier when you put the relevant class up
> on pastebin (i.e. the populating and the saving code). I wouldn't look
> through your whole project anyway, due to time constraints.
> 
> Andreas
> 

--
 [ signature omitted ] 

Message 23 in thread

On 18.08.06 17:13:37, rek2 wrote:
> Hi Andreas, ok here it is.. but I have only put the main window and the
> class funtion were it saves my labels and my cells(cells were I have the
> issue)
> 
> http://rafb.net/paste/results/ryhevp81.html
> 
> if you need more infomation let me know please so I put more info on it.
> the main class is in .h but dont know if you need this.

Sorry I can't reproduce your problem here. I think you have to strip
down your source code to a complete but minimal example.

Andreas

-- 
 [ signature omitted ] 

Message 24 in thread

"Andreas Pakulat" <apaku@xxxxxx> wrote in message 
news:ec58oc$3al$1@xxxxxxxxxxxxxxxxxxxxx
> On 18.08.06 15:39:30, rek2 wrote:
>> did you got it this time? :-/
>
> No, nothing from rek2 in my inbox or spam filter.
>
> As I said it's probably much easier when you put the relevant class up
> on pastebin (i.e. the populating and the saving code). I wouldn't look
> through your whole project anyway, due to time constraints.

Besides, not everyone use's a valid reply-to address.
For example, I access here via nntp and providing a
valid reply-to address would not be a good idea.

The best thing would be to create a sample that exhibits
the problems (preferably < 50 lines) and post it here.


--
 [ signature omitted ] 

Message 25 in thread

ok Im going to try to take my code and strip it down to less than <50
lines if possible, but since my issue is only when the last cell is
selected, is there a way to delesect all cells before I save the data to
files? my issue is that when I enter the data in the last cell I use it
wont get saved but when I enter the data and click on another empty cell
then everything gets saved... so I need to make sure what I do with the
mouse I have the program do automatically at least till I can figure out
what I am doing wrong.

Thanks.


Duane Hebert wrote:
> "Andreas Pakulat" <apaku@xxxxxx> wrote in message 
> news:ec58oc$3al$1@xxxxxxxxxxxxxxxxxxxxx
> 
>>On 18.08.06 15:39:30, rek2 wrote:
>>
>>>did you got it this time? :-/
>>
>>No, nothing from rek2 in my inbox or spam filter.
>>
>>As I said it's probably much easier when you put the relevant class up
>>on pastebin (i.e. the populating and the saving code). I wouldn't look
>>through your whole project anyway, due to time constraints.
> 
> 
> Besides, not everyone use's a valid reply-to address.
> For example, I access here via nntp and providing a
> valid reply-to address would not be a good idea.
> 
> The best thing would be to create a sample that exhibits
> the problems (preferably < 50 lines) and post it here.
> 
> 

--
 [ signature omitted ] 

Message 26 in thread

On 20.08.06 17:24:05, rek2 wrote:
> ok Im going to try to take my code and strip it down to less than <50
> lines if possible, but since my issue is only when the last cell is
> selected, is there a way to delesect all cells before I save the data to
> files?

QList<QTableWidgetItem*> selected = table->selected();
for( QList<QTableWidgetItem*>::iterator it = selected.begin(); it !=
selected.end(); ++it)
{
	table->setItemSelected(*it, false);
}

Shouldn't be too hard to discover this in the docs ;-)

BTW: You could also do (*it)->setSelected(false) inside the for loop.

Andreas

-- 
 [ signature omitted ] 

Message 27 in thread

Thanks Andreas, I am going to try this looks like a better aproach than
mine, after I posted my question I read about this:
tabla1->setCurrentCell(0, 0);
so I added that and now right before it saves it will move the selection
to 0,0 and now it *saves* all my data.
now I think all this are work arounds... not really the issue, when  a
user will enter data in the last cell and saves if we dont do this
workarounds that data is not getting into the program cache so it dont
knows about it when the user saves, so we can do this workarounds or the
user have to select or press enter/tab to force it to get into cache,
I think QT should be able to handle this in a better way.

Cheers and thanks for the help.



Andreas Pakulat wrote:
> On 20.08.06 17:24:05, rek2 wrote:
> 
>>ok Im going to try to take my code and strip it down to less than <50
>>lines if possible, but since my issue is only when the last cell is
>>selected, is there a way to delesect all cells before I save the data to
>>files?
> 
> 
> QList<QTableWidgetItem*> selected = table->selected();
> for( QList<QTableWidgetItem*>::iterator it = selected.begin(); it !=
> selected.end(); ++it)
> {
> 	table->setItemSelected(*it, false);
> }
> 
> Shouldn't be too hard to discover this in the docs ;-)
> 
> BTW: You could also do (*it)->setSelected(false) inside the for loop.
> 
> Andreas
> 

--
 [ signature omitted ] 

Message 28 in thread

On 20.08.06 18:21:33, rek2 wrote:
> now I think all this are work arounds... not really the issue, when  a
> user will enter data in the last cell and saves if we dont do this
> workarounds that data is not getting into the program cache so it dont
> knows about it when the user saves, so we can do this workarounds or the
> user have to select or press enter/tab to force it to get into cache,
> I think QT should be able to handle this in a better way.

You got me thinking... How do you tell your program to save the data?
Normally if you click a button or something the editor with which you
changed the content of that cell, is "closed" and the current editor
value is saved into the table. At least that is what happens here.

Your description above sounds like you save the data while the editor is
still active, which means that the data in the editor has not been
"transferred" to the table, which explains why you don't see the data
for the last cell, or the cell beeing edited atm.

Andreas

-- 
 [ signature omitted ] 

Message 29 in thread

That is exactly what happens, so then is regular behavior? to be more
clear.. when I enter data and save I still have the cursor on the cell,
but when I click somewhere else or the same cell the cursor dissapear,
then it does save it..
I found this to be confusing me and maybe any future user of the program
in general(not that this is going to be used, is just for me to learn)
so I am going to keep the line where... before it saves it forces to
move to cell 0,0 so it saves the last cell edited or been edit...

Thanks Andreas.
Chris.


Andreas Pakulat wrote:
> On 20.08.06 18:21:33, rek2 wrote:
>> now I think all this are work arounds... not really the issue, when  a
>> user will enter data in the last cell and saves if we dont do this
>> workarounds that data is not getting into the program cache so it dont
>> knows about it when the user saves, so we can do this workarounds or the
>> user have to select or press enter/tab to force it to get into cache,
>> I think QT should be able to handle this in a better way.
> 
> You got me thinking... How do you tell your program to save the data?
> Normally if you click a button or something the editor with which you
> changed the content of that cell, is "closed" and the current editor
> value is saved into the table. At least that is what happens here.
> 
> Your description above sounds like you save the data while the editor is
> still active, which means that the data in the editor has not been
> "transferred" to the table, which explains why you don't see the data
> for the last cell, or the cell beeing edited atm.
> 
> Andreas
> 

--
 [ signature omitted ] 

Message 30 in thread

On 21.08.06 11:58:05, rek2@xxxxxxxxxxxxxxxxxx wrote:
> That is exactly what happens, so then is regular behavior? to be more
> clear.. when I enter data and save I still have the cursor on the cell,
> but when I click somewhere else or the same cell the cursor dissapear,
> then it does save it..

Well it depends on how "save" is done in the UI. As I said if you do
this by clicking a button and the editor is still open when clicking it,
this is a bug. I'm not sure about menu actions, i.e. it could be that
those don't remove the focus from the editor, but they should I think.

Andreas

-- 
 [ signature omitted ] 

Pages: Prev | 1 | 2 | 3 | Next