×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Nov 2011
    Posts
    104

    How to display the text in a tool other than message box?

    Hi,
    I am trying a application in which when the user clicks the button it displays the text. (other than messagebox)

    That displayed text could not be edited..

    Can anyone help me with this and if there is any sample code please help me out?


    Thanks and regards
    Harish.
    Last edited by mkhpad; 2011-11-14 at 06:02.

  2. #2
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: How to display the text in a tool other than message box?

    You can use QTextEdit to display and edit the text.
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  3. #3
    Regular Contributor
    Join Date
    Nov 2011
    Posts
    104

    Re: How to display the text in a tool other than message box?

    Thank you for your reply kkrish....



    I need not and not be able to edit my text.
    Last edited by mkhpad; 2011-11-14 at 05:33.

  4. #4
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: How to display the text in a tool other than message box?

    you can use QLabel if you do not wish to edit the text.
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  5. #5
    Regular Contributor
    Join Date
    Nov 2011
    Posts
    104

    Re: How to display the text in a tool other than message box?

    Ok I will try thank you for the information provided.

    Regards,
    Harish.

  6. #6
    Regular Contributor
    Join Date
    Nov 2011
    Posts
    104

    Re: How to display the text in a tool other than message box?

    Hi here is my code:



    #include "mainwindow.h"
    #include<QString>
    #include<QObject>
    #include<QDialog>

    #include <QtGui/QApplication>

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);


    QDialog dialog;
    QString temp = QObject::tr("dadasda");


    QString romeo = QObject::tr(
    "But soft, what light through yonder window breaks? / "
    "It is the east, and Juliet is the sun. / "
    "Arise, fair sun, and kill the envious moon, / "
    "Who is already sick and pale with grief / "
    "That thou, her maid, art far more fair than she."
    );






    dialog.show();





    return app.exec();
    }


    The program runs but displays only the dialog box and not the text that i like to display..
    Can anyone point out where i had done the mistake and what is the wrong in my code so that i will be getting my text displayed.


    Thank you in advance...
    Harish.

  7. #7
    Nokia Developer Expert
    Join Date
    Feb 2008
    Posts
    183

    Re: How to display the text in a tool other than message box?

    QDialog by itself does not have any text "property", it is just a empty window. If you need to show a widget inside a dialog (such as QLabel), you need to add that to the dialog.
    If you need to have several widgets inside your dialog, best is to add the widgets to a layout to control positioning and spacing.

    In your code, you create two texts and a dialog, but you don't "glue" them together in any way.

Similar Threads

  1. Replies: 2
    Last Post: 2010-09-28, 07:41
  2. How to display a lengthy text message ?
    By smanikandan14 in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-10-22, 17:06
  3. Hot to display pop up message with more text than two lines
    By Brunnen-G in forum Symbian User Interface
    Replies: 3
    Last Post: 2007-05-21, 14:54
  4. Display Text Message on a Form (CAknForm)
    By saadmansur in forum Symbian User Interface
    Replies: 5
    Last Post: 2007-04-25, 11:45
  5. Replies: 0
    Last Post: 2004-10-07, 08:57

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×