Results 1 to 7 of 7

Thread: a simple application

  1. #1
    Join Date
    Feb 2007
    Posts
    42
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Exclamation a simple application

    hi, i am trying to make a simple application with 2 QLineEdits.... where i type text in one, and automatically in the other it appears Capitalized....

    Qt Code:
    1. connect(lineEditOriginalText, SIGNAL(textChanged(QString&)), this, SLOT(functionCaseChange(QString&)));
    2. connect(lineEditOriginalText, SIGNAL(textEdited(QString&)), this, SLOT(functionCaseChange(QString&)));
    To copy to clipboard, switch view to plain text mode 

    why both of these connects don't work....???

    thanks in advance for your help...

  2. #2
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: a simple application

    Not enough info.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: a simple application

    Hmm... I think it should be "const QString&". And make sure "functionCaseChange" is declared as a slot.

  4. The following user says thank you to wysota for this useful post:

    aegis (12th March 2007)

  5. #4
    Join Date
    Feb 2007
    Posts
    42
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: a simple application

    Quote Originally Posted by wysota View Post
    Hmm... I think it should be "const QString&". And make sure "functionCaseChange" is declared as a slot.
    yes, you were right....it was "const QString&"

    thank you all for your answers...

  6. #5
    Join Date
    Feb 2007
    Posts
    42
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Re: a simple application

    two other questions for the same application.....

    i want to copy the contents of a QLineEdit to clipboard...
    so i 've made a function that does:::
    Qt Code:
    1. lineEditEditedText->selectAll();
    2. lineEditEditedText->copy();
    To copy to clipboard, switch view to plain text mode 

    the problem is that i don't the text to appear selected after this function...is there anyway to copy the contents of QLineEdit without using the select all.....

    my second question is that i want to have an option to this dialog:::"Always on top" so that it stays always on top of other applications, how can i do this...??

  7. #6
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: a simple application

    Quote Originally Posted by aegis View Post
    is there anyway to copy the contents of QLineEdit without using the select all.....
    Have a look at QLineEdit::text() and QClipboard::setText()

    my second question is that i want to have an option to this dialog:::"Always on top" so that it stays always on top of other applications, how can i do this...??
    See Qt::WindowFlags


    Lykurg

  8. #7
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: a simple application

    Quote Originally Posted by aegis View Post
    two other questions for the same application.....

    i want to copy the contents of a QLineEdit to clipboard...
    so i 've made a function that does:::
    Qt Code:
    1. lineEditEditedText->selectAll();
    2. lineEditEditedText->copy();
    To copy to clipboard, switch view to plain text mode 

    the problem is that i don't the text to appear selected after this function...is there anyway to copy the contents of QLineEdit without using the select all.....
    No idea here. Looks ok for me.

    Quote Originally Posted by aegis View Post
    my second question is that i want to have an option to this dialog:::"Always on top" so that it stays always on top of other applications, how can i do this...??
    No sure if this is possible at all. You might be able to tell its parent application that you always want to have this dialog on top. But for all applications? Things like that are very dependent on what window manager you use. I have often seen that KDE is ignoring window flags. And if you think about it, it is only logical. KDE is an integrated desktop manager, it allows a very fine grained configuration how it handles single programs. Would be quite a mess, if every program could ignore global settings and do what it wants.

Similar Threads

  1. Replies: 2
    Last Post: 12th January 2007, 11:19
  2. Replies: 3
    Last Post: 8th December 2006, 18:51
  3. Gnome makes application crash
    By regix in forum Qt Programming
    Replies: 35
    Last Post: 18th August 2006, 19:44
  4. Replies: 3
    Last Post: 31st March 2006, 18:38
  5. Simple Question on Variable initialization
    By Naveen in forum Qt Programming
    Replies: 3
    Last Post: 17th March 2006, 11:01

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
  •  
Qt is a trademark of The Qt Company.