FET Forum

Discussions and Chat => Talk It Up! => Topic started by: Mejda on May 19, 2012, 07:00:48 PM

Title: Chat about languages :)
Post by: Mejda on May 19, 2012, 07:00:48 PM
unlike thank you for the correction I should concentrate on my mistakes in English but in tunisia we are good in french not englich. (we spreak french and arabic)
:D
Title: Re: Re: how I use QFtp
Post by: Liviu Lalescu on May 19, 2012, 07:06:13 PM
No problem, even my English is far from perfect, and unfortunately I do not know as much French as I should, considering that it is related to Romanian :)
Title: Re: Re: how I use QFtp
Post by: Mejda on May 19, 2012, 07:19:15 PM
 :) what is the native language in Romania you are good in what ????
Title: Re: Re: how I use QFtp
Post by: Liviu Lalescu on May 19, 2012, 07:30:30 PM
In Romania we speak Romanian, which is my mother tongue. And generally we learn English and French early in school. French is generally regarded as related to Romanian, from the Latin origin and from XIX-th century vocabulary borrowings (we took neologisms from them at that time).

I think I know English good and a bit of French and Italian.

PS: I might consider splitting/moving part of this topic to http://lalescu.ro/liviu/fet/forum/index.php?board=3.0 , I hope you agree :)
Title: Re: Re: how I use QFtp
Post by: Mejda on May 19, 2012, 08:20:42 PM
ok I am agree Mr Liviu  ;)
Title: Re: Chat about languages :)
Post by: Liviu Lalescu on May 19, 2012, 08:51:30 PM
OK, I split the topic.

PS: Only Liviu should be fine :)  But as you wish :)
Title: Re: Chat about languages :)
Post by: Mejda on May 19, 2012, 09:11:14 PM
I do not understand why you said "Only Liviu should be fine" for me I hope for you all hapiness ;)
Title: Re: Chat about languages :)
Post by: Liviu Lalescu on May 19, 2012, 09:30:36 PM
Oh, sorry, I meant "Mr. Liviu" is too much to address me; people may call me just simply "Liviu", if they want :)   (because you said "Mr. Liviu" above).
Title: Re: Chat about languages :)
Post by: Mejda on May 19, 2012, 09:41:47 PM
hmmm ok I am sorry I will call you just Liviu :)

So I have a problem I do the upload of my file in the Ftp server but it is empty (in my pc contain information but the file in server is empty)
I think that is hear error


QString filename;
     QString files = QFileDialog::getOpenFileName(this, tr("Select File"),
     "D://");

     if (files.isEmpty())
     return;

     while(files.indexOf("/", i) != (-1)) //find the file name not include the full url
     i = files.indexOf("/",i) + 1;
     while(i < files.size())
     {
     filename.append(files.at(i));
     i++;
     }

     QFile *file = new QFile(filename);
     Q_ASSERT(file != NULL);

     if(!file->open(QIODevice::ReadWrite)) //finished create the file in the debug file
     {
     qDebug() << "opern err" << file->fileName();
     return;


what is you opinion :)
Title: Re: Chat about languages :)
Post by: Liviu Lalescu on May 19, 2012, 09:56:07 PM
I think this should be the way (but I didn't compile or test):


#include <QFileInfo>

...

QStringList files=QFileDialog::getOpenFileNames(this, "Please select the file(s)");
foreach(QString fileName, files){
QString strippedFileName=QFileInfo(fileName).fileName();
QFile file(strippedFileName);
...open file, etc....
}

Title: Re: Chat about languages :)
Post by: Mejda on May 19, 2012, 10:08:26 PM
hmm I will test this all my thanks for you
Title: Re: Chat about languages :)
Post by: Mejda on May 20, 2012, 05:23:14 PM
Hi Liviu,
I want to extract nombre of hours of Tp in french(travaux pratiques) , number of hours of cour and number of hours of TD in french (Travaux dérigé) so I can determine number of Tp by this code

int nHours=0;
        foreach(Activity* act, gt.rules.activitiesList)
                if(act->active)
                        if(act->teachersNames.contains(Teachername)){

                                nHours+=act->duration;
                        }

but other informations I can't do this  :-[

and please how I insert an space I also seek and I can't identify how I do this  :)
thank you
Title: Re: Chat about languages :)
Post by: Liviu Lalescu on May 20, 2012, 05:38:41 PM
Hi, Mejda,

Quote
I want to extract nombre of hours of Tp in french(travaux pratiques) , number of hours of cour and number of hours of TD in french (Travaux dérigé) so I can determine number of Tp by this code


int nHours=0;
foreach(Activity* act, gt.rules.activitiesList)
if(act->active)
if(act->subjectName==QString("Tp") || act->subjectName==QString("cour") || act->subjectName==QString("TD"))
nHours+=act->duration;


Quote
and please how I insert an space I also seek and I can't identify how I do this  :)

To insert a space into a QString is very easy:


QString s=QString("Project");
s+=QString(" ");
s+=QString("started");


:)
Title: Re: Chat about languages :)
Post by: Mejda on May 20, 2012, 06:07:38 PM
No Liviu I do this :
QString chaine=QString("Nombre des heurs de cour:");
chaine+=QString("  ");
chaine+=QString("  ");
chaine+=QString("  ");
chaine+=QString("  ");
chaine+=QString("Nombre des heurs de TD:");

