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. unable to maximize QfileDialog in stackwidget
QtWS25 Last Chance

unable to maximize QfileDialog in stackwidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 2.1k 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.
  • G Offline
    G Offline
    guru007
    wrote on last edited by guru007
    #1

    I try to open a video file with QfileDialog but that dialog pop out with small dimensions in centre of its parent widget.How I can open file dialog maximized as default.
    Here is some code:
    player::player(QWidget parent) :
    QWidget(parent),
    ui(new Ui::player)
    {
    QFont player_font;
    ui->setupUi(this);
    QDesktopWidget screen;
    video_dialog = new QFileDialog(this);
    video_dialog->setModal(true);
    }
    void player::on_toolButton_6_clicked()
    {
    video_dialog->setSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding);
    QString video_location;
    video_location = video_dialog->getOpenFileName(this,tr("Open File"),"/home/apaul/Videos", tr("Video-Files (
    )"),0);
    player1->setMedia(QUrl::fromLocalFile(video_location));
    player1->play();
    }
    if I use :
    video_dialog->showMaximized();
    then it popped up as maximized but how can I get selected filename from that.

    1 Reply Last reply
    0
    • RatzzR Offline
      RatzzR Offline
      Ratzz
      wrote on last edited by
      #2

      Hi,
      May be getOpenFileName help you?

      --Alles ist gut.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        guru007
        wrote on last edited by
        #3

        I already used it but problem is showing the dialog in maximized mode.

        kshegunovK 1 Reply Last reply
        0
        • G guru007

          I already used it but problem is showing the dialog in maximized mode.

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by kshegunov
          #4

          @guru007
          Hello,
          QWidget::setWindowState and QDialog::setModal might be of use.

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi and welcome to devnet,

            getOpenFileNames is a static method that uses the native file dialog. So the parameters you are modifying have not incident when allying getOpenFileNames.

            selectedFiles will return what you have selected.

            Hope it helps

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • G Offline
              G Offline
              guru007
              wrote on last edited by
              #6

              Thanks @SGaist for help;;;;
              I tried it and succeeded but there is one problem.I want to show FileDialog as full screen with no buttons on top left and no title bar.How can I do this?

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Set the Qt::FramelessWindowHint on your dialog

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - 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