Search Results

Search found 17342 results on 694 pages for 'custom draw'.

Page 102/694 | < Previous Page | 98 99 100 101 102 103 104 105 106 107 108 109  | Next Page >

  • Custom QGraphicsItems not compiling and give object is is private error

    - by bahree
    Hi, I am trying to create a Custom QGraphicsItem button as shown by Fred here. The code which he posted can be found here. The problem is when I try and compile the code I get the following two errors: /usr/include/qt4/QtGui/qgraphicsitem.h ‘QGraphicsItem::QGraphicsItem(const QGraphicsItem&)’ is private /usr/include/qt4/QtCore/qobject.h ‘QObject::QObject(const QObject&)’ is private Here is the code snippet which essentially is the same as that in the sample above. The error is on the class deceleration. class MyButton : public QObject, public QGraphicsItem { Q_OBJECT Q_INTERFACES(QGraphicsItem) public: MyButton(QGraphicsItem *parent = 0); MyButton(const QString normal, const QString pressed = "", QGraphicsItem *parent = 0); .... } Interestingly the other sample as shown here works fine. The sample code for that can be found here. Any idea what is wrong? Thanks in advance.

    Read the article

  • How to transfer url parameters to repoze custom predicate checkers

    - by user281521
    I would like to create a repoze custom predicate checker that is capable to access url parameters and validate something. But I would like to use allow_only to set this permission checker in all the controller's scope. Something like: class MyController(BaseController): allow_only = All(not_anonymous(msg=l_(u'You must be logged on')), my_custom_predicate(msg=l_(u'something wrong'))) def index(self, **kw): return dict() then, my_custom_predicate should check the url paramters for every request in every MyController method, and do whatever it do. The problem is just that: how to allow my_custom_predicate to check the url parameters, using it in that way I wrote above.

    Read the article

  • Deallocating NSMutableArray of custom objects

    - by Dave
    I need help with deallocation of my NSMutableArray of custom objects. I need to retain the array and so I have added a property in .h and I release it in dealloc in .m file. When I add objects to the array, I do the following: myarray = [[NSMutableArray alloc] init]; [myarray addObject:[[mycustomObject alloc]initWithObject:obj1]]; [myarray addObject:[[mycustomObject alloc]initWithObject:obj2]]; Now, I don't know how to release mycustomobject. If I do the following: [myarray addObject:[[[mycustomObject alloc]initWithObject:obj1] autorelease]; I run in to problems when I access the array later. Please advice.

    Read the article

  • Add client-side events to ASP.Net custom control at runtime

    - by nw
    I'm building an ASP.net custom control that implements IScriptControl. I would like other users of my control to be able to assign client-side event handlers to the control. Unfortunately the JS generated by IScriptControl is always injected at the very bottom of the rendered page (see below), so any attempt to assign an event handler in the ASPX page fails because the code executes too early. ... <script type="text/javascript"> //<![CDATA[ Sys.Application.initialize(); Sys.Application.add_init(function() { $create(MyNamespace.MyControl, {}, null, null, $get("my_control_id")); }); //]]> </script> </form> What's the right way to assign an event handler to the instantiated control upon page load?

    Read the article

  • jQuery validator and a custom rule that uses AJAX

    - by thatweblook
    Hi, I read your reply regarding the jQuery validator where you outline a method to check a username against a value in a database. Ive tried implementing this method but no matter what is returned from the PHP file I always get the message that the username is already taken. Here is ths custom method... $.validator.addMethod("uniqueUserName", function(value, element) { $.ajax({ type: "POST", url: "php/get_save_status.php", data: "checkUsername="+value, dataType:"html", success: function(msg) { // if the user exists, it returns a string "true" if(msg == "true") return false; // already exists return true; // username is free to use } })}, "Username is Already Taken"); And here is the validate code... username: { required: true, uniqueUserName: true }, Is there a specific way i am supposed to return the message from php. Thanks A

    Read the article

  • Xcode: Using a custom framework

    - by Robert
    The error I'm getting: in /Users/robert/Documents/funWithFrameworks/build/Debug-iphonesimulator/funWithFrameworks.framework/funWithFrameworks, can't link with a main executable Cliff notes: trying to include framework doesn't want to link More detail: I'm developing for a mobile device... hint, hint using Xcode and I'm trying to make my own custom framework which I can include from another application. So far, I've done the following: Create a new project; an iPhone OS window based app. Go to target info- under packaging, change the wrapper extension from app to framework Go to Action-new build phase - copy headers. Change roles of headers to 'public' From my application, I add the framework to the frameworks group.

    Read the article

  • How to evaluate a custom math expression in Python

    - by taynaron
    I'm writing a custom dice rolling parser (snicker if you must) in python. Basically, I want to use standard math evaluation but add the 'd' operator: #xdy sum = 0 for each in range(x): sum += randInt(1, y) return sum So that, for example, 1d6+2d6+2d6-72+4d100 = (5)+(1+1)+(6+2)-72+(5+39+38+59) = 84 I was using regex to replace all 'd's with the sum and then using eval, but my regex fell apart when dealing with parentheses on either side. Is there a faster way to go about this than implementing my own recursive parsing? Perhaps adding an operator to eval?

    Read the article

  • Flex4 Application state in a custom component

    - by itarato
    Hi, I'm porting my Flex3 app to Flex4 (FlashBuilder4). I get the whole new state concept, except one thing. In a custom component (separate mxml file) I'm using the main level Application's state. In Flex3 it was: <mx:State name="only_view_mode"> <mx:RemoveChild target="{myComponent.button1}" /> </mx:State> In Flex4 it should be something like that: <mx:State name="only_view_mode" /> and <mx:LinkButton id="button1" excludeFrom="???" /> My question is: how can I access to an Application state from a component? I checked the official reference (http://www.adobe.com/go/learn_flex4_alldocumentation_en) and Google of course but without any success. Thanks in advance

    Read the article

  • Query multiple custom taxonomy terms in Wordpress 2.8?

    - by thechrisvoth
    I created a custom taxonomy named 'technologies' but cannot query multiple terms like I can with categories or tags. These querys DO work: query_posts('tag=goldfish,airplanes'); query_posts('technologies=php'); However, neither of the following work correctly: query_posts('technologies=php,sql'); query_posts('technologies=php&technologies=sql'); My objective: Show all posts with a technology of 'php' and all posts with a technology of 'sql' Any ideas? Is this even possible? Thanks!

    Read the article

  • How to know when my control changes size?

    - by Mason Wheeler
    I'm building a custom control, and I need it to be able to respond when it gets resized. I need the old dimensions and the new dimensions available in order to do some calculations. Unfortunately, the SetWidth and SetHeight methods are private to TControl, not protected, and so I can't override them. Is there any other way to know that my control's about to be resized, and to have the old size and the new size both available?

    Read the article

  • How can custom properties be added to a column in Doctrine

    - by murze
    With doctrine if you execute this code $columns = $accountTable->getColumns(); foreach ($columns as $column) { print_r($column); } you could get for example this as result: Array ( [type] => integer [length] => 20 [autoincrement] => 1 [primary] => 1 ) Array ( [type] => string [length] => 255 ) Is there a way to add custom properties to a column, so that the result would be: Array ( [type] => integer [length] => 20 [autoincrement] => 1 [primary] => 1 [customproperty] => customvalue ) Array ( [type] => string [length] => 255 )

    Read the article

  • SQLAlchemy custom sorting algorithms when using SQL indexes

    - by David M
    Is it possible to write custom collation functions with indexes in SQLAlchemy? SQLite for example allows specifying the sorting function at a C level as sqlite3_create_collation(). An implementation of some of the Unicode collation algorithm has been provided by James Tauber here, which for example sorts all the "a"'s close together whether they have accents on them or not. Other examples of why this might be useful is for different alphabet orders (languages other than English) and sorting numeric values (sorting 10 after 9 rather than codepoint order.) Is this possible in SQLAlchemy? If not, is it supported by the pysqlite3 or MySQLdb modules, or for any other SQL database modules supported by python for that matter? Any information would be greatly appreciated.

    Read the article

  • Watir: Need to double click on an element to open custom popup

    - by Namratha
    Hello, I am a newbie in WATIR. The problem I am facing is - The application I am testing has thumbnails (like Windows icons) placed on the page and I need to double click it. On doing that, an custom popup (ajax popup implemented in javascript) will open. The fire_event("ondblclick") is not working for me. I also tried 'click' twice but that too is not helping. Is there any other way of handling this? Your help is highly appreciated.

    Read the article

  • Custom editor in QAbstractTableModel

    - by Martin Beckett
    Does anyone have an example of using a QWidget as an editor in a QAbstractTableModel? I have a column which when edited should create a QCombobox with the list of choices. The docs seem to suggest I need to write a QAbstractItemDelegate and a custom paint function but that seems overkill to simply pop-up a standard QCombobox in Qt::EditRole. Note - the combo box contents are the same for every row and it only needs to be shown when somebody clicks in the cell. I know this should be simple but I can't get it to work. It's easy for a QTableWidget based table - but I need it for a very large data table.

    Read the article

  • Can't Instantiate Windsor Custom Component Activator

    - by jeffn825
    Hi, I'm getting an exception calling Resolve: KernelException: Could not instantiate custom activator Inner Exception: {"Constructor on type 'MyProj.MyAdapter`1[[MyProj.MyBusinessObject, MyAsm, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' not found."} There's definitely a public parameterless constructor there (and I've verified this using reflection at runtime)...so I figure the problem might have to do with the fact that it's generic? I've tried getting the component model object and setting RequiresGenericArguments to true, but that hasn't gotten me anywhere. Any help would be much appreciated! Thanks.

    Read the article

  • PIG doesn't read my custom InputFormat

    - by Simon Guo
    I have a custom MyInputFormat that suppose to deal with record boundary problem for multi-lined inputs. But when I put the MyInputFormat into my UDF load function. As follow: public class EccUDFLogLoader extends LoadFunc { @Override public InputFormat getInputFormat() { System.out.println("I am in getInputFormat function"); return new MyInputFormat(); } } public class MyInputFormat extends TextInputFormat { public RecordReader createRecordReader(InputSplit inputSplit, JobConf jobConf) throws IOException { System.out.prinln("I am in createRecordReader"); //MyRecordReader suppose to handle record boundary return new MyRecordReader((FileSplit)inputSplit, jobConf); } } For each mapper, it print out I am in getInputFormat function but not I am in createRecordReader. I am wondering if anyone can provide a hint on how to hoop up my costome MyInputFormat to PIG's UDF loader? Much Thanks. I am using PIG on Amazon EMR.

    Read the article

  • WCF - (Custom) binary serialisation.

    - by Barguast
    I want to be able to query my database over the web, and I am wanting to use a WCF service to handle the requests and results. The problem is that due to the amount of data that can potentially be returned from these queries, I'm worried about how these results will be serialised over the network. For example, I can imagine the XML serialisation looking like: <Results> <Person Name="Adam" DateOfBirth="01/02/1985" /> <Person Name="Bob" DateOfBirth="04/07/1986" /> </Results> And the binary serialisation containing types names and other (unnecessary) metadata. Perhaps even the type name for each element in a collection? o_o Ideally, I'd like to perform the serialisation of certain 'DataContract'-s myself so I can make it super-compact. Does anyone know if this is possible, or of any articles which explain how to do custom serialisation with WCF? Thanks in advance

    Read the article

  • Custom Validator and specifying type of message

    - by user102533
    I have a custom validation in the enterprise validation block. The DoValidate method is as shown below. protected override void DoValidate(Double objectToValidate, object currentTarget, string key, ValidationResults validationResults) { if (!IsSalMoreThanMinWage(objectToValidate)) { //Here I need to mark this message as a "Warning" LogValidationResult(validationResults, "Salary is too low for this state", currentTarget, key); } } I'd need to mark this validation failure as a "warning" message. In the front end, when I iterate through the ValidationResults collection and grab a ValidationResult object, I would need to identify and group different types of messages and render them differently. My question is - how do I mark a failure as a warning?

    Read the article

  • Wordpress include custom page

    - by Josef
    Hi, I'm sure this is a simple question. But how do I get Wordpress at startup to ignore trying to load a Page or Post and instead load my custom page? When in the Wordpress bootstrap process is it decided which php-page is going to load? I will have the following url: bt.local/wp/ads/1 And would like a php-page called ads.php to be loaded and load the ad with adid = 1. What's the best way to solve this? (there's no Post called ads and there's no Page called Ads). Thank you! KR Josef

    Read the article

  • jQuery Autocomplete fetch and parse data source with custom function, except not

    - by Ben Dauphinee
    So, I am working with the jQuery Autocomplete function, and am trying to write a custom data parser. Not sure what I am doing incorrectly, but it throws an error on trying to call the autocompleteSourceParse function, saying that req is not set. setURL("ajax/clients/ac"); function autocompleteSourceParse(req, add){ var suggestions = []; $.getJSON(getURL()+"/"+req, function(data){ $.each(data, function(i, val){ suggestions.push(val.name); }); add(suggestions); }); return(suggestions); } $("#company").autocomplete({ source: autocompleteSourceParse(req, add), minLength: 2 });

    Read the article

  • Clear Input onFocus with Google Custom Search

    - by Wes
    I'm moving a sites search over to google custom search. The old input for text looks like this: <input type="text" value="Search this website..." name="s" id="searchbox" onfocus="if (this.value == 'Search this website...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search this website...';}" /> Now I need to Have the attr 'name' as 'q', like so: <input type="text" value="Search this website..." name="q" id="searchbox" onfocus="if (this.value == 'Search this website...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search this website...';}" /> The odd thing is that when I swap the name over to q, I'm unable to clear the search box on focus. Am I missing something super easy?

    Read the article

  • custom TreeNode and SelectNodeChanged

    - by gilloux
    Hello, I'm working on asp.net I've written a custom Treenode (customTreeNode) that I use to populate a treeview the problem comes up when firing the selectnodechanged event this event give me a TreeNode object and not a customTreeNode and I cannot seem to cast it somehow, does sy have a clue ? Thx here is the code I have populate my tree node.ChildNodes.Add ( customTreeNode = new customTreeNode(site) ); customTreeNode public class customTreeNode : TreeNode { public Guid Id { get; set; } private SPWebEntry _dataContext; public SPWebEntry DataContext { get { return _dataContext; } } public customTreeNode(SPWebEntry DataContext) { _dataContext = DataContext; this.Text = _dataContext.Title; this.Id = _dataContext.Id; } } and the event void treeViewSiteCollection_SelectedNodeChanged(object sender, EventArgs e) { treeViewSiteCollection.SelectedNode; } treeViewSiteCollection.SelectedNode is of type TreeNode and I cannot cast it. Thx guys

    Read the article

  • unicode data with custom font doesn't work properly in ipad

    - by David Ohanyan
    I am using custom font for label and string which I am getting from unicode characters. And the font is not changing. here is the snippet of my code: NSString* str = @"\u05D0\u05D1\u05D2"; [mMatchingLabel setText:str]; mMatchingLabel.font = [UIFont fontWithName:@"David New Hebrew" size:26]; But when I write for example : NSString* str = @"label"; [mMatchingLabel setText:str]; mMatchingLabel.font = [UIFont fontWithName:@"David New Hebrew" size:26]; The font effect is evident. Can someone explain what's here wrong?

    Read the article

  • Saving to SharedPreferences from custom DialogPreference

    - by Ronnie
    I've currently got a preferences screen, and I've created a custom class that extends DialogPreference and is called from within my Preferences. My preferences data seems store/retrieve from SharedPreferences without an issue, but I'm trying to add 2 more sets of settings from the DialogPreference. Basically I have two issues that I have not been able to find. Every site I've seen gives me the same standard info to save/restore data and I'm still having problems. Firstly I'm trying to save a username and password to my SharedPreferences (visible in the last block of code) and if possibly I'd like to be able to do it in the onClick(). My preferences XML that calls my DialogPreference: <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceCategory> <com.rone.optusmon.AccDialog android:key="AccSettings" android:title="Account Settings" android:negativeButtonText="Cancel" android:positiveButtonText="Save" /> </PreferenceCategory> </PreferenceScreen> My Preference Activity Class: package com.rone.optusmon; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; import android.preference.Preference; import android.preference.Preference.OnPreferenceClickListener; import android.preference.PreferenceActivity; import android.view.KeyEvent; public class EditPreferences extends PreferenceActivity { Context context = this; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); } } My Custom DialogPreference Class file: package com.rone.optusmon; import android.content.Context; import android.content.DialogInterface; import android.content.SharedPreferences; import android.preference.DialogPreference; import android.preference.PreferenceManager; import android.text.method.PasswordTransformationMethod; import android.util.AttributeSet; import android.view.View; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; public class AccDialog extends DialogPreference implements DialogInterface.OnClickListener { private TextView mUsername, mPassword; private EditText mUserbox, mPassbox; CharSequence mPassboxdata, mUserboxdata; private CheckBox mShowchar; private Context mContext; private int mWhichButtonClicked; public AccDialog(Context context, AttributeSet attrs) { super(context, attrs); mContext = context; } @Override protected View onCreateDialogView() { @SuppressWarnings("unused") LinearLayout.LayoutParams params; LinearLayout layout = new LinearLayout(mContext); layout.setOrientation(LinearLayout.VERTICAL); layout.setPadding(10, 10, 10, 10); layout.setBackgroundColor(0xFF000000); mUsername = new TextView(mContext); mUsername.setText("Username:"); mUsername.setTextColor(0xFFFFFFFF); mUsername.setPadding(0, 8, 0, 3); mUserbox = new EditText(mContext); mUserbox.setSingleLine(true); mUserbox.setSelectAllOnFocus(true); mPassword = new TextView(mContext); mPassword.setText("Password:"); mPassword.setTextColor(0xFFFFFFFF); mPassbox = new EditText(mContext); mPassbox.setSingleLine(true); mPassbox.setSelectAllOnFocus(true); mShowchar = new CheckBox(mContext); mShowchar.setOnCheckedChangeListener(mShowchar_listener); mShowchar.setText("Show Characters"); mShowchar.setTextColor(0xFFFFFFFF); mShowchar.setChecked(false); if(!mShowchar.isChecked()) { mPassbox.setTransformationMethod(new PasswordTransformationMethod()); } layout.addView(mUsername); layout.addView(mUserbox); layout.addView(mPassword); layout.addView(mPassbox); layout.addView(mShowchar); return layout; // Access default SharedPreferences SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this); } public void onClick(DialogInterface dialog, int which) { mWhichButtonClicked = which; // if statement to set save/cancel button roles if (mWhichButtonClicked == -1) { Toast.makeText(mContext, "Save was clicked", Toast.LENGTH_SHORT).show(); mUserboxdata = mUserbox.getText(); mPassboxdata = mPassbox.getText(); // Save user preferences SharedPreferences settings = getDefaultSharedPreferences(this); SharedPreferences.Editor editor = settings.edit(); editor.putString("usernamekey", (String) mUserboxdata); editor.putString("passwordkey", (String) mPassboxdata); } else { Toast.makeText(mContext, "Cancel was clicked", Toast.LENGTH_SHORT).show(); } } } In my SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this); line, Eclipse says "The method getDefaultSharedPreferences(AccDialog) is undefined for the type AccDialog". I've attempted to change the context to my preferences class, use a blank context and I've also tried naming my SharedPrefs and using "getSharedPreferences()" as well. I'm just not sure exactly what I'm doing here. As I'm quite new to Java/Android/coding in general, could you please be as detailed as possible with any help, eg. which of my files I need to write the code in and whereabouts in that file should I write it (i.e. onCreate(), onClick(), etc) Edit: I will need to the preferences to be Application-wide accessible, not activity-wide. Thanks

    Read the article

  • using OOoWrite, i would like to add custom html elements

    - by romunov
    I have 35 pages list of scientific references. In order to upload them to a webpage, I would like to add custom fields before and after each reference. I would also like to find italicized text and add around it. For instance, I would like this paragraph Alouf N., 1973. Biotope et description de Niphargus altagahizi n. sp., Amphipode Gammaridé souterrain du Liban, International Journal of Speleology 5: 49-61. to look like: <p class="cite">Alouf N., 1973. Biotope et description de <em>Niphargus altagahizi</em> n. sp., Amphipode Gammaridé souterrain du Liban, International Journal of Speleology 5: 49-61.</p> Any suggestions how to do this in OOoWriter macros perhaps, or any other application?

    Read the article

< Previous Page | 98 99 100 101 102 103 104 105 106 107 108 109  | Next Page >