Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Toolbar customize dialog
Qt 6.11 is out! See what's new in the release blog

Toolbar customize dialog

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 3.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Diluka
    wrote on last edited by
    #1

    Hi

    Have a nice day,I had requirement to develop toolbar customize dialog use in Qt i decide to use QDialog widget for it if some one have better experience or idea about it please share with me

    Thanks

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      You plan to create the contents of your dialog all yourself right?
      If so you could also use simply QWidget/QFrame, but basically there is nothing wrong using QDialog for convenience ;)

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Diluka
        wrote on last edited by
        #3

        yes content of dialog is create by my self if I used QFrame, it had advantages compare with QDialog i havn't any idea about QFrame because i am still not use QFrame. Thanks for your reply

        1 Reply Last reply
        0
        • raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          only if you want to be open for styling and/or frame border later on?
          If not you're just fine with QDialog...

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • D Offline
            D Offline
            Diluka
            wrote on last edited by
            #5

            According to your answer and consider with my future developments i think QFrame is most suitable for my work thanks for your reply :)

            1 Reply Last reply
            0
            • raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              if you need the dialog to be blocking you have to start your own QEventLoop.
              To start and show the dialog call the exec() method:

              @
              MyFrameDialog::MyFrameDialog(QWidget* parent) : QFrame(parent)
              {
              this->setWindowFlags( Qt::Dialog );
              m_EventLoop = new QEventLoop(this);
              }

              void MyFrameDialog::closeEvent(QCloseEvent* event)
              {
              QFrame::closeEvent(event);
              if( event->isAccepted() )
              m_EventLoop->exit();
              }

              int MyFrameDialog::exec()
              {
              this->show();
              //do other init stuff here (if needed)...
              return m_EventLoop->exec();
              }
              @

              now connect every button which should close the dialog to the dialogs "close()":http://qt-project.org/doc/qt-4.8/qwidget.html#close slot.

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved