Home > Mobile >  QFileDialog popup window location problem, urgent please!
QFileDialog popup window location problem, urgent please!

Time:04-17

Now there is a problem, when there are multiple display, found QfileDialog pop-up comes within the screen sometimes can't find, it is what reason, or is there a way to make QfileDialog centered? Urgent please

CodePudding user response:

After the new a qfiledialog popup, move to the specified location

CodePudding user response:

Tried it on, it didn't take found move (Qt5.6)

QFileDialog * stFileDialog=new QFileDialog;
StFileDialog - & gt; SetWindowTitle (QString: : fromLocal8Bit (" open Angle standard file "));
StFileDialog - & gt; SetNameFilter (QString: : fromLocal8Bit (" Angle of standard file (*. PNG; *.jpg; *. BMP; *. GIF) "));
StFileDialog - & gt; Move (0, 0);

CodePudding user response:

refer to the second floor vaychouzww response:
tried, found a move not (Qt5.6)

QFileDialog * stFileDialog=new QFileDialog;
StFileDialog - & gt; SetWindowTitle (QString: : fromLocal8Bit (" open Angle standard file "));
StFileDialog - & gt; SetNameFilter (QString: : fromLocal8Bit (" Angle of standard file (*. PNG; *.jpg; *. BMP; *. GIF) "));
StFileDialog - & gt; Move (0, 0);


Get the screen size, then calculate the middle of the screen, and then move to the specified location is ok,

CodePudding user response:

Not position for less than, but a move at all useless ah, I can't move to 0, 0

CodePudding user response:

The
reference 4 floor vaychouzww reply:
is not a place for less than, but move at all useless, I can't move to 0, 0


You this is multiple display!!
//for you to show the display ID, and then use this function
SetGeometry ();

CodePudding user response:

The detailed how to use, also hope to solve! Thank you very much!

CodePudding user response:

reference 5 floor u010370871 reply:
Quote: refer to 4th floor vaychouzww response:

Not position for less than, but a move at all useless ah, I can't move to 0, 0


You this is multiple display!!
//for you to show the display ID, and then use this function
SetGeometry ();


Find the common Qdialog can move, QfileDIalog can't move! There is a question
QfileDialog can on the time can in the task bar shows a form? I can't try not

CodePudding user response:

refer to 7th floor vaychouzww response:
Quote: refer to fifth floor u010370871 response:

Quote: refer to 4th floor vaychouzww response:

Not position for less than, but a move at all useless ah, I can't move to 0, 0


You this is multiple display!!
//for you to show the display ID, and then use this function
SetGeometry ();


Find the common Qdialog can move, QfileDIalog can't move! There is a question
QfileDialog can on the time can in the task bar shows a form? How do I try can't


The task bar shows a form? What do you mean the lower right corner shows an icon?

CodePudding user response:

You stupid ah, no show, also expect dialog out!
The correct code
 QFileDialog * stFileDialog=new QFileDialog; 
StFileDialog - & gt; SetWindowTitle (QString: : fromLocal8Bit (" open Angle standard file "));
StFileDialog - & gt; SetNameFilter (QString: : fromLocal8Bit (" Angle of standard file (*. PNG; *.jpg; *. BMP; *. GIF) "));
StFileDialog - & gt; Move (100, 100);
StFileDialog - & gt; show();

CodePudding user response:

The task bar had QFileDialog form,

CodePudding user response:

references 9 f feiyangqingyun response:
you silly ah, no show, also expect dialog out!
The correct code
 QFileDialog * stFileDialog=new QFileDialog; 
StFileDialog - & gt; SetWindowTitle (QString: : fromLocal8Bit (" open Angle standard file "));
StFileDialog - & gt; SetNameFilter (QString: : fromLocal8Bit (" Angle of standard file (*. PNG; *.jpg; *. BMP; *. GIF) "));
StFileDialog - & gt; Move (100, 100);
StFileDialog - & gt; show();


Later, of course, have the exec (), forgot to post, dialog box must come out, the problem is this move cannot be effective, where it before or which position now

CodePudding user response:

Do not specify a parent window task bar will have a small window, unless you set the window properties for the tool

CodePudding user response:

references 9 f feiyangqingyun response:
you silly ah, no show, also expect dialog out!
The correct code
 QFileDialog * stFileDialog=new QFileDialog; 
StFileDialog - & gt; SetWindowTitle (QString: : fromLocal8Bit (" open Angle standard file "));
StFileDialog - & gt; SetNameFilter (QString: : fromLocal8Bit (" Angle of standard file (*. PNG; *.jpg; *. BMP; *. GIF) "));
StFileDialog - & gt; Move (100, 100);
StFileDialog - & gt; show();
I use the exec, show show window too ugly
  •  Tags:  
  • Qt
  • Related