Navigation

    Qt Forum

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

    • UNSOLVED Smooth change of background image / PyQt6
      Qt for Python • python qmainwindow animation background pyqt6 • • FoxyFox  

      1
      0
      Votes
      1
      Posts
      315
      Views

      No one has replied

    • UNSOLVED QDialog in QMainwinndow and make the background dark
      Qt for Python • python widget qdialog qmainwindow child • • Emrecp  

      6
      0
      Votes
      6
      Posts
      322
      Views

      So you want a modal dialog that is in fact loaded within a widget inside your QMainWindow class ? You can manually set the modality of your dialog with setModal.
    • UNSOLVED Pressing ALT+CAPSLOCK when Japanese IME keyboard is active highlights QMenu items, losing focus from editor.
      General and Desktop • qmainwindow qtextedit qmenu pyside6 • • Squeakychu  

      1
      0
      Votes
      1
      Posts
      121
      Views

      No one has replied

    • UNSOLVED How to keep border around QTabWidget with tabBarAutoHide enabled
      General and Desktop • qmainwindow qtabwidget qdockwidget border • • dporobic  

      1
      0
      Votes
      1
      Posts
      142
      Views

      No one has replied

    • UNSOLVED Hide QMainWindow from task bar and task switcher
      General and Desktop • qmainwindow hide taskbar • • Roysten Rigobert  

      1
      1
      Votes
      1
      Posts
      314
      Views

      No one has replied

    • UNSOLVED QMainWindow: how to get a mouseReleaseEvent after resizing?
      General and Desktop • qmainwindow resizeevent • • BwvB  

      4
      0
      Votes
      4
      Posts
      351
      Views

      @BwvB I don't know whether installing an eventFilter somewhere would see the mouse release. But I don't see the solutions mentioning that.
    • UNSOLVED how to set "Ctrl + c" for copy shortcut on a QMainWindow?
      Language Bindings • qmainwindow pyqt qaction • • Herzl Sh  

      7
      0
      Votes
      7
      Posts
      746
      Views

      Because we had declarations of shortcuts littered all over the place we came up with the following solution to handle them in one place. We derived a class MyApplication from QApplication and overrode bool notify(QObject *receiver, QEvent *e) override. Within this function we checked e->type() == QEvent::Shortcut. Everything that couldn't be handled is then forwarded to QApplication::notify. We didn't override the Ctrl+C shortcut or anything similar. However, because this is so early in Qt's signal handling you could be lucky with this approach.
    • SOLVED How to avoid bringing QMainWindow to the front when clicking on independent QWidget on MacOS
      General and Desktop • qt5 qwidget qmainwindow mac os activate • • RaulSanchez  

      8
      0
      Votes
      8
      Posts
      543
      Views

      I made it work by removing this flag: Qt::WindowDoesNotAcceptFocus
    • UNSOLVED How to populate values in my Qdialogbox's linedits?
      General and Desktop • c++ qt 5.4 qdialog qmainwindow qlineedit • • learnist  

      6
      0
      Votes
      6
      Posts
      247
      Views

      Hi, exec is a blocking call so basically you modify your dialog content after you dismiss it.
    • UNSOLVED How can i stop a thread running in my Dialog Class from my mainWindow
      General and Desktop • c++ qdialog qmainwindow threads • • learnist  

      8
      0
      Votes
      8
      Posts
      505
      Views

      @learnist please don't double post.
    • SOLVED Strange QMainWindow Layout behaviour
      General and Desktop • layout qmainwindow size • • DL5EU  

      12
      0
      Votes
      12
      Posts
      1054
      Views

      Glad you found out and thanks for the detailed solution !
    • UNSOLVED QDockWidget pin/unpin hide feature as Visual Studio IDE
      General and Desktop • qmainwindow qdockwidget visualstudio • • sayan275  

      9
      0
      Votes
      9
      Posts
      658
      Views

      Hi Yes they say "QtitanDocking replicates Microsoft Visual Studio UI for Qt" but cant find the actual pinning either. But at €624.01, i would sure ask first :) Im have not used Qt-Advanced-Docking-System before so i have no idea if pin Docks are possible without huge rewrites.
    • UNSOLVED Clicking on QMacToolBar does not close open QMenus
      General and Desktop • qmainwindow qmenu qaction qmacnativewidge qmactoolbar • • SajasKK  

      7
      0
      Votes
      7
      Posts
      336
      Views

      Old lasting bug ... Funny things happen in full screen ... In this screenshots you can see an another bug : the checkmark ✓ doesn't follow the font size of the menu.
    • UNSOLVED Detect top/parent move event on child widget
      General and Desktop • qwidget qmainwindow qmoveevent • • Dariusz  

      24
      0
      Votes
      24
      Posts
      2908
      Views

      I'm sorry, my bad :- (( @mrjj said in Detect top/parent move event on child widget: @Dariusz said in Detect top/parent move event on child widget: Or the issue is that sometimes WidgetA is a window and life is good, but then same class (WidgetA ) is used in a layout and then suddenly it cant inform widgetB any more since only top parent knows it was moved ? Something like that ? Yes, since its dynamically generated UI based on a user template, the WidgetA can be inside layout of another widget, or be by itself.
    • SOLVED Add QWidget above QToolBar in QMainWindow
      General and Desktop • qmainwindow qtoolbar layouts • • Rizwan94  

      5
      0
      Votes
      5
      Posts
      948
      Views

      @Rizwan94 May I ask what was your final implementation? I'm trying to setup a frameless window and add my title/close buttons on top of an existing QMainWindow (from .ui) Thanks in advance
    • UNSOLVED Blurred background for Main window
      General and Desktop • qmainwindow qapplication qtwidgets qtgui • • shanmugaraja  

      3
      0
      Votes
      3
      Posts
      780
      Views

      Hi As far as I know, there is nothing like that in Qt. It can blur widgets but not the actual desktop.
    • Create and show the object of my QWidget (heir) in the main window (heir of QMainWindow)
      General and Desktop • qwidget qmainwindow opencv qt designer videocapture • • Algorithm0  

      4
      0
      Votes
      4
      Posts
      714
      Views

      @jsulm Hello! Sorry, but that doesn't work. I tried to insert a loop in different places, but the result remains the same. I also tried to display the main widget. @SGaist Hello. So the VideoWindow.h file (VideoWindow class) is my custom widget. This is the first piece of code that I presented.
    • UNSOLVED QMainWindow & tabbed dock widgets, minimize area on click
      General and Desktop • qmainwindow qdockwidget qtabbar • • Dariusz  

      8
      0
      Votes
      8
      Posts
      1008
      Views

      Hi I did not find any other way to gain access to the tab bar.
    • SOLVED What is different in between laptop main screen and external connected screen?
      General and Desktop • qwidget qmainwindow c++11 qt 5.12.3 • • Yash001  

      6
      0
      Votes
      6
      Posts
      753
      Views

      got solution. before using the minimum size function set the windowstate Qt::WindowFullScreen. In my case I used line this->setWindowState(Qt::WindowFullScreen); before this->setMinimumWidth(1366); this->setMinimumHeight(768);.
    • UNSOLVED How to divide a project? (For readability)
      General and Desktop • c++ qmainwindow project management • • R_Irudezu  

      7
      0
      Votes
      7
      Posts
      987
      Views

      Seperation of Concerns (SoC): https://en.wikipedia.org/wiki/Separation_of_concerns There are design approaches that go further, but SoC is a good place to start.
    • SOLVED Add TreeWidget item from another dialog
      General and Desktop • qdialog qmainwindow qlineedit qtreewidget • • HenrikSt.  

      3
      0
      Votes
      3
      Posts
      512
      Views

      Thanks, mrjj! That's it! Merry christmas
    • UNSOLVED Let widget active even if we're clicking onto the MainWindow
      General and Desktop • qwidget qmainwindow focus • • jkx1  

      2
      0
      Votes
      2
      Posts
      763
      Views

      Hi and welcome to devnet, First thing, please don't delete all that stuff in your destructors. Qt has a pattern that is based on parent widget (the parameter "this" in widget constructors) that take care of destructing all the children automatically when the parent is deleted: http://doc.qt.io/qt-5/objecttrees.html Now regarding your problem, only one widget can have focus at the same time. For the focus part, you can use setFocusPolicy on your widgets, giving an enum that tells more about the behavior you expect. For what I have experienced, playing with opacity and trying to give a modern look to a desktop software is kind of a pain. Long story short: there is no user friendly API to do so, or at least as user friendly as what QML provides. This is either because the widgets part is late compared to the QML one, or because "modern" has been associated with app, browsers, Internet, but not with desktop. Nonetheless, things might evolve in the future, since Qt developers have communicated about resuming the widgets development. This doesn't solve your problem, but could explain why you are having so much trouble trying to code an overlay that behaves with good focus policy, and using low level code such as QPalette that is always a sign you're doing something wrong, or at least not initially intended. Which could be fine, if you really know what you're doing, and you are aware that you'll have to deal with a lot of work to make your application look the same on every platform. EDIT: So I created a project with your code and here are some remarks: 1 Do not set a layout to your main window, just set the central widget with, well setCentralWidget(widget) 2 qreal is an alias for double, so instead of qreal(100)/100 just write 1.0; same for qreal(50)/100, just write 0.5 and it will be perfectly fine. 3 No need to use "this->" you are coding in C++, not JAVA ;) For your problem, I think I don't really get what you are expecting. Just an overlay when the setting widget pops? If so, maybe working with a QDialog (a modal one) would be better.
    • SOLVED How to use Qt classes defined accross multiple files?
      General and Desktop • desktop qmainwindow qmenu gui developer • • MakingTheEight  

      8
      0
      Votes
      8
      Posts
      1093
      Views

      @jsulm @mrjj @ig Thanks for all the help. I was able to fix the inheritance issue by creating a new FileMenu instance in the main window.
    • UNSOLVED Drag and drop widgets in QSplitter
      General and Desktop • qmainwindow qdockwidget qsplitter qdrag drag drop • • NIXIN  

      6
      0
      Votes
      6
      Posts
      903
      Views

      @NIXIN You have a QMainWindow inside splitter?! I doubt that. You should have two widgets: for the left side of the splitter and for the right side of the splitter.
    • SOLVED QMainWindow Titile Background Color or Opacity
      General and Desktop • qmainwindow • • Ongsk  

      2
      0
      Votes
      2
      Posts
      5911
      Views

      @Ongsk Title bar decorations are managed by your window manager. You can change them (at a user level only) by changing your theme. This applies to osx, linux, and windows. If you want to force a specific color then you could make a window with a custom title bar and draw it however you want. Things like Chrome do this. Then they have an option to "use system title bar and borders". IMO, unless you are making a fully custom window like a video game launcher, or splash screen, or something like that you should let the window manager decorate the window. People customize their WMs to look how they like and standard looks are a foundation of GUI development. Here's a post from @mrjj that shows you how to do it in windows with native calls (Qt doesn't have a call for it) in case you insist on forcing a color on your users. https://forum.qt.io/topic/85837/change-window-title-bar-color-in-windows Keep in mind that will be for windows only so if you compile for linux or osx it will not work.
    • SOLVED Passing variables from a QDialog to a QMainWindow
      General and Desktop • qwidget qdialog qmainwindow • • davidc75  

      6
      0
      Votes
      6
      Posts
      3168
      Views

      @magicstar Thanks i landed up using this. Worked
    • UNSOLVED Mirroring MainWindow to a second QMainWindow
      General and Desktop • qmainwindow mouse event grab • • L Koziarz  

      10
      0
      Votes
      10
      Posts
      2671
      Views

      @L-Koziarz Yep its sounds somewhat convoluted but never the less - exciting approach . I wish it had worked as prof of concept but it seems there are issues.
    • Resize QMainWindow and QDialog
      Italian • qt5.5 windows 10 qdialog qmainwindow resize • • Ocram10  

      2
      0
      Votes
      2
      Posts
      1012
      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
      2861
      Views

      @Fuel the exemples in pyqt-master do it automatically but i don't understsnd what event or property they use
    • SOLVED Customizing QMainWindow by style sheet
      General and Desktop • stylesheet qmainwindow css qt5.8 • • eDeviser  

      5
      0
      Votes
      5
      Posts
      10260
      Views

      @eDeviser said in Customizing QMainWindow by style sheet: Yes, this helps! I see the QMainWindow holds a QWidget which is set as cetralWidget. So It would be necessary to set the QMainWindow as centralWidget or to apply my css for the QWidget. Thank you for this hint. You have to apply your css in your qwidget ! Your css should be : centralWidget { background: yellow; width: 10px; /* when vertical / height: 10px; / when horizontal */ } centralWidget:hover { background: red; }
    • SOLVED QDockWidget::restoreGeometry not working correctly when QMainWindow is maximized
      General and Desktop • qt5.5 qmainwindow qdockwidget • • skebanga  

      6
      0
      Votes
      6
      Posts
      5790
      Views

      You should care about QSizePolicy and sizeHint of your widgets inside QDockWidget. ;)
    • UNSOLVED Custom Window Border
      General and Desktop • windows qmainwindow paintevent • • dot97  

      2
      0
      Votes
      2
      Posts
      1686
      Views

      Hi, and welcome. The image upload function on our forum is broken, the uploaded images might be visible to you, but they aren't to anyone else. See this thread for a workaround.
    • Embedding window inside Illustrator panel does not load 3D model on Mac
      General and Desktop • qmainwindow qwindow embed qmacnativewidge • • Poorti  

      3
      0
      Votes
      3
      Posts
      1137
      Views

      @mrjj Thanks for the reply! I followed your advice and tried setting the panelWindow as the parent... No change.. Any other ideas? I followed this link, http://doc.qt.io/qt-5/qmacnativewidget.html#details
    • UNSOLVED QMainWindow::show() breaks QMenuBar::cornerWidget()
      General and Desktop • layout qmainwindow qmenubar show • • jacobP  

      3
      0
      Votes
      3
      Posts
      1732
      Views

      Hi SGaist and thank for the help. For the code being in the constructor when it should not be, I only did it that way to have the simplest code possible to show my issue. I understand and agree with your point. I am working on an already existing application, I created this QtCreator project to isolate and replicate the issue. I do not call QWidget::show() in the constructor of my application. I have made an important discovery while working on this issue: calling blue_widget->show() at the end of my code in my QtCreator project does fixe the problem, but doing the same in my application does not fix the issue. This is the 1st time I see a different behavior, I thought I had manage to have the same 1:1 behavior between the QtCreator project and my application. Thanks for the help, I will keep looking.
    • SOLVED how to parent qpainter (code) to QTabWidget (Design Mode)
      General and Desktop • qtablewidget qpainter qt5.6 qmainwindow parent • • pauledd  

      13
      0
      Votes
      13
      Posts
      6113
      Views

      @pauledd :) class MyWidget : public QWidget << yes that is subclassing :) Also, a widget can only paint on it self. its not possible to paint on other widget from inside a paintevent. Thats why the first sample didnt work. You asked painter to paint on tab from inside mainwindows paintEvent :) I guess you already found out but its just to make clear for other readers.
    • UNSOLVED Loading different classes in same window
      General and Desktop • c++ qmainwindow qtdesigner mainwindow • • ronyNS  

      7
      0
      Votes
      7
      Posts
      2223
      Views

      @SGaist I just want 1 window with the forms changing for the login and presentation windows. And then ill use dialog windows after the presentation window. Anyways thank you. Ill try QStackedWidget.
    • UNSOLVED mainWindow disable maximize button
      General and Desktop • qmainwindow maximize • • Gianluca86  

      3
      0
      Votes
      3
      Posts
      4684
      Views

      I need to be as big as the screen. Before I used this code to display it as big as the screen int Height = 0; int Width = 0; foreach (QScreen *screen, QGuiApplication::screens()) { if(QGuiApplication::primaryScreen()->name() == screen->name()) { QRect rec = screen->availableGeometry(); Height = rec.height(); Width = rec.width(); } } w.setFixedSize(Width,Height); Unfortunately, I do not know why, the height is still longer than the screen. This is why I decided to use showMaximized (), unfortunately this does not seem to go well for both systems.
    • QMainWindow paint event
      General and Desktop • qmainwindow • • Gianluca86  

      11
      0
      Votes
      11
      Posts
      4623
      Views

      Thank you all, I will try to use your advice.
    • UNSOLVED Cannot add widgets to layout
      General and Desktop • qwidget qmainwindow qlayout vlc-qt • • AyushExel204  

      18
      0
      Votes
      18
      Posts
      7960
      Views

      @AyushExel204 It is indeed strange. I haven't worked with that library, but I see no good reason that is should work with VlcMediaPlayer but not with VlcMediaListPlayer. In this example (graciously provided by @mrjj over chat), they don't seem to use VlcMediaListPlayer and as you said that should work. Perhaps you can use it to build upon. Also you might want to search through the library's bugtracker to see if there is something known about this issue.
    • UNSOLVED QApplication does not exits if last window is closed with MSVC2015 WinRT 64bit
      General and Desktop • qmainwindow qapplication msvc2015 msvc winrt • • Baarnus  

      7
      0
      Votes
      7
      Posts
      2567
      Views

      Hi, just to want add, while Qt Creator's capturing of your qDebug() output is usually 100%, but if you want to be sure to get everything, you could try running DebugView when your app exits.