Read compile warnins please. Fix color picker
This commit is contained in:
parent
363c817cfb
commit
bb6b41f762
@ -15,6 +15,9 @@ ColorPickerScene::ColorPickerScene(QPixmap pixmap, QWidget *parentWidget)
|
||||
setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::HighQualityAntialiasing);
|
||||
setCursor(QCursor(Qt::CrossCursor));
|
||||
setMouseTracking(true);
|
||||
setWindowTitle("KShare Color Picker");
|
||||
setGeometry(pixmap.rect());
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
pItem = addPixmap(pixmap);
|
||||
pItem->setZValue(-2);
|
||||
@ -29,6 +32,8 @@ ColorPickerScene::ColorPickerScene(QPixmap pixmap, QWidget *parentWidget)
|
||||
color = pItem->pixmap().toImage().pixelColor(QCursor::pos());
|
||||
text->setPlainText(color.name());
|
||||
ellipse->setBrush(color);
|
||||
|
||||
show();
|
||||
}
|
||||
|
||||
void ColorPickerScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
|
||||
|
@ -17,12 +17,7 @@ public:
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *) override;
|
||||
static void showPicker() {
|
||||
ColorPickerScene *s = new ColorPickerScene(screenshotutil::fullscreen(), 0);
|
||||
QTimer::singleShot(0, [s] {
|
||||
s->showFullScreen();
|
||||
QScopedPointer<ColorPickerScene>(s);
|
||||
// Before anyone asks I have 0 clue about how does this not segfault
|
||||
});
|
||||
ColorPickerScene(screenshotutil::fullscreen(), 0);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -26,6 +26,7 @@ UploaderSingleton::UploaderSingleton() : QObject() {
|
||||
qFatal("Cannot determine location of your home directory");
|
||||
}
|
||||
saveDir = QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/Screenshots";
|
||||
break;
|
||||
default:
|
||||
qFatal("Invalid config [saveLocation not int or is not in range]");
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user