Picture control in QT - qt

i am learning QT, i am not getting how to get the picture control in QT?.
in .net we have picture control right same way i need in QT.
i know text edit support pictures but is there any alternatives.
please tell if so.
Thanks

I assume that you mean a control for showing pictures. In that case, simply use a QLabel and call setPixmap. There is a more versatile, but less polished picture widget here.

Related

How can I add custom graphics in Qt designer?

I'm comfortable with C++ but brand new to Qt. I apologize for my ignorance as I'm sure this is a very simple question. I'd like to make a custom clickable widget, basically a push button that is just a black square with Qt designer, but don't have any idea on where to start.
EDIT: after fumbling around I think I'm an epsilon closer.
I created a black_box.png file. In the resource browser I created a new resource and prefix, and added the black_box.png. Any advice from here?
You have a few options for what you want to achieve.
You can use custom painting to draw a new button that subclasses QPushButton, this is reasonably involved and provides a huge amount of flexibility to build it to your requirements.
You can use Qt's stylesheets mechanism to style it, you can get more information on it here: http://doc.qt.io/qt-5/stylesheet.html
Or you can set a QPixmap of your image to be a button icon, and size your button to match it, there's a good answer on how to do this on this question: How to set image on QPushButton?

Qt: How to implement a class for an image with properties

I have dared to start learning Qt with very basic C++ knowledge. I am asked to implement a class for image in Qt.
In my application whenever I will select a picture it will have some properties, such as, when I will move the window the QLabel that is containing my image will also increase in size of width and height without loosing the aspect ratio.
I do not expect some finished code. But I want to know how to think for that. I am having problem to make an algorithm.
I am expecting some help to solve this problem. Thanks in advance!
You should begin by running some sample code and seeing how they work. There are lots of examples that display images in various ways. Step through them to see if you can understand what each step does.
Try to write a simple "Hello world!" app in Qt. Then try adding an image display to it. The solution to the task you describe should become straightforward as you develop knowledge of Qt.

Qt drawing with Qt designer

I have tried to search on the internet and here as well, without success though. I am using Qt 4.8.2 and design my app in the Designer, then I write code in VS2010. I would like to show a chart on the application window, e.g. like http://www.infocaptor.com/user_help/help_img/dashboard_line_chart_screen.png , based on some data that are created by the app.
In the Widget Box of the Designer, I can't find any widget related to drawing. So I tried creating a QTextEdit and drawing on that using QPainter. However, this does not work. I can draw on the whole appwindow, but not just on the text edit. So the question is: what widget can be added onto the app window in the designer and that is going to allow me to draw on it using QPainter?
I'm eluded as the documentation says specifically that QPainter can draw on any QWidget which a QTextEdit is...
Any help is much appreciated,
Daniel
The function of "drawing" is tooo complex/unspecific to be included as a specialized widget. You'll have to create it yourself and implement the desired drawing functions.
Here is an example which you can learn from, the scribblearea class could be pretty much what you are looking for. In that case you can copy it to your project and use in in the Qt-Designer by promoting a widget to this class.

How do I use my own custom buttons and design with wxpython

I've been looking for some inspiration with wxpython as far as the GUI goes. Everything in the demo looks boring and uninspiring so I want to go in my own direction but I can't figure out how to use my own buttons I made in photoshop or my own background images.
I'm kind of new to GUI programming so I ask if you could please be clear in what steps I should take. Once I intialize the frame...how to I load my custom buttons, or set the panel background?
As acattle pointed out, I already wrote on how to change a panel's background. You should note that wxPython isn't a themable GUI toolkit. It uses the native widgets of the OS wherever possible and most of the time, those just aren't very themable. If you need that, then you should look at Tkinter's (especially ttk) or pyside/pyQt.
If you need bitmap buttons, there are several options:
BitmapButton
GradientButton
AquaButton
PlateButton
I did some googling and I found this tutorial for setting the background of panels.
A bit more googling and I found this post talking about wxPython's Bitmap Button Class and showing some code examples.
I would suggest being very very careful designing your GUI if you're going to use custom images. You need to pay special attention to your spacing and your text sizes or your GUI might come out looking like crap.

Qt Iphone-like navigation Controller

I'm new to Qt. This is simply great.
I was wondering whether you guys knew if there happened to exist some kind of navigation controller function like you can find on Iphone...
What I mean is I want to have one MainWindow and slide between different views.
What should I look for please ?
Any doc about that ?
Any help would be very much apreciated.
Thanks in advance and sorry for being such a noob... ;-)
Miky Mike
Me again,
by searching the site, I've come across with this...
http://wiki.forum.nokia.com/index.php/Code_Example_for_SlidingStackedWidget_class_in_Qt
But is there a means of sliding with a mouse movement ?
This look more difficult to me...
Thanks,
Mike
Miky, in my understanding you're trying to write a mobile phone app using Qt (probably for a Nokia phone). I'd recommend you to have a look at Qt Quick which is designed to help people develop mobile applications including touch screen input. You can find what you want there. Check out ListView and Flickable elements. With list view you can create much more than just a list view how we have seen it. You basically can flip whole pages horizontally and vertically which would be ListView items. If you develop for Symbian, check out Qt Quick components for Symbian where you may find necessary components.
Happy hacking !

Resources