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. Basics. How to use <a href> equivalent to display new content?
Forum Updated to NodeBB v4.3 + New Features

Basics. How to use <a href> equivalent to display new content?

Scheduled Pinned Locked Moved Unsolved General and Desktop
21 Posts 3 Posters 6.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.
  • Andrey VolodinA Andrey Volodin

    @jsulm said in Basics. How to use <a href> equivalent to display new content?:

    In designer you can connect existing signals/slots. You can even define a new slot in Designer, but you have to implement it by yourself.
    That means: add slot to main window in Designer, connect this slot to the clicked() signal of your push button in Designer, implement the slot in main window.

    The above is what I have done ;
    How to connect the stackWidgets call with the above?
    What do you mean saying "implement the slot in mine window" ?

    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on last edited by
    #21

    @Andrey-Volodin You mean setCurrentIndex()? I did it in the example above.
    What I mean with implement: write the body of the slot since Designer does not know what you want to do in the slot. From my example above:

    // You have to write this code even if you added the slot in Designer
    void MainWindow::onButtonPressed()
    {
        int pageToShow = 1; // you need to find out what the next index is
        ui->stackedWidget->setCurrentIndex(pageToShow);
    }
    

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    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