It seems that around the 1400-1700s China was quickly falling behind Europe due to isolationist policies. Between the Ming and the Qing, which dynasty was more stagnate in terms of scientific and technological advancement?
Neither. The stagnation of China and rise of the West in the Great Divergence is one of the most studied topics in economic history and the conclusion is essentially that the West was able, through imperialism, to increase capital accumulation that resulted in a re-investment, increasing industrialization and agricultural output, while no such economic upward spiral existed in China. The Chinese mode of production was one which was specialized, but in which no capitalist or merchant was able to acquire sufficient capital reserves with which to invest in improved industrial operations. In short, Chinese stagnation was an economic, not a political, problem. Many accuse both Ming and Qing of creating stagnation, but these arguments ultimately fall short. The case is stronger for Ming, who were a highly superstitious, militaristic, and zealous dynasty and instituted economic policies which were unquestionably a step backwards for Song - on top of this, partially motivated by their notorious superstition, the Ming burned Zheng He's fleet, a symbol of Chinese backwardness in traditional Orientalist histories of China.
However, Ming had lost control of most of China by the late 17th century, nearly 50 years before the First Industrial Revolution was in full swing in England, and "full swing" here is generous, as is the term Industrial Revolution. In reality, the Industrial Revolution was a slow process - the European "heartland" of both the First and Second Industrial Revolutions: Britain, Northern France, Belgium, and West Germany - grew at 1-2% per year. Certainly this was faster than at any other point in history, but it pales in comparison to modern growth rates, which can hit double digits in some countries. During the early 20th century, the above-2% growth rate of Austria-Hungary was considered alarmingly fast by contemporaries. In short, even if Ming lasted to 1750, there was plenty of time for Qing to "catch up".
Qing also takes some blame. In his famous interaction with a British trade delegation, Kangxi remarked that all European Sciences were worthless, as they were Chinese to begin with, since they all derived from the I-Ching. While modern readers have interpreted his remarks as a sign of Chinese arrogance and ignorance, there was much basis to his beliefs. At the time, Britain was still running a trade deficit with China, and Chinese goods were noted for their quality. European economies outpaced China by the late 19th century, and the conversion was fast. By that time, Western European governments had understood political economy to the point at which they could average 1-2% growth rates, while Russia had undergone a population explosion through the settlement of the steppe and Siberia, and had also raced ahead. Chinese institutions were inferior from the perspective of encouraging economic growth, but this was not necessarily the fault of any Chinese dynasty. "Rapid", meaning 1-2%, economic growth during the Industrial Revolution was the exception, not the norm. Only a small section of Western Europe achieved those rates for most of the 19th century. Russia and the United States met and exceeded those rates of growth, but in the case of Russia, this was fueled mainly by population growth and did not translate in increases in per-capita terms. Indeed, for the majority of human history, GDP growth per capita averaged zero or near-zero for most regions, so the Chinese dynasties cannot be blamed for failure to catch wind of Western European economic theory of the 1750-1850 period after thousands of years of economic continuity.
This all begs the question of what the causes of divergence were. The single biggest cause was imperialism, which accumulated capital in the hands of a few. China grew less because its economy was more equal, and labor market was freer, while European slavery and the trans-Atlantic exchange allowed for a select few joint-stock companies, shipping magnates, and a planter class to accumulate large amounts of wealth. While evenly distributed wealth may have a positive economic effect statistically on consumption, it has a negative effect on investment, as wealth inequality leads to a larger portion of the fortunes of the rich being invested. The problem of China was not necessarily technological, but was in accumulating the necessary capital and expertise to implement European technologies, which, by the late 19th century, were in play in small-scale manufacturing operations along the coast.
The second issue of Chinese industrialization was institutional. After the Glorious Revolution in England, Parliament created the Bank of England to service the crown's debt, and prevent the defaults and forced lending that European monarchs at the time were notorious for. This led to plummeting interest rates and an increased creditability of the English crown. This in turn led to the Bank of England being a reliable institution to deposit funds into, which an investor could be assured would not go bankrupt. Over time, this led to an increase in private banking as a whole, while pooled dispersed capital surpluses and allowed for more investment. Other countries caught on, with France establishing its own national bank. Chinese businesses in the private sector were also institutionally behind, which slowed capital accumulation. In Europe, powers used joint stock companies to compete each other as proxies in the imperial race. This led to special relationships developing between large corporations and governments. In China, excessive accumulation of the power of business was seen as a threat to the government, and, even if it wasn't, the government's policy was too ad-hoc and inconsistent to facilitate the rise of a nation-wide corporation, much less a large-scale stock market. Chinese scholar bureaucrats, despite their misleading name, did not operate very bureaucratically by modern connotation. They had immense freedom of action and latitude in enforcing the Emperor's laws, were judged on perception of their deeds in court and among the gentry class, and dealt with affairs on a case by case basis. As a result, no consistent laws existed to protect corporations, and no special relationships existed between the Emperor and nationwide business interests, as they did between the rulers of Western European states and their colonial companies.
When looked at through this lense, Chinese "stagnation" is not as blameworthy and surprising as it would otherwise seem. Most of the world had "stagnated" economically throughout thousands of years of history. Select European countries' business interests, through banking, profits from global commerce, sale of stock, and scale, managed to accumulate and invest enough profits to achieve 1-2% growth rates per year. China did not, due to long standing institutional, labor market, and cultural factors that pre-dated both Ming and Qing. That the Chinese did not fully appreciate Western European economic policies, the implications of which were often not even fully understood by European governments, is understandable given the slow rate of growth during the Industrial "Revolution" and the esoteric nature of the factor that produced it.
Sources:
Pommeranz, Kenneth. The Great Divergence: China, Europe, and the Making of the Modern World Economy.
Jones, Geoffrey. Business History, the Great Divergence and the Great Convergence.
Feurwerker, Albert. The State and the Economy in Late Imperial China.
Wong, Bin. Economic Change in Late Imperial China and Early Modern Europe.