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. QStackedWidget unexpected behavior

QStackedWidget unexpected behavior

Scheduled Pinned Locked Moved Unsolved General and Desktop
qstackedwidget
2 Posts 2 Posters 628 Views
  • 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.
  • W Offline
    W Offline
    WhatIf
    wrote on 30 Nov 2015, 19:18 last edited by
    #1

    I'm using Qt designer to develop a simple log in system where users enter username/password to gain access to the app. Page 1 of the QStackedWidget has the Sign In button and page 2 has the actual content of the app and a Sign out button.

    The weird behavior I'm getting is if I have page 2 in display in Qt designer before I run the app, when the app starts page 2 which has the Sign out button is the first page to show up when the program starts. If page 1 is in display in Qt designer, when I click run, page 1 is the first page to show up when the program runs.

    Is this normal? How do I make sure that page 1 is the first page the user sees no matter which page is the current page in Qt designer?

    My concern is if the app goes into actual deployment how will I be sure that the sign in page is displayed first before the user is authenticated to use the program?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 30 Nov 2015, 19:21 last edited by mrjj
      #2

      Hi
      yes its normal. You set the active page in Designer when you go to it.
      You can call ui->yourstackedwidget->setCurrentIndex(0) in QMainWindow
      constructor to make sure first page is always displayed.

      1 Reply Last reply
      0

      1/2

      30 Nov 2015, 19:18

      • Login

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