Results 1 to 2 of 2

Thread: repc generated file with different sort order

  1. #1
    Join Date
    Nov 2024
    Posts
    2
    Thanked 1 Time in 1 Post

    Default repc generated file with different sort order

    Hi,

    I have some issues using ccache and Qt build tools, because the content of the generated files with repc is different from time to time.
    When I use the following commands, it could be possible, that the generated content inside method registerMetatypes has a different sort order:
    Qt Code:
    1. repc -o replica Abcd.rep rep_Abcd_replica1.h
    2. repc -o replica Abcd.rep rep_Abcd_replica2.h
    To copy to clipboard, switch view to plain text mode 

    rep_Abcd_replica1.h
    Qt Code:
    1. static void registerMetatypes()
    2. {
    3. static bool initialized = false;
    4. if (initialized)
    5. return;
    6. initialized = true;
    7. qRegisterMetaType<State1>();
    8. qRegisterMetaType<State2>();
    9.  
    10. }
    To copy to clipboard, switch view to plain text mode 

    rep_Abcd_replica2.h
    Qt Code:
    1. static void registerMetatypes()
    2. {
    3. static bool initialized = false;
    4. if (initialized)
    5. return;
    6. initialized = true;
    7. qRegisterMetaType<State2>();
    8. qRegisterMetaType<State1>();
    9.  
    10. }
    To copy to clipboard, switch view to plain text mode 

    As you can see, the sort order for qRegisterMetaType has been changed.

    The rep File itself remains unchanged.
    Qt Code:
    1. class Abcd
    2. {
    3. ENUM State1 { Off=0, On }
    4. PROP(State1 state=State1::Off SOURCEONLYSETTER)
    5.  
    6. ENUM State2 { Off=0, On }
    7. PROP(State2 state=State2::Off SOURCEONLYSETTER)
    8. }
    To copy to clipboard, switch view to plain text mode 

    Is it not possible, to generate always the same content?

  2. #2
    Join Date
    Nov 2024
    Posts
    2
    Thanked 1 Time in 1 Post

    Default Re: repc generated file with different sort order

    It can be avoided by set QT_HASH_SEED=0

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

    d_stranz (8th November 2024)

Similar Threads

  1. Replies: 3
    Last Post: 28th September 2012, 15:01
  2. Restore table sort order after app restart
    By aguayro in forum Qt Programming
    Replies: 0
    Last Post: 21st August 2012, 20:20
  3. uic: file generated with too old version
    By dacrawler in forum Newbie
    Replies: 4
    Last Post: 22nd January 2011, 13:32
  4. QTreeView: get current sort column and order
    By supergillis in forum Qt Programming
    Replies: 1
    Last Post: 14th October 2008, 18:25
  5. Drag and drop items in view to sort order
    By Big Duck in forum Qt Programming
    Replies: 1
    Last Post: 25th May 2006, 20:43

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.