I get usually
Nombre des heurs de cour: Nombre des heurs de TD: ( hav'nt any space )  :-[
Title: Re: Chat about languages :)
Post by: Liviu Lalescu on May 20, 2012, 06:14:47 PM
Ah, you mean in the HTML output? Please try this:


QString s=QString("1");
s+=QString("&nbsp;").repeated(5);
s+=QString("2");


Please let me know.
Title: Re: Chat about languages :)
Post by: Mejda on May 20, 2012, 06:28:22 PM
I am in class timetableexport exactly in function "singleTeachersTimetableDaysVerticalHtml(int htmlLevel, int teacher, const QString& saveTime, bool printActivityTags)
And my object is to insert in PDF version 2 strings but should be spaced
so I do
QString chaine=QString("Nombre des heurs de cour:");
chaine+=QString("&nbsp;").repeated(5);
chaine+=QString("Nombre des heurs de TD:")

I get:
Nombre des heurs de cour:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nombre des heurs de TD:


Title: Re: Chat about languages :)
Post by: Liviu Lalescu on May 20, 2012, 07:09:09 PM
Yes, and if you see the HTML with the browser, it looks good.

For instance, in the FET page http://lalescu.ro/liviu/fet/credits.html , under Authors (at the beginning), Volker Dirr's contributions begin with spaces.

The HTML code for the file above (credits.html) is:


<p><b>Authors:</b>
</p>
<p>Liviu Lalescu</p>
<br />

<p>Volker Dirr
<br />
&nbsp;&nbsp;&nbsp;&nbsp;- XHTML timetable export.
<br />
&nbsp;&nbsp;&nbsp;&nbsp;- CSV import and export.
<br />
&nbsp;&nbsp;&nbsp;&nbsp;- Advanced statistics export.
<br />
&nbsp;&nbsp;&nbsp;&nbsp;- Speed improvements in the timetable generation.
<br />
&nbsp;&nbsp;&nbsp;&nbsp;- Locking the activities.
<br />
&nbsp;&nbsp;&nbsp;&nbsp;- Activity planning dialog.
<br />
&nbsp;&nbsp;&nbsp;&nbsp;- Print timetable dialog.
</p>
<br />
<p>To contact an author, please see the AUTHORS file in the FET distribution or the FET menu Help/About/Authors</p>
<br />

Title: Re: Chat about languages :)
Post by: Mejda on May 20, 2012, 08:21:41 PM
I do not understand what I should write because with this instruction  "chaine+=QString("&nbsp;").repeated(5);"  I hav'nt spaces I have "&nbsp" repeated  :(
Title: Re: Chat about languages :)
Post by: Liviu Lalescu on May 20, 2012, 08:25:36 PM
This "&nbsp;" is HTML code. The source of HTML contains "&nbsp;", but if you open it with Chromium/Firefox (internet browser) you will see it as a space. See my link to credits.html and the source HTML code of credits.html.

I think that you are generating HTML code (and convert it to pdf, but after that).

In HTML source, if you add more spaces as "     ", they will be considered a single space. You need to add "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".

Please let me know if you understood now (or maybe I misunderstood?)
Title: Re: Chat about languages :)
Post by: Mejda on May 20, 2012, 08:42:18 PM
I understant that I must modify my file.html but in my case I want that be by C++ code because chaines "Nombre des heurs de TP:"  is not in html code and I can't insert this string in my timetable with html code
Title: Re: Chat about languages :)
Post by: Liviu Lalescu on May 20, 2012, 08:58:11 PM
Hmm, sorry, I do not understand.

1)  You want when you open a HTML file in internet browser to see the spaces? In this case, you should use "&nbsp;" in the HTML file, and you can write that using C++ code.

2) You want something else? Please give me more details.
Title: Re: Chat about languages :)
Post by: Mejda on May 20, 2012, 09:25:25 PM
Hi Liviu
we can resolve this problem by insertion of a table (1 row and 3 column) first column we affiche "nombre des heurs de cour",second column we affiche "nombres des heurs TD" et third column we affiche "nombre des heurs TP" :)  how I can do this ?
And please how I modify color of the border of timetable because in class timetableprintform I can modify just fond  :)
Title: Re: Chat about languages :)
Post by: Mejda on May 20, 2012, 09:32:37 PM
I hope that you understand me so I explain in above of the timetable of a teacher I want see those information(number of hours of TD,number of hours of TP and number of hours of cour) so 2 solution
1)insert a table in above of teacher timetable like I was described it( 1 row 3 column)
2) insert those 3 informations but spaced

this what I want to do but in second solution I can't identify how insert spaces :)
Title: Re: Chat about languages :)
Post by: Liviu Lalescu on May 21, 2012, 05:18:42 AM
There are many HTML tutorials, here are some links that I found on Google about your specific problems:

http://www.w3schools.com/html/html_tables.asp , http://www.w3schools.com/css/css_table.asp and http://www.hitmill.com/html/tables/two_d.html#bordercolor

As for the second solution, with spaces, it is exactly what I described earlier, with "&nbsp;", but I don't know why it does not work for you.