Results 1 to 1 of 1

Thread: bug in qt 4.7rc1? wrong availablegeometry

  1. #1
    Join Date
    Aug 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default bug in qt 4.7rc1? wrong availablegeometry

    Hi guys I'm stuck on a bug with rc1...

    The software was working ok with beta2...

    The problem is, I'm using the PLLayout class by nokia (http://wiki.forum.nokia.com/index.ph...e_Layout_in_Qt) to use rotation functions...

    BUT, when I rotate the screen, the wrong availablegeometry is shown...

    Is there anything I can do about it?

    Qt Code:
    1. void dummy::createComponents()
    2. {
    3. centralwidget = new QWidget();
    4. imgCameraLab = new QLabel(centralwidget);
    5. imgCameraLab->setObjectName(QString::fromUtf8("imgCameraLab"));
    6.  
    7. cameramenu = new QMenu(this);
    8. cameramenu->addAction(tr("Photo PF"), this, SLOT(PFphoto_slot()));
    9. cameramenu->addAction("Photo AF", this, SLOT(AFphoto_slot()));
    10.  
    11. videomenu = new QMenu(this);
    12. videomenu->addAction("Video PF", this, SLOT(PFvideo_slot()));
    13. videomenu->addAction("Video AF", this, SLOT(AFvideo_slot()));
    14.  
    15. samsungmenu = new QMenu(tr("Samsung devices"),this);
    16. samsungmenu->addAction(tr("i8910"), this, SLOT(i8910_slot()));
    17. samsungmenu->addAction(tr("i8510"), this, SLOT(i8510_slot()));
    18.  
    19. motomenu = new QMenu(tr("Motorola devices"),this);
    20. motomenu->addAction(tr("droidx"), this, SLOT(droidx_slot()));
    21. motomenu->addAction(tr("milestone"), this, SLOT(milestone_slot()));
    22.  
    23. othersmenu = new QMenu(tr("Other devices"),this);
    24. othersmenu->addAction(tr("vivaz"), this, SLOT(vivaz_slot()));
    25. othersmenu->addAction(tr("devplat"), this, SLOT(devplat_slot()));
    26. othersmenu->addAction(tr("n900"), this, SLOT(n900_slot()));
    27. othersmenu->addAction(tr("palm pre"), this, SLOT(palm_slot()));
    28.  
    29. codecsmenu = new QMenu(this);
    30. codecsmenu->addMenu(samsungmenu);
    31. codecsmenu->addMenu(motomenu);
    32. codecsmenu->addMenu(othersmenu);
    33.  
    34.  
    35. cameramenu_butt = new ModButton(tr("Camera Focus"));
    36. cameramenu_butt->setMenu(cameramenu);
    37. videomenu_butt = new ModButton(tr("Video Focus"));
    38. videomenu_butt->setMenu(videomenu);
    39. codecsmenu_butt = new ModButton(tr("JPEG Codecs Setting"));
    40. codecsmenu_butt->setMenu(codecsmenu);
    41. startcamera_butt = new ModButton(tr("Start Camera"));
    42. connect(startcamera_butt, SIGNAL(pressed()), this, SLOT(startcamera_slot()));
    43. exit_butt = new ModButton("EXIT");
    44. connect(exit_butt, SIGNAL(pressed()), this, SLOT(exit_slot()));
    45. }
    46.  
    47. void dummy::createPortraitLayout()
    48. {
    49. Qt::Alignment AlignFull = 0x0;
    50. layoutPortrait = new QGridLayout;
    51. layoutPortrait->setHorizontalSpacing(15);
    52. layoutPortrait->setVerticalSpacing(30);
    53.  
    54. cameramenu_butt->setFixedHeight(80);
    55. videomenu_butt->setFixedHeight(80);
    56. codecsmenu_butt->setFixedHeight(80);
    57. startcamera_butt->setFixedHeight(110);
    58. exit_butt->setFixedHeight(70);
    59. /*layoutPortrait->setRowMinimumHeight(3,300);*/
    60. layoutPortrait->addWidget(cameramenu_butt, 1, 0, 1, 1, AlignFull);
    61. layoutPortrait->addWidget(videomenu_butt, 1, 1, 1, 1, AlignFull);
    62. layoutPortrait->addWidget(codecsmenu_butt, 2, 0, 1, 2, AlignFull);
    63. layoutPortrait->addWidget(startcamera_butt, 4, 0, 1, 1, Qt::AlignLeft);
    64. layoutPortrait->addWidget(exit_butt, 4, 1, 1, 1, Qt::AlignBottom);
    65. layoutPortrait->addWidget(imgCameraLab, 0, 0, 1, 1, Qt::AlignLeft);
    66. }
    67.  
    68. void dummy::createLandscapeLayout()
    69. {
    70. Qt::Alignment AlignFull = 0x0;
    71.  
    72. layoutLandscape = new QGridLayout;
    73. layoutLandscape->setHorizontalSpacing(15);
    74. layoutLandscape->setVerticalSpacing(30);
    75. layoutLandscape->addWidget(imgCameraLab, 0, 0 ,1 ,1, AlignFull);
    76. layoutLandscape->addWidget(cameramenu_butt, 1, 0, 1, 1, AlignFull);
    77. layoutLandscape->addWidget(videomenu_butt, 1, 1, 1, 1, AlignFull);
    78. layoutLandscape->addWidget(codecsmenu_butt, 2, 0, 1, 2, AlignFull);
    79. layoutLandscape->addWidget(startcamera_butt, 3, 0, 1, 1, Qt::AlignLeft);
    80. layoutLandscape->addWidget(exit_butt, 3, 1, 1, 1, Qt::AlignBottom);
    81.  
    82. }
    83.  
    84.  
    85. void dummy::createAutoLayout() {
    86. autoLayout = new PLLayout();
    87. autoLayout->setPLayout(layoutPortrait);
    88. autoLayout->setLLayout(layoutLandscape);
    89. //recommendation; first assign Landscape and THEN portrait layout
    90. //as some - not yet understood - effects have been observed for other sequence
    91. }
    92.  
    93. void dummy::resizeEvent (QResizeEvent* event)
    94. {
    95.  
    96.  
    97. autoLayout->resizeEvent(event);
    98.  
    99. if(autoLayout->m_isLLayout == true )
    100. {
    101. this->setStyleSheet("dummy {background-image: url(C:/Data/faenil-graphics/backCamland.jpg)}");
    102. }
    103. else
    104. {
    105. this->setStyleSheet("dummy {background-image: url(C:/Data/faenil-graphics/backCam.jpg)}");
    106. }
    107.  
    108.  
    109. // Call base class impl
    110. QMainWindow::resizeEvent(event);
    111. }
    112.  
    113.  
    114. void dummy::selfAssignLayout() {
    115.  
    116. centralwidget->setLayout(autoLayout);
    117. centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
    118. this->setCentralWidget(centralwidget);
    119. }
    To copy to clipboard, switch view to plain text mode 



    This is the code of my mainwindow...
    the code of the PLLayout class is the same given by nokia...

    What am I doing wrong?
    The problem is the wrong available geometry makes my pushbutton menu go out of screen while in landscape, because the system uses the availablegeometry of portrait...

    The RESIZEEVENT example code from Nokia has the same problem that I have, it doesn't work correctly in the S60 SDK and on the phone, but it works ok in QT Creator's Simulator...

    so I guess it's a Symbian libraries bug...
    Last edited by faenil; 30th August 2010 at 00:28.

Similar Threads

  1. i don't know what i do wrong..
    By Hardstyle in forum Newbie
    Replies: 2
    Last Post: 27th June 2010, 17:33
  2. what is wrong with my qt ?
    By lwb422 in forum Qt Programming
    Replies: 5
    Last Post: 12th April 2010, 14:07
  3. What's wrong??
    By dreamer in forum Qt Programming
    Replies: 2
    Last Post: 25th June 2008, 08:07
  4. availableGeometry() & Gnome
    By December in forum Qt Programming
    Replies: 0
    Last Post: 6th April 2007, 16:18
  5. Help please - what am I doing wrong?
    By Jimmy2775 in forum Qt Programming
    Replies: 6
    Last Post: 6th March 2006, 22:06

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.