Posts

Showing posts from September, 2015

jsf - How to order SelectItems in custom renderer extending MyFaces HtmlMenuRenderer -

i´m trying migrate custom component render selectonemenu on myfaces 2.0, need use library because 8.5 moved mojarra 1.2 myfaces 2.0 implementation. in mojarra 1.2, extended com.sun.faces.renderkit.html_basic.menurenderer had method renderoptions receives parameters facescontext context, uicomponent component, list<selectitem> listselectitems , myfaces haven´t similar method. this method used order items before render (mojarra 1.2): @override protected void renderoptions(facescontext context, uicomponent component, list<selectitem> listselectitems) throws ioexception { cobisselectonemenuuicomponent uicomponent = (cobisselectonemenuuicomponent) component; string order = uicomponent.getorder(); if (order == null || order.isempty()) { order = default_order; } if (order.equals("asc")) { collections.sort(listselectitems, comparatorselectitemlabel); } else { if (order.equals("desc")) {

Android : Making Listview full screen -

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".mainactivity"> <edittext android:layout_margintop="5dp" android:layout_width="match_parent" android:layout_height="50dp" android:background="@drawable/location_edittext" android:id="@+id/locationeditext" android:textsize="15sp" android:textcolor="#999" android:paddingleft="15dp" /> <com.example.ravi_gupta.slider.viewpagercustomduration android:layout_width="wrap_content" android:layout_height="0dp" android:id="@+id/viewpager" android:scrollbarstyle="outsideoverlay" android:layout_weight="0.5&quo

java - WebServiceException : Class do not have a property of the name debug -

i generated java proxy classes using 'xjc'. getting "do not have property of name debug" webservice exception when deploy application production environment. however, in staging environment works fine. referring same web-service both environments, endpoint url & wsdl same. any appreciated. built on java 6, deployed on jboss 6.x here client code using call webservices. ==========client code=========== processaccountsiteunitwsd service = new processaccountsiteunitwsd(); final processaccountsiteunitwsdporttype port = service.getgesfdcpwaccountsiteunitserviceswebservicesproviderprocessaccountsiteunitwsdport(); final bindingprovider hb = ((bindingprovider) port); hb.getrequestcontext().put(bindingprovider.endpoint_address_property, resources.getstring("endpoint_address")); hb.getrequestcontext().put(bindingprovider.username_property,

sql server - SQL, get max id of column -

i've got table in ms sql server management studio +------+-----------+-------- | id | client id | bla bla blaaaa +------+-----------+-------- | 1 | 1 | ....... | 2 | 2 | ....... | 3 | 3 | ....... | 4 | 8 | ....... | 5 | 9 | ....... | 6 | 15 | ....... | 7 | 1 | ....... | 8 | 16 | ....... | 9 | 2 | ....... | 10 | 9 | ....... | 12 | 12 | ....... +------+-----------+-------- i need unique [client id] max value of [id], this +------+-----------+-------- | id | client id | bla bla blaaaa +------+-----------+-------- | 3 | 3 | ....... | 4 | 8 | ....... | 6 | 15 | ....... | 7 | 1 | ....... | 8 | 16 | ....... | 9 | 2 | ....... | 10 | 9 | ....... | 12 | 12 | ....... +------+-----------+-------- i tried code, doesn't work .. can me? select * table 1 inner join table 2 o

c# - How to share session between a MVC project and a WCF project? -

i have angular-webapi-mvc-wcf solution. i want share user session between mvc , wcf projects. possible? also, want share authentication mechanism, mean, want user authenticated once on mvc project using formauthentication, , let wcf know when user authenticated without envolving other technologie. i have solution mvc , wcf app reside on same project(dll), , on context can share authentication , session data. so, in order share session, should move svc files wcf mvc project? way? all projects share same db, solve without having store session data on db level. thanks info if wcf layer on same app pool, can check aspxauth cookie (forms auth cookie name configurable) , can use methods in formsauthentication class/namespace decode cookie user in wcf layer. if configure forms auth cookie domain cookie can host wcf layer in different app pool/iis site long it's on same domain main site. both sites receive cookie. that cookie drives forms authentication. if fo

javascript - How to Hide Date Menu from Datepicker in yii2 -

basically in datetimepicker widget date choose first time, how can hide date option widget , filter according time. tried not working want hide remove button [ 'attribute'=>'time', 'label'=>'time', 'format'=>'raw', 'value'=>function($data){ return date('h:i:s',strtotime($data->time)); }, 'filter'=> datetimepicker::widget([ 'model' => $searchmodel, 'attribute' => 'time', 'clientoptions' => [ 'autoclose' => true, 'format' => 'hh:ii', 'showon' =&

ios - How to call the -(void)update:(CCTime)delta method in Objective-C -

is there way call -(void)update:(cctime)delta method in objective-c? know (using sprite builder) can create scene , have attached custom class when scene loaded through ccbreader, class's update method automatically called. i loading scene through code without custom class still update method "start" (for lack of better word.) there way this? call scheduleupdate from, example, onenter method. [self scheduleupdate]; however if using cocos2d-objc or cocos2d-spritebuilder version 3.0 or later, update: methods scheduled automatically. https://github.com/cocos2d/cocos2d-objc/blob/v3.0/cocos2d/ccnode.m#l1190 -(cctimer *) schedule:(sel)selector interval:(cctime)interval repeat: (nsuinteger) repeat delay:(cctime) delay { nsassert(selector != nil, @"selector must non-nil"); nsassert(selector != @selector(update:) && selector != @selector(fixedupdate:), @"the update: , fixedupdate: methods scheduled automatically.");

javascript - getting null value in list when passing by ajax call to mvc controller -

i passing list mvc controller getting null value in controller.but list has values when show in alert on client side. ajax call $("#addtiles").click(function() { usertiles = json.stringify({ 'usertiles': usertiles }); alert("entered function."); alert(usertiles[0].tileid); var url = '@url.action("addtiles")'; $.ajax({ type: "get", url: url, data: usertiles, success: function(d) { if (d.indexof('"issessionexpired":true') != -1) { location.reload(); } else { onaddtilessuccessful(d); } }, error: function() { errorinoperation(); }, contenttype: "application/html; charset=utf-8", datatype: 'html' }); }); function onaddtilessuccessful(e) { $("#tilessubmissionmsg").append(e); } function errorin

android - Google Maps Api V2 draw circle around current position -

im working google maps api v2 on android project, need able draw circle around users current position , display markers points of interest within radious around users current position. im struggling small marker denotes users current position can draw circle around it. this code far. //set map , display users current position. mapfragment mapfragment = (mapfragment) getfragmentmanager() .findfragmentbyid(r.id.nearbymapsearch); mapfragment.getmapasync(this); final googlemap map = (((mapfragment) getfragmentmanager().findfragmentbyid(r.id.nearbymapsearch)).getmap()); map.setmylocationenabled(true); //zoom users location geolocationhandler geohandler = new geolocationhandler(getactivity().getapplicationcontext()); log.i("search fragment", "" + geohandler.getcurrentlatitude() + " , " + geohandler.getcurrentlongitude()); latlng loc = new latlng(geohandler.getcurrentlatitude(), geohandler.getcurrentlongitud

javascript - Jquery ajax on IE11 -

i have problem here. use jquery ajax send request end server , return clue notice if request proceed or not. had try in ie8 , ie7, jquery ajax works well, when try on ie11, error few times, , work after that. question is, how make run on ie11 without have wait few times? this jquery ajax script var value = $("#record"+index).attr('value'); var hiddenamount = number ($("#hiddentotalamount").val()); var values=value.split('/'); var uncheckedamount = number(values[1]); var realamount = 0; var realrecord = number ($("#totalrecord").val()); var checkeddoc = $("#record"+index).val(); var datastring = "action=validatedocnum&holddocnum="+checkeddoc; if($("#record"+index).attr('checked')){ $.ajax({ type: "post", url: "executesp2d.do", data: datastring+"&act=check", cache: fa

node.js - Passing/Comparing by reference for javascript objects -

i'm trying compare 2 objects. use socket.io send nodes object client. my server.js goes: var nodes = {'101':{id:'101',x:100,y:200}, '102':{id:'102',x:200,y:200}}; socket.emit('message', nodes); in client, i'd create copy of object nodes first time receives. save variable oldnodes , next time socket receives nodes object, comparison oldnodes , output property has been changed. e.g., if receives var nodes = {'101':{id:'101',x:100,y:200},'102':{id:'102',x:200,y:300}}; , should print(console.log) nodes[102].y changed . client.html : socket.on('message', function(nodes){ if (oldnodes == undefined){ var oldnodes = nodes; } else{ //compare oldnodes & nodes //print result } }); for copying, var oldnodes = nodes; not want since javascript passes objects reference. so, if oldnodes & nodes have same content, (oldnodes == nodes)

c - What is the best way to generate prime numbers? -

i doing exercises programming in c kochan; @ initial stage, chapter 5. here task: program 5.10 has several inefficiencies. 1 inefficiency results checking numbers. because obvious number greater 2 cannot prime, program skip numbers possible primes , possible divisors. inner loop inefficient because value of p divided values of d 2 through. inefficiency avoided adding test value of is_prime in conditions of loop. in manner, loop set continue long no divisor found , value of d less p. modify program 5.10 incorporate these 2 changes. here program 5.10 // generate table of prime numbers #include <stdio.h> int main (void) { int p, d; _bool is_prime; (p = 2; p <= 50; ++p) { is_prime = 1; (d = 2; d < p; ++d) if (p % d == 0) is_prime = 0; if (is_prime) // or if (is_prime != 0); same printf ("%i &quo

vb.net - Auto-save attachments in Outlook 2010 -

my goal able save attachments specific email address folder locally. have created vb script reason doesn't work. public sub saveattachtodisk (itm outlook.mailitem) dim objatt outlook.attachment dim savefolder string dim dateformat dateformat = format(now, "dd-mm-yyyy h-mm") savefolder = "c:\temp\" each objatt in itm.attachments objatt.saveasfile savefolder & "\" & dateformate & objatt.displayname set objatt = nothing next end sub i've tried created new module , new rule run script when message arrives specific address. have tried put script in "thisoutlooksession" nothing works. did try run script manually under debugger? try choose drive. c: drive requires admin privileges writing. you may find getting started vba in outlook 2010 article helpful.

django - iOS Push Notifications is not received -

backend - django frontend - objective c (x-code) i've followed this apple document configure push notifications , completed steps. for backend, using django-push-notifications django==1.7 , results no error when message sent. for frontend, have added following lines receive notification, uiusernotificationtype usernotificationtypes = (uiusernotificationtypealert | uiusernotificationtypebadge | uiusernotificationtypesound); uiusernotificationsettings *settings = [uiusernotificationsettings settingsfortypes:usernotificationtypes categories:nil]; [application registerusernotificationsettings:settings]; [application registerforremotenotifications]; - (void)application:(uiapplication *)application didregisterforremotenotificationswithdevicetoken:(nsdata *)devicetoken {

objective c - AFNetworking GET parameters with JSON (NSDictionary) string contained in URL key parameter -

this json string has sent: { "dashboard": "compact", "theme": "dark", "show_side_bar": "yes" } to rest api using get method in format (since server retrieves data php code $_get["setting"] ) afhttprequestoperationmanager , such equivalent url becomes: http://www.examplesite.com/api/change_setting?setting={ "dashboard" : "compact", "theme" : "dark", "show_side_bar" : "yes" } when create nsdictionary of parameters in afhttprequestoperationmanager 's get:parameters:success:failure: adds url key parameter parameter dictionary this: { "setting": { "dashboard": "compact", "theme": "dark", "show_side_bar": "yes" } } in short only json string must encapsulated in setting parameter not object of setting in json string. edit: here's code: afhttpreq

java - How to upload files to server using JSP/Servlet? -

how can upload files server using jsp/servlet? tried this: <form action="upload" method="post"> <input type="text" name="description" /> <input type="file" name="file" /> <input type="submit" /> </form> however, file name, not file content. when add enctype="multipart/form-data" <form> , request.getparameter() returns null . during research stumbled upon apache common fileupload . tried this: fileitemfactory factory = new diskfileitemfactory(); servletfileupload upload = new servletfileupload(factory); list items = upload.parserequest(request); // line died. unfortunately, servlet threw exception without clear message , cause. here stacktrace: severe: servlet.service() servlet uploadservlet threw exception javax.servlet.servletexception: servlet execution threw exception @ org.apache.catalina.core.applicationfilterchain.internaldofilter(

python - How to remove the Xframe Options header in django? -

i have made page has iframe . inside iframe want show multiple different links article facebook, or news, or youtube video or other possible url. but, due xframe header, unable so. referred following link: https://docs.djangoproject.com/en/1.8/ref/clickjacking/ , django xframeoptionsmiddleware (x-frame-options) - allow iframe client ip but didn't help. my settings.py file's middleware_classes is: middleware_classes = ( 'django.contrib.sessions.middleware.sessionmiddleware', 'django.middleware.common.commonmiddleware', 'django.middleware.csrf.csrfviewmiddleware', 'django.contrib.auth.middleware.authenticationmiddleware', 'django.contrib.auth.middleware.sessionauthenticationmiddleware', 'django.contrib.messages.middleware.messagemiddleware', 'django.middleware.clickjacking.xframeoptionsmiddleware', ) from http://django-secure.readthedocs.org/en/latest/middleware.html , found using

xml - List<JAXBElement> in adapter code impacting JSON format -

i format json output contain string objects having 1 element , not array. below pojo. @component("myvo") @scope("prototype") @xmlrootelement @xmlaccessortype(xmlaccesstype.none) @xmltype(proporder = {"a", "b", "c", "d", "e", "f", "sectionlist"}) public class myvo extends serviceresponseto { private static final long serialversionuid = -9190950749517871535l; @xmlelement(name="abc") private string a; @xmlelement(name="def") private string b; @xmlelement(name="ghi") private string c; @xmlelement(name="jkl") private string d; @xmlelement(name="mno") private string e; @xmlelement(name="pqr") private string f; @xmlelement(name="section") @xmljavatypeadapter(myadapter.class) private list<map<string, string>> sectionlist ; //corresponding getters , setters @override public string tostring() { return

java - OnClickListener doesn't work implicitly. Why? -

i created custom button class implements listener interface: public class blinkbutton extends button implements view.onclicklistener { list<onclicklistener> onclicklistenerlist = new arraylist<onclicklistener>(); public blinkbutton(context context) { super(context); this.setlistener(new highlightbuttonlistener()); } //other constructors here public void setlistener(onclicklistener listener){ onclicklistenerlist.add(listener); } @override public void onclick(view v) { for(onclicklistener listener : onclicklistenerlist){ listener.onclick(this); } } and have view: <com.example.element.blinkbutton .../> i claim onclick method inside com.example.element.blinkbutton should call implicitly when user clicks blinkbutton, it's not. have write explicitly: android:onclick="fireevent" , public void fireevent(view view) { fireeventbutton.onclick(view); } why blinkbutton.onclick(); doesn'

Value of variable is not changing on first iteration when input in loop, batch file -

this question has answer here: why setting batch script variable delayed? 1 answer by input value of variable not changing, on next iteration , show previous input value. set /a firstnum=0 set /a secondnum=0 :while if %firstnum% neq -99 ( set /p firstnum="enter first number" echo first number %firstnum% ) if %secondnum% neq -99 ( :2input set /p secondnum="enter second numer" echo second number %secondnum% if %secondnum% == 0 ( goto :2input ) ) goto :while no idea want achieve peace of nonsense if want values chenge have add setlocal enabledelayedexpansion @ beginning of code , call variables !variable! instead of %variable% .

python - PyScripter can`t import PyQt4.uic.Loader -

Image
i import uic , qtgui pyqt4 , can`t compile project because have message: i have __init__.py file in uic\loader, how fix problem? update i think pyscripter can`t see folder 'loader' in uic. why?

osx - Mac keyboard from the command line -

i'm writing bash script, , attempting open separate terminal window run commands in. able open new terminal window open -a terminal . , possible switch between windows bash? you can run applescript scripts using command osascript. script activating terminal window: tell application "terminal" activate or opening new terminal window: tell application "terminal" script " " activate end tell found here - https://superuser.com/questions/195633/applescript-to-open-a-new-terminal-window-in-current-space

html - Python Scrapy - XPath for nested table tags -

this source code: <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td align="center"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td style="border-left: 1px solid rgb(153, 153, 153); border-right: 1px solid rgb(153, 153, 153);"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <tr> <td height="511"> <table width="100%" cellspacing="0" cellpadding="5" border="0" height="500"> <tbody> <tr> <td width="1%" valign="top" height="500"> <table width="100%" cellspacing="1" cellpadding="1" bordercolor="#cccccc" border="0"

javascript - checking that an event fired with mocha -

how can test element fired event mocha? i've got ugly solution working, it's not readable, takes long time time out when fails, , doesn't give failure messaging. describe('test-element', function() { var el; beforeeach(function() { el = document.createelement('test-element'); }); it('fires save event', function(done) { el.addeventlistener('save', function() { done(); }); el.save(); }); in perfect world, think cooler. it('fires save event', function() { el.save(); expect(el).to.have.firedevent('save'); }); }); am going right way? there better approach or custom matcher library should using? how spying on fire function...? not sure stubbing/spying library you're using lets sinon.js . like... var spy = sinon.spy(el, 'fire'); el.save(); expect(spy.calledwith('save')).to.be.true;

git pull - Why does git log not show anything new after git fetch? -

i learning working git remotes reading relevant section of pro git book . if clone repository, command automatically adds remote repository under name "origin". so, git fetch origin fetches new work has been pushed server since cloned (or last fetched from) it. it’s important note git fetch command fetches data local repository; doesn’t automatically merge of work or modify you’re working on. have merge manually work when you’re ready. here tried. cloned repository , edited file. in original repository, updated same file , pushed. then, i ran git fetch . showed update progress message. however, git log did not show update. did misunderstand git fetch does? missing something? i ran git pull , , got error: local changes 'hello_world.c' overwritten merge. aborting. please, commit changes or stash them before can merge. here, believe it's merging , avoid accidental data loss, aborts. edit: answers. before looking @ answers, trying mys

Youtube API V3 commentThreads.list method not returning "shared privately" comments -

while requesting list of comment threads youtube video there comments not appear on results: comments inside private videos comments shared privately i understand normal response when using public api key . happening if i'm using oauth 2.0 access token belonging user , channel owner of target video. it's there workaround this? many in advance can shed light on matter

jquery - Javascript Slideshow Issue. Getting Blank Screen -

i using following code place javascript slideshow on website - http://leemark.github.io/better-simple-slideshow/ . trying implement example 2 given on link. must doing wrong because blank screen. no images , caption. this code have on website. <div class="bss-slides num2" tabindex="2"> <figure> <img src="bodhgaya.jpg" width="100%" /><figcaption>"snowying" <a href="http://www.flickr.com/photos/fiddleoak/8511209344/">fiddleoak</a>.</figcaption> </figure> <figure> <img src="chardham.jpg" width="100%" /><figcaption>"starlight" <a href="http://www.flickr.com/photos/chaoticmind75/10738494123/in/set-72157626146319517">chaoticmind75</a>.</figcaption> </figure> <figure> <img src="ta

Jquery filter on php generated Divs -

i can't seem figure out why jquery isn't filtering. jquery function not correct or php using generate divs wrong. each generated div so each generated div looks so <div class="content" style="background-color: firebrick"> content </div> this code on page jquery function <html> <head> <link rel="stylesheet" href="css/logged_in.css"> <?php include("login_php_scripts.php"); ?> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script> $('#filter').keyup(function () { var filter = $("#filter").val(); $('#warnings').each(function() { $(this).find("div:not(:contains('" + filter + "'))").hide(); $(this).find("div:contains('" + filter + "')").show(); }); }); </

file type - Geany custom folding for custom filetype -

company work develops new programming language ease job of engineer. job supply language nice editor involves code folding. need have custom code folding not include "{" , "}". working geany filetypes. add new filetype. want fold structure below. if %condition% each %element% in %range% %statement% %statement% else if %condition% end %statement% else end if i know language far c type , add such line code enabling syntax coloring. [settings] lexer_filetype=c any kind of appreciated. i dont know exact answer know how can dig up. far there no answer going write how can answer can appeared. using scintilla , lexers can take solution of problem. both geany , scintilla documentations mention support of feature.

c# - How can I use WebClient.DownloadString from a secure URL (https)? -

the code i'm using webclient webclient = new webclient(); string xmlresult = webclient.downloadstring("https://kat.cr/usearch/ubuntu/?rss=1"); i'm bit confused url seems tunnel through secondary page kastatic.com:443 , kat.cr:443 (if i'm understanding fiddler correctly). the server certificate seems fine adding following code nothing helpful servicepointmanager.servercertificatevalidationcallback = (sender, certificate, chain, sslpolicyerrors) => { return true; }; i've tried setting useragent headers on webclient object in case need identify browser or don't think i'm on right track. edit: response "12a9" 2 odd ascii characters trailing (a question mark symbol , white circle black border. if @ headers in fiddler, response gzip-encoded (compressed). see this answer how deal this, since there's no "quick , easy" way we

c# - Working with UMat in Emgu wrapper -

i have made application apply hsv filters image , try track specific color. want use umat because need computation of image in gpu , not in cpu instead. in code below first take image<bgra, byte> , convert umat format hsv color format. however, when split channels 3 channels each channel (ex. the hsvchannels[0] has 3 channels; don't know why happening). can't apply filters because when use inrangeimage method image 1 channel , error form cvinvoke.copy "unknown array format". the application not best, want first understand how umat image format works , try improve it. private umat cvandhsvimage(image<bgra, byte> imgframe, byte lowerhue, byte upperhue, byte lowersat, byte uppersat, byte lowerbright, byte upperbright, byte erosion = 0, byte dilate = 0, bool hue = false, bool sat = false, bool bright = false, bool invert = false) { // first convert input image hsv can change channels //image<hsv, byte> hs

javascript - jsf.ajax.addOnEvent works only if I explicitly include javax.faces:jsf.js -

i using jsf 2.2.4 following in head tag: <h:outputscript library="javax.faces" name="jsf.js" /> later found following post , removed above code included automatically: renaming jsf.js.jsf jsf.js.xhtml when checked found included automatically said getting error script put in head of common template. error script getting object jsf undefined . purpose of script show common loader jsf ajax calls. script given below: //to display loading indicator jsf f:ajax calls. jsf.ajax.addonevent(function(data) { var ajaxstatus = data.status; // can "begin", "complete" , "success" switch (ajaxstatus) { case "begin": // called right before ajax request been sent. wizshowajaxloader(); break; case "complete": // called right after ajax response received. wizhideajaxloader(); break; case "success": // called when ajax response processed. // noop. break;

jquery - Returning ordered json data inside filter.js using JsonQuery -

i'm using filter.js https://github.com/jiren/filter.js - great script. var fjs = filterjs(products, '#products', { template: '#productfinder-template', search: {ele: '#searchbox'}, callbacks: { beforeaddrecords: function(records){ var jq = jsonquery(records); console.log(jq.order({'artnr': 'asc'}).exec()); }, afterfilter: function(result){ $('#total_products').text(result.length+' records found'); } } }); inside callback "beforeaddrecord" called jsonquery "order" function , result ordered json list, way wanted. problem getting result on screen. has have experience script? did testing , found following working. put code on button click testing purposes. jquery("#xselected").on('click', function(){ var jq = jsonquery(products); products = jq.order({'artnr': 'asc

javascript - Multiple facebook post via jquery -

i'm trying post multiple facebook post on page using jquery . far getting success post first facebook post not able post another. what happening? facebook post embed url <div id="fb-root"> </div><script> (function(d, s, id) { var js, fjs = d.getelementsbytagname(s)[0]; if (d.getelementbyid(id)) return; js = d.createelement(s); js.id = id; js.src = "//connect.facebook.net/en_us/sdk.js#xfbml=1&version=v2.3"; fjs.parentnode.insertbefore(js, fjs); } (document, 'script', 'facebook-jssdk')); </script> <div class="fb-post" data-href="https://www.facebook.com/clashofclans/posts/1104473549576967:0" data-width="500"> <div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/clashofclans/posts/1104473549576967:0"> <p>the update here!!! maintenance start soon! read that&#039;s new: http://supr.cl/up

qt - How to limit the size of drop-down of a ComboBox in QML -

i using combobox in qml , when populated lot of data exceeds main windows bottom boarder. googling have learned drop-down list of combobox put on top of current application window , therefore not respect boundaries. ideally want combobox never exceed main applications boundary, can not find property in documentation . a different approach limit number of visible items of drop-down list not exceed window limits given window geometry. not able find in documentation either , have run out of ideas. take combobox source code, popup of menu type , doesn't have property limit size. moreover, z property of menu infinite , i.e. it's always on top. if find no way use combobox of qt can create 2 models 1 visual purpose, call visual model, show in combobox , complete 1 , reference model. items count in visualmodel wil equal int property maximumcomboboxitemscount declare . you'll need o find way onhovered find index under mouse in visualmodel if it's ==