Results 1 to 13 of 13

Thread: dropdown menu(popupmenu) refreshing issue

  1. #1
    Join Date
    Jun 2007
    Posts
    9
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Smile dropdown menu(popupmenu) refreshing issue

    Hi all,

    I m using Qt 3.2

    In my application I am using one dropdown menu just like our normal FILE menu.

    Now when I click on one of the items from that drop down list, It displays one dialog box.

    When I click the item, dialog box opens.Now my problem comes here, when I close the dialog box, partial part of the that dropdown menu remains on the page, so what can I do to prevent so.

    Thanks in Advance
    Ankit

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: dropdown menu(popupmenu) refreshing issue

    Can we see the code you wrote to handle the menu?

  3. #3
    Join Date
    Jun 2007
    Posts
    9
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: dropdown menu(popupmenu) refreshing issue

    here is the code how the menu is generated:

    CMainPage::CMainPage( QWidget *pParent, const char *member, const QString &nMemStatus , const QString &nBattaryStatus , const QString &strTitle)
    :CMenuPage(pParent, member, nMemStatus, nBattaryStatus, strTitle)
    ,m_pStartExpt((m_pImage->m_pPixSetup), &g_optimizedPageTable_Normal[0] ,this)
    ,m_pResult((m_pImage->m_pPixResult), &g_optimizedPageTable_Normal[1] , this)
    ,m_pSysSetting ((m_pImage->m_pPixSetting), &g_optimizedPageTable_Normal[2], this)
    ,m_pShutDown((m_pImage->m_pPixShutDown), &g_optimizedPageTable_Normal[3] ,this)

    {
    setFont(*CGUIAppController::m_pNormalFont);
    m_pParent = pParent;
    //Add the Popup menu
    m_pImage = CImages::Instance();
    addPopupMenu((m_pImage->m_pPixStart), g_StrTbl_ConstLables_Bold[0], 1);
    addPopupMenu((m_pImage->m_pPixSetup), g_StrTbl_ConstLables_Bold[14], 2);
    addPopupMenu((m_pImage->m_pPixResult), g_StrTbl_ConstLables_Bold[16], 3);
    addPopupMenu((m_pImage->m_pPixSetting), g_StrTbl_ConstLables_Bold[18], 4);
    addPopupMenu((m_pImage->m_pPixeloglogo), g_StrTbl_ConstLables_Bold[27], 5);

    here is the constructor is shown and also image instance is there to display a small image and the text comes from the string table.
    now when I click on the last item dialog box opens, but when I close it partial part of this menu remains there..

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: dropdown menu(popupmenu) refreshing issue

    How does the addPopupMenu() method work? What are all these variables? This doesn't look like plain Qt code...

  5. #5
    Join Date
    Jun 2007
    Posts
    9
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: dropdown menu(popupmenu) refreshing issue

    its nothing buddy,
    here the first parameter puts a small image (pointer to the image)beside the text.
    second is the text of the popup, and last is the index no.

  6. #6
    Join Date
    Sep 2006
    Posts
    339
    Thanks
    15
    Thanked 21 Times in 16 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: dropdown menu(popupmenu) refreshing issue

    Quote Originally Posted by Ankit View Post
    its nothing buddy,
    here the first parameter puts a small image (pointer to the image)beside the text.
    second is the text of the popup, and last is the index no.
    I have a simple question
    What does the following code mean

    Qt Code:
    1. CMainPage::CMainPage( QWidget *pParent, const char *member, const QString &nMemStatus , const QString &nBattaryStatus , const QString &strTitle)
    2. :[B]CMenuPage[/B](pParent, member, nMemStatus, nBattaryStatus, strTitle)
    To copy to clipboard, switch view to plain text mode 
    What is the base class of CMainPage?

    And one more thing, please use
    Qt Code:
    1. .....
    To copy to clipboard, switch view to plain text mode 
    for your "code snippet". It makes the code more readable.

    Thanks

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: dropdown menu(popupmenu) refreshing issue

    But what does it do internally? Are these your own classes or are they a part of some framework?

  8. #8
    Join Date
    Jun 2007
    Posts
    9
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: dropdown menu(popupmenu) refreshing issue

    Hi Dear,

    I have used Qpushbuton class and created a pushbutton.
    I have used the setpopup functionality of pushbutton class so when i click on this push button a popup menu of options will appear.

    This popup menu is like our file menu only. Now when we click on file button a popup menu will open and when we select the open from the list a dialog box appears and popup menu gets hide am i right? Here in my case on clicking the button a popup menu opens perfectly and choosing options among popup menu a dialog box appears this thing works fine but the popup menu remains open in background. I would like to know how to hide this popup menu. .

    All the above classes are derived from class QWidget.

    We have used our own hardware platform to run this firmware code.

    This will make more clear for your understanding of my problem.

    Waiting for your reply.

  9. #9
    Join Date
    Sep 2006
    Posts
    339
    Thanks
    15
    Thanked 21 Times in 16 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: dropdown menu(popupmenu) refreshing issue

    For me your constructor seems to be wrong, if your base class is QWidget then I think your constructor should be something like this

    Qt Code:
    1. CMainPage::CMainPage( QWidget *pParent, const char *member, const QString &nMemStatus , const QString &nBattaryStatus , const QString &strTitle)
    2. :QWIdget(pParent, member)
    3. {
    4. //your code
    5. }
    To copy to clipboard, switch view to plain text mode 
    Try this and then let us know the status....

    Thanks

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: dropdown menu(popupmenu) refreshing issue

    What is the base class of the popup menu? If it's QPopupMenu and you trigger it with exec(), it should hide itself when you click outside the menu or choose one of its actions.

  11. #11
    Join Date
    Jun 2007
    Posts
    9
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: dropdown menu(popupmenu) refreshing issue

    thanks for ur help dear,
    but here that functionality just u told about exec() is already implemented.
    after opening the menu if I click else where then it automatically gets hidden.
    Is there any other way????

  12. #12
    Join Date
    Jun 2007
    Posts
    9
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: dropdown menu(popupmenu) refreshing issue

    Hi

    Thanks for your quick reply.

    Qpopupmenu is the class of popup menu, but we are using the popup to trigger the popup menu is there any function while using popup to hide the menubar.

  13. #13
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: dropdown menu(popupmenu) refreshing issue

    I must admit I'm having trouble understanding what the problem is. Could you post a screenshot of what happens?

Similar Threads

  1. Refreshing issue
    By Ankit in forum Qt Programming
    Replies: 1
    Last Post: 14th August 2007, 12:30

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.