Results 1 to 6 of 6

Thread: Window size problem after Qt version update

  1. #1
    Join Date
    Nov 2014
    Posts
    4
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Window size problem after Qt version update

    First off I have to say I a still very new at using Qt and I inherited all the applications I am working on.

    I have been working on updating three applications from using Qt version 4.4.3 to 5.3 and these applications worked just fine before hand. These applications have two components as far a qt is concerned, a common library for Qt application widgets and a application layer that contains the specific widgets and other gui components for that application. Although the three application layer components are different there are structured in the same way and have a lot of duplicate code. So far I have managed to update the common library and two of the application layer components and they are working great, then there is the third application. I went through the exact same process as i did on the other two applications but for some reason I cannot get this one to start properly. The error i am getting is:

    QWindowsWindow::setGeometry: Unable to set geometry 6186674x454+0+0 on QWidgetWindow/'lightPaneWindow'. Resulting geometry: 65519x454+0+0 (frame: 8, 30, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 524297x454, maximum size: 16777215x16777215).

    If the application were to open correctly it should result in a gui about 6x6 inches or so, but instead it seem to be trying to extent the width of the gui off into the horizon. While trying to debug this issue I have found that disabling the signals for one of the QComboBoxes in the application layer seems to allow the application to start correctly, or at least with the right dimensions.

    Any help or guidance for this issue would be greatly appreciated.

  2. #2
    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: Window size problem after Qt version update

    Could you show connect() statements for those signals and body of the slots they are connected to?
    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.


  3. #3
    Join Date
    Nov 2014
    Posts
    4
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Window size problem after Qt version update

    Qt Code:
    1. //TabInstr extends QWidget
    2.  
    3. //idRing is of a type the extends QComboBox
    4. void TabInstr::createConnections(void)
    5. {
    6. connect(idRing, SIGNAL(currentIndexChanged(int)), this, SLOT(sendNewInst()));
    7. connect(idRing, SIGNAL(currentIndexChanged(QString)), this, SLOT(updateInfoBox(QString)));
    8.  
    9. ....
    10.  
    11. }
    12.  
    13. void TabInstr::sendNewInst()
    14. {
    15. QString temp = idRing->currentText();
    16. emit instrChanged(temp);
    17. return;
    18. }
    19.  
    20. //instInfoMap is of type QMap
    21. //infoBox is of a type that extends QLineEdit
    22. void TabInstr::updateInfoBox(QString address)
    23. {
    24. infoBox->setText(instInfoMap[address]);
    25. return;
    26. }
    27.  
    28. //from generated moc file
    29. // SIGNAL 0
    30. void TabInstr::instrChanged(QString _t1)
    31. {
    32. void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
    33. QMetaObject::activate(this, &staticMetaObject, 0, _a);
    34. }
    To copy to clipboard, switch view to plain text mode 

    Is this what you are asking for?

    when I comment out the two connect statements show the application is able to show its gui with normal dimensions.

  4. #4
    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: Window size problem after Qt version update

    How long are the entries in instInfoMap? What is the instrChanged() signal connected to? Does it help if you hide() infoBox widget?
    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.


  5. #5
    Join Date
    Nov 2014
    Posts
    4
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Window size problem after Qt version update

    instInfoMap is of type QMap<QString, QString>
    the key is always about 25 characters
    the value is also always about 25 characters
    instInfoMap contains about 6 entries

    hiding the infoBox widget does not seem to help
    I have tried hiding all the widgets that act as containers all the way up the chain from infoBox and short of not showing the main window nothing seem to help.

    As for what the instrChanged() signal is connected to I followed it back to a function in the main application code. While stepping through this code something doesn't seem right. Let me look into it and get back to you. This might be the issue.

    When I was tying to trace where the signal path ended I could not understand how Qt sets this up or how to trace the signal back. I was force to step through the qt code to see what functions were called. Can you explain what it is that I want to look at to understand how the signal are moving back up though the containers to the application window.

  6. #6
    Join Date
    Nov 2014
    Posts
    4
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Window size problem after Qt version update

    To make a long story short I think i fixed my problem. In the end Qt was just doing what it was told.

    The function i mentioned in my previous post contained another function call that took a QString and tried to convert it into a c_str. The implementation for this function was different from the other two applications that I converted successfully. This implementation assumed it was dealing with a unicode string, while the others implemented a generic conversion to a c_str. Needless to say the resulting string was junk after the conversion. This string was then used by a underlying driver for an attribute query, since the string used for the query was bad the driver call returned an error and the attribute's value was undefined. The return value for this call was never checked and the attribute's value was then used to calculate the size need for a QGridLayout and a widget.

Similar Threads

  1. Replies: 2
    Last Post: 8th December 2013, 05:53
  2. Replies: 1
    Last Post: 20th July 2011, 08:27
  3. Problem in size of window.
    By Niamita in forum Qt Programming
    Replies: 6
    Last Post: 10th June 2011, 11:40
  4. Main Window size problem
    By frenk_castle in forum Newbie
    Replies: 2
    Last Post: 20th December 2009, 10:49
  5. update window size
    By eric in forum Newbie
    Replies: 3
    Last Post: 14th January 2008, 10:21

Tags for this Thread

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.