Results 1 to 2 of 2

Thread: how to dreate dialog with variable message

  1. #1
    Join Date
    Jan 2010
    Posts
    63
    Qt products
    Qt4
    Platforms
    Windows

    Default how to dreate dialog with variable message

    I am trying to create a popup message that accepts a string
    Can someone show me some code to do it ?

    The code is based on this:
    Qt Code:
    1. #include "gotocelldialog.h"
    2.  
    3. GoToCellDialog::GoToCellDialog(QWidget *parent)
    4. : QDialog(parent)
    5. {
    6. setupUi(this);
    7.  
    8. QRegExp regExp("[A-Za-z][1-9][0-9]{0,2}");
    9. lineEdit->setValidator(new QRegExpValidator(regExp, this));
    10.  
    11. connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
    12. connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
    13. }
    14.  
    15. void GoToCellDialog::on_lline_textedit()
    16. {
    17. QMessageBox msgBox;
    18.  
    19. //* When ok button is clicked messagebox pops up stating your key is "key"//
    20. msgBox.exec();
    21.  
    22.  
    23.  
    24. }
    To copy to clipboard, switch view to plain text mode 
    which comes from Qt Gui prgramming version 1
    Last edited by Petr_Kropotkin; 18th January 2010 at 22:39.

  2. #2
    Join Date
    Jan 2006
    Location
    Netherlands
    Posts
    56
    Thanks
    10
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: how to dreate dialog with variable message

    If I understand you correctly.. you need something like this..

    Qt Code:
    1. QString text = QInputDialog::getText(this, tr("QInputDialog::getText()"),
    2. tr("Input:"), QLineEdit::Normal,
    3. QDir::home().dirName(), &ok);
    To copy to clipboard, switch view to plain text mode 

    It comes from a Qt Example: standard dialogs.. see here: http://doc.trolltech.com/4.6/dialogs...ialog-cpp.html

    at the function: void Dialog::setText()
    maybe it can help you further

    if I misunderstand your question, maybe another part of the code at the mentioned example can help you out..
    Last edited by BrainB0ne; 19th January 2010 at 09:28.
    ..:: Still Standing Strong ::..

Similar Threads

  1. how to display dialog message
    By Petr_Kropotkin in forum Newbie
    Replies: 1
    Last Post: 12th January 2010, 14:16
  2. How to blur parent dialog when child dialog is displayed
    By abhilashajha in forum Qt Programming
    Replies: 4
    Last Post: 10th June 2009, 13:01
  3. Replies: 4
    Last Post: 12th October 2008, 13:47
  4. I need to send a message to parent dialog
    By santhoshv84 in forum Qt Programming
    Replies: 1
    Last Post: 3rd July 2008, 11:16
  5. Replies: 1
    Last Post: 7th November 2007, 08:39

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.