A quadtree-based adaptive Cartesian grid generation and a flow solver for 2-D flow of Navier-Stokes equations and solutions to Euler equation with a moving boundary were developed . The grid adaptation based on pressure or density gradient was performed and a gridless or meshless method based on the least-square fashion was used to treat a wall surface boundary condition handled difficulty with a common Cartesian grid. Firstly, to validate the technique of grid adaptation, the flows over a cube were computed. Secondly, the flows over a cylinder were calculated to validate the developed gridless method. Thirdly, Euler solutions of Naca0012 wing under three working cases were solved and computed with moving grid with gridless method. The computational results indicated the developed methods are reasonable for complex flows. So these methods provides a new idea to simulate flows over objects with complex geometric shepes using more reasonable distribution of grids and easier boundary treatment.