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. [SOLVED] QPushButton. I click on the button, but nothing not happend.
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] QPushButton. I click on the button, but nothing not happend.

Scheduled Pinned Locked Moved General and Desktop
24 Posts 7 Posters 32.9k 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.
  • I Offline
    I Offline
    I-sty
    wrote on 18 Jul 2012, 08:28 last edited by
    #21

    [quote author="goblincoding" date="1342530066"]Your problem is this:

    @
    void MainWindow::on_actionOther_triggered()
    {
    Ui::setRefreshSpeed something;
    QDialog *d = new QDialog;
    something.setupUi(d);
    d->show();
    }
    @

    You're creating QDialog object, not a refreshSpeed object and QDialog does not have a slot1() (as your compiler rightfully pointed out). You also do not need to explicitly create or setup the UI (that's kind of the whole point with Qt Designer Form classes :) ). This is what you want:

    @
    void MainWindow::on_actionOther_triggered()
    {
    //Ui::setRefreshSpeed something;
    setRefreshSpeed *d = new setRefreshSpeed;
    d->setAttribute( Qt::WA_DeleteOnClose );
    //something.setupUi(d);
    d->show();
    }
    @[/quote]

    Thanks, goblincoding! :D

    I rewrote, and works perfectly.

    @void MainWindow::on_actionOther_triggered()
    {
    short x = freq;
    setRefreshSpeed *d = new setRefreshSpeed;
    d->setAttribute(Qt::WA_DeleteOnClose);
    d->exec();

    if (freq != x){
        timer->start(freq);
        ui->action1s->setChecked(false);
        ui->action2s->setChecked(false);
        ui->action3s->setChecked(false);
        ui->actionOther->setChecked(true);
    }
    

    }@

    Sorry, for my bad English. My first language is Hungarian.

    1 Reply Last reply
    0
    • I Offline
      I Offline
      I-sty
      wrote on 18 Jul 2012, 08:34 last edited by
      #22

      So, the topic is solved. Not? :)
      This problem is resolved. I'll write the next. :D

      Sorry, for my bad English. My first language is Hungarian.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sam
        wrote on 18 Jul 2012, 08:42 last edited by
        #23

        Glad that you got the code working. Kindly Edit your title and add Solved to it.

        Happy Coding!!!!

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goblincoding
          wrote on 18 Jul 2012, 10:28 last edited by
          #24

          Happy to finally be of some service here :D

          http://www.goblincoding.com

          1 Reply Last reply
          0

          21/24

          18 Jul 2012, 08:28

          • Login

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