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
Forum Updated to NodeBB v4.3 + New Features

Toolbar customize dialog

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 3.1k 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 3 May 2013, 10:13 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
    • R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 3 May 2013, 10:18 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 3 May 2013, 10:31 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
        • R Offline
          R Offline
          raven-worx
          Moderators
          wrote on 3 May 2013, 10:39 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 3 May 2013, 11:06 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
            • R Offline
              R Offline
              raven-worx
              Moderators
              wrote on 3 May 2013, 11:13 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

              1/6

              3 May 2013, 10:13

              • Login

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