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
Re: dropdown menu(popupmenu) refreshing issue
Can we see the code you wrote to handle the menu?
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..
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...
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.
Re: dropdown menu(popupmenu) refreshing issue
Quote:
Originally Posted by
Ankit
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
Code:
CMainPage
::CMainPage( QWidget *pParent,
const char *member,
const QString &nMemStatus ,
const QString &nBattaryStatus ,
const QString &strTitle
):[B]CMenuPage[/B](pParent, member, nMemStatus, nBattaryStatus, strTitle)
What is the base class of CMainPage?
And one more thing, please use for your "code snippet". It makes the code more readable.
Thanks
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?
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.
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
Code:
CMainPage
::CMainPage( QWidget *pParent,
const char *member,
const QString &nMemStatus ,
const QString &nBattaryStatus ,
const QString &strTitle
):QWIdget(pParent, member)
{
//your code
}
Try this and then let us know the status....
Thanks
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.
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????
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.
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?