MainWidget::MainWidget(QWidget *parent) : QWidget(parent), ui(new Ui::MainWidget), ts(new RectSelector), maximizedState(false) { ui->setupUi(this); QVector<QPushButton*> modeButtons; modeButtons.push_back(ui->mode0Button); modeButtons.push_back(ui->mode1Button); modeBox = new ModeBox(modeButtons); createActions(); createTrayIcon(); windowVisibility = true; loadSettings(); //storePositionInfo(); connect(this, SIGNAL(setPixmap(QPixmap)), ts, SLOT(loadBackgroundPixmap(QPixmap))); connect(ts, SIGNAL(finishPixmap(QPixmap)), this, SLOT(triangleReceiver(QPixmap))); connect(ts, SIGNAL(quitPixmap()), this, SLOT(triangleReceiver())); connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason))); shootFullScreen(); updateScreenshotLabel(); }
void ScreenshotsWidget::loadBackgroundPixmap(const QPixmap &bgPixmap) { int width,height; width = QApplication::desktop()->size().width(); height = QApplication::desktop()->size().height(); loadBackgroundPixmap(bgPixmap,0,0,width,height); }