Qt World Summit: Register Today!

QGridLayout::addMultiCellWidget analog in Qt 5.7 ?

  • Hi all,

    I have very old source code that use , I guess , Qt 3 . I want to port it to Qt 5.7 .
    Compiling it with Qt Creator I see lots of errors:

     'class QGridLayout' has no member named 'addMultiCellWidget'
      layout->addMultiCellWidget(w.c, 0, 0, 1, 1);

    Have no clue how to port it to modern version of Qt .
    Thanks for any suggestions .

  • @poshichek

    You might be correct that the code originates from Qt3. At least Qt 4.8 has a note for "addMultiCellWidget" in there for compatibility. There is a note to use addWidget
    Note, this documentation is for Qt4.8 and not Qt5 yet. However, the same routine is given also in Qt5 addWidget.

    Applications written for Qt4 can be compiled and linked most of the time Qt5. Only few adaptations are required.

    I have never worked with Qt3. Therefore, I do not know what further problems you are facing. However, I know that there have been significantly more changes from Qt3 to Qt4 than for Qt4 to Qt5.

  • Lifetime Qt Champion


    To add to @koahnig you have the:

    1. Porting overview page
    2. Porting to Qt 4 page

    that will help port your application.

  • Thank you guys for your response.
    Your advice did the job and with few other minor changes the app is compiled now ... Now I'm going to make it work :-)

    BTW I don't have such an option "Mark topic as solved" in tools menu , so moderators , please, do it for me .

  • @poshichek

    Good luck for migration from older Qt version.

    Not sure why you cannot mark it as solved. However, I cannot set it to solved either.

  • @koahnig

    Thanks .
    Additional issue was re-ordering parameters in all calls to addWidget method. It's already done and original layout shows up on application run .

  • @poshichek

    There is an on-going discussion in the moderator's part. The platform allows to "Ask question" or to discuss ("Submit"). The problem is in what is default. When a question has been as asked, everybody answering will see "ask a question" for submit, which is really confusing, because they are actually answering.

    The other option is to have discussions as default and everybody sees "Submit", but the "Mask as Solved" vanishes.

    In order to mark discussions as "Solved" go to "Topic Tools" and press "Ask as question". Open "Topic Tools" again and now you should see "Mark as Solved" to press.

  • @koahnig

    Now in my Topic Tools I see an option "Mark as Unsolved" . I think I'll create new test thread to exercise in using Mark as Solved feature .

  • @poshichek

    Initially you had in "Topic Tools" as last entry "ask as question". I had changed the status of your thread there. Therefore, you see "Mark as unsolved", since I could activate the "mark as solved" status then as well. Now you see "Mark as normal topic" at the end. There is the key for switching forth and back.

  • @koahnig
    Thanks, this problem is solved now .

Log in to reply