Results 1 to 5 of 5

Thread: path to qt source

  1. #1
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default path to qt source

    Hello forum

    I have the Qt 4.4 installed in Ubuntu 8.10 through the repository.

    I need to get some of the source files .cpp to get to see some function definition. So far i have found the header files under


    /usr/include/qt4/Qt/


    i need to get to the Qt source files of all these header files.

    Thanks
    Sajjad

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: path to qt source

    There's no reason you should have the source files; they're not needed for normal uses. You'll probably only have them if you've installed the development packages.

    Try looking for a likely candiate, with something like 'locate qsound.cpp'. If you come up empty, you'll need to install the development packages.

  3. #3
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: path to qt source

    Hi

    I needed to know how to use the data() function for the QGraphicsItem class. Do you know any example that over-ridden this function?

    The small snippet inside thE Qt Assistant seems not to be enough for me to understand.


    Thanks
    Sajjad

  4. #4
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: path to qt source

    From the documentation:

    Custom item data is useful for storing arbitrary properties for any item. Qt does not use this feature for storing data; it is provided solely for the convenience of the user.
    So you can stuff an arbitrary item of data of any type understood by QVariant into a QGraphicsItem, and retrieve it later. This might be useful if you need to keep track of a single value - a user's name, for example, or a floating point value or some such - instead of deriving your own class to hold a more complex assortment of data.

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

    Default Re: path to qt source

    Furthermore the method is not virtual so overriding it doesn't make any sense. And the source code for the method will not do you much good, here it is:
    Qt Code:
    1. QVariant QGraphicsItem::data(int key) const
    2. {
    3. QGraphicsItemCustomDataStore *store = qt_dataStore();
    4. if (!store->data.contains(this))
    5. return QVariant();
    6. return store->data.value(this).value(key);
    7. }
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Path for a dll , is it possible ?
    By tonnot in forum Newbie
    Replies: 3
    Last Post: 9th December 2010, 16:07
  2. Replies: 8
    Last Post: 17th October 2009, 08:10
  3. Lib path
    By yagabey in forum Qt Programming
    Replies: 4
    Last Post: 3rd April 2009, 15:01
  4. Which path should I use?
    By Dark_Tower in forum Newbie
    Replies: 3
    Last Post: 8th April 2006, 12:09
  5. Replies: 11
    Last Post: 24th March 2006, 06:40

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.