#include <screenshot.h>
Collaboration diagram for ScreenShot:
Public Slots | |
void | shoot () |
void | save () |
void | target (int) |
void | delaychanged (int) |
void | fileSelect () |
void | fileChanged () |
void | timeout () |
void | areaSelected (const QRect &) |
void | areaSelect () |
Public Member Functions | |
ScreenShot (QWidget *parent=0, const char *name=0, WFlags fl=0) | |
Private Types | |
enum | Mode { screen, window, area } |
Private Member Functions | |
void | getWindow () |
void | displayShot () |
Private Attributes | |
Mode | mode |
int | delay |
QTimer * | timer |
QPixmap | shotPixmap |
QImage | shotImage |
bool | haveImage |
QString | workDir |
QString | fileName |
QString | baseName |
int | shotCount |
QRect | areaRect |
AreaGrab * | selectArea |
|
|
|
The c'tor hasn't got much to do except set up some class variables. All the layouting of widgets and the connection of signals and slots is already been done in ScreenShotUI. |
|
A necessary slot to make shure this widget is hidden when area selection starts. |
|
This slot is called when area selection is completed. The selectArea widget is deleted to clean up, it has already hidden itself at this point. |
|
This slot is used whenever a different delay is selected. |
|
Like the name says, this is where the shot image is shown. |
|
This slot is called when the user bothers to change the filename by typing on the keyboard, which is signified by a return pressed signal. |
|
This slot receives the click on the fileToolButton. It is used to pop up a file dialog and let the user select a file ( and directory ) name. The default directory initially is the user's home directory, after this it will be the selected directory. The selected file name, if valid, will always be converted to have the extension ".png". |
|
getWindow() grabs the currently focussed window, if it is completely visible. If the window is partially obscured, a region the size of the window is grabbed anyway. I see this as a feature, so don't ask me to do anything about it. |
|
This slot is triggered by clicking the QPushButton labeled with the same name. It saves the generated image at the chosen location. |
|
This slot gets triggered by clicking the QPushButton labeled with the same name. |
|
This slot gets called when selecting a different target in the radio button group box. |
|
This slot is used by the timer, when it timeouts. The timer is only used if mode == screen or mode == window. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|