Attach the file in the document



  • Hi, am using the TextEdit widget. I can open the files like html and etc in the textedit..
    Now i am trying to attach the file in the TextEdit !! Is it possible? Which class should i use for Attaching a file in the TextEdit ?? Help me out

    Thanks in Advance!!





  • You can embed a file in an application using the resource system.
    http://doc.qt.nokia.com/4.7/resources.html
    Once the file is added you can easily load it into the TextEdit.



  • [quote author="leojoseph" date="1298885450"]Hi, am using the TextEdit widget. I can open the files like html and etc in the textedit..
    Now i am trying to attach the file in the TextEdit !! Is it possible? Which class should i use for Attaching a file in the TextEdit ?? Help me out

    Thanks in Advance!!
    [/quote]

    Define "attach the file in the TextEdit" please.



  • leojoseph, are you trying to build some kind of email-like client? What do you mean exactly by "attaching a file to a TextEdit"? Load it, or really create some kind of attachment like you have in email applications?



  • THanks for the replies!!
    Am not creating an e-mail client !! I am creating a Texteditor on my own!! Instead of selecting a *.txt or *.html file and displaying it in the TextEdit widget, i thought of attaching that file. Like in MSWord, whenever we select the PDF , it will gets attached along with the Document!! I thought of doing it in the same way!! Please help me



  • What should this "attachment" entail then, exactly? I tried to see what MS Word does, but my version tries to import the PDF if I try to open one. You are still not describing very clearly what you want to achieve. As long as you don't, we can not help you properly.

    So please, sit down and write out what you want to achieve exactly, if possible at all without relying on reference to how third party applications do something, as not everyone has those applications available.



  • [quote author="leojoseph" date="1298895993"]THanks for the replies!!
    Am not creating an e-mail client !! I am creating a Texteditor on my own!! Instead of selecting a *.txt or *.html file and displaying it in the TextEdit widget, i thought of attaching that file. Like in MSWord, whenever we select the PDF , it will gets attached along with the Document!! I thought of doing it in the same way!! Please help me[/quote]

    Read "this":http://www.catb.org/~esr/faqs/smart-questions.html. It will help you understanding your actual problem.



  • K. Let me clear. I have a filename first.doc . I am selecting the File using the QFileDialog. TextEdit will not load Doc files. So i have created a code which will place an image in TextEdit widget , where the image will have the Document URL. So now whenever i click that image , the Doc will be opened by openoffice. Now that is not a Problem. Now my task is to Copy/Import the first.doc into the TextEdit file. Can u get me??

    The Single TextEdit file which i am going to save should contain all the Documents which i have inserted/attached ?? Is that possible ??



  • QTextEdit cannot open OpenOffice documents neither can it open Microsoft Word documents. Only plain text and HTML rich text. Additionally, you can safe a QTextEdit's content to OpenOffice format (QTextDocumentWriter).

    And I prefer being called "you", not "u".



  • Mr.Volker, i can Explain my Problem elaborately if you want !! But don' ask me to go through all those links to post a Technical Questions. May be i might miss some words while typing , that lead you peoples difficult to find a Problem!!



  • Am sorry!!! I know QTextEdit cannot open the OpenOffice documents ! I am using the QDesktopServices to open the Documents ! Thats not a Problem now! What i am trying is to attach a file inside the TextEdit!! Am not inserting, i want to attach / import the file



  • I'm lost and out.



  • [quote author="leojoseph" date="1298899886"]Mr.Volker, i can Explain my Problem elaborately if you want !! But don' ask me to go through all those links to post a Technical Questions. May be i might miss some words while typing , that lead you peoples difficult to find a Problem!! [/quote]
    If you can't be bothered to read through a guide that you obviously need to help you formulate a question that we can answer, then why do you assume we can be bothered to play 20 questions with you until we understand what you mean, all the time having to puzzle to try to make out what!! each!! of! your! sentences!! mean!! between all the exclamation points and SMS-like abbreviations?

    Good luck with your problem, I am out too.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.