Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. resize
    Log in to post

    • UNSOLVED Resize QWidget during show event?
      General and Desktop • resize showevent • • CJha  

      3
      0
      Votes
      3
      Posts
      41
      Views

      @Christian-Ehrlicher Ok. I understand, I will add my check boxes in a different function and not during showEvent(). I tried setting layoutSizeConstraint to different values for the vertical layout, the QScrollArea as well as for the widget itself, because of QScrollArea my widget is always resized to a small size when shown for the first time, this is why I tried to add and resize the widget during showEvent() myself. According to Qt's documentation: If a scroll area is used to display the contents of a widget that contains child widgets arranged in a layout, it is important to realize that the size policy of the layout will also determine the size of the widget. This is especially useful to know if you intend to dynamically change the contents of the layout. In such cases, setting the layout's size constraint property to one which provides constraints on the minimum and/or maximum size of the layout (e.g., QLayout::SetMinAndMaxSize) will cause the size of the scroll area to be updated whenever the contents of the layout changes. But this is not working for me, I am setting the size constraint to QLayout::SetMinAndMaxSize but the QScrollArea remains at the minimum size when shown for the first time.
    • UNSOLVED QGraphicsTextItem dynamic resizing
      General and Desktop • qt5 resize dynamic qgraphicstextit • • wazzdaman  

      1
      0
      Votes
      1
      Posts
      59
      Views

      No one has replied

    • UNSOLVED Qt Quick applications do not repaint on window resize
      General and Desktop • qt quick resize window freeze repaint • • Kevinb9c  

      1
      0
      Votes
      1
      Posts
      121
      Views

      No one has replied

    • SOLVED Resizing problems, dragging when it is not allowed
      General and Desktop • resize qtwidgets dragging borderless wind • • Krakenus00  

      3
      0
      Votes
      3
      Posts
      144
      Views

      SetMinimumSize() does not work for me. I think it is because I change the window's position. However, the problem was in my form file. For an unknown reason, it changed the window's size to 802x600 when I was checking for 800x600. Maybe there was some another way out, but now all works just fine.
    • SOLVED scrollbar not reappearing when a tableWidget is stretched then shrinked
      General and Desktop • qtablewidget resize scrollbar • • torea  

      4
      0
      Votes
      4
      Posts
      268
      Views

      Calling the base class implementation did the trick. Thank you again! I didn't try the resizeToContents as some cells shouldn't be sized to their content in some context.
    • UNSOLVED How to set the base size of QDockWidget?
      General and Desktop • resize qtabwidget qdockwidget layouts • • Sailanarmo  

      3
      0
      Votes
      3
      Posts
      697
      Views

      @SGaist That's a fair question and to answer that it's because on the actual dock widget itself, in the production code, there are two widgets that get placed inside the dock widget itself. The topFrame contains the layout for the QTabWidget as you have pointed out. The code that is not present, botFrame contains another QGridLayout. These two then get placed inside the QGridLayout which is the layout of QGroupBox. Then to answer Why am I subclassing a layout to put widgets in it? I guess this is a personal decision and can be argued either way. For now, I will say that you are correct, that the Widget should manage the way the GridLayout adds widgets to them. However, I will argue that since QGridLayout is it's own class; the Widget does not "own" the widgets, rather, the layout owns the widgets since QWidget does not have a addWidgets function in it. Therefore, QGridLayout owns and is responsible for the Widgets that it owns. Hence the decision that the QWidget is the parent, which has a QGridLayout, which the QGridLayout as the Child, has the widgets that belong inside of it. This is a programming decision that I made with these arguments.
    • UNSOLVED Random crash on window resize.
      General and Desktop • resize crash • • YouDoItWrong  

      7
      0
      Votes
      7
      Posts
      1059
      Views

      @YouDoItWrong said in Random crash on window resize.: By "bugreport" you mean code and error in this "head topic forum post"? No, bug report in Qt bug tracker: https://bugreports.qt.io/secure/Dashboard.jspa
    • SOLVED Strange mouse press events in lower right corner of window widgets Mac only
      General and Desktop • qwidget resize mouse events mac-os • • KonradGl  

      14
      0
      Votes
      14
      Posts
      1516
      Views

      We found a solution to that bug. The Cocoa window itself isn't set to non resizeable. If you do this, everything works as expected. class MainWindow : public QMainWindow { public: explicit MainWindow(QWidget *parent = nullptr) : QMainWindow(parent) { //this will get rid of the size grip widget showing setFixedSize(500, 500); } void mousePressEvent(QMouseEvent *) override { std::cout<<"mouse pressed"<<std::endl; } }; int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; NSWindow* window = [(NSView*)w.window()->winId() window]; //IMTPORTANT. Otherwise the lower right mouse events will not be passed on correctly by cocoa window.styleMask &= ~NSWindowStyleMaskResizable; w.show(); return a.exec(); }
    • UNSOLVED Dynamically fit QComboBox popup height to the (dynamically changing) count of items
      General and Desktop • qcombobox resize qlistview item view • • AloyseTech  

      9
      0
      Votes
      9
      Posts
      2088
      Views

      @AloyseTech IIRC hidePop() will reset the Popupwidget, so maybe hijack the add/remove process. Call hidePopup before adding are removing item and call showPopup afterwards?
    • UNSOLVED Resizing makes slow on mac
      General and Desktop • qwidget resize • • DestinyAt  

      2
      0
      Votes
      2
      Posts
      434
      Views

      Hi and welcome to devnet, What version of macOS ? Did you also check whether the latest beta of 5.12 has the same problem ?
    • SOLVED Resizing the widget(listwidget)
      General and Desktop • qtcreator resize sizepolicy listwidget • • Kinesis  

      10
      0
      Votes
      10
      Posts
      2331
      Views

      @jsulm I got this, thanks
    • UNSOLVED Change the window's size through a button (flickers)
      QML and Qt Quick • qml resize flickering • • Leon_2001  

      1
      0
      Votes
      1
      Posts
      458
      Views

      No one has replied

    • UNSOLVED Manual resizing of QGraphicsItem using mouse
      General and Desktop • qgraphicsview qgraphicsscene qgraphicsitem resize mouse event • • hellozee  

      1
      0
      Votes
      1
      Posts
      665
      Views

      No one has replied

    • UNSOLVED QGraphicsRectItem coordinate system on image resize
      General and Desktop • qgraphicsscene qgraphicsitem resize mapto • • sayan275  

      3
      0
      Votes
      3
      Posts
      743
      Views

      @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. 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?
    • SOLVED Convert and resize matrix to image
      General and Desktop • resize interpolation • • Ankit.Jain  

      3
      0
      Votes
      3
      Posts
      700
      Views

      @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): 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): 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: Seems the most promising one yet
    • SOLVED How to resize QListView row to index widget size
      General and Desktop • resize qlistview view row sizehint • • sm4ll-3gg  

      8
      0
      Votes
      8
      Posts
      4073
      Views

      @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 windows 10 qmainwindow qdialog resize • • Ocram10  

      2
      0
      Votes
      2
      Posts
      931
      Views

      @Ocram10 said in Resize QMainWindow and QDialog: proprietà di windows "Ridimensionamento e layout" Dove trovi questa variabile?
    • UNSOLVED Resizing QMainWindow and QDialog
      General and Desktop • qmainwindow resize python3 windows10 qt 5 • • Ocram10  

      7
      0
      Votes
      7
      Posts
      2736
      Views

      @Fuel the exemples in pyqt-master do it automatically but i don't understsnd what event or property they use
    • SOLVED How to resize main window when bottom element's height change
      QML and Qt Quick • resize • • MoaMoaK  

      19
      1
      Votes
      19
      Posts
      4614
      Views

      @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.
    • SOLVED Resize image with mouse QTextEdit
      General and Desktop • image resize qtextedit mouse • • HenrikSt.  

      10
      0
      Votes
      10
      Posts
      3766
      Views

      @mrjj I don't want to resize it via a dialog. I need to do that with the mouse (manually)
    • SOLVED QDockWidget doesn't resize after add widget
      General and Desktop • resize qdockwidget • • Gianluca86  

      7
      0
      Votes
      7
      Posts
      2775
      Views

      @Gianluca86 You can make main window bigger and move the splitter. then it should be bigger.
    • SOLVED Resize QListWidget
      General and Desktop • resize qlistwidget dialog • • Jedd  

      2
      0
      Votes
      2
      Posts
      1502
      Views

      Put the list widget in a layout. Here's more on layouts in Qt.
    • UNSOLVED QWebEngineView Flickers on Resize
      General and Desktop • qwidget resize qwebengineview • • Erika  

      2
      0
      Votes
      2
      Posts
      1489
      Views

      Hi. already fixed in https://bugreports.qt.io/browse/QTBUG-46074
    • UNSOLVED Resize A Picture When Print it
      General and Desktop • resize print picture screen capture • • M4RZB4Ni  

      8
      0
      Votes
      8
      Posts
      5287
      Views

      @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(); }
    • SOLVED Best practice: resize Widgets with mouse
      General and Desktop • resize frameless • • the_  

      4
      0
      Votes
      4
      Posts
      8845
      Views

      @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.
    • UNSOLVED Dock Widget programmatically resizing problems
      General and Desktop • resize cursor margins dockwidget setgeometry • • eduardo_parra  

      2
      0
      Votes
      2
      Posts
      837
      Views

      @eduardo_parra said: but the cursor detect the margins What margins? Do you mean for something inside the docks?
    • SOLVED Make a frameless QWidget resizable with QRubberBand ?
      General and Desktop • qwidget resize frameless • • IMAN4K  

      19
      0
      Votes
      19
      Posts
      11390
      Views

      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!
    • UNSOLVED Copy MainWindow content and interact with it
      General and Desktop • resize mainwindow interface copy • • eduardo_parra  

      2
      0
      Votes
      2
      Posts
      936
      Views

      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.
    • SOLVED Resize Objects With Mainwindow Resize
      General and Desktop • resize window object • • M4RZB4Ni  

      4
      0
      Votes
      4
      Posts
      1707
      Views

      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
    • UNSOLVED resizable layout based on default font size
      QML and Qt Quick • qml qtquick resize font qtquick control • • randsfjorden  

      1
      0
      Votes
      1
      Posts
      710
      Views

      No one has replied

    • UNSOLVED Anchoring the widgets for resizing with the form
      General and Desktop • layout resize • • nulluse  

      22
      0
      Votes
      22
      Posts
      10948
      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.
    • UNSOLVED Minimum size for QTableWidget collums/multiple resize modes?
      General and Desktop • resize qt 5.6.0 column table • • oblivioncth  

      1
      0
      Votes
      1
      Posts
      2710
      Views

      No one has replied

    • SOLVED PathView and screen size
      Mobile and Embedded • qml qt quick resize pathview screen rotation • • EtaPhi  

      3
      0
      Votes
      3
      Posts
      1062
      Views

      It works! I'm very grateful to you.
    • SOLVED QDockWidget half resizable
      General and Desktop • resize qdockwidget separator • • Siegwald  

      7
      0
      Votes
      7
      Posts
      2650
      Views

      So, I cheated. I set the max height to 180 pix and the min height to 179. The vertical resize handler is still here, but a so little resize not affect the design of my window, and I can resize horizontaly as I want.
    • UNSOLVED enabling user to resize the widgets
      General and Desktop • resize • • Lorence  

      2
      0
      Votes
      2
      Posts
      762
      Views

      You can put your widget and its neighbour into a QSplitter.
    • SOLVED Resizing image to display in TableView
      General and Desktop • tableview resize image display • • gabor53  

      4
      0
      Votes
      4
      Posts
      1856
      Views

      Thank you. It worked.