Results 1 to 9 of 9

Thread: Drop downs appearing off the bottom of the page

  1. #1
    Join Date
    Jul 2007
    Posts
    90
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Drop downs appearing off the bottom of the page

    Hi,

    I have created application using QMainWIndow and added a toolbar at the bottomside of main window.

    I have added drop-down menu to this toolbar.
    When i clicked this drop-down menu, it is appearing off the bottom of the page( When application window is maximized ).

    is there any way so that i can show drop-down upwards, when it would go off the screen.

    regards,
    ~Sanjay

  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: Drop downs appearing off the bottom of the page

    Can we see the code?
    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
    Jul 2007
    Posts
    90
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Drop downs appearing off the bottom of the page

    yes sure.

    Here is the code fragment.

    Qt Code:
    1. QMyToolbar ::QMyToolbar()
    2. {
    3. // fill color drop-down menu
    4. m_actGroupFillColour = new QActionGroup(this);
    5. pAction = new QAction( QIcon( QMulteMathTool::relativeToAbsolutePath ( "English_en/fillcolor.png" ) ), tr("Fill Colour"), this );
    6. connect( pAction, SIGNAL( triggered() ), this, SLOT( setFillColor() ) );
    7. pAction->setData( QString("Fill Colour") );
    8. pAction->setCheckable( true );
    9. QMenu *pMenuFillColor = new QMenu();
    10. pMenuFillColor->setFixedSize(100,100);
    11. QGridLayout *pGridLayout5 = new QGridLayout();
    12. pGridLayout5->setHorizontalSpacing(5);
    13. pGridLayout5->setVerticalSpacing(0);
    14. pGridLayout5->setContentsMargins(4,4,4,4);
    15. for( int nCol = 0, i = 1; nCol<4; nCol++ )
    16. {
    17. for( int nRow = 0; nRow<4; nRow++)
    18. {
    19. QString fileName = QString("English_en/brushcolor%1.png").arg(i);
    20. fileName = QMulteMathTool::relativeToAbsolutePath(fileName);
    21. QToolButton *pBtn = new QToolButton(this);
    22. pBtn->setIcon( QIcon(fileName) );
    23. pGridLayout5->addWidget( pBtn, nRow, nCol);
    24. i++;
    25. connect( pBtn, SIGNAL( pressed() ), this, SLOT( setFillColor() ) );
    26. }
    27. }
    28. pMenuFillColor->setLayout(pGridLayout5);
    29. pAction->setMenu( pMenuFillColor );
    30. addAction( pAction );
    31. m_actGroupFillColour->addAction( pAction );
    32. m_actGroupFillColour->addAction( addSeparator() );
    33. }
    To copy to clipboard, switch view to plain text mode 


    here is the snapshot of drop down menu which is created by using above code
    [IMG]C:\Documents and Settings\sanjays\Desktop\drop-down menu.PNG[/IMG]

    regards,
    ~Sanjay
    Last edited by wysota; 25th May 2009 at 08:36. Reason: missing [code] tags

  4. #4
    Join Date
    Jul 2007
    Posts
    90
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Drop downs appearing off the bottom of the page

    Hi,
    I think snapshot may not be properly inserted.

    Can you see the snapshot properly.

    regards,
    ~Sanjay

  5. #5
    Join Date
    Jul 2007
    Posts
    90
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Drop downs appearing off the bottom of the page

    hi Wysota,

    Is there anything wrong in the code.

    regards,
    ~Sanjay

  6. #6
    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: Drop downs appearing off the bottom of the page

    How do you use (call) the code?
    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.


  7. #7
    Join Date
    Jul 2007
    Posts
    90
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Drop downs appearing off the bottom of the page

    Hi,

    I am calling from QMainwindow like this,

    m_MyToolBar = addToolBar( tr("Property ToolBar") );
    addToolBar( Qt::BottomToolBarArea, m_MyToolBar );

    But i dont think it is related to problem.

    regards,
    Sanjay

  8. #8
    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: Drop downs appearing off the bottom of the page

    It might be a bug in Qt.
    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.


  9. #9
    Join Date
    Jul 2006
    Location
    Atlanta, GA
    Posts
    86
    Thanks
    26
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Drop downs appearing off the bottom of the page

    You wouldn't happen to be forwarding X from an ssh session would you? I use Qt that way, and windows and drop downs always flow off the screen.
    fnmblot
    --------------------------------------
    Gee Ricky, I'm sorry your mom blew up.

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.