Navigation

    Qt Forum

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

    • UNSOLVED How to disable all options of QDialog closure
      General and Desktop • qdialog • • Dariusz  

      8
      0
      Votes
      8
      Posts
      40
      Views

      @Cobra91151 Which is what I suspected, hence the question. Your original answer made the nativeEvent interception look "optional" ("you can modify"), now the OP knows it is mandatory.
    • UNSOLVED setupUi
      General and Desktop • qdialog c++ qt5 gui • • smbika  

      7
      1
      Votes
      7
      Posts
      127
      Views

      @Chris-Kawa Thanks for the insight. I think the system I am working on is similar in evolutionary history. There are just a few setupUi() methods in it and the rest of the uis are heavily wrapped in extended classes. I think all I need is that first clue but I may be able to suss it out myself. That would be nice...pat on the back sorta nice...:-) Again, thanks! I appreciate the help!
    • SOLVED Dialog does not close correctly
      General and Desktop • qdialog close • • OlivierDz  

      3
      0
      Votes
      3
      Posts
      24
      Views

      @JonB said in Dialog does not close correctly: Thanks, it works now. I created a custom slot for the Cancel button in my CMyDialog class. I this slot a put this->parentWidget()->close(). This solved the problem.
    • UNSOLVED How to populate values in my Qdialogbox's linedits?
      General and Desktop • c++ qt 5.4 qmainwindow qdialog qlineedit • • learnist  

      6
      0
      Votes
      6
      Posts
      35
      Views

      Hi, exec is a blocking call so basically you modify your dialog content after you dismiss it.
    • SOLVED Pass value to Dialog/set Values
      General and Desktop • qdialog qlineedit pass value • • nicmorais  

      7
      0
      Votes
      7
      Posts
      73
      Views

      Wow! Thank you @JonB, this solved my issue. One more solved topic to the forum. Have a nice a nice day!
    • UNSOLVED How to access the OK button in QDialog's buttonBox and use it to stop a thread
      General and Desktop • c++ qthread qt 5.4 qdialog qlistwidget • • Mr-Workalot  

      3
      0
      Votes
      3
      Posts
      66
      Views

      By the way, how are your buttons connected ? You might want to rather call the dialog's accept slot from on_buttonBox_accepted rather than connecting it directly to your button.
    • UNSOLVED Dialog UI freezed/unresponsive until all the elements are finished loading into my Qlistwidget. Any way to solve this?
      General and Desktop • c++ qt 5.4 qdialog qlistwidget threads • • Mr-Workalot  

      2
      0
      Votes
      2
      Posts
      62
      Views

      Hi 10.000 items take some time to create and add. Print_Descendants_key must not touch/access the ListWidget from the other thread. that will not be good. To make the UI less hanged while adding such a number of items, you can do 3 things. 1: use a View + custom model instead. If you already have all the data in a list/vector, a custom model on top of that would be super fast. 2: Use a thread to send data to main. Make sure the thread is not hammering the main gui as that would lag too. You can also use a QTimer and simply slow down the adding. 3: Do the ugly trick of calling QApplication::processEvents() (in the loop that adds the items) to allow the main GUI to be more responsive.
    • UNSOLVED How to access the Accepted and Close Event of QDialogbox
      General and Desktop • c++ qdialog thread multithreading • • learnist  

      4
      0
      Votes
      4
      Posts
      65
      Views

      Hi, In your class declaration. Note that this is basic C++. If you do not know that, I highly encourage you to first improve your C++ knowledge before going further.
    • UNSOLVED How can i stop a thread running in my Dialog Class from my mainWindow
      General and Desktop • c++ qmainwindow qdialog threads • • learnist  

      8
      0
      Votes
      8
      Posts
      100
      Views

      @learnist please don't double post.
    • UNSOLVED How to change the width of QDialogbox with the click of a button
      General and Desktop • c++ qdialog size • • Mr-Workalot  

      2
      0
      Votes
      2
      Posts
      36
      Views

      @Mr-Workalot First of all, it seems that you don't use any layouts. Secondly, don't hide your widget by just resizing your dialog (if you are trying to do that). Better hide the widget itself. To set a width anyway, you can use QWidget::resize(int w, int h)
    • UNSOLVED Can i have multiple Qdialog boxes along with my Mainwindow in my application ??
      General and Desktop • c++ qdialog qlistwidget • • Mr-Workalot  

      3
      0
      Votes
      3
      Posts
      54
      Views

      Hi The downside of having 22 dialogs is all the .cpp and .h you get and also adding new features, say you want to have an image of the dish at some later point you would have to add this 22 places. For your use case, it sounds like data driver would be much better. Meaning you have just one dialog and then based on the data structure where you keep the information about the recipes, you add the needed EditLines at runtime. SO as @JonB asks, are they that special each of the dishes that you cant handle them very much the same?
    • UNSOLVED Send Variable values from QDialog to QMainwindow function
      General and Desktop • c++ qt 5.4 qdialog • • learnist  

      10
      0
      Votes
      10
      Posts
      79
      Views

      @learnist said in Send Variable values from QDialog to QMainwindow function: Awesome, it works great, but function can return only 1 QString, it might be from 1 line edit, but i have multiple line edits in my QDialog box, so how can i deal with that situation? I will just throw this thought in. You may not fancy changing your architecture, but it is good to know about if you start having a lot of widgets to deal with. https://doc.qt.io/qt-5/qdatawidgetmapper.html is a very nice interface between multiple widgets and back-end data, without you having to write lots of dedicated getters/setters. But it requires you changing so that your data is all kept in a model. Bear it in mind.
    • SOLVED Qwt plot inside QDialog inside QWidget?
      3rd Party Software • qwidget qdialog qwt parent • • pauledd  

      2
      0
      Votes
      2
      Posts
      122
      Views

      ok, stupid me! I forgot to include Qwt in the *.pro file: ... CONFIG += qwt INCLUDEPATH +="/usr/include/qwt" LIBS += -L/usr/lib -lqwt
    • SOLVED How can I set maximum width to which QScrollArea (within QDialog) will expand without adding scrollbar?
      General and Desktop • qdialog qscrollbar • • Kot Shrodingera  

      5
      0
      Votes
      5
      Posts
      807
      Views

      Thanks but I asked same question on StackOverflow https://stackoverflow.com/questions/55471486/how-can-i-set-maximum-width-to-which-qscrollarea-within-qdialog-will-expand-wi/ The reason of such behaviour is cause QScrollArea::sizeHint() has boundedTo(QSize(36 * h, 24 * h)) , where h is fontMetrics().height(), at the end of implementation. So reimplementing sizeHint() is doing the job just fine
    • UNSOLVED modeless QDialog passes mouse click event to its parent
      General and Desktop • qwidget qdialog opencv mouse event • • shawnL  

      5
      0
      Votes
      5
      Posts
      787
      Views

      Then add a signal to your dialog that you will emit when needed from your mouse move event.
    • SOLVED Incorrect QDialog view in Windows 10 taskbar
      General and Desktop • qdialog windows10 taskbar • • GreenSadFrog  

      7
      0
      Votes
      7
      Posts
      680
      Views

      @mrjj Thanks for the reply.
    • SOLVED Add TreeWidget item from another dialog
      General and Desktop • qmainwindow qdialog qlineedit qtreewidget • • HenrikSt.  

      3
      0
      Votes
      3
      Posts
      341
      Views

      Thanks, mrjj! That's it! Merry christmas
    • SOLVED Subclassed QDialog, exec() calls after the first one, don't raise the dialog!
      General and Desktop • qdialog exec raise • • enjoysmath  

      3
      0
      Votes
      3
      Posts
      405
      Views

      @enjoysmath I wouldn't expect to need to use that, and would have thought it could lead to other problems. A dialog should be on top anyway. Did you try just passing the main window as the parent?
    • UNSOLVED QDialog blankly freezes unless I set a breakpoint in the code, break and continue.
      General and Desktop • qdialog debugging freeze breakpoint blank • • enjoysmath  

      2
      0
      Votes
      2
      Posts
      286
      Views

      Hi, Why are you mixing both like that ?
    • UNSOLVED How to open dialog box on top of the application if two screen are connected?
      General and Desktop • qdialog splashscreen splash • • Yash001  

      28
      0
      Votes
      28
      Posts
      5377
      Views

      @mrjj understood. thank you.
    • UNSOLVED QDialog not reappearing after hiding parent window on Ubuntu
      General and Desktop • qwidget qdialog bug tray • • artudi54  

      7
      0
      Votes
      7
      Posts
      1109
      Views

      @artudi54 Tested with gnome on arch and it does the same thing. I'd say this is a bug since d.show() never pulls the window back up. I would file the bug with Qt. To work around it I just made sure to call d.hide() before hiding the main window. Then after w.show() just call d.show() again.
    • SOLVED Passing variables from a QDialog to a QMainWindow
      General and Desktop • qwidget qmainwindow qdialog • • davidc75  

      6
      0
      Votes
      6
      Posts
      2555
      Views

      @magicstar Thanks i landed up using this. Worked
    • SOLVED QInputDialog with fixed size
      General and Desktop • qdialog size qinputdialog • • YokeM  

      4
      0
      Votes
      4
      Posts
      3592
      Views

      @SGaist Ahh thank you. Totally overlooked that while implementing.
    • Resize QMainWindow and QDialog
      Italian • qt5.5 windows 10 qmainwindow qdialog resize • • Ocram10  

      2
      0
      Votes
      2
      Posts
      838
      Views

      @Ocram10 said in Resize QMainWindow and QDialog: proprietà di windows "Ridimensionamento e layout" Dove trovi questa variabile?
    • UNSOLVED Can't Interact with Main GUI while Brining up Dialog
      General and Desktop • qt4 qdialog • • DougyDrumz  

      4
      0
      Votes
      4
      Posts
      834
      Views

      @DougyDrumz Open the dialog without this information. Then in a separate thread (so you don't lock things up) get the info you need and populate the dialog once the info is available. The way I would do that is just show a loading widget of some sort while it loads the info, then once loaded, show the real widgets on the dialog. You can use QStackedWidget to make this easy. Another way is don't use dialogs. Modern applications rarely use them any more, except for things like File->Open.
    • SOLVED Avoid that a QDialog activates with show()
      General and Desktop • qdialog • • floatingWoods  

      5
      0
      Votes
      5
      Posts
      1386
      Views

      That's just perfect! How could I oversee this? Thanks a lot!
    • SOLVED QDialog auto fit content
      General and Desktop • qtcreator qdialog qlistwidget • • Gianluca86  

      4
      0
      Votes
      4
      Posts
      2492
      Views

      I get it. Thanks so much
    • SOLVED QDialog attribute WA_DeleteOnClose
      General and Desktop • qdialog • • Gianluca86  

      9
      0
      Votes
      9
      Posts
      6975
      Views

      Both solutions are great, now I see what to use. Thank you all
    • SOLVED Why is the action from a context menu on a popup dialog not triggered?
      General and Desktop • qt5 qdialog qmenu popup • • Jakob  

      14
      0
      Votes
      14
      Posts
      5685
      Views

      @SGaist According to comments in the bug report the posted code should work in qt 5.6.1, and I have been able to verify this is indeed the case. So I guess I should consider this question as 'answered' then. Thanx for the help
    • SOLVED why Input Panel does not work in QDialog?
      Mobile and Embedded • qdialog input panel • • MhM93  

      8
      0
      Votes
      8
      Posts
      2631
      Views

      Restore it ? What do you mean by that ?
    • SOLVED QDialog doesn't close
      General and Desktop • qdialog • • gabor53  

      29
      0
      Votes
      29
      Posts
      11097
      Views

      Thank you all. I started to rebuild things in hope that solves the problem.
    • How to close QDialog
      General and Desktop • qdialog close dialog • • gabor53  

      16
      0
      Votes
      16
      Posts
      14084
      Views

      I created a new project with 2 dialogs, the sources are mainwindow.cpp and dialog.cpp. The code in dialog.cpp looks like this: #include "dialog.h" #include "ui_dialog.h" Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog) { ui->setupUi(this); } Dialog::~Dialog() { delete ui; } void Dialog::message() { QMessageBox::StandardButton reply; reply = QMessageBox::information(this, "Confirmation","<b><font size='16' color='green'>Do you want to close the 2nd window?</font></b>",QMessageBox::Yes | QMessageBox::No); if(reply == QMessageBox::Yes) { qDebug() << "Yes was clicked. Close 2nd."; this->reject(); } else { qDebug() << "No was clicked. Don't close 2nd."; } } void Dialog::on_pushButton_clicked() { message(); } When I click yes, it does what I want, it closes dialog. When I use the same code in my original application, it does nothing (no error message either). What can cause this completely different behavior? Thank you.
    • SOLVED Passing QString from QDialog to QDialog
      General and Desktop • qdialog • • gabor53  

      10
      0
      Votes
      10
      Posts
      2496
      Views

      Thank you
    • UNSOLVED Qdialog trouble with change show size
      General and Desktop • qdialog qt 5.5 window size • • Psy_Duck  

      11
      0
      Votes
      11
      Posts
      4304
      Views

      @mrjj said: seems to be full screen/max ? seems. Well, if not used setgeometry, window open in left high angle.
    • UNSOLVED Adding layout to Qdialog changes the layout in an other Qdialog
      General and Desktop • layout qdialog • • gabor53  

      7
      0
      Votes
      7
      Posts
      5079
      Views

      @gabor53 : You change the widget geometry in a way it affects hints. so layout has to be updated. From the top of my head it might be enough to call the following updateGeometry() on every affected widget. Aka: Actually I take it back. If you could show your ui->setupUi(this); code I could probably say more, but as for now it seems you are trying to use the same layout in different dialogs. Make sure you do not.
    • UNSOLVED show QDialog when called from QMessageBox
      General and Desktop • qdialog qmessagebox • • the_  

      5
      0
      Votes
      5
      Posts
      1794
      Views

      @jsulm pbar is in the VBoxLayout of the dialog, q is a QSqlQuery. I Just modified the code so that the dialog also contains the yes and no buttons and no QMessageBox is shown. When i now show the QDialog instead of the QMessageBox and then execute the slot, everything looks good and the progressbar is updated at each step of the foreach() loop.
    • SOLVED QPainter strange behavior
      General and Desktop • qpainter qdialog • • SysTech  

      8
      0
      Votes
      8
      Posts
      2393
      Views

      @kshegunov Awesome! I'll give it a try!
    • UNSOLVED Reset all of the widgets in QDialog
      General and Desktop • widget qdialog reset • • gabor53  

      2
      0
      Votes
      2
      Posts
      2805
      Views

      The best way would be to close the dialog and create a new one again. (from outside) Alternative make a new function that set the default values and call that when u want to "reset"