HOWTO: Use the contextual action with ListView in C++
Hello
I need your advice and the best way to manage the user in the context menu action, linked to a ListItem (or the MultiSelectActionItem)
My skeleton of ListView is defined in QML. In C++, I create and fill in ListView. ListView can be instancied multiple times (each with its own data model). So for each ListView, I get the same action of context.
Now, how to manage the action trigger signal. Sample for ListItem delete action, I can not connect a slot to the signal of ListItem. Otherwise, I have to do for each ListItem! I think that this is not the right way.
I looked at the bucket sample. Stocks are managed directly by the datamodel.
The second point is that the action item process is long and regular through the event of Qt. loop (and of course the content list may change before the end of the process).
Another solution could be: QML send a signal custom ListView object (and not the ListItem).
Nicolas
I see what you mean about Battambang: there are a series of action applied to each element.
In many cases, it may be wiser to join acts to list. I suggest something along these lines:
Addition of stampcollector main.qml in the ListView after the ListItemComponents:
contextActions: [ ActionSet { ActionItem { objectName: "ooglyAction" title: "oogly" } ActionItem { objectName: "booglyAction" title: "boogly" } DeleteActionItem { objectName: "deleteAction" title: "Delete" } } ]
In stampcollectorapp.cpp:
(a) in the constructor:
ActionItem* action = nav->findChild("ooglyAction"); if (action) connect(action, SIGNAL(triggered()), this, SLOT(onListActionOogly())); action = nav->findChild ("booglyAction"); if (action) connect(action, SIGNAL(triggered()), this, SLOT(onListActionBoogly())); DeleteActionItem* daction = nav->findChild ("deleteAction"); if (daction) connect(daction, SIGNAL(triggered()), this, SLOT(onListActionDelete()));
(although you can use the same signal for all the actions non - handler remove if you want to turn on the text of action in Manager)
(b) methods as:
void StampCollectorApp::onListActionOogly() { qDebug() << "Here I am: oogly!"; qDebug() << sender(); } void StampCollectorApp::onListActionBoogly() { qDebug() << "Here I am: Boogly!"; qDebug() << sender(); } void StampCollectorApp::onListActionDelete() { qDebug() << "Here I am: Delete!"; qDebug() << sender(); DeleteActionItem* action = dynamic_cast(sender()); if (action == 0) { qDebug() << "Not expected type"; return; } qDebug() << "Yes, found!"; QObject* parent = action->parent(); // get ActionSet if (parent != 0) parent = parent->parent(); if (parent == 0) { qDebug() << "No parent!"; return; } const QMetaObject* m = parent->metaObject(); if (m == 0) { qDebug() << "No metaobject!"; } qDebug() << m->className(); }
In other words, use sender()
Stuart
Tags: BlackBerry Developers
Similar Questions
-
Is it possible to use the Remote app with the Apple TV connected via ethernet and iPhone via WiFi? When I try this Apple TV does not appear in the list of devices on my iPhone.
Yes, I'm doing exactly this with the same put in place.
If the problem persists the next relative to the following articles might help you.
-
When I use the mail merge with excel file, after I press ok of the progress bar indicates "NaN", mail project window crashes. My file is in the correct format and small size (4-column 4 raws). I use an English version of thunderbird after accidentally, I installed one in my tongue.
I am attaching the screenshot
I solved the problem
has been st@pid excelI created a CSV file in openoffice calculator and everything went smoothly
-
Brother.
We use win7 with Mozila 31, 4.2 with Mozila Android smart phone latest google app store on 04/10/0214. Using the same account with the same email. But the phone does not get any new information of win7 with Mozila 31. PL z give useful information.Hi w3ur_team,
Thank you for your question. I understand that there are two features that are documented in the sync account. However the Android is not synchronized.There are two places we can check:
- In the Android settings, under accounts is the Firefox Sync or Firefox Sync (discouraged) joint account?
- Credentials work on accounts.firefox.com on the mobile device and are there any error messages in the synchronization of the settings menu > sync?
See also Firefox Sync troubleshooting and tips for more troubleshooting steps.
-
How to use the "Toshiba controls" with other players?
Heey
I have a Satellite with Toshiba controls. How can I change so I can use the buttons for other media players and not only Windows Media Player?
A dude sorry for the bad news, but I fear that it is not possible to use the Toshiba controls with another application as with WMP (CD) and WinDVD (DVD)
I think that the utility was already programmed and designed to use only these two applications. -
I can collect data from a hygrometer in a text file using the RS232 port with the following T75.2F:H17.0% format, these data are collected using a data logger software. I was wondering if I can collect this data for later analysis using Dasylab. Any help is appreciated.
The setting below causes the error. Change for the second selection, output values of all channels.
-
I have a router Linksys Wireless (wrt160n) that I am not using. I whant to buy a (Linksys WUSB600N) for my office. I want to know if I need to use the software supplied with the hardware, or can I just use Microsoft Wizard to configure my network? Operating system is Vista Premium.
Thank you Jeremy will do.
-
Hello, December 22, 2015, I paid € 144,33 on account of Adobesystem (using photoshop). I wonder what for? I got no answer, no program to install etc... Can you help me? I used the demo version with the idea that I could update, but nothing.
Download/install the desktop application, connect and install applications subscription.
https://helpx.Adobe.com/creative-cloud/help/download-install-app.htmlCreative cloud to desktop
https://helpx.Adobe.com/creative-cloud/help/creative-cloud-desktop.htmlSign out, sign in | Creative office cloud app
http://helpx.Adobe.com/creative-cloud/KB/sign-in-out-creative-cloud-desktop-app.htmlInstall, update, or uninstall applications
http://helpx.Adobe.com/creative-cloud/help/install-apps.htmlInstall creative Cloud applications
http://TV.Adobe.com/watch/CS6-creative-cloud-feature-tour-for-video/installing-desktop-app s-of-creative-cloud. -
To connect to vCenter using the same Session with PowerCLI
Hi all
Is it possible that we can establish multiple connections to vCenter using the same session with Powercli.
As connect-viserver-Server "vcenter1" - domain\domainacnt of the username-password "Password".
is to establish several connections and we want to limit, because we are in the process of report generation based on the web developing using Powercli with IIS.
Please suggest.
You can use the Session parameter on the cmdlet Connect-VIServer .
I use this for the PowerShell Workflows, see workflow of PowerShell and PowerCLI
-
When you use the Polygonal Lasso with 13 elements, I get the message ' WARNING: no pixel is selected to more than 50 percent. " Why - and how to fix it?
Make sure that the correct layer is selected.
Decrease the amount of feathers.
-
How do you use the creative cloud with using the internet.
How do you use the creative cloud with using the internet.
You MUST have an internet connection to download and activate the programs
After this, you MUST have a connection to the programs check your subscription on the calendar below
Cloud status check 30-or-99 days https://forums.adobe.com/thread/1549838
-
Using the pencil tool with workspace IIllustrator with Surface Pro 2 touch stylus sometimes draws a shape, sometimes doesn't. never draw a blue preliminary guidance to see the shape before it's over. These bugs can be corrected?
BestCoast,
You can try to disable the GPU performance by clicking on the icon of the rocket in the bar of the App, or on the top of the menu bar, deselect the box Performance GPU; You may also uncheck performance GPU in your preferences.
-
Hi all
I want to use the function NOW with a different operator in obiee11.1.1.6.11 or 11.1.1.7.1
but every time I have a creating a filter as
TRAN_DATE is equal to NOW()-120, we become "an arithmetic operation is being performed on a non-digital type.»
11.1.16.11 and 11.1.1.7.1
Hare TRAN_DATE is in RPD datetime data type
Can someone tell me how to replace the error and make the report run and return the results
Do now () - 120 is a very simplistic way to look at it because it is highly ambiguous. IE: NOW less 120 "what?" Minutes? Seconds? Years? Petroleum products?
Accuracy is the key. Now() gives a timestamp (a real timestamp DATA TYPE object!), so I guess you mean days.
Timestamp data types are changed (projected through time) using the TIMESTAMPADD function, which in your case would by this formula:
TIMESTAMPADD (SQL_TSI_DAY,-120, NOW()))
-
What should I do to be able to use the Kodak filters with PSE V13?
With PSE Version 10 (and PSE Versions older than V10), I have to be able to use the Kodak filters (e.g. the Kodak 'Digital Roc Professional V2.1.0,' the KODAK "Digital GEM Professional V2.1.0",...), I had to (one time) the following when you run PES Editor:
- Preferences-> Plug-Ins
- Check the box "Plug-in additional files" and then "select" files C\Program (X 86) \Kodak folder that contains the files with the Kodak flters
Once I did that (after stopping and restarting of the PES editor), I could use the KODAK filters with full Editor from PSE via the Menu-> filters.
With PSE V13, it does not. In the V13 PES Editor, Menu-> filters don't show me any KODAK filter.
Because the V13 PES editor not showing me filters KODAK via the Menu-> filters: I tried the following: I copied the folder that contains the KODAK filters in the V13 PES editor plug-in folder. It worked too much
I'd appreciate your help / feedback, because I need KODAK filters for retouching of tousands of scanned old slides (among others for the removal of color in all cases casts where using the PES editor alone is not enough to eliminate the strong color casts in old slides)
Thanks in advance
You use windows? Remember that PSE 13 is 64-bit, unless you have a 32-bit system (indicating the path of file in your post is not the case) and plugins should be as well. Many existing plugins will not work unless there is a updated version. If these are the image enhancement plug-ins, note the tecniques:
V
2.1: Compatible with WINDOWS 7, XP and Vista for ADOBE PHOTOSHOP CS5/CS6 (32-bit ONLY) and CS5 MAC/INTEL (32-bit ONLY).
-
Anyone use the <; cfdocument >; tag with a <; cfloop >;
Anyone use the < cfdocument > tag with a < cfloop >
I'm generating more documents like this.
< cfloop query = "myquery" >
< cfdocument type = pdf >
< html >... .HTML code here... < html >
< / cfdocument >
< / cfloop >
But only the first document is generated in the browser?
My requirement that I want to create multiple PDF and publish to folder and zip folder so that the user can able to download the ZIP file
Thanks in advance
My requirement that I want to create multiple PDF and publish to folder and zip folder so that the user can able to download the ZIP file
(1) create a folder named, say, docsDir, in the current directory.
(2) create PDF files, using suggestion of Eddie Lotter, name each file dynamically and store them in the folder docsDir.
Insert here the code to generate the content of
#filename # .(3) zip file, docsDir, store the resulting file, docsDir.zip, in the current directory.
Maybe you are looking for
-
Product recovery / disk drive not recognized
I am trying to achieve a waste product on a Toshiba Satellite running Windows Vista. I followed the instructions provided with the product recovery disc (insert the disc, restart your computer, press F12). While the recovery was then frozen at about
-
What version of Bootcamp need me?
Hello I have a Macbook Pro end 2013/mid 2014 (model A1398) running Windows 7. I got a pair of headphones Bluetooth Jaybird X 2 for Christmas that I tried to go to work. I have completely failed. I am able to pair the headset but there are about four
-
HP elitebook 8460p: drivers needed
My HP elite book 8460p will not get online and I have no idea why, but the WiFi connection seems fine. I am aware that miss me three pilots in the section 'other' devices... I believe that those who might be the reason, but I don't know and because I
-
I tried several times to install Service Pack 3. I have XP Professional. The error is "not enough disk space on C:\Windows\$NtServicePackUninstall$ etc etc and he wants an another 4 MB of space." I have about 24Gig of space and deleted several tim
-
Remove the symbol of security on the desktop icon shield
Greetings. Is it possible that I can remove security shield symbol that comes with the desktop icon or prevent before installing any program... As far as I know, there are forums that suggesting turning out of control (UAC) user account would solve t