Commit e1a6962a authored by treat@webkit.org's avatar treat@webkit.org

2009-07-30 Mike Fenton <mike.fenton@torchmobile.com>

         Reviewed by Adam Treat.

         Add previously defined out support to PopupMenuQt for marking entries as
         disabled and for selecting the desired item.

         https://bugs.webkit.org/show_bug.cgi?id=27772

         * platform/qt/PopupMenuQt.cpp:
         (WebCore::PopupMenu::populate):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@46593 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9c962752
2009-07-30 Mike Fenton <mike.fenton@torchmobile.com>
Reviewed by Adam Treat.
Add previously defined out support to PopupMenuQt for marking entries as
disabled and for selecting the desired item.
https://bugs.webkit.org/show_bug.cgi?id=27772
* platform/qt/PopupMenuQt.cpp:
(WebCore::PopupMenu::populate):
2009-07-30 Darin Adler <darin@apple.com>
Reviewed by David Levin.
......
......@@ -38,6 +38,7 @@
#include <QListWidgetItem>
#include <QMenu>
#include <QPoint>
#include <QStandardItemModel>
#include <QWidgetAction>
namespace WebCore {
......@@ -63,12 +64,22 @@ void PopupMenu::populate(const IntRect& r)
clear();
Q_ASSERT(client());
QStandardItemModel* model = qobject_cast<QStandardItemModel*>(m_popup->model());
Q_ASSERT(model);
int size = client()->listSize();
for (int i = 0; i < size; i++) {
if (client()->itemIsSeparator(i))
m_popup->insertSeparator(i);
else
else {
m_popup->insertItem(i, client()->itemText(i));
if (model && !client()->itemIsEnabled(i))
model->item(i)->setEnabled(false);
if (client()->itemIsSelected(i))
m_popup->setCurrentIndex(i);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment