Quantum computing has become a pivotal innovation in computational science, offering novel avenues for tackling the increasingly complex and high-dimensional optimization challenges inherent in engineering design. This paradigm shift is particularly pertinent in the domain of structural optimization, where the intricate interplay of design variables and constraints necessitates advanced computational strategies. In this vein, the gate-based variational quantum algorithm utilizes quantum superposition and entanglement to improve search efficiency in large solution spaces. This paper delves into the gate-based variational quantum algorithm for the discrete variable truss structure size optimization problem. By reformulating this optimization challenge into a quadratic, unconstrained binary optimization framework, we bridge the gap between the discrete nature of engineering optimization tasks and the quantum computational paradigm. A detailed algorithm is outlined, encompassing the translation of the truss optimization problem into the quantum problem, the initialization and iterative evolution of a quantum circuit tailored to this problem, and the integration of classical optimization techniques for parameter tuning. The proposed approach demonstrates the feasibility and potential of quantum computing to transform engineering design and optimization, with numerical experiments validating the effectiveness of the method and paving the way for future explorations in quantum-assisted engineering optimizations.