w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Want to place a QPushButton onto a GraphicView... but no button is displayed?
wrap it around QGraphicsWidget. QGraphicsWidget *pBtn = scene->addWidget(m_button6); scene->addItem(pBtn) oh! don't forget: m_button6->show(); widgets are hidden by default!

Categories : C++

QPushButton Main Gui
You're creating a button and a window, but you're not associating them together. Therefore, the button is not part of the main UI. In order to add the button to the main window, you should add the following line- mWin->setCentralWidget(button); When creating user interfaces with Qt, it's better to avoid setting the geometry explicitly. Here is a nice page which describes the layouting in Qt. Also, you seem to be missing a main function.

Categories : Qt

Qt Animate QPushButton Icon
What you need to do is instead pass in a valid reference to a QObject (per Chris' comment above) Your code works fine if I simply replace the parameter passed into QPropertyAnimation: // ui->pushButton is a QPushButton* QPropertyAnimation *animation = new QPropertyAnimation(ui->pushButton, "size"); animation->setDuration(1000); QSize test = this->size(); animation->setStartValue(test); animation->setEndValue(QSize(test.width()+100,test.height()+100)); animation->start(); I'm going to assume that you're subclass-ing QPushButton (explains this->icon())... perhaps you can try to access it directly instead? Though I'm going to guess that it's privately owned by the base/parent class.

Categories : C++

How to tell when a QPushButton is clicked in a QButtonGroup
The documentation for QButtonGroup shows a QButtonGroup::buttonClicked() signal - have you already tried that one? The signal comes in two variants - one that gives the QPushButton as a parameter (as a QAbstractButton), and one that gives the ID of the button in the group. You can use 'connect()' to setup signal and slot connections in your C++ code. Sometime during the initialization of your window's class (perhaps in the constructor), call this: connect(myButtonGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(theSlotThatYouWrite(QAbstractButton*)); Where myButtonGroup is probably this->ui->nameOfTheButtonGroup, and theSlotThatYouWrite is a function that you write in your own code, that belongs to your window's class, that returns void and takes a signal QAbstractButt

Categories : C++

(Qt C++) QPushButton setIcon() not working
If you are on Windows using MSVC as your compiler, and want to use Qt's resource system, you will need to add Q_INIT_RESOURCE(res) to the beginning of main(), where res is the name of your .qrc file without the ".qrc". To get a full view of this, look at this gist: https://gist.github.com/alexreinking/5992821

Categories : C++

How do I set the accessibility name for a QPushButton that just has an icon?
You can use QWidget::setAccessibleName(const QString &name). QPushButton *button = new QPushButton(this); button->setAccessibleName("name"); Is this what you were looking for?

Categories : Windows

Make QPushButton invisible yet still work?
When you call QWidget::setVisible(false), you not only hide it from view, but also logically remove it from the layout, so it is no longer there to respond to key presses or mouse clicks. What you want is to keep the widget there while not displaying it. What I would try in your situation is changing the QPalette associated with your QPushButton to make it transparent (i.e. invisible) // Make the button "invisible" QBrush tb(Qt::transparent); // Transparent brush, solid pattern ui->button->setPalette(QPalette(tb, tb, tb, tb, tb, tb, tb, tb, tb)); // Set every color roles to the transparent brush // Make the button "visible" ui->button->setPalette(QPalette()); // Back to the default palette That way, the button is still logically in the layout (and take up the appropriate s

Categories : C++

How i can change number that displaying on QPushButton?
Type of Number must be int. So it will work properly. #include <QApplication> #include <QPushButton> int main(int argc,char **argv) { QApplication app(argc,argv); QPushButton *pd = new QPushButton; pd->setText(QString("%1").arg(1234)); pd->show(); return app.exec(); }

Categories : C++

Enabling a QPushButton when an item is selected in a QListView
clicked(QModleIndex) looks like it can be a decent starting point - if you setup a slot to receive that notification, you should be able to enable your button. Using QtCreator/Designer: void MainWindow::on_listWidget_clicked(const QModelIndex &index) { ui->pushButton->setEnabled(true); } Without QtCreator, the connection would break down into something like this (Qt4 style): MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { QListWidget* listWidget = new QListWidget(); // ... setup ui stuff, etc ... connect(listWidget, SIGNAL(clicked(QModelIndex)), this, SLOT(on_listWidget_clicked(QModelIndex)); }

Categories : Qt

Change QStackedLayout Index with QPushButton not QComboBox
You should add change_stack function to your Dialog class and connect to it like this: class Dialog : public QWidget { ... private slots: void change_stack(); private: QStackedLayout *stackia; } Dialog::Dialog { ... connect(tombold, SIGNAL(clicked()), this, SLOT(change_stack())); ... } void Dialog::change_stack() { stackia->setCurrentIndex(1); }

Categories : C++

Make QPushButton close all open program windows
Checkout this example: #!/usr/bin/env python #-*- coding:utf-8 -*- #--------- # IMPORT #--------- import sys from PyQt4 import QtGui, QtCore #--------- # DEFINE #--------- class MyWindow(QtGui.QWidget): def __init__(self, parent=None): super(MyWindow, self).__init__(parent) self.pushButtonClose = QtGui.QPushButton(self) self.pushButtonClose.setText("Close Windows!") self.pushButtonClose.clicked.connect(self.on_pushButtonClose_clicked) self.pushButtonWindows = QtGui.QPushButton(self) self.pushButtonWindows.setText("Create Windows!") self.pushButtonWindows.clicked.connect(self.on_pushButtonWindows_clicked) self.layoutVertical = QtGui.QVBoxLayout(self) self.layoutVertical.addWidget(self.pushButtonClose)

Categories : Python

How to change QPushButton icon/text spacing with stylesheets?
Actually with QPushButton you are out of luck. You can find a complete list of working options for styling push buttons in the qt documentation ( I am assuming you use qt5, but it is available for other versions as well). What is often recommended if you want more control over the icon is to exchange your QPushButtons with QToolButtons wich are exactly the same except that they have extra features to make them compatible with toolbars -and- they have more options for icon placement. But this might not work for you because as you can see they are styled the exact same way as QPushButtons. But do look into the "toolButtonStyle" parameter which allows you to move the icon around. Next on the list comes changing the artwork. If all you want is more space then just add the extra empty pixels

Categories : Qt

QPushButton won't fire clicked slot (method of QObject)
May be could try the released signal instead of the clicked signal, because the clicked signal is emitted when the button is activated (i.e. pressed down then released while the mouse cursor is inside the button). Or you could try the #method 2 of connecting the signals. class MyController(QObject): def __init__(self, parent=None): super(MyController, self).__init__(parent) self.some_ref = .... self.button = self.some_ref.button # method 1 self.button.released.connect(self.button_clicked) # method 2 self.connect(self.button, SIGNAL('released()'), self.button_clicked) def button_clicked(self): print "yipee it works..."

Categories : Qt

QPushButton creates empty space on Mac OS X resulting in ugly layouts
You should be using a QButtonBox for your buttons, not discrete buttons in a custom layout. You'll need to add the PDF generation button manually. As a temporary workaround, you need to reduce the bottom margin size on OS X. Hopefully it'll get fixed eventually. Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Widget) { ui->setupUi(this); QPushButton * btn = new QPushButton(tr("PDF Generieren...")); btn->setIcon(QIcon(":/images/images/arrow-right.png")); ui->buttonBox->addButton(btn, QDialogButtonBox::AcceptRole); #if (QT_VERSION <= QT_VERSION_CHECK(5, 1, 1)) && defined(QT_OS_MAC) QMargins margins = layout()->contentsMargins(); margins.setBottom(margins.bottom() - 6); layout()->setContentsMargins(margins); #end

Categories : Osx

How to get the background color of a button or label (QPushButton, QLabel) in PyQt
I haven't used PyQt, but I think API should be very similar to C++. To get background color of QWidget-based class, first get its palette and then call QPalette::color() with QPalette::Window role.

Categories : Python

Map not getting Displayed
In my android manifest I have the line: <uses-library android:name="com.google.android.maps" /> I have this just after the application tag. Don't know if this will fix it but it was on the tutorial I used.

Categories : Android

UIScrollview isn't displayed
Sorry, i'm an idiot. The embedded view frame is being pushed down from the origin of the scroll frame these should be CGRect viewFrame = CGRectMake(0, 0, screenRect.size.width * 3, 50); CGRect scrollFrame = CGRectMake(0, 30, screenRect.size.width, 50);

Categories : Iphone

Fragment UI not getting displayed
remove if(m_f_text_entry_activity == null) { m_f_text_entry_activity = new Fragment(); m_fm_text_entry_activity.beginTransaction() .add(R.id.fragmentContainer_TextEntry, m_f_text_entry_activity) .commit(); } and replace with m_fm_text_entry_activity.beginTransaction() .add(R.id.fragmentContainer_TextEntry, m_f_text_entry_activity) .commit(); ==================EDIT================================== Also TextEntryFragment m_f_text_entry_activity=new TextEntryFragment(); instead of Fragment m_f_text_entry_activity = m_fm_text_entry_activity.findFragmentById(R.id.fragmentContainer_TextEntry);

Categories : Android

iAd Test Ads not being displayed
It seems that there is a problem in iTunes Connect. I'm trying to set my iAd banner too and always the delegate returns the same error (ad inventory unavailable). In addition, there is a problem that many people are reporting at this moment with iTunes Connect. Try it in a few hours!

Categories : Iphone

Background not displayed
www.doomfire106.co.nf/Music.html is full of errors according to the W3C HTML validator. Most of these are harmless, but the duplicate <body> elements is not; remove the extra element. You also have content before your <body background="WebsiteBack.png"> element; content should be inside the element. Sending an HTTP request for www.doomfire106.co.nf/Websiteback.png returns HTTP 500, Internal Server Error, so something is going wrong with your host when requesting that file. Check file permissions of your Websiteback.png file; it must have Read and Execute permissions for everyone. The response looks like a PHP error message; do you have any filters on your site? Is your WebsiteBack.png page being generated by PHP?

Categories : HTML

Why the value of first element only is getting displayed?
user_state and user_city are both added, so your code is working fine. You gotta know why $user_data is empty there. Make your code like this: echo $sql; print_r($user_data); $data[$key]['user_state'] = $user_data['user_state']; $data[$key]['user_city'] = $user_data['user_city']; That will output your sql for each loop and print_r function (or var_dump) will echo $user_data array right before those lines. Check why it is empty. Probably your second query in that loop is not what you think it is.

Categories : PHP

Message box cant be displayed When run in IIS?
To get the effect I believe you are wanting, you'll want to use the Javascript confirm() function. It is typically used like this: <asp:Button runat="server" OnClientClick="return confirm('Are you sure you want to save the details?')" id="btnSubmit" OnClick="btnSubmit_Click" /> This would, upon clicking the button, display a confirmation box that would stop the server OnClick event from firing if the user clicks No, Cancel, etc. OnClientClick will render as an onclick event on the <input> tag. The rest is determined by the browser's handling of Javascript. See What's the effect of adding 'return false' to an onclick event? for more details on what the return value of the code in OnClick (OnClientClick) does. Here's an example of the return values of confirm()

Categories : C#

Buttons not getting displayed
If you want to align your Buttons at the bottom then you are better off with a RelativeLayout as the root. Try changing it to the following and notice the properties <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="100dp" android:text="@string/hello_world" android:textSize="32sp" /> <EditText android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:hint="@string/ad_desc" android:inputType="text" androidi:layout_below="@id/tex

Categories : Android

Set a value displayed in a dropdown
you can override configurable.js in your skin or magento js folder Create one file named : configurable.js in add it to your js folder write in your local.xml or any custom xml of your extension <catalog_product_view> <reference name="head"> <action method="addJs"><script>yourjsfolder/configurable.js</script></action> </reference> </catalog_product_view> And add below code to in this js like below if (typeof Product.Config != 'undefined') { Product.Config.addMethods({ getOptionLabel: function(option, price){ var price = parseFloat(price); if (this.taxConfig.includeTax) { var tax = price / (100 + this.taxConfig.defaultTax) * this.taxConfig.defaultTax;

Categories : Magento

iOS UITableView not displayed
I could not get a conclusion about the problem you are facing. But here are few things you should check. Because i cannot see even an empty table view in your screenshot Do you have the TableView on the Nib file ? It is mapped from The Nib file to the IBOutlet itemTableView ?

Categories : Iphone

Google map not being displayed
Try like this function initialize() { latlng1 = new google.maps.LatLng(44.5403, -78.5463); options = { zoom: 8, center: latlng1, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById("map_canvas"), options); } And in your code there is an syntax that you need to change like google.maps.event.addDomListener(window, 'load', initialize); And also @Amal said it will work only when it calls on load for the page like <body onload="initialize();">

Categories : PHP

Why are the images not being displayed?
If you take a look at the ImageIcon source you will notice that the ImageIcon(String) constructor calls another constructor ImageIcon(String filename, String description) { image = Toolkit.getDefaultToolkit().getImage(filename); if (image == null) { return; } this.filename = filename; this.description = description; loadImage(image); } and .getImage() public Image getImage() { return image; } If it fails to load an image that image will simply be null without throwing any errors. Your code fails (silently) to load the image (check this with a System.out.println(image) most likely because of an incorrect filepath. Edit to your comments: I prefer ImageIO to load my files feeding it an inputstream. It is more verbose and has the added benefit of letting

Categories : Java

Scroll to top of div when it is not displayed
Edit v3 So I've added a console.log on this and it never fired. $('input[name="customer"]').on('typeahead:closed', function(){ console.log('test'); }); So instead of splitting typeahead() from on(), I've used jQuery chain and now it is triggering typeahead:closed. Don't ask me why it wasn't triggering, still didn't figured out :(. Anyways, this will work (tested on chrome v29) when you type a, scroll down, click outside then click back on the input, the list will be back up. $('input[name="customers"]').typeahead({ local: ['a','ab','ac','ad','ae','af', 'ag','ah','ai','aj','ak','al', 'am','an','ao','ap','aq','ar', 'as','at','au','av','aw','ax', 'ay','az' ], limit: 20, name: 'customers', rateLimitWait: 100, tt

Categories : Javascript

Image could not be displayed
This is not inside an <?php ?> block: <img src = "/avatars/'.$image.'" So it should be: <img src = "/avatars/<?php echo $image; ?>"

Categories : PHP

How come the image is not displayed?
The link to the page that displays picture in your main.php is img.php: <a href='img.php?c_id=".$c_id."'> Yet the Name of the file you posted here that display picture is viewfile.php, so just change your link to point to viewfile.php: <a href='viewfile.php?c_id=".$c_id."'>

Categories : PHP

gif not getting displayed using php ajax
First of all, please don't leave spaces in attribtue, value pairs like here: ...width = "44" height = "10"... Make it look like this: ...width="44" height="10"... That was just style guide :). Second check your browsers network panel to see that: it is loading gif. Because if there's no loading, there's no gif. if loading that it finds it. It should return 200 http response or 404 if not found. On all modern browsers you can open developer panel with F12 or CTRL+SHIFT+i and click "Network".

Categories : PHP

Ext JS 4 checkboxfield not displayed
I didnt really test your code like kevhender did. But the fact that it works for him but not you, makes me think that you dont have the image file that extjs uses for a checkbox. Usually it is placed in images/form/checkbox.gif. please check your images folder once. Also dev tools (either Firebug or chrome dev tools) console should throw an error if thats the case - saying "file could not be found at path blahblah" or something.

Categories : Javascript

JScrollPane isn't displayed
try with this JScrollPane jScrollPane1= new JScrollPane() jScrollPane1.setViewportView(jList1); getContentPane().setLayout(null);// here u specify layout put the layout what u want getContentPane().add(jScrollPane1);// add to the contentPane jScrollPane1.setBounds(126, 63, 100, 100);// here we set coordinates x, y width height cause we have null layout pack();// Size the frame. NOTE You should always provide a layoutManager so then u dont have to setBounds "hardcoded" JScrollPane jScrollPane1= new JScrollPane() jScrollPane1.setViewportView(jList1); setLayout(new BorderLayout()); add(jScrollPane1);// add to the frame pack();// Size the frame. Also a good practice is to use a top level container to add to a Frame for example, u could use a JPanel setLayout(new BorderLayou

Categories : Java

Flyout not being displayed
Have a look at this solution → http://jsfiddle.net/matbloom/8cYFU/ If you're looking for a CSS-only solution fly-out, then try implementing this solution. The hidden fly-out needs to be inside the hover element container: HTML: <div class="toolbar clearfix"> <div class="right"> <span>Right Button</span> </div> <div class="left"> <span>Left Button</span> <div id="login-flyout"> <form> <input type="text" placeholder="Sample field" /><br /> <input type="text" placeholder="Sample field" /><br /> <input type="submit" value="GO &rarr;" /> </form> </div> </div>

Categories : HTML

Output is not getting displayed
You can try this which is a bit faster than yours solution:- for(int i = 190; ; i += 190) { if(i % 3 == 0 && i % 4 == 0 && i % 6 == 0 && i % 7 == 0 && i % 8 == 0 && i % 9 == 0 && i % 11 == 0 && i % 12 == 0 && i % 13 == 0 && i % 14 == 0 && i % 15 == 0 && i % 16 == 0 && i % 17 == 0 && i % 18 == 0 && i % 20 == 0) { System.out.println(i); break; } } You can also check out this article.

Categories : Java

Images don't get displayed before a pop-up box
In the function Dealcards() you probably have to wait for the images to be loaded first, before dealing the cards. You can use add an eventhandler for this: <html> <head> <script> function loadImage() { alert("Image is loaded"); } </script> </head> <body> <img src="w3javascript.gif" onload="loadImage()" id="myImage"> </body> </html> //Or use: // example function addEvent(element, evnt, funct){ if (element.attachEvent) return element.attachEvent('on'+evnt, funct); else return element.addEventListener(evnt, funct, false); } addEvent( document.getElementById('myImage'), 'load', function () { alert('image loaded!'); } ); addEventListener vs onclick

Categories : Javascript

All products being displayed instead of only one
Add in your select query in WHERE clause: AND a.prod_id = ".$prod_id." query: "SELECT a.prod_name, a.prod_brand, b.prod_price FROM tblproduct a, tblretprod b where a.prod_id = b.prod_id AND a.prod_id = ".intval($prod_id)."" To make the query safer against SQL Injection i've added intval function like Kickstart well pointed out.

Categories : PHP

ImageView isn't displayed
I'm not sure exactly what you want without a screenshot or a description but your problem is that your ImageView is inside a LienarLayout with horizontal orientation who has another child LinearLayout with a horizontal orientation who's width is match_parent, leaving no room for the ImageView <LinearLayout android:orientation="horizontal" <!-- This is the ImageViews parent --> android:layout_width="match_parent" android:layout_height="wrap_content"> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" <!-- This child is taking up all of the width --> android:layout_height="wrap_content"> There are different things you can do here depending on what you want like removing one of the L

Categories : Android

MapView not getting displayed
Make sure your activity extends a FragmentActivity instead of Activity. And replace you xml layout fragment with the following one: <?xml version="1.0" encoding="utf-8"?> <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.SupportMapFragment" />

Categories : Android

Why is AssertionError not displayed?
>>> try: assert 1==2 ... except Exception as e: print type(e) ... <type 'exceptions.AssertionError'> or >>> try: assert 1==2, "They Are Not Equal!!" ... except Exception as e: print e ... They Are Not Equal!! as to why: it is calling the __str__ method of the exception when you call print... since you did not put any text there, your text is the empty string... which is what's printed.

Categories : Python



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.