Skip to content
  • 0 Votes
    3 Posts
    1k Views
    S
    @raven-worx I tried the following but didn't work out.. QGraphicsPixmapItem* item = new QGraphicsPixmapItem(QPixmap::fromImage(qImage, Qt::AutoColor)); m_ViewerScene->addItem(item); QGraphicsRectItem* rect = new QGraphicsRectItem(m_BoundingBox); m_ViewerScene->addItem(rect); rect->setParentItem(item); m_ViewerScene->update(); //add the resized QGraphicsPixmapItem to the pixmap item->setPixmap( item->pixmap().scaled(QSize(128, 32),Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); qInfo()<<"Rect resize props:::"<<item->childItems()[0]->boundingRect(); m_BoundingBox = item->childItems()[0]->boundingRect(); later I'm drawing box, on the image in an other viewer, with m_BoundingBox. [image: 02c5c881-2cce-4791-bba4-27f853945931.png] The grey area within the blue rectangle will be resized to 128 * 32, and then the red rectangle would be added on the resized image. How to get the co-ordinates of red rect on the resized image?
  • Convert and resize matrix to image

    Solved General and Desktop interpolation resize
    3
    0 Votes
    3 Posts
    1k Views
    A
    @mrjj Sorry for not mentioning this before, I already tried a Gaussian Blur, it didn't help. The data is have is in the form: (xCood, yCood, zCood, value) For the first phase I am ignoring zCood. The problem comes with the sample data granuality as data is something like: (0,0), (0,100)..............(0,1500) (100, 0).(100,100)........(100,1500) ..... ..... (1500, 0).(1500,100)........(1500,1500) I have a canvas of 1500x1500 The image before gaussian (The border is part of a layer above the image, so they aren't going anywhere soon): [image: 564300eb-b6df-46e3-a59c-cbf0e365343a.png] After Gaussian Blurring (and some some interpolation on my part)(the data is a little different in both cases and I have done this in a separate application): [image: ce602226-98b9-4337-a5ed-e1972bdd128e.png] As you can see, the output still has some boxiness to it. Also, doing it like this is just removing the sharpness of the image [it is eventually meant to be used to visualize input data not be a sunset image. Not to mention I am going too far with the blurring here making it really heavy for a repaint]. EDIT: Forgot to mention, I am using a continuous hue change here w.r.t value. But it seems that the proposal is for limited number of colors making the output even more blocky and blurring even more useless. EDIT 2: I eventually used the 2D shader for openGL. Latest output: [image: 9f0a0667-bd19-4e0e-aaeb-51113027e7da.png] Seems the most promising one yet
  • 0 Votes
    8 Posts
    5k Views
    VRoninV
    @sm4ll-3gg said in How to resize QListView row to index widget size: what I should read to better understand Model / View / Delegate programming? Basically everything I know comes from Advanced Qt Prgramming: Creating Great Software with C++ and Qt4 It is normal to set new delegate for each item if I need to show heterogeneous data in list? No. What I would do is create a QStackedWidget with the possible combinations, use that as base and display the correct page based on the data in the index
  • Resize QMainWindow and QDialog

    Italian qt5.5 qmainwindow qdialog windows 10 resize
    2
    0 Votes
    2 Posts
    1k Views
    VRoninV
    @Ocram10 said in Resize QMainWindow and QDialog: proprietà di windows "Ridimensionamento e layout" Dove trovi questa variabile?
  • Resizing QMainWindow and QDialog

    Unsolved General and Desktop resize qmainwindow qt 5 python3 windows10
    7
    0 Votes
    7 Posts
    4k Views
    O
    @Fuel the exemples in pyqt-master do it automatically but i don't understsnd what event or property they use
  • How to resize main window when bottom element's height change

    Solved QML and Qt Quick resize
    19
    1 Votes
    19 Posts
    6k Views
    jsulmJ
    @Ashutosh_Sachdeva You can try online installer to install Qt. My Qt setup installed using online installer has this header file. Also as stated in your other thread make sure you have QT += quickwidgets in your pro file.
  • Resize image with mouse QTextEdit

    Solved General and Desktop image resize qtextedit mouse
    10
    0 Votes
    10 Posts
    5k Views
    S
    @mrjj I don't want to resize it via a dialog. I need to do that with the mouse (manually)
  • QDockWidget doesn't resize after add widget

    Solved General and Desktop qdockwidget resize
    7
    0 Votes
    7 Posts
    4k Views
    mrjjM
    @Gianluca86 You can make main window bigger and move the splitter. then it should be bigger.
  • Resize QListWidget

    Solved General and Desktop qlistwidget resize dialog
    2
    0 Votes
    2 Posts
    2k Views
    Chris KawaC
    Put the list widget in a layout. Here's more on layouts in Qt.
  • QWebEngineView Flickers on Resize

    Unsolved General and Desktop qwebengineview resize qwidget
    2
    0 Votes
    2 Posts
    2k Views
    V
    Hi. already fixed in https://bugreports.qt.io/browse/QTBUG-46074
  • Resize A Picture When Print it

    Unsolved General and Desktop resize picture screen capture print
    8
    0 Votes
    8 Posts
    7k Views
    mrjjM
    @M4RZB4Ni yes, that is normal. Printer have many more pixels. so image seem smaller. Read docs. they have example of scaling stuff. This sample takes snapshot and scales it. void MainWindow::printshot() { QPixmap pix = QPixmap::grabWindow(QApplication::desktop()->winId()); QPrinter printer(QPrinter::HighResolution); printer.setOrientation(QPrinter::Landscape); QPainter painter; painter.begin(&printer); double xscale = printer.pageRect().width() / double(pix.width()); double yscale = printer.pageRect().height() / double(pix.height()); double scale = qMin(xscale, yscale); painter.translate(printer.paperRect().x() + printer.pageRect().width() / 2, printer.paperRect().y() + printer.pageRect().height() / 2); painter.scale(scale, scale); painter.translate(-width() / 2, -height() / 2); // note uses the form width/height! use pix.h/w if random image painter.drawPixmap(0, 0, pix); painter.end(); }
  • Best practice: resize Widgets with mouse

    Solved General and Desktop frameless resize
    4
    0 Votes
    4 Posts
    14k Views
    mrjjM
    @the_ Yep its a nice few liners and not really dirty as sizegrip is made for such task so its not abuse or anything :) But sometimes having the grip there can be issue.
  • 0 Votes
    2 Posts
    1k Views
    mrjjM
    @eduardo_parra said: but the cursor detect the margins What margins? Do you mean for something inside the docks?
  • 0 Votes
    19 Posts
    15k Views
    W
    I found very usefull this class, I added some code to handle correctly a maximized FrameLess Widget. In void FrameLess::mouseMove(QMouseEvent *e) { if (_dragStart) { if (_parent->isMaximized()) { //this will handle correctly dragging when it is maximized maximizeWidth = _parent->width(); //maximizeWidth is an int attribute _parent->showNormal(); } if (_dragPos.x() > _parent->width()) _dragPos.setX((_parent->width()*_dragPos.x()) / maximizeWidth); _parent->move(e->globalX() - _dragPos.x(), e->globalY() - _dragPos.y()); } if (!_mousePress.testFlag(Edge::None) && !_parent->isMaximized() ) { //this prevent resizing if it is maximized [...] Now I'm wondering if there is a way to implement Windows 7/10 autosize function (the function when you drag a window on top/left/right/bottom edge of desktop and it will maximize/resize to half desktop size) on a frameless widget!
  • 0 Votes
    2 Posts
    1k Views
    SGaistS
    Hi, No, it's something you'll have to implement yourself. You'll probably have to create an event filter that will re-send any relevant event to your other windows.
  • Resize Objects With Mainwindow Resize

    Solved General and Desktop resize window object
    4
    0 Votes
    4 Posts
    2k Views
    mrjjM
    Hi If you use layouts and put the buttons in one. Then no need for any code to do resize. So using layouts is how you do in Visual Design. Try this : Make new project open the mainwindow UI Place a button in the empty mainwindow. Right click empty spot on form Select the Layout menu (bottom) Select Layout Horizontally
  • 0 Votes
    1 Posts
    970 Views
    No one has replied
  • Anchoring the widgets for resizing with the form

    Unsolved General and Desktop layout resize
    22
    0 Votes
    22 Posts
    13k Views
    ?
    BTW: If you want a fancy GUI that doesn't look / behave natively then you can use QtQuick for that. Besides layouts it has anchors, too.