Results 1 to 2 of 2

Thread: problem with char*/QString*

  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default problem with char*/QString*

    Hi I wonder what's the problem in that code. Compiler get me this error (on the last code):
    Qt Code:
    1. error C2664: 'MyPopupmenu::MyPopupmenu(MyWidget *,const char *,const QString *)' : cannot convert parameter 3 from 'const char [6]' to 'const QString *'
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. MyPopupmenu::MyPopupmenu(MyWidget* parent, const char* name, const QString* title):
    2. QPopupMenu( parent, name) {
    3. .................
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. MyPopupmenu* myPopupmenu = new MyPopupmenu( this,0, "title" );
    To copy to clipboard, switch view to plain text mode 
    Regards

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: problem with char*/QString*

    Quote Originally Posted by mickey
    MyPopupmenu::MyPopupmenu(MyWidget* parent, const char* name, const QString* title)
    It should be rather:
    Qt Code:
    1. MyPopupmenu::MyPopupmenu( ..., const QString& title )
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to jacek for this useful post:

    mickey (26th May 2006)

Similar Threads

  1. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  2. Problem with receiving events from QDateEdit
    By gunhelstr in forum Qt Programming
    Replies: 4
    Last Post: 20th April 2006, 11:21
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.