Qt 4.8
Public Functions | Public Variables | List of all members
QMenuPrivate::QWceMenuPrivate Struct Reference

#include <qmenu_p.h>

Public Functions

void addAction (QAction *, QWceMenuAction *=0)
 
void addAction (QWceMenuAction *, QWceMenuAction *=0)
 
QWceMenuActionfindAction (QAction *a)
 
 QWceMenuPrivate ()
 
void rebuild ()
 
void removeAction (QWceMenuAction *)
 
void removeAction (QAction *a)
 
void syncAction (QWceMenuAction *)
 
void syncAction (QAction *a)
 
 ~QWceMenuPrivate ()
 

Public Variables

QList< QWceMenuAction * > actionItems
 
HMENU menuHandle
 

Detailed Description

Definition at line 344 of file qmenu_p.h.

Constructors and Destructors

◆ QWceMenuPrivate()

QMenuPrivate::QWceMenuPrivate::QWceMenuPrivate ( )

Definition at line 435 of file qmenu_wince.cpp.

Referenced by QMenuPrivate::wceMenu().

436 : menuHandle(0)
437 {
438 }

◆ ~QWceMenuPrivate()

QMenuPrivate::QWceMenuPrivate::~QWceMenuPrivate ( )

Definition at line 440 of file qmenu_wince.cpp.

441 {
443  if (menuHandle)
444  DestroyMenu(menuHandle);
445 }
QList< QWceMenuAction * > actionItems
Definition: qmenu_p.h:345
static void qt_wce_delete_action_list(QList< QWceMenuAction *> *list)

Functions

◆ addAction() [1/2]

void QMenuPrivate::QWceMenuPrivate::addAction ( QAction a,
QWceMenuAction before = 0 
)

Definition at line 447 of file qmenu_wince.cpp.

Referenced by QMenuBarPrivate::QWceMenuBarPrivate::addAction().

448 {
449  QWceMenuAction *action = new QWceMenuAction;
450  action->action = a;
452  addAction(action, before);
453 }
long ASN1_INTEGER_get ASN1_INTEGER * a
static uint qt_wce_menu_static_cmd_id
Definition: qmenu_wince.cpp:88
QPointer< QAction > action
Definition: qmenu_p.h:129
uint command
Definition: qmenu_p.h:128
void addAction(QAction *, QWceMenuAction *=0)

◆ addAction() [2/2]

void QMenuPrivate::QWceMenuPrivate::addAction ( QWceMenuAction action,
QWceMenuAction before = 0 
)

Definition at line 455 of file qmenu_wince.cpp.

456 {
457  if (!action)
458  return;
459  int before_index = actionItems.indexOf(before);
460  if (before_index < 0) {
461  before = 0;
462  before_index = actionItems.size();
463  }
464  actionItems.insert(before_index, action);
465  rebuild();
466 }
void insert(int i, const T &t)
Inserts value at index position i in the list.
Definition: qlist.h:575
QList< QWceMenuAction * > actionItems
Definition: qmenu_p.h:345
int indexOf(const T &t, int from=0) const
Returns the index position of the first occurrence of value in the list, searching forward from index...
Definition: qlist.h:847
int size() const
Returns the number of items in the list.
Definition: qlist.h:137

◆ findAction()

QWceMenuAction* QMenuPrivate::QWceMenuPrivate::findAction ( QAction a)
inline

Definition at line 356 of file qmenu_p.h.

Referenced by QMenuBarPrivate::QWceMenuBarPrivate::addAction().

356  {
357  for(int i = 0; i < actionItems.size(); i++) {
358  QWceMenuAction *act = actionItems[i];
359  if(a == act->action)
360  return act;
361  }
362  return 0;
363  }
QList< QWceMenuAction * > actionItems
Definition: qmenu_p.h:345
QPointer< QAction > action
Definition: qmenu_p.h:129
int size() const
Returns the number of items in the list.
Definition: qlist.h:137

◆ rebuild()

void QMenuPrivate::QWceMenuPrivate::rebuild ( )

Definition at line 492 of file qmenu_wince.cpp.

Referenced by QMenuBarPrivate::QWceMenuBarPrivate::addAction(), addAction(), QMenuBarPrivate::QWceMenuBarPrivate::removeAction(), removeAction(), QMenuBarPrivate::QWceMenuBarPrivate::syncAction(), syncAction(), and QMenuPrivate::wceMenu().

493 {
494  if (!menuHandle)
495  menuHandle = CreatePopupMenu();
496  else
498 
499  for (int i = 0; i < actionItems.size(); ++i) {
500  QWceMenuAction *action = actionItems.at(i);
501  action->menuHandle = menuHandle;
503  }
505 }
HMENU menuHandle
Definition: qmenu_p.h:130
static void wceRefresh()
This function refreshes the native Windows CE menu.
QList< QWceMenuAction * > actionItems
Definition: qmenu_p.h:345
static void qt_wce_insert_action(HMENU menu, QWceMenuAction *action)
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
static void qt_wce_clear_menu(HMENU hMenu)

◆ removeAction() [1/2]

void QMenuPrivate::QWceMenuPrivate::removeAction ( QWceMenuAction action)

Definition at line 512 of file qmenu_wince.cpp.

513 {
514  actionItems.removeAll(action);
515  delete action;
516  rebuild();
517 }
QList< QWceMenuAction * > actionItems
Definition: qmenu_p.h:345
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
Definition: qlist.h:770

◆ removeAction() [2/2]

void QMenuPrivate::QWceMenuPrivate::removeAction ( QAction a)
inline

Definition at line 355 of file qmenu_p.h.

Referenced by removeAction().

355 { removeAction(findAction(a)); }
void removeAction(QWceMenuAction *)
QWceMenuAction * findAction(QAction *a)
Definition: qmenu_p.h:356

◆ syncAction() [1/2]

void QMenuPrivate::QWceMenuPrivate::syncAction ( QWceMenuAction )

Definition at line 507 of file qmenu_wince.cpp.

508 {
509  rebuild();
510 }

◆ syncAction() [2/2]

void QMenuPrivate::QWceMenuPrivate::syncAction ( QAction a)
inline

Definition at line 352 of file qmenu_p.h.

Referenced by syncAction().

352 { syncAction(findAction(a)); }
QWceMenuAction * findAction(QAction *a)
Definition: qmenu_p.h:356
void syncAction(QWceMenuAction *)

Properties

◆ actionItems

QList<QWceMenuAction*> QMenuPrivate::QWceMenuPrivate::actionItems

◆ menuHandle

HMENU QMenuPrivate::QWceMenuPrivate::menuHandle

The documentation for this struct was generated from the following files: